Commit Graph

38672 Commits

Author SHA1 Message Date
Anton Timmermans 578192177b 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@44176 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 09:46:30 +00:00
Anton Timmermans b053b80b59 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@44175 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 09:41:56 +00:00
Anton Timmermans f44e3f1740 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@44174 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 09:38:09 +00:00
Gary Pendergast a376b4e284 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@44173 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 06:03:35 +00:00
Gary Pendergast fb2f48d81b 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@44172 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 06:01:24 +00:00
Gary Pendergast ebb6b7f703 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@44171 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 05:57:19 +00:00
Gary Pendergast 9e49ba8a97 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@44170 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 05:54:34 +00:00
Gary Pendergast 8d897837aa 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@44169 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 05:51:31 +00:00
Gary Pendergast ccd35b3c02 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@44168 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 05:42:20 +00:00
Jonathan Desrosiers 2e78177467 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@44167 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 05:15:54 +00:00
Jonathan Desrosiers 89d76b9884 PHP7.3 compatibility: Fix compact throwing notices.
In PHP 7.3, the `compact()` function has been changed to issue an `E_NOTICE` level error if a passed string refers to an unset variable. In previous versions of PHP, this notice was silently skipped. The full RFC can be viewed here: https://wiki.php.net/rfc/compact.

Props jorbin, desrosj.

Merges [43819] and [43832] to trunk.

Fixes #44416.

git-svn-id: https://develop.svn.wordpress.org/trunk@44166 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 05:12:12 +00:00
Gary Pendergast 3011f8c8e7 Editor: Merge some minor bug fixes.
There were some tweaks made to the post editor in WordPress 5.0 that hadn't been merged to `trunk`, this commit rectifies that.

Merges [43815,43816] from the 5.0 branch to trunk.

Props birgire, jorbin, abdullahramzan, adamsilverstein, mrahmadawais, airathalitov, ajitbohra, schlessera, albertomedina, aldavigdis, alexsanford1, xyfi, nitrajka, afercia, andreiglingeanu, euthelup, aduth, sumobi, anevins, azaozz, androb, andrewserong, kallehauge, nosolosw, apeatling, atimmer, arnaudban, asvinballoo, b-07, benlk, blowery, caxco93, benjamin_zekavica, kau-boy, bernhard-reiter, bcolumbia, bph, boblinthorst, bradyvercher, bpayton, brentswisher, bronsonquick, burhandodhy, icaleb, chouby, ehg, chrisvanpatten, butimnoexpert, christophherr, chriskmnds, claudiosanches, danielbachhuber, mrmadhat, danielhw, danieltj, goldsounds, dfangstrom, daniloercoli, dannycooper, nerrad, dsawardekar, davemoran118, davidherrera, dryanpress, davidsword, davisshaver, dmsnell, dlocc, diegoreymendez, dd32, dency, ocean90, donnapep, chopinbach, electricfeet, eliorivero, sewmyheadon, ericnmurphy, foobar4u, circlecube, fabs_pim, flixos90, floriansimeth, gma992, garrett-eclipse, garyj, pento, doomwaxer, revgeorge, gziolo, bordoni, hardeepasrani, helen, luehrsen, herbmiller, toro_unit, ianbelanger, iandunn, igorsch, ipstenu, ireneyoast, israelshmueli, sisanu, jd55, copons, jnylen0, jamestryon, ephoxjames, jamiehalvorson, jsnajdr, jagnew, dciso, octalmage, vengisss, jhoffm34, shenkj, audrasjb, jblz, jeremyfelt, motleydev, jipmoors, sephsekla, joemaller, joemcgill, joen, johndyer, johnjamesjacoby, joshuawold, johnny5, desrosj, jonsurrell, belcherj, sirjonathan, koke, jorgefilipecosta, shelob9, jvisick77, julienmelissas, kopepasah, kadamwhite, codebykat, ryelle, gwwar, kevinwhoffman, coderkevin, ixkaito, kjellr, obenland, lancewillett, postphotos, loicblascos, lucasstark, luigipulcini, lucaskowalski, lukepettway, mahdiyazdani, mahmoudsaeed, mkaz, tyxla, markjaquith, mapk, vindl, m-e-h, mboynes, mattheu, lonelyvegan, mtias, napy84, maurobringolf, maximebj, mayukojpn, woodent, michaelhull, mmtr86, stubgo, simison, mihai2u, mike-haydon-swo, mnelson4, mpheasant, mikeschroder, idpokute, mikeyarce, dimadin, gonzomir, milesdelliott, warmarks, munirkamal, nfmohit, nateconley, greatislander, njpanderson, notnownikki, nielslange, nikschavan, potbot, nshki, webmandesign, oskosk, pglewis, pareshradadiya-1, swissspidy, pbearne, pauldechov, psealock, paulstonier, paulwilde, pedromendonca, ptasker, peterwilsoncc, tyrannous, strategio, piersb, delawski, prtksxna, presskopp, rachelbaker, rachelmcr, rakshans1, rahmon, lamosty, youknowriad, riddhiehta02, noisysocks, deviodigital, sanchothefat, robertsky, _dorsvenabili, rohittm, magicroundabout, rmccue, welcher, ryo511, sagarprajapati, samikeijonen, scottmweaver, kluny, sharaz, giventofly76, designsimply, sstoqnov, hypest, netweb, stevehenty, stuartfeldt, sergioestevao, soean, tammie_l, karmatosed, thrijith, timgardner, timmydcrawford, tjnowell, mirucon, travislopes, truongwp, tjfunke001, vishalkakadiya, vtrpldn, walterebert, westonruter, skorasaurus, somtijds, earnjam, williampatton, willybahuaud, yoavf, zebulan, ziyaddin, abhijitrakas, andreamiddleton, csabotta, dixitadusara, etoledom, faishal, hideokamoto, imath, iseulde, j-falk, jaswrks, johnwatkins0, jomurgel, notlaura, leahkoerper, mcsf, meetjey, 0mirka00, mitogh, ephoxmogran, tacrapo, mzorz, nagayama, omarreiss, ramonopoly, rileybrook, tinkerbelly, shaileesheth, sikander, ssousa, tfrommen, yahil.

Fixes #45037.



git-svn-id: https://develop.svn.wordpress.org/trunk@44165 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 05:11:14 +00:00
Gary Pendergast 4389369668 Scripts: Revert some functions being incorrectly removed in [44163].
git-svn-id: https://develop.svn.wordpress.org/trunk@44164 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 04:52:27 +00:00
Gary Pendergast dc6b225023 Build Tools: Update the `@wordpress/*` packages.
Merges [43801,43803] from the 5.0 branch to trunk.

See #45145.



git-svn-id: https://develop.svn.wordpress.org/trunk@44163 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 04:42:55 +00:00
Jonathan Desrosiers a8f4e58e75 Scripts: Add a missing date format to the `wp-date` config.
`wp-date` recently added the `datetimeAbbreviated` format, but the config wasn't sending it on page load.

Props pento.

Merges [43818] to trunk.

Fixes #45158.

git-svn-id: https://develop.svn.wordpress.org/trunk@44162 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 04:40:11 +00:00
Jonathan Desrosiers 6993b164b5 Build tools: Build webpack dev in grunt build.
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.

git-svn-id: https://develop.svn.wordpress.org/trunk@44161 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 04:35:59 +00:00
Jonathan Desrosiers 7732cce708 General: Fix some code formatting issues.
A handful of code formatting issues were introduced in [44159], runs the auto-fixer on them.

git-svn-id: https://develop.svn.wordpress.org/trunk@44160 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 04:34:25 +00:00
Gary Pendergast 934f0ca2b8 Build Tools: Copy package JavaScript and CSS into `wp-includes`.
- `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.



git-svn-id: https://develop.svn.wordpress.org/trunk@44159 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 04:10:26 +00:00
Jonathan Desrosiers 67f54c4696 Themes: Document the new theme features being added.
The add_theme_support() inline docs now includes the features that the block editor adds.

Props pento, desrosj.

Merges [43814] to trunk.

Fixes #45134.

git-svn-id: https://develop.svn.wordpress.org/trunk@44158 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 03:40:37 +00:00
Jonathan Desrosiers 76525a75b7 Styles: Add helper functions for loading block styles.
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.

git-svn-id: https://develop.svn.wordpress.org/trunk@44157 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 03:35:55 +00:00
Gary Pendergast 524f5be4c6 KSES: Allow the `download` attribute on `<a>` tags.
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.



git-svn-id: https://develop.svn.wordpress.org/trunk@44156 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 03:27:55 +00:00
Gary Pendergast 466ec7483a General: Fix some code formatting issues.
A handful of code formatting issues were introduced in recent commits, runs the auto-fixer on them.



git-svn-id: https://develop.svn.wordpress.org/trunk@44155 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 03:24:35 +00:00
Gary Pendergast f61cfa648c 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.

Merges [43810] from the 5.0 branch to trunk.

Props danielbachhuber, imath, swissspidy.
Fixes #45142.



git-svn-id: https://develop.svn.wordpress.org/trunk@44154 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 03:19:48 +00:00
Jonathan Desrosiers 88de9a1d7c Meta: Allow empty strings to be set by Custom Fields meta box.
Because the REST API allows meta keys to have empty values, the Custom Fields meta box should permit the same behavior.

Props charlestonsw, soulseekah, danielbachhuber.

Merges [43811] to trunk.

Fixes #43559.

git-svn-id: https://develop.svn.wordpress.org/trunk@44153 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 03:16:56 +00:00
Jonathan Desrosiers e34fe23ff0 Bundled Themes: Expand initial block editor support.
A handful of items were missed when adding initial support for the new block editor to bundled themes in [43793]-[43800]. This adds support for those missed items.

Props pento, davidakennedy, laurelfulford.

Merges [43869], [43870], [43871], [43872], [43873], [43874], [43875], [43876] to trunk.

Fixes #45238, #45239, #45240, #45242, #45243, #45244, #45245, #45246.

git-svn-id: https://develop.svn.wordpress.org/trunk@44152 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 02:54:17 +00:00
Gary Pendergast c474d190e7 Bundled Themes: Make twentynineteen the default theme.
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.



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

Merges [43805] and [43806] from the 5.0 branch to trunk.

Props desrosj, danielbachhuber, pento, Presskopp, swissspidy.
See #45065, #45098.


git-svn-id: https://develop.svn.wordpress.org/trunk@44150 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 02:34:28 +00:00
Gary Pendergast aadbdd7ad0 Default Themes: Import Twenty Nineteen from the 5.0 branch.
Merges [43808,43821,43842,43860,43892,43904,43909,43926-43929,43956,43961-43963] from the 5.0 branch to trunk.

Props allancole, karmatosed, kjellr, yingling017, mrasharirfan, milana_cap, fabiankaegy, westonruter, jorbin, netweb, b-07, khleomix, audrasjb, nielslange, mmaumio, richsalvucci, littlebigthing, dimadin, joyously, anevins, peterwilsoncc, dannycooper, iCaleb, siriokun, technosiren, travel_girl, azchughtai, ianbelanger, nadim1992, ismailelkorchi, nativeinside, chetan200891, grapplerulrich, ocean90, joshfeck, frankew, AbdulWahab610, mendezcode, eliorivero, melchoyce, joen, laurelfulford, mdawaffe, kraftbj, dsmart, nao, mayukojpn, enodekciw, ketuchetan, atanasangelovdev, poena, sharaz, artisticasad, mukesh27, burhandodhy, crunnells, aprakasa, themeroots, imonly_ik, tlxo, youthkee, brentswisher, smyoon315, mrahmadawais, desideveloper, Kau-Boy, mor10, mikeyarce, dingo_bastard, xkon, twoabove.

Fixes #45424.



git-svn-id: https://develop.svn.wordpress.org/trunk@44149 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 02:32:33 +00:00
Jonathan Desrosiers 0ae7e0ad0c 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, davidkennedy.

Merges [43800] to trunk.

Fixes #45045.

git-svn-id: https://develop.svn.wordpress.org/trunk@44148 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 02:21:38 +00:00
Jonathan Desrosiers c7c777aab2 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, davidkennedy.

Merges [43799] to trunk.

Fixes #45044.

git-svn-id: https://develop.svn.wordpress.org/trunk@44147 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 02:17:17 +00:00
Jeremy Felt 6a84afa33c Blocks: Add the reusable block post type, `wp_block`.
Merges [43804] from the 5.0 branch to trunk.

See #45098.


git-svn-id: https://develop.svn.wordpress.org/trunk@44146 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 02:14:13 +00:00
Jonathan Desrosiers 93836b4fb7 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, davidkennedy.

Merges [43798] to trunk.

Fixes #45043.

git-svn-id: https://develop.svn.wordpress.org/trunk@44145 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 02:12:04 +00:00
Jonathan Desrosiers 87bb7ccb37 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, davidkennedy.

Merges [43797] to trunk.

Fixes #45042.

git-svn-id: https://develop.svn.wordpress.org/trunk@44144 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 02:03:09 +00:00
Gary Pendergast e14e84a7c5 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.

Merges [43802] from the 5.0 branch to trunk.

See #45065.



git-svn-id: https://develop.svn.wordpress.org/trunk@44143 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 02:01:08 +00:00
Jonathan Desrosiers 14e685c0d5 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, davidkennedy.

Merges [43796] to trunk.

Fixes #45041.

git-svn-id: https://develop.svn.wordpress.org/trunk@44142 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 01:58:53 +00:00
Jeremy Felt f77c9bdd84 Meta Boxes: Sync checks for valid meta boxes from `do_meta_boxes()` to `the_block_editor_meta_boxes()`.
Merges [43792] from the 5.0 branch to trunk.

Props ocean90.
See #45112.


git-svn-id: https://develop.svn.wordpress.org/trunk@44141 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 01:54:40 +00:00
Jonathan Desrosiers 5e64a1fedd 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, davidakennedy.

Merges [43795] to trunk.

Fixes #45040.

git-svn-id: https://develop.svn.wordpress.org/trunk@44140 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 01:54:15 +00:00
Jonathan Desrosiers 25fd0f8438 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, davidakennedy.

Merges [43794] to trunk.

Fixes #45039.

git-svn-id: https://develop.svn.wordpress.org/trunk@44139 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 01:50:30 +00:00
Jeremy Felt 82b3fac279 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.

Merges [43790] and [43791] from the 5.0 branch to trunk.

Props desrosj, danielbachhuber, ocean90.
Fixes #45125.


git-svn-id: https://develop.svn.wordpress.org/trunk@44138 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 01:49:46 +00:00
Jonathan Desrosiers 3f8768a577 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, davidakennedy.

Merges [43793] to trunk.

Fixes #45038.

git-svn-id: https://develop.svn.wordpress.org/trunk@44137 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 01:45:57 +00:00
Gary Pendergast 79486d7656 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.

Merges [43781] from the 5.0 branch to core.

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



git-svn-id: https://develop.svn.wordpress.org/trunk@44136 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 01:40:50 +00:00
Jeremy Felt c125a50838 Build: Ignore the vendor directory during the jsvalidate:build task.
Merges [43783] from the 5.0 branch to trunk.

Props netweb.
Fixes #45119.


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

Merges [43776] from the 5.0 branch to trunk.

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


git-svn-id: https://develop.svn.wordpress.org/trunk@44134 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 01:31:27 +00:00
Gary Pendergast 981678ba36 Block Editor: Add extra body classes when the block editor is loaded.
Merges [43780] from the 5.0 branch to trunk.

See #45037.



git-svn-id: https://develop.svn.wordpress.org/trunk@44133 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 01:20:12 +00:00
Gary Pendergast 23efeb45c8 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.

Merges [43779] from the 5.0 branch to trunk.

See #45112.



git-svn-id: https://develop.svn.wordpress.org/trunk@44132 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 01:17:57 +00:00
Gary Pendergast cb0b292c87 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.

Merges [43778] from the 5.0 branch to trunk.

See #45112.



git-svn-id: https://develop.svn.wordpress.org/trunk@44131 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 01:10:20 +00:00
Gary Pendergast 99dd4f8c38 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.

Merges [43777] from the 5.0 branch to trunk.

See #45037.


git-svn-id: https://develop.svn.wordpress.org/trunk@44130 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 01:07:11 +00:00
Gary Pendergast 8a54057af7 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.

Merges [43775] from the 5.0 branch to trunk.

Fixes #35667.



git-svn-id: https://develop.svn.wordpress.org/trunk@44129 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 01:03:51 +00:00
Jeremy Felt 2f9a63bf87 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.

Merges [43774] from the 5.0 branch to trunk.

See #45131.


git-svn-id: https://develop.svn.wordpress.org/trunk@44128 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 00:57:50 +00:00
Gary Pendergast 63d9540fd8 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.

Merges [43770] from the 5.0 branch to trunk.

Props danielbachhuber, birgire.
Fixes #43887.


git-svn-id: https://develop.svn.wordpress.org/trunk@44127 602fd350-edb4-49c9-b593-d223f7449a82
2018-12-14 00:54:51 +00:00