38323 Commits

Author SHA1 Message Date
Andrew Ozz
abfbb344f1 TinyMCE:
- Fix parsing of the init array in script-loader.
- Do not JSON encode the options object when outputting it from PHP.
- Remove JSON decoding of TinyMCE's `style_formats` option.

Fixes #45221.

git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43867 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-05 08:38:47 +00:00
Gary Pendergast
1f4c84c65d Tests: Skip symlinked theme file tests if the links could not be created, or if symlink() is not available
Merges [42812,42819] to the 5.0 branch.

Props SergeyBiryukov.
Fixes #43508.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43866 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-05 02:46:14 +00:00
Gary Pendergast
d1807924bc Post WordPress 5.0 Beta 3 version bump.
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43865 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-05 00:18:44 +00:00
Gary Pendergast
141768a67b WordPress 5.0 Beta 3.
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43864 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-05 00:06:03 +00:00
Gary Pendergast
fc3644fff9 Meta Boxes: Add curly brackets missed in [43861].
This was causing the custom meta box to be incorrectly added to post types that don't support it.

Props ocean90, epointal.
Fixes #45257,


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43863 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-04 23:22:25 +00:00
Daniel Bachhuber
a4b6ac656f REST API: Prevent duplicate firing of rest(_after)?_insert_attachment actions.
Props danielbachhuber, peterwilsoncc.
Fixes #45269.
See #42864.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43862 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-03 14:13:16 +00:00
Gary Pendergast
5504866f20 Build Tools: Update the @wordpress packages.
This brings support for the custom fields meta box to the block editor.

The `webpack` and `copy-webpack-plugin` packages have also been updated.

See #45145.
Fixes #45257.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43861 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-03 07:56:28 +00:00
allancole
c2527dfc96 Importing Twenty Nineteen, our new default theme for 2019, set for 5.0.
Let Gutenberg shine with this simple, fast, and powerful theme. Initial development occurred on GitHub. See: https://github.com/WordPress/twentynineteen

Props allancole, karmatosed, kjellr, yingling017, mrasharirfan, milana_cap, fabiankaegy, westonruter, aaronjorbin, netweb, b-07, khleomix, blowery, dereksmart, jasmussen, audrasjb, nielslange, mmaumio, dimadin, joyously, anevins12, peterwilsoncc, dannycooper, icaleb, siriokun, technosiren, travel_girl, azchughtai, ianbelanger, nadim1992, ismailelkorchi, nativeinside, chetan200891, icaleb, grapplerulrich, ocean90, joshfeck, frankew, abdulwahab610, mendezcode, eliorivero, melchoyce, joen, laurelfulford, mdawaffe, kraftbj, dsmart, mukeshpanchal27, burhandodhy, crunnells, Ismail-elkorchi, aryaprakasa.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43860 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-02 23:52:16 +00:00
herregroen
c4bffce143 I18N: Improve JavaScript translation support.
Improves upon [43825] by adding unit tests to cover additional use-cases and changes loading translations to only occur when outputting the script to allow setting translations on dependencies.

Props atimmer, omarreiss, nerrad, swissspidy, ocean90.
Fixes #45103.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43859 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-01 13:50:59 +00:00
Gary Pendergast
fe56c5deb3 Editor: Cast the result of the default_content, default_title, and default_excerpt filters.
If a plugin returns a non-string value (or returns `null`) on these filters, it can cause errors in the block editor. Casting them as a string prevents these errors.

Props dd32.
See #45236.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43858 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-01 05:19:48 +00:00
Gary Pendergast
12f0039b5c Block Editor: Remove CodeMirror settings.
CodeMirror is no longer used in the block editor, so we don't need to load the settings.

Props noisysocks.
Fixes #45248.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43857 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-01 05:06:44 +00:00
Gary Pendergast
364f935221 Block Editor: Don't show back compat or incompatible meta boxes in Options.
Meta boxes that exist for back compat, or that are incompatible with the block editor aren't displayed, so they don't need an option to display or hide them in the Options dialog.

Props noisysocks.
Fixes #45249.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43856 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-01 04:32:37 +00:00
Gary Pendergast
4d2db97c5d Posts: Remove the slug from Quick Edit for posts that are not is_post_type_viewable().
This is a followup to [43728], which added the same check, but using the `publicly_queryable` option. This behaviour is incorrect for `_builtin` post types, which go by the logic in `is_post_type_viewable()`, instead.

See #43278.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43855 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-01 02:34:26 +00:00
Gary Pendergast
d9bc4caf9d Blocks: Add "Export as JSON" action to the wp_block post list screen.
Remove the "Quick Edit" for `wp_block`s, too, as they don't need any of that functionality.

Props noisysocks.
Fixes #45247.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43854 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-01 02:24:18 +00:00
Gary Pendergast
981c18c941 Build Tools: Switch to Node 10.13.0.
Now that Node 10 is the LTS branch, with 10.13.0 as the first LTS release, let's use that for building WordPress.

See #45241.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43853 602fd350-edb4-49c9-b593-d223f7449a82
2018-11-01 02:01:04 +00:00
Daniel Bachhuber
7818e29cc5 REST API: Fix array syntax after [43851].
I thought I was writing JavaScript. Alas.

See #45196.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43852 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-31 14:02:45 +00:00
Daniel Bachhuber
fcd9381149 REST API: Regenerate fixure schema after introduction of new endpoints.
This fixture schema ensures `wp-api-generated.js` doesn't change when running tests in local dev environments.

Fixes #45196.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43851 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-31 13:25:28 +00:00
Daniel Bachhuber
74a3e2788a REST API: Restore access to audio/video metadata functions.
Ensures `wp_read_video_metadata()`/`wp_read_audio_metadata()` functions are available when uploading video and audio. Fixes error introduced in [43589].

Props ocean90.
See #43757.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43850 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-31 12:44:21 +00:00
Daniel Bachhuber
b05849574d Blocks: Include necessary labels for the 'wp_block' post type.
See #45098


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43849 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-31 11:34:01 +00:00
Gary Pendergast
6ca255f3fd FTP/PemFTP Library: Fix some PHP notices.
- `ftp_base::glob()` used `each()`, which is deprecated as of PHP 7.2.
- `ftp_base::fget()` was missing the decleration of its third parameter, `$rest`.

Props itowhid06.
See #44489.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43848 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-31 06:00:03 +00:00
Gary Pendergast
f05a39a875 Build Tools: Update the @wordpress packages.
Trunk now matches Gutenberg 4.2 RC1.

See #45145.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43847 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-31 05:49:01 +00:00
Daniel Bachhuber
c5e1cd0401 l10n: Avoid calling is_user_logged_in() in determine_locale().
`is_user_logged_in()` is a pluggable function, and loaded after plugins are loaded. If a plugin calls `__()` too early, `is_user_logged_in()` is missing and WordPress will fatal. `get_user_locale()` already handles this scenario for us, so it's safe to rely on exclusively.

See #44758.
Fixes #45235.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43846 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-31 02:32:49 +00:00
Gary Pendergast
3e303f7817 Posts WordPress 5.0 Beta 2 version bump.
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43845 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-30 04:59:49 +00:00
Gary Pendergast
ebba44cf66 WordPress 5.0 Beta 2.
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43844 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-30 04:46:12 +00:00
Gary Pendergast
165b192bbd Build Tools: Update @wordpress packages.
See #45145.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43843 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-30 02:43:08 +00:00
allancole
d101a26902 Importing Twenty Nineteen, our new default theme for 2019, set for 5.0.
Let Gutenberg shine with this simple, fast, and powerful theme. Initial development occurred on GitHub. See: https://github.com/WordPress/twentynineteen

Props allancole, karmatosed, kjellr, yingling017, mrasharirfan, milana_cap, fabiankaegy, westonruter, aaronjorbin, netweb, b-07, khleomix, blowery, dereksmart, jasmussen, audrasjb, nielslange, mmaumio, dimadin, joyously, anevins12, peterwilsoncc, dannycooper, icaleb, siriokun, technosiren, travel_girl, azchughtai, ianbelanger, nadim1992, ismailelkorchi, nativeinside, chetan200891, icaleb, grapplerulrich, ocean90, joshfeck, frankew, abdulwahab610, mendezcode, eliorivero, melchoyce, joen, laurelfulford, mdawaffe, kraftbj, dsmart.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43842 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-30 02:13:07 +00:00
Gary Pendergast
1a826d1f31 Tests: Fix failing unit tests caused by [43840].
See #45145.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43841 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-29 08:00:56 +00:00
Gary Pendergast
f5788217b3 Build Tools: Upgrade @wordpress packages to the latest version.
This also includes the new `@wordpress/format-library` and `@wordpress/notices` packages.

`package-lock.json` has been completely regenerated in this commit.

See #45145.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43840 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-29 07:40:44 +00:00
Gary Pendergast
b2bd3994d4 Meta boxes: Don't show the block editor incompatiblity message when it doesn't apply.
We should only be showing this message in the classic editor interface, for meta boxes that are marked as being incompatible with the block editor.

Fixes #45207.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43839 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-29 04:02:40 +00:00
Gary Pendergast
cdb35577d2 Meta boxes: Don't assume that callback args are an array.
While the documentation for `add_meta_box()` specifices that `$callback_args` should be an array, this has never been enforced, and we have workarounds in place for when it's passed as something other than an array.

Rather than break sites that are passing unexpected data, we can quietly just allow for it, instead.

Props johnjamesjacoby, birgire.
Fixes #45206.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43838 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-29 03:15:11 +00:00
Gary Pendergast
96857764e1 Block Editor: Fix meta boxes not showing.
The block editor needs to duplicate the classic meta box behaviour, so it can extract the registered meta boxes, and import them into the block editor.

To match the classic editor behaviour as closely as possible, this moves the relevant code from the classic editor, into a new function, so it can be called by both.

Props pento, peterwilsoncc.
Fixes #45172.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43837 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-29 02:42:23 +00:00
Gary Pendergast
a46ea4aa86 Build Tools: Add an npm script shortcut to run grunt.
Rather than needing to install grunt globally, this allows running grunt from `node_modules`, instead.

`npm run grunt ...` is effectively the equivalent of running `grunt ...`.

Props andrew.taylor.
See #45214.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43836 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-29 02:11:35 +00:00
Gary Pendergast
25928ac375 Build Tools: Revert [43826] and [43824].
Grabbing the packages directly from the Gutenberg repo was an interesting experiment, but it causes significant workflow issues, particular for folks using Windows.

See #45145.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43835 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-29 01:55:57 +00:00
Daniel Bachhuber
168120ecd0 REST API: Improve performance by avoiding call_user_func().
The `get_compact_response_links()` method was introduced in WP 4.5, and this conditional is no longer necessary.

Props schlessera, timothyblynjacobs.
Fixes #45189.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43834 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-29 00:47:01 +00:00
Daniel Bachhuber
b5e73f7e7f Block Editor: Preload wp/v2/media with OPTIONS for caps check.
Also introduces a `block_editor_preload_paths` filter for plugins and themes to preload additional data.

Props imath, mattheu.
Fixes #45194.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43833 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-29 00:23:11 +00:00
Aaron Jorbin
894e847238 php7.3 compatibility: Fix compact throwing notices for multisite
In PHP 7.3, the compact() function has been changed to issue an E_NOTICE level error if a passed string refers to an unset variable. In previous versions of PHP, this notice was silently skipped. The full RFC can be viewed here: https://wiki.php.net/rfc/compact

By initializing these variables, they can be compacted.

Previously [43819].
See #44416.
Props desrosj.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43832 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-26 20:16:22 +00:00
Gary Pendergast
8dbb161323 Script Loader: Add translator comments and remove textdomains.
The inline script for `wp-date` incorrectly included a textdomain, and lacked translator comments.

Props mukesh27.
Fixes #45191, #45162.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43831 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-26 08:14:49 +00:00
Gary Pendergast
0ba73f24ba Meta Boxes: Fix error when a meta box is rendered with a static method callback.
When `WP_DEBUG` is set, ensure that a static method callback is passed to `ReflectionMethod`, instead of `ReflectionFunction`.

Props DrewAPicture.
Fixes #45192.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43830 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-26 08:10:18 +00:00
Gary Pendergast
9cd32b93da Accessibility: Media: Improve the usage of a few label elements in the media templates.
Label elements should only be used for labelable elements.
- `Uploaded By` and `Uploaded To` aren't form controls and shouldn't be associated with labels
- changes the labels for media source, alternate sources, poster image, and tracks to solve a layout issue and explicitly associate the labels to their form fields (previously, the labels were wrapping also the Remove buttons)

Merges [42444] to the 5.0 branch.

Props Presskopp, afercia.
Fixes #38759, #40468.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43829 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-26 07:13:25 +00:00
Sergey Biryukov
845f569b46 Tests: Use DIR_TESTDATA in test_wp_set_script_translation().
`__DIR__` is not available in PHP 5.2.x.

See #45103.

git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43828 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-26 03:54:02 +00:00
Drew Jaynes
ebcfbfe286 Docs: Link to the "Conditional Tags" article in the Theme Developer Handbook from the descriptions for a variety of core conditional tag functions.
These notations largely serve to direct consumers (of both the source and the parsed code reference) to extended information on individual and related conditional tags throughout WordPress. The changeset also standardizes corresponding DocBlock summaries to use third-person singular verbs.

Notations have been added for the following functions:

* comments_open()
* email exists()
* has_excerpt()
* has_post_thumbnail()
* has_tag()
* in_category()
* in_the_loop()
* is_404()
* is_active_sidebar()
* is_active_widget()
* is_admin()
* is_admin_bar_showing()
* is_archive()
* is_attachment()
* is_author()
* is_blog_installed()
* is_category()
* is_comments_popup()
* is_date()
* is_day()
* is_dynamic_sidebar()
* is_feed()
* is_front_page()
* is_home()
* is_local_attachment()
* is_main_query
* is_month()
* is_multi_author
* is_new_day()
* is_page()
* is_page_template()
* is_paged()
* is_plugin_active()
* is_plugin_active_for_network()
* is_plugin_inactive()
* is_plugin_page()
* is_post_type_archive()
* is_preview()
* is_rtl()
* is_search()
* is_single()
* is_singular()
* is_sticky()
* is_tag()
* is_tax()
* is_taxonomy_hierarchical()
* is_time()
* is_trackback()
* is_user_logged_in()
* is_year()
* pings_open()
* post_type_exists()
* taxonomy_exists()
* term_exists()
* username exists()
* wp_attachment_is_image()
* wp_script_is() 

Merges [42710] to the 5.0 branch.

Props janalwin.
Fixes #43254.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43827 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-26 01:23:29 +00:00
Anton Timmermans
2d74b7157c Build tools: Fix build after [43824].
Props omarreiss.
See #45145.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43826 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-25 15:22:12 +00:00
herregroen
4f05bb81f6 I18N: Add JavaScript translation support.
Adds the `wp_set_script_translations` function which registers translations for a JavaScript file. This function takes a handle, domain and optionally a path and ensures JavaScript translation files are loaded if they exist.

Props atimmer, omarreiss, nerrad, swissspidy, ocean90.
Fixes #45103.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43825 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-25 13:59:51 +00:00
Anton Timmermans
6da9e42b26 Build tools: Clone and build from packages repo.
Instead of requiring the packages individually this commit changes it so the packages are used from the packages repository (gutenberg). This is a solution that makes updating the packages easier, as long as we don't have a monorepo to manage both WordPress & the JavaScript packages together.

Props youknowriad, gziolo, omarreiss, herregroen.
See #45145.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43824 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-25 13:42:03 +00:00
Gary Pendergast
4452b29fb8 Post WordPress 5.0 Beta 1 version bump.
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43823 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-24 21:53:25 +00:00
Gary Pendergast
cef611a087 WordPress 5.0 Beta 1.
git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43822 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-24 21:37:45 +00:00
Dominik Schilling (ocean90)
5cf0de4e92 Bundled Themes: Remove languages folder with POT file from Twenty Nineteen.
POT files are no longer required.

git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43821 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-24 21:00:26 +00:00
Sergey Biryukov
546e59fe33 Upgrade/Install: Convert Sample Page, Hello World, and Privacy Policy to block content.
Props desrosj, garrett-eclipse, danielbachhuber.
Fixes #45151.

git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43820 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-24 18:50:35 +00:00
Aaron Jorbin
5a3ad21aeb php7.3 compatibility: Fix compact throwing notices
In PHP 7.3, the compact() function has been changed to issue an E_NOTICE level error if a passed string refers to an unset variable. In previous versions of PHP, this notice was silently skipped. The full RFC can be viewed here: https://wiki.php.net/rfc/compact

This fixes all unit tested code that uses compact.

Props desrosj.
Fixes #44416.


git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43819 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-24 16:32:29 +00:00
Gary Pendergast
efce353424 Scripts: Add a missing date format to the wp-date config.
`wp-date` recently added the `datetimeAbbreviated` format, but the config wasn't sending it on page load.

Fixes #45158.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@43818 602fd350-edb4-49c9-b593-d223f7449a82
2018-10-24 11:47:56 +00:00