Commit Graph

12452 Commits

Author SHA1 Message Date
desrosj
a2845863e5 Twenty Nineteen: Fixes and improvements.
This commit brings over several changes that occurred upstream in the theme’s GitHub repository into core.

- Fix the gallery caption link color. https://github.com/WordPress/twentynineteen/pull/687
- Remove left padding from pullquote blocks. https://github.com/WordPress/twentynineteen/pull/690
- Print `skip-link-focus-fix` inline instead of enqueueing as blocking script. https://github
.com/WordPress/twentynineteen/pull/47
- Fix and improve some strings with placeholders. https://github.com/WordPress/twentynineteen/pull/217
- Fixes some minor code quality issues. https://github.com/WordPress/twentynineteen/pull/237
- Fix PHP Warning: Parameter must be an array or an object that implements Countable. https://github
.com/WordPress/twentynineteen/pull/661
- Add missing text domain and escaping to comment author text. https://github.com/WordPress/twentynineteen/pull/274
- Remove hyphens rule for cover image text. https://github.com/WordPress/twentynineteen/pull/691
- Fix left/right-aligned pullquote spacing. https://github.com/WordPress/twentynineteen/pull/695
- Improve `readme.txt` to follow the correct standards for themes. https://github.com/WordPress/twentynineteen/issues/689

Props kjellr, allancole, dimadin, westonruter, khleomix, grapplerulrich, iCaleb, desrosj.

Merges [44196], [44199], and [44201-44202] into trunk.

Fixes #45424.
Built from https://develop.svn.wordpress.org/trunk@44305


git-svn-id: http://core.svn.wordpress.org/trunk@44135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-19 03:24:11 +00:00
desrosj
7cbba801e2 Twenty Thirteen: Fix button block custom colors.
Simplify some of the button block’s CSS selectors in the theme, to make sure the default colors don’t override the custom colors on the front end.

Also make sure the button’s gradient is not applied when a custom background color is added, since it will hide it.

Props laurelfulford.

Merges [44195] into trunk.

Fixes #45431.
Built from https://develop.svn.wordpress.org/trunk@44304


git-svn-id: http://core.svn.wordpress.org/trunk@44134 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-19 03:23:21 +00:00
desrosj
680bbf62d9 Twenty Twelve: Fix button block custom colors.
Simplify some of the button block’s CSS selectors in the theme, to make sure the default colors don’t override the custom colors on the front end.

Also make sure the button’s gradient is not applied when a custom background color is added, since it will hide it.

Props laurelfulford.

Merges [44194] to trunk.

Fixes #45432.
Built from https://develop.svn.wordpress.org/trunk@44303


git-svn-id: http://core.svn.wordpress.org/trunk@44133 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-19 03:22:31 +00:00
desrosj
01029daf49 Updating Twenty Nineteen, the new default theme for 2019.
This update changes the following:

- Properly sets the primary color hue theme option. See https://github.com/WordPress/twentynineteen/pull/683.
- Add proper frontend styles for center aligned archive and category blocks. See https://github.com/WordPress/twentynineteen/pull/684.
- Fix `image_filter` theme option conditional function. See https://github.com/WordPress/twentynineteen/pull/680.
- Remove duplicate rule-line when a separator block is followed by H1/H2 in the editor. See https://github.com/WordPress/twentynineteen/pull/686.

Props richtabor, kjellr, allancole.

Merges [44192] and [44193] to trunk.

See #45424.
Built from https://develop.svn.wordpress.org/trunk@44302


git-svn-id: http://core.svn.wordpress.org/trunk@44132 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-19 03:21:42 +00:00
desrosj
3b995edda6 Twenty Eleven: Correct font-size and button issues.
Update a mistake in Twenty Eleven's block editor styles that erroneously sets the `font-size` to `300`, when it should set the `font-weight` to `300`. This was causing browsers in quirks mode to make the editor font size very large.

Also, simplify some of the button block’s CSS selectors in the theme, to make sure the default colors don’t override the custom colors on the front end.

Props laurelfulford.

Merges [44190] and [44191] to trunk.

Fixes #45421, #45433.
Built from https://develop.svn.wordpress.org/trunk@44301


git-svn-id: http://core.svn.wordpress.org/trunk@44131 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-19 03:20:53 +00:00
desrosj
b25a43d635 Updating Twenty Nineteen, the new default theme for 2019.
This update changes the following:

- Reverts the customization to the toolbar for wide and full blocks to make them more usable. More info here: https://github.com/WordPress/twentynineteen/pull/668
- Add `nowrap` to the columns block at breakpoints above `600px`. More info here: https://github.com/WordPress/twentynineteen/pull/674 

Props joen, kjellr, allancole.

Fixes #45369.

Merges [44189] into trunk.

See #45424.
Built from https://develop.svn.wordpress.org/trunk@44300


git-svn-id: http://core.svn.wordpress.org/trunk@44130 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-19 03:20:04 +00:00
desrosj
7f02dfc545 Twenty Ten: Custom colors should override :visited link styles on blocks.
Make sure the block editor custom colors in the theme also override the theme's `:visited` link styles. This prevents contrast issues, like in the button block -- when the background is dark, the purple `:visited` link can be difficult to read.

Props laurelfulford.

Merges [44188] into trunk.

Fixes #45434.
Built from https://develop.svn.wordpress.org/trunk@44299


git-svn-id: http://core.svn.wordpress.org/trunk@44129 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-19 03:19:15 +00:00
desrosj
110aae8048 Twenty Nineteen: Code Quality Improvements.
This change adds general code quality and documentation improvements.

More info here: https://github.com/WordPress/twentynineteen/pull/546 

Props grapplerulrich, iCaleb, allancole.

Merges [44187] to trunk.

See #45424.
Built from https://develop.svn.wordpress.org/trunk@44298


git-svn-id: http://core.svn.wordpress.org/trunk@44128 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-19 03:18:26 +00:00
desrosj
5a30da57c6 PHP 7.3 Compatibility: Fix compact related 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. This fixes a few more instances of unset variables in the WordPress admin.

The full RFC can be viewed here: https://wiki.php.net/rfc/compact.

See #44416.

Merges [44185] into trunk.

Fixes #45483.
Built from https://develop.svn.wordpress.org/trunk@44297


git-svn-id: http://core.svn.wordpress.org/trunk@44127 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-19 03:17:37 +00:00
desrosj
d6e8d93412 Block Editor: Upgrade @wordpress packages to match version 4.7.1.
Updated packages:

- `@wordpress/annotations
- `@wordpress/api-fetch
- `@wordpress/block-library@2.2.10
- `@wordpress/block-serialization-default-parser@2.0.2`
- `@wordpress/block-serialization-spec-parser@2.0.2`
- `@wordpress/blocks@6.0.4`
- `@wordpress/components@7.0.4`
- `@wordpress/core-data@2.0.15`
- `@wordpress/data@4.1.0`
- `@wordpress/date@3.0.1`
- `@wordpress/edit-post@3.1.5`
- `@wordpress/editor@9.0.5`
- `@wordpress/eslint-plugin@1.0.0`
- `@wordpress/format-library@1.2.8`
- `@wordpress/html-entities@2.0.4`
- `@wordpress/list-reusable-blocks@1.1.17`
- `@wordpress/notices@1.1.1`
- `@wordpress/nux@3.0.5`
- `@wordpress/rich-text@3.0.3`
- `@wordpress/url@2.3.2`
- `@wordpress/viewport@2.0.13`

This also includes the updates the Core blocks.

The script loader is updated to match the Gutenberg repository as well.

Props atimmer, gziolo, joen, youknowriad.

Merges [44183] to trunk.

Fixes #45442, #45637.
Built from https://develop.svn.wordpress.org/trunk@44296


git-svn-id: http://core.svn.wordpress.org/trunk@44126 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-19 03:16:48 +00:00
desrosj
43bdb0e193 Editor: Remove unwanted fields before saving posts.
The meta_input, file, and guid fields are not intended to be updated through user input.

Merges [44047] to trunk.
Built from https://develop.svn.wordpress.org/trunk@44295


git-svn-id: http://core.svn.wordpress.org/trunk@44125 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-18 21:32:48 +00:00
desrosj
8cb7058273 PHPCS: Fix alignment issues.
This fixes some array alignment issues introduced in [44293].
Built from https://develop.svn.wordpress.org/trunk@44294


git-svn-id: http://core.svn.wordpress.org/trunk@44124 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-18 16:58:48 +00:00
desrosj
164452f942 KSES: Conditionally remove the <form> element from $allowedposttags.
To avoid backwards compatibility issues, `<form>` is re-added if a custom filter has added the `<input>` or `<select>` elements to `$allowedposttags`.

Merges [43994] to trunk.
Built from https://develop.svn.wordpress.org/trunk@44293


git-svn-id: http://core.svn.wordpress.org/trunk@44123 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-18 16:46:48 +00:00
desrosj
3af00578e4 Media: Improve verification of MIME file types.
Merges [43988] to trunk.
Built from https://develop.svn.wordpress.org/trunk@44292


git-svn-id: http://core.svn.wordpress.org/trunk@44122 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-18 16:35:49 +00:00
desrosj
38d1e7233d Block Editor: Show privacy help notice on Privacy Policy page.
When editing a page set to be the Privacy Policy page, display a help notice
containing a link to the Privacy Policy guide.

Merges [43920] to trunk.

Fixes #45057.
Built from https://develop.svn.wordpress.org/trunk@44291


git-svn-id: http://core.svn.wordpress.org/trunk@44121 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-18 16:14:49 +00:00
Sergey Biryukov
985bed281c Scripts: Ensure sub-directory WordPress installs can load polyfill scripts.
`wp_get_script_polyfill()` bypasses `WP_Scripts::do_item()`, so didn't transform the script path into its fully qualified URL.

Props swissspidy, ocean90.
Merges [43960] to trunk.
Fixes #45469.
Built from https://develop.svn.wordpress.org/trunk@44286


git-svn-id: http://core.svn.wordpress.org/trunk@44116 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-18 04:05:48 +00:00
Sergey Biryukov
7b4a2c9827 Build/Test Tools: Remove vendor file name entry from .gitignore.
Props netweb.
Merges [43747] to trunk.
Fixes #43411.
Built from https://develop.svn.wordpress.org/trunk@44285


git-svn-id: http://core.svn.wordpress.org/trunk@44115 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-18 03:42:49 +00:00
Sergey Biryukov
693e8303ba Build Tools: Don't minimise CSS in the unminimised files.
Props pento.
Merges [43933] to trunk.
Fixes #45201.
Built from https://develop.svn.wordpress.org/trunk@44283


git-svn-id: http://core.svn.wordpress.org/trunk@44113 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-18 03:17:48 +00:00
Sergey Biryukov
8f4440eb10 Build Tools: Don't include .map files in the build.
These files are fairly large, and while they're useful in development, they're not needed in the final build.

Props pento, mcsf.
Merges [43931] and [43932] to trunk.
See #45201.
Built from https://develop.svn.wordpress.org/trunk@44282


git-svn-id: http://core.svn.wordpress.org/trunk@44112 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-18 03:14:52 +00:00
desrosj
077e2c5fcf Block Editor: Update @wordpress package dependencies.
Updates the following packages:

block-library, block-serialization-default-parser, block-serialization-spec-parser, blocks, edit-post, editor, format-library.

Merges [43955] to trunk.

Props youknowriad.

Fixes #45145.
Built from https://develop.svn.wordpress.org/trunk@44281


git-svn-id: http://core.svn.wordpress.org/trunk@44111 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 21:59:54 +00:00
desrosj
7a97c31f4e Block Editor: Add a placeholder for meta boxes that don't work in the block editor.
If a meta box is registered with the `__block_editor_compatible_meta_box` set to `false`, it's indicating that it doesn't work in the block editor. If that's the case, we can add a place holder to inform the user that they'll need to use the classic interface to work with this meta box.

Props pento, jorgefilipecosta, peterwilsoncc, karmatosed, noisysocks, dd32, ocean90.

Merges [43941] and [43945] to trunk.

Fixes #45217.
Built from https://develop.svn.wordpress.org/trunk@44280


git-svn-id: http://core.svn.wordpress.org/trunk@44110 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 21:52:53 +00:00
desrosj
a9b6d58870 Default Themes: Bump the version numbers and release dates.
The POT files for Twenty Ten and Eleven have also been updated.

Props laurelfulford, maedahbatool, mrahmadawais, pento.

Merges [43964] into trunk.

Fixes #45167.
Built from https://develop.svn.wordpress.org/trunk@44279


git-svn-id: http://core.svn.wordpress.org/trunk@44109 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 19:38:53 +00:00
desrosj
d92ccd83a0 l10n: Ensure JavaScript language packages are loaded for the user locale.
`load_script_textdomain()` had a reversed check to decide if the user locale should be loaded. This check is now replaced with `determine_local()`.

Props ocean90.

Merges [43959] into trunk.

Fixes #45465.
Built from https://develop.svn.wordpress.org/trunk@44278


git-svn-id: http://core.svn.wordpress.org/trunk@44108 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 19:36:52 +00:00
desrosj
e188e2d3a3 Block Editor: Fix the WordPress packages and vendor script registration.
The version is set properly and the scripts are automatically loaded in the footer.

This patch also includes a revert for the reusable blocks enqueue script.

Props pento, swissspidy, youknowriad.

Merges [43942] into trunk.

Fixes #45402.
See #45396.
Built from https://develop.svn.wordpress.org/trunk@44277


git-svn-id: http://core.svn.wordpress.org/trunk@44107 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 19:34:52 +00:00
desrosj
c7c9bc7585 Query: Remove nextpage block delimiters when setting up global post data.
`WP_Query::setup_postdata()` splits the post up by `<!--nextpage-->`, which causes invalid block data to be contained in the post content.

This change removes the `<!-- wp:nextpage -->` and `<!-- /wp:nextpage -->`, as well.

Props pento, youknowriad, azaozz, noisysocks.

Merges [43940] into trunk.

See #45401.
Built from https://develop.svn.wordpress.org/trunk@44276


git-svn-id: http://core.svn.wordpress.org/trunk@44106 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 19:29:51 +00:00
desrosj
03262a191f Block Editor: Refresh nonces used by wp.apiFetch.
Adds heartbeat nonces refreshing support to `wp.apiFetch` requests.

Props pento, adamsilverstein, dd32, desrosj, youknowriad.

Merges [43939] into trunk.

Fixes #45113. 
Built from https://develop.svn.wordpress.org/trunk@44275


git-svn-id: http://core.svn.wordpress.org/trunk@44105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 19:28:51 +00:00
desrosj
54ab431046 Block Editor: Fix loading the script handling the "Manage Reusable Blocks" page.
This ensures the "import from JSON" and "export JSON" buttons are shown properly. The script is loaded in the footer because it relies on the DOM being already there.

Props noisysocks, mukesh27.

Merges [43936] into trunk.

Fixes #45396.
Built from https://develop.svn.wordpress.org/trunk@44274


git-svn-id: http://core.svn.wordpress.org/trunk@44104 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 19:08:51 +00:00
desrosj
36158d7909 Block Editor: Update @wordpress package dependencies.
Update packages include:

- block-library
- components
- edit-post
- editor
- format-library
- list-reusable-blocks
- nux

Other changes:

- Fix a translator comment in `edit-form-blocks.php`.
- Rename the `gutenberg_` functions in `blocks/latest-comments.php`.

Props noisy socks, youknowriad, pinto, swissspidy.

Merges [43935] and [43949-43951] into trunk.

See #45145.
Built from https://develop.svn.wordpress.org/trunk@44273


git-svn-id: http://core.svn.wordpress.org/trunk@44103 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 19:06:59 +00:00
desrosj
945ba795dc WPDB: Check that $wpdb->last_result is countable before counting with it.
`wpdb::get_col()` iterates over `$wpdb->last_result`, which can be a non-countable value, should the preceding query have failed.

Props spacedmonkey, desrosj, pento.

Merges [43934] into trunk.

See #45299.
Built from https://develop.svn.wordpress.org/trunk@44272


git-svn-id: http://core.svn.wordpress.org/trunk@44102 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 18:39:52 +00:00
desrosj
820f643bff Core Editor: Specify script versions for the WordPress packages and their vendor dependencies.
Using the `package.json` versions of the NPM dependencies as versions when registering the WordPress scripts.

Props dimadin, dd32, youknowriad.

Merges [43925] to trunk.

Fixes #45187.
Built from https://develop.svn.wordpress.org/trunk@44271


git-svn-id: http://core.svn.wordpress.org/trunk@44101 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 18:19:50 +00:00
desrosj
4b0f960b7c Block Editor: Fix PHP warning when loading editor styles while in RTL.
In RTL languages, WordPress adds `style-editor-rtl.css` editor styles to the global `$editor_styles`.
This patch ignores handling these styles if the file is not preset.

Also, clarify the docs for the return value of the `block_version` function.

Props mostafa.s1990, desrosj, mukesh27.

Merges [43923] and [43924] to trunk.

Fixes #45288, #45342.
Built from https://develop.svn.wordpress.org/trunk@44270


git-svn-id: http://core.svn.wordpress.org/trunk@44100 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 18:07:51 +00:00
desrosj
bc9dfcfeb1 REST API: Preserve unknown, respect null in server-side block rendering.
- Skips validation where there is no attribute definition, but keeps the attribute value. Previously, the attribute would be omitted from the attributes passed to `render_callback`. Notably, this resolves an issue where `render_callback` cannot receive a block's `align` and `customClassName` attribute values, since these are defined as a client-side filter.
- Validates `null` as a proper value in its own right. Previously, a client implementation of a block could track `{“attribute":null}` as an explicitly empty value, and the server would wrongly initiate defaulting behavior. The new behavior will now only populate a default value if the attribute is not defined at all, including when unset in its being invalid per the attribute schema. 

Props aduth, noisysocks, youknowriad, danielbachhuber.

Merges [43918] to trunk.

See #45145 for the patch, #45098 for the original ticket.
Built from https://develop.svn.wordpress.org/trunk@44269


git-svn-id: http://core.svn.wordpress.org/trunk@44099 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 18:00:52 +00:00
desrosj
f2b97f3c7f REST API: Always include title.raw/content.raw for Blocks in context=view.
Demarcations for reusable blocks are always expected to be accessible by clients.

Props noisysocks, youknowriad.

Merges [43917] to trunk.

See #45145 for the patch, #45098 for the original ticket.
Built from https://develop.svn.wordpress.org/trunk@44268


git-svn-id: http://core.svn.wordpress.org/trunk@44098 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 17:22:52 +00:00
desrosj
e06611512c Block Editor: Expose value of user_can_richedit().
In order for the Block Editor to know whether to allow visual editing, it needs to know the value of `user_can_richedit()`.

Props youknowriad, danielbachhuber.

Merges [43916] into trunk.

Fixes #45375.
Built from https://develop.svn.wordpress.org/trunk@44267


git-svn-id: http://core.svn.wordpress.org/trunk@44097 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 17:09:51 +00:00
desrosj
9510a4f036 PHPCS: Fix code formatting issues.
In [44264], several code formatting issues were introduced. This fixes them.
Built from https://develop.svn.wordpress.org/trunk@44266


git-svn-id: http://core.svn.wordpress.org/trunk@44096 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 17:07:52 +00:00
desrosj
2899f355a9 TinyMCE: Run the filters for the Classic block.
The `wp_editor_settings` and `disable_captions` filters need to be run for the Classic Block.

This fixes possible regressions in plugins that use these filters, and plugins that use them to add filters for the buttons, external plugins, etc.

Props azaozz.

Merges [43914] into trunk.

Fixes #45348.
Built from https://develop.svn.wordpress.org/trunk@44265


git-svn-id: http://core.svn.wordpress.org/trunk@44095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 17:03:51 +00:00
desrosj
9cd64e1341 Help/About: WordPress 5.0 About Page.
The About page describes all the great changes in WordPress 5.0.

Highlights:

- Warn users of Gutenberg plugin of its deactivation upon 5.0 upgrade.
- Added illustrations to the Four Freedoms page.
- Include a link to wporg user’s plugin favorites as a way to display only the classic plugin as a suggestion for install.
- Detail the Classic Editor plugin and the support timeline.

Props pixelverbieger, ocean90, karmatosed, pento, boemedia, lonelyvegan, sami.keijonen, TimothyBlynJacobs, xkon, afercia, laurelfulford, joostdevalk, ipstenu, matveb, joen, tinkerbelly, chanthaboune, kjellr, alexislloyd, melchoyce, mcsf, courtney0burton, Otto42, cathibosco, tobifjellner, helen, audrasjb, antpb, jjj, elrae, desrosj, azaozz, joemcgill, skithund, gziolo.

Merges [43913], [43921-43922], [43937-43938], [43946-43947], [43952-43953], [43967-43969] into trunk.

Fixes #45178.
Built from https://develop.svn.wordpress.org/trunk@44264


git-svn-id: http://core.svn.wordpress.org/trunk@44094 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 16:36:59 +00:00
desrosj
6bec9ed8f6 Twenty Sixteen: Update theme’s wide image styles to include Image Blocks
Twenty Sixteen includes functionality and styles that make full-size images extend wider than the content when they are added to posts, and appear below the post meta. This update adds the same behavior to image blocks and their captions.

Merges [43911] to trunk.

Props laurelfulford.
Fixes: #45380.
Built from https://develop.svn.wordpress.org/trunk@44263


git-svn-id: http://core.svn.wordpress.org/trunk@44093 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 15:46:52 +00:00
desrosj
4f86a03258 Block Editor: Update @wordpress dependencies to match Gutenberg 4.5.1.
- Update the annotations, api-fetch, block-library, blocks, components, compose, core-data, data, date, dom, edit-post, editor, element, format-library, html-entities, i18n, jest-console, jest-preset-default, keycodes, list-reusable-blocks, notices, nux, plugins, rich-text, scripts, token-lists, url, viewport packages.
- Upgrades React from 16.5.2 to 16.6.3.
- Adds a missing `wp-date` dependency to the editor script.
- Updates changed dependencies in `script-loader.php`.
- Fixes undefined notices in some blocks.
- Removes incorrect `gutenberg` textdomain.

Merges [43891], [43903], and [43919] to trunk.

Props atimmer, aduth, youknowriad, danielbachhuber.
See #45145.
Built from https://develop.svn.wordpress.org/trunk@44262


git-svn-id: http://core.svn.wordpress.org/trunk@44092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 15:37:00 +00:00
desrosj
9d7aa3436e Block Editor: Update @wordpress dependencies.
Changes of note:

- Includes the new Annotations API package.
- `wp-polyfill-ecmascript.js` is renamed to `wp-polyfill.js`.
- `strip_dynamic_blocks()` has been removed in favor of `excerpt_remove_blocks()`.
- The PHP block parser is now syncing from the `block-serialization-default-parser` package.
- `do_blocks()` uses the new parser.
- The `do_block` filter has been removed from `do_blocks()`, in favor of a `render_block` filter in `render_block()`.

Also, a little cleanup to `render_block()`. Always normalize `$block['attrs’]` to array in `’render_block’` filter.
Props pento, azaozz.

Merges [43884] and [43888] to trunk.

See #45145, #45190, #45264, #45282.
Built from https://develop.svn.wordpress.org/trunk@44261


git-svn-id: http://core.svn.wordpress.org/trunk@44091 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 04:52:00 +00:00
desrosj
bbe9a37b6c 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.
Built from https://develop.svn.wordpress.org/trunk@44260


git-svn-id: http://core.svn.wordpress.org/trunk@44090 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:52:51 +00:00
Sergey Biryukov
6ffafa5bc7 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.
Built from https://develop.svn.wordpress.org/trunk@44257


git-svn-id: http://core.svn.wordpress.org/trunk@44087 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:32:21 +00:00
Sergey Biryukov
60c96f7377 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.
Built from https://develop.svn.wordpress.org/trunk@44256


git-svn-id: http://core.svn.wordpress.org/trunk@44086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:31:30 +00:00
Sergey Biryukov
589af44fc1 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.
Built from https://develop.svn.wordpress.org/trunk@44255


git-svn-id: http://core.svn.wordpress.org/trunk@44085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:30:39 +00:00
Sergey Biryukov
ff3ea55f76 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.
Built from https://develop.svn.wordpress.org/trunk@44254


git-svn-id: http://core.svn.wordpress.org/trunk@44084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:29:47 +00:00
Sergey Biryukov
88d99119bc PHPCS: Fix errors introduced in [44250].
See #43316.
Built from https://develop.svn.wordpress.org/trunk@44253


git-svn-id: http://core.svn.wordpress.org/trunk@44083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:28:57 +00:00
Sergey Biryukov
07ce537eb8 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.
Built from https://develop.svn.wordpress.org/trunk@44252


git-svn-id: http://core.svn.wordpress.org/trunk@44082 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:28:06 +00:00
Sergey Biryukov
dbc692fb84 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.
Built from https://develop.svn.wordpress.org/trunk@44251


git-svn-id: http://core.svn.wordpress.org/trunk@44081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:27:12 +00:00
Sergey Biryukov
940a4be804 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.
Built from https://develop.svn.wordpress.org/trunk@44250


git-svn-id: http://core.svn.wordpress.org/trunk@44080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:26:22 +00:00
Sergey Biryukov
909cddb3b8 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.
Built from https://develop.svn.wordpress.org/trunk@44249


git-svn-id: http://core.svn.wordpress.org/trunk@44079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:25:31 +00:00
Sergey Biryukov
e8cbdf9405 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.
Built from https://develop.svn.wordpress.org/trunk@44247


git-svn-id: http://core.svn.wordpress.org/trunk@44077 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:23:55 +00:00
Sergey Biryukov
8f1ed83852 Build Tools: Revert unrelated changes to Gruntfile.js added in [44245].
See #45156.
Built from https://develop.svn.wordpress.org/trunk@44246


git-svn-id: http://core.svn.wordpress.org/trunk@44076 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:23:04 +00:00
Sergey Biryukov
c6d8f995cd Build Tools: Add non-minified @wordpress scripts to the build output.
Props atimmer.
Merges [43886] to trunk.
See #45156.
Built from https://develop.svn.wordpress.org/trunk@44245


git-svn-id: http://core.svn.wordpress.org/trunk@44075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:22:13 +00:00
Sergey Biryukov
6ef54307b1 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.
Built from https://develop.svn.wordpress.org/trunk@44244


git-svn-id: http://core.svn.wordpress.org/trunk@44074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:21:21 +00:00
Sergey Biryukov
223eb21b47 PHPCS: Fix errors introduced in [44241].
See #45283.
Built from https://develop.svn.wordpress.org/trunk@44243


git-svn-id: http://core.svn.wordpress.org/trunk@44073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:20:29 +00:00
Sergey Biryukov
659ca2bd1e Tests: Fix tests broken in PHP 5.x after [43879].
Props pento.
Merges [43883] to trunk.
See #45290.
Built from https://develop.svn.wordpress.org/trunk@44242


git-svn-id: http://core.svn.wordpress.org/trunk@44072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:19:38 +00:00
Sergey Biryukov
7f8d6eccd0 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.
Built from https://develop.svn.wordpress.org/trunk@44241


git-svn-id: http://core.svn.wordpress.org/trunk@44071 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:18:47 +00:00
Sergey Biryukov
eccc31aadf 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.
Built from https://develop.svn.wordpress.org/trunk@44240


git-svn-id: http://core.svn.wordpress.org/trunk@44070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:17:56 +00:00
Sergey Biryukov
9e54ec265c 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.
Built from https://develop.svn.wordpress.org/trunk@44239


git-svn-id: http://core.svn.wordpress.org/trunk@44069 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:17:04 +00:00
Sergey Biryukov
030b1ba144 PHPCS: Fix errors introduced in [44236].
See #45221.
Built from https://develop.svn.wordpress.org/trunk@44238


git-svn-id: http://core.svn.wordpress.org/trunk@44068 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:16:12 +00:00
Sergey Biryukov
86bff28a19 Script Loader: Ensure default packages are registered when loaded via load-scripts.php.
Props CantoThemes, ocean90.
Merges [43877] to trunk.
Fixes #45271.
Built from https://develop.svn.wordpress.org/trunk@44237


git-svn-id: http://core.svn.wordpress.org/trunk@44067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:15:20 +00:00
Sergey Biryukov
c72f02aa49 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.
Built from https://develop.svn.wordpress.org/trunk@44236


git-svn-id: http://core.svn.wordpress.org/trunk@44066 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:14:31 +00:00
Jeremy Felt
9988653fdf 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.

Built from https://develop.svn.wordpress.org/trunk@44234


git-svn-id: http://core.svn.wordpress.org/trunk@44064 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:12:54 +00:00
Jeremy Felt
677a497ee2 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.

Built from https://develop.svn.wordpress.org/trunk@44233


git-svn-id: http://core.svn.wordpress.org/trunk@44063 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:12:03 +00:00
desrosj
fcaad833b7 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.
Built from https://develop.svn.wordpress.org/trunk@44230


git-svn-id: http://core.svn.wordpress.org/trunk@44060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:09:37 +00:00
desrosj
147ce45d29 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.
Built from https://develop.svn.wordpress.org/trunk@44229


git-svn-id: http://core.svn.wordpress.org/trunk@44059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:08:46 +00:00
desrosj
be0b403077 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.
Built from https://develop.svn.wordpress.org/trunk@44228


git-svn-id: http://core.svn.wordpress.org/trunk@44058 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:07:55 +00:00
desrosj
f4fa2c362e 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.
Built from https://develop.svn.wordpress.org/trunk@44227


git-svn-id: http://core.svn.wordpress.org/trunk@44057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:07:04 +00:00
Jeremy Felt
7509965a56 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.

Built from https://develop.svn.wordpress.org/trunk@44226


git-svn-id: http://core.svn.wordpress.org/trunk@44056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:06:12 +00:00
Jeremy Felt
58fdce722c 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.

Built from https://develop.svn.wordpress.org/trunk@44225


git-svn-id: http://core.svn.wordpress.org/trunk@44055 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:05:20 +00:00
Jeremy Felt
7ffb7340f5 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.

Built from https://develop.svn.wordpress.org/trunk@44224


git-svn-id: http://core.svn.wordpress.org/trunk@44054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:04:29 +00:00
Jeremy Felt
7b58ca24e3 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.

Built from https://develop.svn.wordpress.org/trunk@44223


git-svn-id: http://core.svn.wordpress.org/trunk@44053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:03:38 +00:00
Jeremy Felt
c92118203b 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.

Built from https://develop.svn.wordpress.org/trunk@44222


git-svn-id: http://core.svn.wordpress.org/trunk@44052 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:02:46 +00:00
Jeremy Felt
49418dbd7e 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.

Built from https://develop.svn.wordpress.org/trunk@44221


git-svn-id: http://core.svn.wordpress.org/trunk@44051 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:01:56 +00:00
Jeremy Felt
b93dd61e90 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.

Built from https://develop.svn.wordpress.org/trunk@44220


git-svn-id: http://core.svn.wordpress.org/trunk@44050 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:01:05 +00:00
Jeremy Felt
fc22863570 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.

Built from https://develop.svn.wordpress.org/trunk@44219


git-svn-id: http://core.svn.wordpress.org/trunk@44049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-17 03:00:14 +00:00
Jeremy Felt
014d87067d 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.

Built from https://develop.svn.wordpress.org/trunk@44218


git-svn-id: http://core.svn.wordpress.org/trunk@44048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-16 01:41:54 +00:00
Jeremy Felt
0451345941 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.

Built from https://develop.svn.wordpress.org/trunk@44217


git-svn-id: http://core.svn.wordpress.org/trunk@44047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-16 01:38:53 +00:00
Jeremy Felt
e42dd489bc 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.

Built from https://develop.svn.wordpress.org/trunk@44216


git-svn-id: http://core.svn.wordpress.org/trunk@44046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-16 01:26:53 +00:00
Jeremy Felt
c9f8525211 Blocks: Include necessary labels for the 'wp_block' post type.
Merges [43849] from the 5.0 branch to trunk.

Props danielbachhuber.
See #45098.

Built from https://develop.svn.wordpress.org/trunk@44215


git-svn-id: http://core.svn.wordpress.org/trunk@44045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-16 01:25:52 +00:00
Jeremy Felt
ff7b1bfe48 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.

Built from https://develop.svn.wordpress.org/trunk@44214


git-svn-id: http://core.svn.wordpress.org/trunk@44044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-16 01:19:54 +00:00
iandunn
614df6b5cc 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`.

Built from https://develop.svn.wordpress.org/trunk@44207


git-svn-id: http://core.svn.wordpress.org/trunk@44037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-15 11:18:25 +00:00
desrosj
d6c74f0a32 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.
Built from https://develop.svn.wordpress.org/trunk@44186


git-svn-id: http://core.svn.wordpress.org/trunk@44016 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-15 11:02:18 +00:00
atimmer
7616bf91af 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.

Built from https://develop.svn.wordpress.org/trunk@44184


git-svn-id: http://core.svn.wordpress.org/trunk@44014 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-15 11:00:40 +00:00
atimmer
96b2a4677c Build Tools: Update the @wordpress packages.
Trunk now matches Gutenberg 4.2 RC1.

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

Built from https://develop.svn.wordpress.org/trunk@44182


git-svn-id: http://core.svn.wordpress.org/trunk@44012 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-14 12:20:00 +00:00
atimmer
e055e026e3 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.

Built from https://develop.svn.wordpress.org/trunk@44181


git-svn-id: http://core.svn.wordpress.org/trunk@44011 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-14 12:15:54 +00:00
atimmer
86ccb815e7 Build Tools: Update @wordpress packages.
Props pento.
Merges [43843] to trunk.
See #45145.

Built from https://develop.svn.wordpress.org/trunk@44180


git-svn-id: http://core.svn.wordpress.org/trunk@44010 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-14 12:07:58 +00:00
atimmer
7aeb401531 Tests: Fix failing unit tests caused by [43840].
Props pento.
Merges [43841] to trunk.
See #45145.

Built from https://develop.svn.wordpress.org/trunk@44179


git-svn-id: http://core.svn.wordpress.org/trunk@44009 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-14 11:23:54 +00:00
atimmer
cc13a1f3a0 General: Fix code formatting issues.
Fix code formatting after [44174] and [44177].

Built from https://develop.svn.wordpress.org/trunk@44178


git-svn-id: http://core.svn.wordpress.org/trunk@44008 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-14 11:02:53 +00:00
atimmer
a603510b73 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.

Built from https://develop.svn.wordpress.org/trunk@44177


git-svn-id: http://core.svn.wordpress.org/trunk@44007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-14 10:55:01 +00:00
atimmer
0962e186e8 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, pento.
Merges [43836] to trunk.
See #45214.

Built from https://develop.svn.wordpress.org/trunk@44176


git-svn-id: http://core.svn.wordpress.org/trunk@44006 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-14 09:47:52 +00:00
atimmer
a409c41f62 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.

Props pento.
Merges [43839] to trunk.
Fixes #45207.

Built from https://develop.svn.wordpress.org/trunk@44175


git-svn-id: http://core.svn.wordpress.org/trunk@44005 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-14 09:42:53 +00:00
atimmer
20992de206 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, pento.
Merges [43838] to trunk.
Fixes #45206.

Built from https://develop.svn.wordpress.org/trunk@44174


git-svn-id: http://core.svn.wordpress.org/trunk@44004 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-14 09:39:51 +00:00
Gary Pendergast
d2782aabc5 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.

Merges [43834] from the 5.0 branch to trunk.

Props schlessera, timothyblynjacobs.
Fixes #45189.

Built from https://develop.svn.wordpress.org/trunk@44173


git-svn-id: http://core.svn.wordpress.org/trunk@44003 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-14 06:04:55 +00:00
Gary Pendergast
d8863244cb 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.

Merges [43833] from the 5.0 branch to trunk.

Props imath, mattheu, danielbachhuber.
Fixes #45194.


Built from https://develop.svn.wordpress.org/trunk@44172


git-svn-id: http://core.svn.wordpress.org/trunk@44002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-14 06:02:52 +00:00
Gary Pendergast
5b16eb19a8 Script Loader: Add translator comments and remove textdomains.
The inline script for `wp-date` incorrectly included a textdomain, and lacked translator comments.

Merges [43831] from the 5.0 branch to trunk.

Props mukesh27.
Fixes #45191, #45162.


Built from https://develop.svn.wordpress.org/trunk@44171


git-svn-id: http://core.svn.wordpress.org/trunk@44001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-14 05:58:52 +00:00
Gary Pendergast
3eafdad299 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`.

Merges [43830] from the 5.0 branch to trunk.

Props DrewAPicture.
Fixes #45192.


Built from https://develop.svn.wordpress.org/trunk@44170


git-svn-id: http://core.svn.wordpress.org/trunk@44000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-14 05:55:53 +00:00
Gary Pendergast
f46fbae857 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.

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
2018-12-14 05:52:52 +00:00
Gary Pendergast
4739b8147b Upgrade/Install: Convert Sample Page, Hello World, and Privacy Policy to block content.
Merges [43820,43912] from the 5.0 branch to trunk.

Props desrosj, garrett-eclipse, danielbachhuber, dd32, ocean90.
Fixes #45151.


Built from https://develop.svn.wordpress.org/trunk@44168


git-svn-id: http://core.svn.wordpress.org/trunk@43998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-12-14 05:43:52 +00:00
desrosj
7cb9a98a5b Nav Menus: Fix a PHP 7.3 error when switching themes.
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
2018-12-14 05:16:52 +00:00