Commit Graph

25342 Commits

Author SHA1 Message Date
danielbachhuber
9cd179146c Embeds: Filter HTML response in oEmbed proxy controller.
Adapts the response from `WP_oEmbed_Controller::get_proxy_item()` so that the response is correctly filtered and embeds work properly in JavaSccript editors. Introduces new `get_oembed_response_data_for_url()` function for preparing internal oEmbed responses.

Props danielbachhuber, imath, swissspidy.
Fixes #45142. 

Built from https://develop.svn.wordpress.org/branches/5.0@43810


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43639 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 17:48:39 +00:00
Aaron Jorbin
634bb165bc Bundled Theme: Make twentynineteen the default theme.
After [43808], we can now make twentynineteen the default theme. Twentyseventeen has been a great default, but 5.0 and twentynineteen is guten.

Fixes #45152.

Built from https://develop.svn.wordpress.org/branches/5.0@43809


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43638 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 16:51:39 +00:00
allancole
a3ae67bd8f 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.

Built from https://develop.svn.wordpress.org/branches/5.0@43808


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43637 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 15:53:44 +00:00
Gary Pendergast
46e270096b Dashboard: Remove the Try Gutenberg callout.
Block or block not. There is no try.

Props mukesh27.
See #45063.


Built from https://develop.svn.wordpress.org/branches/5.0@43807


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 11:04:40 +00:00
danielbachhuber
4521b34dca Blocks: Fix coding standards introduced in [43804].
Props Presskopp, swissspidy.
See #45098

Built from https://develop.svn.wordpress.org/branches/5.0@43806


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43635 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 10:59:40 +00:00
Gary Pendergast
b1f64a77d8 REST API: Add endpoints for blocks.
`WP_REST_Block_Renderer_Controller` allows rendering of server-side rendered blocks, whilst `WP_REST_Blocks_Controller` allows retrieving of reusable blocks.

Props desrosj, danielbachhuber, pento.
See #45065.


Built from https://develop.svn.wordpress.org/branches/5.0@43805


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 07:04:39 +00:00
Gary Pendergast
c60c870ab8 Blocks: Add the reusable block post type, wp_block.
See #45098.


Built from https://develop.svn.wordpress.org/branches/5.0@43804


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43633 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:53:38 +00:00
Gary Pendergast
8083498426 Scripts: wp-url is a dependency of wp-api-fetch.
See #45065.


Built from https://develop.svn.wordpress.org/branches/5.0@43803


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:36:38 +00:00
Gary Pendergast
86484c93cc Script Loader: Fix metadata being registered as an inline script.
[43723] included script metadata for the `wp-polyfill` script that was being registered as an inline script.

See #45065.


Built from https://develop.svn.wordpress.org/branches/5.0@43802


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:21:39 +00:00
Gary Pendergast
f6366c297f Build: Update the @wordpress/editor package.
The `@wordpress/editor` wasn't upgraded to the correct version in [43789].

This commit includes changes from the `@wordpress/block-library` upgrade in [43789], that weren't copied to the correct location in core.

This also regenerates the `package-lock.json` in Linux, which the build server requires.

See #45145.


Built from https://develop.svn.wordpress.org/branches/5.0@43801


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:16:39 +00:00
David A. Kennedy
878a6359dc Twenty Seventeen: Add styles and support for the new block-based editor.
This update adds styles and theme support related to the new block-based editor to enhance the experience of using it with Twenty Seventeen. 

These are the specific changes made to this theme:

* Add blocks.css, to style blocks on the front end, to make sure they match the theme’s existing HTML element styles.
* Add editor-blocks.css to style blocks in the editor, to make sure they match the theme’s existing HTML element styles.
* Add theme support for `editor-styles`, to pull the existing editor stylesheet into the new editor.
* Add theme support for `wp-block-styles`, to load the default block styles on the front end.

Props laurelfulford, ianbelanger, crunnells.
Fixes #45045.

Built from https://develop.svn.wordpress.org/branches/5.0@43800


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43629 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:14:17 +00:00
David A. Kennedy
5454da68ff Twenty Sixteen: Add styles and support for the new block-based editor.
This update adds styles and theme support related to the new block-based editor to enhance the experience of using it with Twenty Sixteen. 

These are the specific changes made to this theme:

* Add blocks.css, to style blocks on the front end, to make sure they match the theme’s existing HTML element styles.
* Add editor-blocks.css to style blocks in the editor, to make sure they match the theme’s existing HTML element styles.
* Add theme support for `editor-styles`, to pull the existing editor stylesheet into the new editor.
* Add theme support for `wp-block-styles`, to load the default block styles on the front end.
* Add theme support for `editor-color-palette`, to load a color palette based on the theme’s color scheme into the block-based editor.

Props laurelfulford.
Fixes #45044.

Built from https://develop.svn.wordpress.org/branches/5.0@43799


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43628 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:13:38 +00:00
David A. Kennedy
969c41a2b4 Twenty Fifteen: Add styles and support for the new block-based editor.
This update adds styles and theme support related to the new block-based editor to enhance the experience of using it with Twenty Fifteen. 

These are the specific changes made to this theme:

* Add blocks.css, to style blocks on the front end, to make sure they match the theme’s existing HTML element styles.
* Add editor-blocks.css to style blocks in the editor, to make sure they match the theme’s existing HTML element styles.
* Add theme support for `editor-styles`, to pull the existing editor stylesheet into the new editor.
* Add theme support for `wp-block-styles`, to load the default block styles on the front end.
* Add theme support for `editor-color-palette`, to load a color palette based on the theme’s color scheme into the block-based editor.

Props laurelfulford.
Fixes #45043.

Built from https://develop.svn.wordpress.org/branches/5.0@43798


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43627 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:13:00 +00:00
David A. Kennedy
283a3791ef Twenty Fourteen: Add styles and support for the new block-based editor.
This update adds styles and theme support related to the new block-based editor to enhance the experience of using it with Twenty Fourteen. 

These are the specific changes made to this theme:

* Add blocks.css, to style blocks on the front end, to make sure they match the theme’s existing HTML element styles.
* Add editor-blocks.css to style blocks in the editor, to make sure they match the theme’s existing HTML element styles.
* Add theme support for `editor-styles`, to pull the existing editor stylesheet into the new editor.
* Add theme support for `wp-block-styles`, to load the default block styles on the front end.
* Add theme support for `editor-color-palette`, to load a color palette based on the theme’s color scheme into the block-based editor.

Props laurelfulford, crunnells, ianbelanger.
Fixes #45042.

Built from https://develop.svn.wordpress.org/branches/5.0@43797


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:12:20 +00:00
David A. Kennedy
3ad030877b Twenty Thirteen: Add styles and support for the new block-based editor.
This update adds styles and theme support related to the new block-based editor to enhance the experience of using it with Twenty Thirteen. 

These are the specific changes made to this theme:

* Add blocks.css, to style blocks on the front end, to make sure they match the theme’s existing HTML element styles.
* Add editor-blocks.css to style blocks in the editor, to make sure they match the theme’s existing HTML element styles.
* Add theme support for `editor-styles`, to pull the existing editor stylesheet into the new editor.
* Add theme support for `wp-block-styles`, to load the default block styles on the front end.
* Add theme support for `editor-color-palette`, to load a color palette based on the theme’s color scheme into the block-based editor.
* Add theme support and styles for `align-wide`, to allow wide and full alignment styles on the blocks.

Props laurelfulford, ianbelanger.
Fixes #45041.

Built from https://develop.svn.wordpress.org/branches/5.0@43796


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:11:39 +00:00
David A. Kennedy
7c3565dd99 Twenty Twelve: Add styles and support for the new block-based editor.
This update adds styles and theme support related to the new block-based editor to enhance the experience of using it with Twenty Twelve. 

These are the specific changes made to this theme:

* Add blocks.css, to style blocks on the front end, to make sure they match the theme’s existing HTML element styles.
* Add editor-blocks.css to style blocks in the editor, to make sure they match the theme’s existing HTML element styles.
* Add theme support for `editor-styles`, to pull the existing editor stylesheet into the new editor.
* Add theme support for `wp-block-styles`, to load the default block styles on the front end.
* Add theme support for `editor-color-palette`, to load a color palette based on the theme’s color scheme into the block-based editor.

Props ianbelanger, crunnells, laurelfulford.
Fixes #45040.

Built from https://develop.svn.wordpress.org/branches/5.0@43795


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:10:58 +00:00
David A. Kennedy
92f2294d71 Twenty Eleven: Add styles and support for the new block-based editor.
This update adds styles and theme support related to the new block-based editor to enhance the experience of using it with Twenty Eleven. 

These are the specific changes made to this theme:

* Add blocks.css, to style blocks on the front end, to make sure they match the theme’s existing HTML element styles.
* Add editor-blocks.css to style blocks in the editor, to make sure they match the theme’s existing HTML element styles.
* Add theme support for `editor-styles`, to pull the existing editor stylesheet into the new editor.
* Add theme support for `wp-block-styles`, to load the default block styles on the front end.
* Add theme support for `editor-color-palette`, to load a color palette based on the theme’s color scheme into the block-based editor.

Props ianbelanger, laurelfulford.
Fixes #45039.

Built from https://develop.svn.wordpress.org/branches/5.0@43794


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:10:19 +00:00
David A. Kennedy
24946fb0f6 Twenty Ten: Add styles and support for the new block-based editor.
This update adds styles and theme support related to the new block-based editor to enhance the experience of using it with Twenty Ten. 

These are the specific changes made to this theme:

* Add blocks.css, to style blocks on the front end, to make sure they match the theme’s existing HTML element styles.
* Add editor-blocks.css to style blocks in the editor, to make sure they match the theme’s existing HTML element styles.
* Add theme support for `editor-styles`, to pull the existing editor stylesheet into the new editor.
* Add theme support for `wp-block-styles`, to load the default block styles on the front end.
* Add theme support for `editor-color-palette`, to load a color palette based on the theme’s color scheme into the block-based editor.

Props nielslange, crunnells, laurelfulford.
Fixes #45038.

Built from https://develop.svn.wordpress.org/branches/5.0@43793


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:09:39 +00:00
Dominik Schilling
957a6af144 Meta Boxes: Sync checks for valid meta boxes from do_meta_boxes() to the_block_editor_meta_boxes().
See #45112.
Built from https://develop.svn.wordpress.org/branches/5.0@43792


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43621 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:08:59 +00:00
Dominik Schilling
4caf9b7aaf Themes: Remove a stray slash and gutenberg text domain.
See #45125.
Built from https://develop.svn.wordpress.org/branches/5.0@43791


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:08:19 +00:00
danielbachhuber
8caf4f9260 Themes: Introduce responsive embeds support.
Responsive embeds is a way for a theme to opt in to WordPress dynamically scaling the width/height of an embed. When a theme supports responsive embeds, a `wp-embed-responsive` class is added to the `<body>` tag. This information is also presented through the REST API for clients to respect.

Props desrosj.
Fixes #45125.

Built from https://develop.svn.wordpress.org/branches/5.0@43790


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43619 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:07:39 +00:00
atimmer
8efbcce93b Build tools: Upgrade @wordpress packages.
Generated using `npm update @wordpress/api-fetch @wordpress/blob @wordpress/block-library @wordpress/blocks @wordpress/components @wordpress/compose @wordpress/core-data @wordpress/data @wordpress/date @wordpress/dom @wordpress/edit-post @wordpress/editor @wordpress/element @wordpress/escape-html @wordpress/list-reusable-blocks @wordpress/nux @wordpress/plugins @wordpress/redux-routine @wordpress/rich-text @wordpress/url @wordpress/viewport`.

See #45145.

Built from https://develop.svn.wordpress.org/branches/5.0@43789


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43618 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-23 06:06:59 +00:00
Gary Pendergast
a618939ddb Script/Style Dependencies: Make sure that inline scripts for handles without a source are printed.
See [36550] for `WP_Styles`.

Merges [43565] to the 5.0 branch.

Props bpayton.
Fixes #44551.


Built from https://develop.svn.wordpress.org/branches/5.0@43788


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-22 06:13:38 +00:00
Gary Pendergast
49702cca54 TinyMCE: remove stray CSS map reference from skin.min.css.
Merges [43581] to the 5.0 branch.

Props pross.
Fixes #44785.

Built from https://develop.svn.wordpress.org/branches/5.0@43787


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43616 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-22 06:05:39 +00:00
Gary Pendergast
a2a28e85a3 Build/Tools: Add PHPCS to the 5.0 branch.
This allows us to apply WordPress Coding Standards rules to new files in the 5.0 branch.

Props netweb.
Fixes #44366.



Built from https://develop.svn.wordpress.org/branches/5.0@43786


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-22 05:15:39 +00:00
Gary Pendergast
38aa44817f Build: Update images following [43684].
`grunt-contrib-imagemin` was updated, which included some changes to image minification. Those changes are now applies.

Props netweb.
See #45080.


Built from https://develop.svn.wordpress.org/branches/5.0@43785


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43614 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-22 05:06:38 +00:00
Gary Pendergast
ce66f73e68 Build: Updated CSS vendor prefixes following [43684].
`autoprefixer` was updated, which included some vendor prefix changes. Those changes are now applied.

Props netweb.
See #45080.


Built from https://develop.svn.wordpress.org/branches/5.0@43784


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-22 05:04:40 +00:00
Gary Pendergast
2025427f5d Build: Ignore the vendor directory during the jsvalidate:build task.
Props netweb.
Fixes #45119.


Built from https://develop.svn.wordpress.org/branches/5.0@43783


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-22 04:54:39 +00:00
Gary Pendergast
fb9f4e8abd Build: Switch package.json to using tabs for indents.
Merges [42460] to the 5.0 branch.

Props netweb.
Fixes #43075.


Built from https://develop.svn.wordpress.org/branches/5.0@43782


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43611 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-22 04:50:40 +00:00
Gary Pendergast
5d58c6dc66 KSES: Allow url() to be used in inline CSS.
The cover image block uses the `url()` function in its inline CSS, to show the cover image. KSES didn't allow this, causing the block to not save correctly for Author and Contributor users. As KSES does already check each attribute name against an allowed list, we're able to add an extra check for certain attributes to be able to use the `url()` function, too.

Props peterwilsoncc, azaozz, pento, dd32.
See #45067.


Built from https://develop.svn.wordpress.org/branches/5.0@43781


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43610 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-22 04:04:41 +00:00
Gary Pendergast
433dfae509 Block Editor: Add extra body classes when the block editor is loaded.
See #45037.


Built from https://develop.svn.wordpress.org/branches/5.0@43780


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43609 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-22 03:14:40 +00:00
Gary Pendergast
6800a811b6 Meta Boxes: Add __back_compat_meta_box and __block_editor_compatible_meta_box flags to meta boxes.
When meta boxes are registered, they can use the `__back_compat_meta_box` and `__block_editor_compatible_meta_box` flags, to show whether this registration just exists for if the classic editor is loaded, and whether this meta box is compatible with the block editor.

When a meta box marks itself as incompatible with the block editor, and `WP_DEBUG` is enabled, a warning will show inside that meta box in the classic editor.

As all core meta boxes have been recreated in the block editor, they can be marked with the `__back_compat_meta_box` flag.

See #45112.


Built from https://develop.svn.wordpress.org/branches/5.0@43779


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43608 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-22 02:32:41 +00:00
Gary Pendergast
acda70184d Block Editor: Add helper functions to collect meta box information.
To allow the block editor to render meta boxes, it needs to collect information about how those meta boxes are registered, and format it for the block editor to make use of.

See #45112.


Built from https://develop.svn.wordpress.org/branches/5.0@43778


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43607 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-22 02:16:39 +00:00
Gary Pendergast
e0361726c2 Block Editor: Add an is_block_editor() method to WP_Screen.
This method allows checking (or setting) whether the block editor is loading on the current screen.

See #45037.


Built from https://develop.svn.wordpress.org/branches/5.0@43777


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43606 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-22 02:06:40 +00:00
danielbachhuber
d6895a1e65 REST API: Render response in user locale with ?_locale=user.
Introduces new `determine_locale()` function for deciding the proper locale to use for a response. Default value is `get_user_locale()` in the admin, and `get_locale()` on the frontend. Because REST API requests are considered frontend requests, `?_locale=user` can be used to render the response in the user's locale.

Also updates `wp-login.php?wp_lang` implementation to benefit from this abstraction.

Props flixos90, mnelson4, swissspidy, TimothyBlynJacobs.
Fixes #44758.

Built from https://develop.svn.wordpress.org/branches/5.0@43776


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43605 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-21 15:03:40 +00:00
Gary Pendergast
648850ea73 Revisions: Improve performance of WP_Text_Diff_Renderer_Table.
`WP_Text_Diff_Renderer_Table` is used to generate the diff view in revisions, but there were some cases that could cause it to take excessive amounts of time to run.

Some noteable cases include:
- When a large number of new lines were inserted in the middle of the post from one revision to the next.
- When both revisions contain >100 lines.
- When either revision contains a lot of long lines.

In one extreme test case, the diff view took over a minute to generate. With this change, it now takes less than a second.

See #35667.


Built from https://develop.svn.wordpress.org/branches/5.0@43775


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-20 08:36:40 +00:00
Sergey Biryukov
bae53caa70 REST API: Restore Autosaves controller test for multisite.
PHPUnit 3.6.x requires `exclude` and `file` paths to be relative to the checkout root.

PHPUnit 4.0.0+ requires the paths to be relative to the configuration file.

See #45131.
Built from https://develop.svn.wordpress.org/branches/5.0@43774


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43603 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-20 04:21:38 +00:00
danielbachhuber
0a3bb63b8f REST API: Limit the scope of wp-admin files required in WP_REST_Attachments_Controller methods.
Narrow the scope of the included wp-admin files loaded for `wp_generate_attachment_metadata()`, `wp_handle_upload()`, `wp_tempnam()`, and `wp_handle_sideload()`. Requires only `wp-admin/includes/file.php` and `wp-admin/includes/image.php` instead of `wp-admin/includes/admin.php`.

Props ocean90, lonelyvegan, soulseekah, pratikthink.
Merges [43589], [43604] to the 5.0 branch.
Fixes #43757.

Built from https://develop.svn.wordpress.org/branches/5.0@43773


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 18:53:41 +00:00
danielbachhuber
5a627786bf Help/About: Ensure the space after the period for the 4.9.8 changelog entry is preserved.
Props chetan200891, burhandodhy, swissspidy.
Merges [43622] to the 5.0 branch.
See #44717.

Built from https://develop.svn.wordpress.org/branches/5.0@43772


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 18:41:40 +00:00
danielbachhuber
6c9675bf37 REST API: Handle api-request query parameters with plain permalinks.
When constructing the request URL, ensure that `?` is replaced with `&` when the API root already contains a `?`. Fixes an issue where requests were broken when sites had permalinks set to plain.

Props aduth.
Merges [42965] to the 5.0 branch.
Fixes #42382.

Built from https://develop.svn.wordpress.org/branches/5.0@43771


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 18:33:39 +00:00
danielbachhuber
58ea8c82e4 REST API: Include block_version on Post content object.
The `block_version` denotes which version of Blocks the `post_content` contains. Introduces new `block_version()` function for versioning Blocks.

Props danielbachhuber, birgire.
Fixes #43887.

Built from https://develop.svn.wordpress.org/branches/5.0@43770


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43599 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 17:58:39 +00:00
danielbachhuber
7700a3ef3e REST API: Skip Autosaves controller test for multisite.
There's some PHP 5.2 (cough, cough) edge case where paths calculated differently, possibly caused by differing version of PHPUnit.

See #45132, #45131, #43316.

Built from https://develop.svn.wordpress.org/branches/5.0@43769


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43598 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 14:09:38 +00:00
danielbachhuber
50b0bf94c4 REST API: Introduce Autosaves controller and endpoint.
* Adds `WP_REST_Autosaves_Controller` which extends `WP_REST_Revisions_Controller`.
* Autosaves endpoint is registered for all post types except `attachment` because even post types without revisions enabled are expected to autosave.
* Because setting the `DOING_AUTOSAVE` constant pollutes the test suite, autosaves tests are run last. We may want to improve upon this later.

Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue.
Fixes #43316.

Built from https://develop.svn.wordpress.org/branches/5.0@43768


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43597 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 13:49:41 +00:00
danielbachhuber
53002c68c4 REST API: Use a truly impossibly high number in User Controller tests.
The `100` number could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.

Fixes #45128.

Built from https://develop.svn.wordpress.org/branches/5.0@43767


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43596 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 11:57:39 +00:00
danielbachhuber
7edc3e2b98 REST API: Ensure rest_url() consistently has leading slash.
`rest_url()` inconsistent addes slashes to the passed path depending on whether the site has pretty permalinks enabled. Apart from being inconsistent, this also caused the unit tests to fail when pretty permalinks are enabled.

Props frank-klein.
Merges [42250] to the 5.0 branch.
Partially reverts [43720].
Fixes #42452. See #41451, #45017.

Built from https://develop.svn.wordpress.org/branches/5.0@43766


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43595 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 11:14:39 +00:00
mcsf
326cd6af15 Deactivate Gutenberg plugin on update to 5.0.
Fixes #45123.


Built from https://develop.svn.wordpress.org/branches/5.0@43765


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43594 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 10:51:39 +00:00
Gary Pendergast
93343de1bd i18n: Remove some translation domains accidentally included in [43762].
See #45110.


Built from https://develop.svn.wordpress.org/branches/5.0@43764


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 09:12:38 +00:00
Gary Pendergast
2ccaeedbda REST API: Introduce the rest_preload_api_request() function.
This function helps perform multiple REST API requests, for the purpose of preloading data into a page.

See #45110.


Built from https://develop.svn.wordpress.org/branches/5.0@43763


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 08:57:40 +00:00
Gary Pendergast
de323bc14c Block Editor: Add helper functions for displaying the editor.
`use_block_editor_for_post()` and `use_block_editor_for_post_type()` determine if the block editor should be loaded.

`get_block_categories()` and `get_block_editor_server_block_settings()` provide data be included while the block editor is loading.

See #45110.


Built from https://develop.svn.wordpress.org/branches/5.0@43762


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43591 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 08:44:41 +00:00
Gary Pendergast
99d061b53c General: Extract the code editor settings from wp_enqueue_code_editor().
They're now returned by a new function, `wp_get_code_editor_settings()`, so they can be reused by the block editor.

See #45127.


Built from https://develop.svn.wordpress.org/branches/5.0@43761


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43590 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-19 06:45:39 +00:00