Commit Graph

38722 Commits

Author SHA1 Message Date
Jonathan Desrosiers e63acae939 Editor: Add custom fields meta box support in the block editor.
This brings support for the custom fields meta box into the new block editor.

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

This does not bump the `@wordpress` packages like in [43861] because of conflicts with package versions already installed in `trunk`. The packages will be brought up to date in a subsequent merge.

Merges [43861] and [43863] into trunk.

See #45145.
Fixes #45257.

git-svn-id: https://develop.svn.wordpress.org/trunk@44260 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-17 03:51:08 +00:00
Sergey Biryukov b6a378d345 TinyMCE: Fix the keyboard shortcut (Alt+Shift+H) to not open the default Block Editor help modal and change the title of the help modal to "Classic Block Keyboard Shortcuts" in the Classic BLock. Also remove Alt+Shift+Z in the Classic Block as it conflicts with the Block Editor.
Props azaozz.
Merges [43915] to trunk.
Fixes #45365.

git-svn-id: https://develop.svn.wordpress.org/trunk@44257 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-17 01:48:05 +00:00
Sergey Biryukov 0ca5139e70 Tests: Replace use of `$this->server` with `rest_get_server()` in `test_get_additional_field_registration_null_schema()`.
In [42724], `$this->server` was replaced with `rest_get_server()` for better memory recycling.

[43908], from the 5.0 branch, was merged into trunk in [44254] and used the now unavailable `$this->server`.

This updates the new test from the 5.0 branch to use the expected `rest_get_server()`.

See #45220, #41641.

git-svn-id: https://develop.svn.wordpress.org/trunk@44256 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-17 01:41:10 +00:00
Sergey Biryukov e3e683fc09 Tests: Replace use of `$this->server` with `rest_get_server()` in `test_registered_query_params()`.
In [42724], `$this->server` was replaced with `rest_get_server()` for better memory recycling.

[43897], from the 5.0 branch, was merged into trunk in [44250] and used the now unavailable `$this->server`.

This updates the new test from the 5.0 branch to use the expected `rest_get_server()`.

See #43316, #41641.

git-svn-id: https://develop.svn.wordpress.org/trunk@44255 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-17 01:24:36 +00:00
Sergey Biryukov d79ec242e4 REST API: Include fields with null schema in `get_fields_for_response()`.
In [43736], we prevented rendering fields when not present in `?_fields=`. However, because `get_fields_for_response()` is dependent on `get_item_schema()`, any custom fields registered with a null schema would be incorrectly excluded from the response. Because the REST API permits a null schema for `register_rest_field()`, those fields should be included in the available fields for a response.

Props danielbachhuber.
Merges [43908] to trunk.
Fixes #45220.

git-svn-id: https://develop.svn.wordpress.org/trunk@44254 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-17 01:14:17 +00:00
Sergey Biryukov 961bc64adf PHPCS: Fix errors introduced in [44250].
See #43316.

git-svn-id: https://develop.svn.wordpress.org/trunk@44253 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-17 01:05:03 +00:00
Sergey Biryukov 2b8464c5e5 Build Tools: Minify the package CSS when building.
CSS coming from the `@wordpress` packages wasn't being minified in the build. This had the noteable side effect of causing RTL CSS to not be loaded when `SCRIPT_DEBUG` was set to `false`.

Props websupporter.
Merges [43905] to trunk.
Fixes #45330.

git-svn-id: https://develop.svn.wordpress.org/trunk@44252 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-17 00:36:36 +00:00
Sergey Biryukov e03dee4e87 Block Editor: Load TinyMCE inline scripts later.
Previously, the TinyMCE inline scripts were added on the `init` action in the block editor. In the classic editor, however, these scripts are loaded when the TinyMCE window is printed, and some plugins rely on them being loaded later, so they can attach to the appropriate filters.

Props pento.
Merges [43901] to trunk.
Fixes #45338.

git-svn-id: https://develop.svn.wordpress.org/trunk@44251 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-17 00:28:36 +00:00
Sergey Biryukov c2390f96a2 REST API: Avoid using 'parent' as path argument name for autosaves.
When 'parent' is set as the path argument name, it gets passed down through to the `create_item()` method and can erroneously reset the 'parent' value on the post itself. Instead, we rename the argument to 'id' and replicate the revision controller's `get_items_permissions_check()` to instead reference 'id'.

Also ensures revision query params (of which there are many) aren't exposed as the query params for autosaves (of which there are two).

Props TimothyBlynJacobs.
Merges [43897] to trunk.
See #43316.

git-svn-id: https://develop.svn.wordpress.org/trunk@44250 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-17 00:23:55 +00:00
Sergey Biryukov 98968ae2fc Scripts: Fix a PHP error in admin-ajax calls.
When making an ajax request, `wp_enqueue_registered_block_scripts_and_styles()` checked if `is_admin()` was true before accessing `$current_screen`, rather than checking if `$current_screen` was defined. This is usually fine, execept for in ajax requests.

Props ocean90, foreverpinetree, pento.
Merges [43893] and [43894] to trunk.
Fixes #45302.

git-svn-id: https://develop.svn.wordpress.org/trunk@44249 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-17 00:14:27 +00:00
Sergey Biryukov 897f8bf3b4 Block Editor: Fix the TinyMCE `wordpress` plugin to handle hiding/showing of toolbars in the classic block. Change the classic block toolbar to use the (now fixed) `wp_adv` button.
Props azaozz.
Merges [43889] and [43890] to trunk.
Fixes #45264.

git-svn-id: https://develop.svn.wordpress.org/trunk@44247 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 23:55:58 +00:00
Sergey Biryukov 376d146378 Build Tools: Revert unrelated changes to `Gruntfile.js` added in [44245].
See #45156.

git-svn-id: https://develop.svn.wordpress.org/trunk@44246 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 23:33:38 +00:00
Sergey Biryukov caca9cb77b Build Tools: Add non-minified `@wordpress` scripts to the build output.
Props atimmer.
Merges [43886] to trunk.
See #45156.

git-svn-id: https://develop.svn.wordpress.org/trunk@44245 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 23:27:36 +00:00
Sergey Biryukov 61234818ae Block Editor: Hide the Custom Fields meta box option if that meta box has been removed.
Some plugins remove the Custom Fields meta box, particularly when they provide functionality that replaces it. The block editor would correctly not display this meta box in these circumstances, but it still showed the option to display or hide it.

Props pento, noisysocks.
Merges [43885] to trunk.
See #45282.

git-svn-id: https://develop.svn.wordpress.org/trunk@44244 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 23:23:38 +00:00
Sergey Biryukov 4c20251e6d PHPCS: Fix errors introduced in [44241].
See #45283.

git-svn-id: https://develop.svn.wordpress.org/trunk@44243 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 23:03:25 +00:00
Sergey Biryukov 7dc55e9fbf Tests: Fix tests broken in PHP 5.x after [43879].
Props pento.
Merges [43883] to trunk.
See #45290.

git-svn-id: https://develop.svn.wordpress.org/trunk@44242 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 22:54:46 +00:00
Sergey Biryukov 8002325c92 Meta Boxes: Add the `block_editor_meta_box_hidden_fields` action.
Lacking an appropriate action in the classic editor, plugins that add meta boxes have historically hooked into various actions in order to add hidden input fields.

This change also adds backwards compatibility for two of the most common: `edit_form_after_title`, and `edit_form_advanced`.

Props pento, danielbachhuber.
Merges [43882] to trunk.
Fixes #45283.

git-svn-id: https://develop.svn.wordpress.org/trunk@44241 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 22:51:01 +00:00
Sergey Biryukov 7f326f92a5 Block Editor: Prevent the meta box form from being accidentally submitted.
Meta boxes are loaded inside a wrapper form, that the block editor submits as part of the saving process. It shouldn't be submitted manually.

Props pento.
Merges [43880] to trunk.
Fixes #45284.

git-svn-id: https://develop.svn.wordpress.org/trunk@44240 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 22:26:30 +00:00
Sergey Biryukov a10598acd0 I18N: Set translations for all WordPress packages scripts.
Calls `wp_set_script_translations` for all packages scripts that have translations. Also correctly sets the domain on the translations.

Props omarreiss, pento, ocean90.
Merges [43878] to trunk.
Fixes #45161.

git-svn-id: https://develop.svn.wordpress.org/trunk@44239 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 22:23:34 +00:00
Sergey Biryukov c687f1957e PHPCS: Fix errors introduced in [44236].
See #45221.

git-svn-id: https://develop.svn.wordpress.org/trunk@44238 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 21:18:38 +00:00
Sergey Biryukov 00f638b6a5 Script Loader: Ensure default packages are registered when loaded via load-scripts.php.
Props CantoThemes, ocean90.
Merges [43877] to trunk.
Fixes #45271.

git-svn-id: https://develop.svn.wordpress.org/trunk@44237 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 20:37:30 +00:00
Sergey Biryukov 55f4475f9f 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.

Props azaozz.
Merges [43867] to trunk.
Fixes #45221.

git-svn-id: https://develop.svn.wordpress.org/trunk@44236 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 20:23:57 +00:00
Jeremy Felt 3bcf9f7e46 Tests: Replace uses of `$this->server` with `rest_get_server()`.
In [42724], `$this->server` was replaced with `rest_get_server()` for better memory recycling.

[43862], from the 5.0 branch, was merged into trunk in [44225] and used the now unavailable `$this->server`.

This updates the new tests from the 5.0 branch to use the expected `rest_get_server()`.

See #45269, #41641.


git-svn-id: https://develop.svn.wordpress.org/trunk@44234 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 18:53:58 +00:00
Jeremy Felt c52b38b844 Build Tools: Update `grunt-sass` to v3 and add `node-sass` v4.
This fixes an error in the PHP 5.2 and 5.3 Travis builds after [44219].

Props netweb.
See #45241.
Fixes #45664.


git-svn-id: https://develop.svn.wordpress.org/trunk@44233 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 18:47:25 +00:00
Jonathan Desrosiers cdaf0b6901 Tests: Update a test that relied on the Hello Dolly plugin version.
[43900] changed the plugin version, causing a unit test failure.

Merges [43902] to trunk.

See #45345.

git-svn-id: https://develop.svn.wordpress.org/trunk@44230 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 04:54:40 +00:00
Jonathan Desrosiers 14ef0dde3a Hello Dolly: Hide the lyrics in the block editor.
I'm sorry, Hello Dolly. You're my favorite plugin, but the way you output your lyrics doesn't play nicely with the block editor, particuarly on mobile devices.

This isn't Farewell Dolly, you're still on every other admin page, and I know you'll come back better and stronger.

Merges [43900] to trunk.

Props joen.
See #45345.

git-svn-id: https://develop.svn.wordpress.org/trunk@44229 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 04:51:42 +00:00
Jonathan Desrosiers 26d5633417 Docs: Future-proof comments referencing 5.0 TODOs.
Some Customizer-related files contain inline comments referencing work to do for #42364 for 5.0. Those comments are now outdated as #42364 was moved to the 5.1 milestone.

Merges [43887] to trunk.

Props dlh, pento.
Fixes #45115.

git-svn-id: https://develop.svn.wordpress.org/trunk@44228 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 04:47:41 +00:00
Jonathan Desrosiers 663a5e9662 Bundled Themes: Add theme support for responsive embeds
Add `add_theme_support( 'responsive-embeds' );` to all of the responsive default themes as part of their block editor support. This makes sure any embeds coming from the new block-based editor maintain their aspect ratios at different screen sizes.

Merges [43868] into trunk.

Props laurelfulford.
Fixes #45274.

git-svn-id: https://develop.svn.wordpress.org/trunk@44227 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 04:33:26 +00:00
Jeremy Felt 415f33c904 Formatting: Ensure `wpautop()` isn't run on content generated from blocks.
As `do_blocks()` is run before `wpautop()` in the_content filter, we can remove in a Just In Time fashion, before that filter is run.

After `wpautop()`s original priority has passed, we can re-add it in a Just Too Late fashion, to ensure it's available if `the_content` filter is run multiple times on a page load.

Merges [43879] and [43881] from the 5.0 branch to trunk.

Props pento, nerrad.
Fixes #45290.


git-svn-id: https://develop.svn.wordpress.org/trunk@44226 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 02:22:43 +00:00
Jeremy Felt deab4810d0 REST API: Prevent duplicate firing of `rest(_after)?_insert_attachment` actions.
Merges [43862] from the 5.0 branch to trunk.

Props danielbachhuber, peterwilsoncc.
Fixes #45269.
See #42864.


git-svn-id: https://develop.svn.wordpress.org/trunk@44225 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 02:16:16 +00:00
Jeremy Felt 7f2a7a3f3e 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.

Merges [43858] from the 5.0 branch to trunk.

Props dd32.
See #45236.


git-svn-id: https://develop.svn.wordpress.org/trunk@44224 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 01:58:41 +00:00
Jeremy Felt 3261d687bb Block Editor: Remove CodeMirror settings.
CodeMirror is no longer used in the block editor, so we don't need to load the settings.

Merges [43857] from the 5.0 branch to trunk.

Props noisysocks.
Fixes #45248.


git-svn-id: https://develop.svn.wordpress.org/trunk@44223 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 01:56:44 +00:00
Jeremy Felt 01fbdc0860 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.

Merges [43856] from the 5.0 branch to trunk.

Props noisysocks.
Fixes #45249.


git-svn-id: https://develop.svn.wordpress.org/trunk@44222 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 01:55:08 +00:00
Jeremy Felt 5c3f3b8167 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.

Merges [43855] from the 5.0 branch to trunk.

Props pento.
See #43278.


git-svn-id: https://develop.svn.wordpress.org/trunk@44221 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 01:52:50 +00:00
Jeremy Felt c9c6beb3f3 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.

Merges [43854] from the 5.0 branch to trunk.

Props noisysocks.
Fixes #45247.


git-svn-id: https://develop.svn.wordpress.org/trunk@44220 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 01:48:05 +00:00
Jeremy Felt 33a1131b17 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.

Merges [43853] from the 5.0 branch to trunk.

Props pento.
See #45241.


git-svn-id: https://develop.svn.wordpress.org/trunk@44219 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 01:42:24 +00:00
jeremyfelt 4212d597c5 REST API: Fix array syntax after [43851].
I thought I was writing JavaScript. Alas.

Merges [43852] from the 5.0 branch to trunk.

Props danielbachhuber.
See #45196.


git-svn-id: https://develop.svn.wordpress.org/trunk@44218 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 01:40:02 +00:00
Jeremy Felt de92919e02 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.

Merges [43851] from the 5.0 branch to trunk. `wp-api-generated.js` generated based on current trunk.
Props danielbachhuber.
Fixes #45196.


git-svn-id: https://develop.svn.wordpress.org/trunk@44217 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 01:37:56 +00:00
Jeremy Felt 1e476cf34d 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].

Merges [43850] from the 5.0 branch to trunk.

Props ocean90.
See #43757.


git-svn-id: https://develop.svn.wordpress.org/trunk@44216 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 01:25:27 +00:00
jeremyfelt 67b1a86c40 Blocks: Include necessary labels for the 'wp_block' post type.
Merges [43849] from the 5.0 branch to trunk.

Props danielbachhuber.
See #45098.


git-svn-id: https://develop.svn.wordpress.org/trunk@44215 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 01:24:01 +00:00
Jeremy Felt 9fb651d229 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.

Merges [43837] from the 5.0 branch to trunk.

Props pento, peterwilsoncc.
Fixes #45172.


git-svn-id: https://develop.svn.wordpress.org/trunk@44214 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-16 01:18:22 +00:00
Ian Dunn 7a8e9af6a6 KSES: Make the URI attributes DRY.
This commit introduces the `wp_kses_uri_attributes` function and filter. The function centralizes the list of attributes, in order to prevent inconsistency, and the filter provides a way for plugins to customize the attributes.

Merges [44014] and [44017] to `trunk`.


git-svn-id: https://develop.svn.wordpress.org/trunk@44207 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-15 01:07:06 +00:00
Jonathan Desrosiers 7f23254337 Networks and Sites: Fix incorrect variable location.
This fixes an issue introduced in [44166] where the `$groupby` variable was inserted too low in the `get_site_ids()` function while merging [43832] into `trunk`. The merged location did not account for a new conditional statement that existed only in `trunk`, and would have resulted in values assigned to `$groupby` being erased in certain scenarios.

Props spacedmonkey.

See #44416.
Fixes #45582.

git-svn-id: https://develop.svn.wordpress.org/trunk@44186 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 17:05:58 +00:00
Anton Timmermans fa74040a36 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, pento.
Merges [43848] to trunk.
Fixes #44489.


git-svn-id: https://develop.svn.wordpress.org/trunk@44184 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 12:25:16 +00:00
Anton Timmermans 5f777a1b17 Build Tools: Update the @wordpress packages.
Trunk now matches Gutenberg 4.2 RC1.

Props pento.
Merges [43847] to trunk.
See #45145.


git-svn-id: https://develop.svn.wordpress.org/trunk@44182 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 12:18:28 +00:00
Anton Timmermans fca28f6b85 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.

Props danielbachhuber.
Merges [43846] to trunk.
See #44758.
Fixes #45235.


git-svn-id: https://develop.svn.wordpress.org/trunk@44181 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 12:14:15 +00:00
Anton Timmermans b870f5b13e Build Tools: Update @wordpress packages.
Props pento.
Merges [43843] to trunk.
See #45145.


git-svn-id: https://develop.svn.wordpress.org/trunk@44180 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 12:06:31 +00:00
Anton Timmermans 9c6f855dbf Tests: Fix failing unit tests caused by [43840].
Props pento.
Merges [43841] to trunk.
See #45145.


git-svn-id: https://develop.svn.wordpress.org/trunk@44179 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 11:22:41 +00:00
Anton Timmermans 3a66624677 General: Fix code formatting issues.
Fix code formatting after [44174] and [44177].


git-svn-id: https://develop.svn.wordpress.org/trunk@44178 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 11:01:54 +00:00
Anton Timmermans 19800c7b76 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.

Props pento.
Merges [43840] to trunk.
See #45145.


git-svn-id: https://develop.svn.wordpress.org/trunk@44177 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 10:53:17 +00:00