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.
Merges [43825,43828,43859,43898] from the 5.0 branch to trunk.
Props herregroen, atimmer, omarreiss, nerrad, swissspidy, ocean90, georgestephanis.
Fixes#45103, #45256.
Built from https://develop.svn.wordpress.org/trunk@44169
git-svn-id: http://core.svn.wordpress.org/trunk@43999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When switching themes, `wp_map_nav_menu_locations()` is used to ensure nav menus are placed in the relevant menu location. Occasionally, menus are registered to locations with numeric slugs, rather than strings. `wp_map_nav_menu_locations()` assumed it would be the latter, and ran `stripos()` on those numeric slugs. This behavior is deprecated in PHP 7.3.
As this is the last PHP 7.3 error in unit tests, this commit also removes PHP 7.3 from Travis' `allowed_failures` list.
Props pento, desrosj, jorbin.
Merges [43899] to trunk.
See #45018.
Built from https://develop.svn.wordpress.org/trunk@44167
git-svn-id: http://core.svn.wordpress.org/trunk@43997 1a063a9b-81f0-0310-95a4-ce76da25c4cd
For the WordPress zip we need both the minified and non-minified files. This is because of `SCRIPT_DEBUG`. So in grunt build we need to do both `grunt webpack:prod` and `grunt webpack:dev`.
Props bordoni, atimmer.
Merges [43817] to trunk.
Fixes#45156.
Built from https://develop.svn.wordpress.org/trunk@44161
git-svn-id: http://core.svn.wordpress.org/trunk@43991 1a063a9b-81f0-0310-95a4-ce76da25c4cd
- `grunt webpack:dev` now copies packages JS into `/src/wp-includes/js/dist`, and CSS into `/src/wp-includes/css/dist`.
- `grunt webpack:prod` does the same, but into `/build` instead of `/src`.
- `grunt build` now runs the `webpack:prod` task.
Merges [43760] from the 5.0 branch to trunk.
Props atimmer, pento.
Fixes#45119.
Built from https://develop.svn.wordpress.org/trunk@44159
git-svn-id: http://core.svn.wordpress.org/trunk@43989 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Blocks are able to register styles that used in the editor and the frontend, or only in the editor. These functions ensure the correct styles are loaded in the correct place.
Props pento.
Merges [43812] to trunk.
See #45065.
Built from https://develop.svn.wordpress.org/trunk@44157
git-svn-id: http://core.svn.wordpress.org/trunk@43987 1a063a9b-81f0-0310-95a4-ce76da25c4cd
To avoid this being a vector for bypassing the filetypes that are allowed to be uploaded, this attribute is only allowed to be added without a value.
Merges [43813] from the 5.0 branch to trunk.
Props kalpshit, arshidkv12, welcher, peterwilsoncc, marina_wp, pento.
Fixes#44724.
Built from https://develop.svn.wordpress.org/trunk@44156
git-svn-id: http://core.svn.wordpress.org/trunk@43986 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
Merges [43810] from the 5.0 branch to trunk.
Props danielbachhuber, imath, swissspidy.
Fixes#45142.
Built from https://develop.svn.wordpress.org/trunk@44154
git-svn-id: http://core.svn.wordpress.org/trunk@43984 1a063a9b-81f0-0310-95a4-ce76da25c4cd
After [44149], we can now make twentynineteen the default theme. Twentyseventeen has been a great default, but 5.0 and twentynineteen is guten.
Merges [43809,43954] from the 5.0 branch to trunk.
Fixes#45152.
Props jorbin, SergeyBiryukov, pento, mcsf.
Built from https://develop.svn.wordpress.org/trunk@44151
git-svn-id: http://core.svn.wordpress.org/trunk@43981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
`WP_REST_Block_Renderer_Controller` allows rendering of server-side rendered blocks, whilst `WP_REST_Blocks_Controller` allows retrieving of reusable blocks.
Merges [43805] and [43806] from the 5.0 branch to trunk.
Props desrosj, danielbachhuber, pento, Presskopp, swissspidy.
See #45065, #45098.
Built from https://develop.svn.wordpress.org/trunk@44150
git-svn-id: http://core.svn.wordpress.org/trunk@43980 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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, davidkennedy.
Merges [43800] to trunk.
Fixes#45045.
Built from https://develop.svn.wordpress.org/trunk@44148
git-svn-id: http://core.svn.wordpress.org/trunk@43978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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, davidkennedy.
Merges [43799] to trunk.
Fixes#45044.
Built from https://develop.svn.wordpress.org/trunk@44147
git-svn-id: http://core.svn.wordpress.org/trunk@43977 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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, davidkennedy.
Merges [43798] to trunk.
Fixes#45043.
Built from https://develop.svn.wordpress.org/trunk@44145
git-svn-id: http://core.svn.wordpress.org/trunk@43975 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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, davidkennedy.
Merges [43797] to trunk.
Fixes#45042.
Built from https://develop.svn.wordpress.org/trunk@44144
git-svn-id: http://core.svn.wordpress.org/trunk@43974 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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, davidkennedy.
Merges [43796] to trunk.
Fixes#45041.
Built from https://develop.svn.wordpress.org/trunk@44142
git-svn-id: http://core.svn.wordpress.org/trunk@43972 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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, davidakennedy.
Merges [43795] to trunk.
Fixes#45040.
Built from https://develop.svn.wordpress.org/trunk@44140
git-svn-id: http://core.svn.wordpress.org/trunk@43970 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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, davidakennedy.
Merges [43794] to trunk.
Fixes#45039.
Built from https://develop.svn.wordpress.org/trunk@44139
git-svn-id: http://core.svn.wordpress.org/trunk@43969 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
Merges [43790] and [43791] from the 5.0 branch to trunk.
Props desrosj, danielbachhuber, ocean90.
Fixes#45125.
Built from https://develop.svn.wordpress.org/trunk@44138
git-svn-id: http://core.svn.wordpress.org/trunk@43968 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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, davidakennedy.
Merges [43793] to trunk.
Fixes#45038.
Built from https://develop.svn.wordpress.org/trunk@44137
git-svn-id: http://core.svn.wordpress.org/trunk@43967 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
Merges [43781] from the 5.0 branch to core.
Props peterwilsoncc, azaozz, pento, dd32.
Fixes#45067.
Built from https://develop.svn.wordpress.org/trunk@44136
git-svn-id: http://core.svn.wordpress.org/trunk@43966 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
Merges [43776] from the 5.0 branch to trunk.
Props flixos90, mnelson4, swissspidy, TimothyBlynJacobs.
Fixes#44758.
Built from https://develop.svn.wordpress.org/trunk@44134
git-svn-id: http://core.svn.wordpress.org/trunk@43964 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
Merges [43779] from the 5.0 branch to trunk.
See #45112.
Built from https://develop.svn.wordpress.org/trunk@44132
git-svn-id: http://core.svn.wordpress.org/trunk@43962 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
Merges [43778] from the 5.0 branch to trunk.
See #45112.
Built from https://develop.svn.wordpress.org/trunk@44131
git-svn-id: http://core.svn.wordpress.org/trunk@43961 1a063a9b-81f0-0310-95a4-ce76da25c4cd
`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.
Merges [43775] from the 5.0 branch to trunk.
Fixes#35667.
Built from https://develop.svn.wordpress.org/trunk@44129
git-svn-id: http://core.svn.wordpress.org/trunk@43959 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `block_version` denotes which version of Blocks the `post_content` contains. Introduces new `block_version()` function for versioning Blocks.
Merges [43770] from the 5.0 branch to trunk.
Props danielbachhuber, birgire.
Fixes#43887.
Built from https://develop.svn.wordpress.org/trunk@44127
git-svn-id: http://core.svn.wordpress.org/trunk@43957 1a063a9b-81f0-0310-95a4-ce76da25c4cd
- 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.
Also, use a truly impossibly high number in User Controller tests. The number `100`, (or `7777` in `trunk`), could be valid in certain test run configurations. The `REST_TESTS_IMPOSSIBLY_HIGH_NUMBER` constant is impossibly high for this very reason.
Finally, Skip Autosaves controller test for multisite. There's a PHP 5.2 edge case where paths calculated differently, possibly caused by differing version of PHPUnit.
Props adamsilverstein, aduth, azaozz, danielbachhuber, rmccue, danielbachhuber.
Merges [43767], [43768], [43769] to trunk.
See #45132, #45131.
Fixes#45128, #43316.
Built from https://develop.svn.wordpress.org/trunk@44126
git-svn-id: http://core.svn.wordpress.org/trunk@43956 1a063a9b-81f0-0310-95a4-ce76da25c4cd