Commit Graph

2371 Commits

Author SHA1 Message Date
hellofromTonya 8b50004388 Themes: Remove 'gutenberg' as translation context in `_wp_theme_json_webfonts_handler()`.
Follow-up to [53282].

Props kebbet.

See #55567, #46370.
Built from https://develop.svn.wordpress.org/trunk@53288


git-svn-id: http://core.svn.wordpress.org/trunk@52877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 15:37:09 +00:00
hellofromTonya 053b9bbd71 Themes: Add internal-only theme.json's webfonts handler (stopgap).
Adds `_wp_theme_json_webfonts_handler()` for handling `fontFace` declarations in a theme's `theme.json` file to generate the `@font-face` styles for both the editor and front-end.

Design notes:
* It is not a public API, but rather an internal, Core-only handler.
* It is a stopgap implementation that will be replaced when the public Webfonts API is introduced in Core.
* The code design is intentional, albeit funky, with the purpose of avoiding backwards-compatibility issues when the public Webfonts API is introduced in Core.
   * It hides the inter-workings.
   * Does not exposing API ins and outs for external consumption.
   * Only works for `theme.json`.
   * Does not provide registration or enqueuing access for plugins.

For more context on the decision to include this stopgap and the Webfonts API, see:
* Core's PR 40493 https://github.com/WordPress/gutenberg/pull/40493
* Gutenberg's tracking issue 40472 https://github.com/WordPress/gutenberg/issues/40472

Props aristath, hellofromTonya, peterwilsoncc, costdev, jffng, zieladam, gziolo, bph, jonoaldersonwp, desrosj.

See #55567, #46370.
Built from https://develop.svn.wordpress.org/trunk@53282


git-svn-id: http://core.svn.wordpress.org/trunk@52871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 14:48:09 +00:00
audrasjb 6ef5625ac2 Docs: Docs: Use third-person singular verbs for function descriptions in `wp-includes/blocks.php` and `wp-includes/script-loader.php`, per the documentation standards.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 14:09:11 +00:00
audrasjb 4d3dbe477a Editor: Move `wp_enqueue_block_style()` to `wp-includes/script-loader.php`, for better consistency.
As a result of [52741] and [52743], `wp_enqueue_block_support_styles()` was moved to `wp-includes/script-loader.php`. However, `wp_enqueue_block_style()` was still defined in `wp-includes/blocks.php`. This changeset also moves `wp_enqueue_block_support_styles()` to `wp-includes/script-loader.php` for better consistency.

Follow-up to [52741], [52743].

Props SergeyBiryukov, mukesh27, audrasjb.
Fixes #55182.
See #55148.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 13:53:16 +00:00
desrosj f448f54be5 Script Loader: Specify the version of the `clipboard` library included when registering.
For external libraries, the current version included with WordPress should be specified when registering scripts.

Props elifvish.
Fixes #55565.
Built from https://develop.svn.wordpress.org/trunk@53173


git-svn-id: http://core.svn.wordpress.org/trunk@52762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-13 15:58:08 +00:00
desrosj 43ca7ac938 External Libraries: Update polyfill libraries.
This updates two polyfill libraries to their latest versions.

- `polyfill-library` from `3.105.0` to `4.0.0`.
- `formdata-polyfill` from `4.0.0` to `4.0.10`.

This will affect the following script handles:
- `wp-polyfill-formdata`
- `wp-polyfill-node-contains`
- `wp-polyfill-dom-rect`

These polyfills are no longer used by WordPress Core, but are kept up to date as a courtesy for any plugins or themes still requiring them.

See #55547.
Built from https://develop.svn.wordpress.org/trunk@53165


git-svn-id: http://core.svn.wordpress.org/trunk@52754 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 17:35:27 +00:00
desrosj 35005412d0 External Libraries: Update some external libraries.
This updates three external libraries to their latest versions:

- `backbone` from `1.4.0` to `1.4.1`.
- `underscore` from `1.13.1` to `1.13.2`.
- `clipboard` from `2.0.8` to `2.0.10`.

These are all minor updates containing bug fixes and documentation improvements.

See #55547.
Built from https://develop.svn.wordpress.org/trunk@53164


git-svn-id: http://core.svn.wordpress.org/trunk@52753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 17:17:22 +00:00
desrosj e15e2d78bf External Libraries: Update `moment` to version `2.29.2`.
See #55547.
Built from https://develop.svn.wordpress.org/trunk@53163


git-svn-id: http://core.svn.wordpress.org/trunk@52752 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 16:52:23 +00:00
gziolo 1882e40a8a Editor: Use block settings to pass assets for the iframed editor
Backports changes applied in Gutenberg in https://github.com/WordPress/gutenberg/pull/37193.

Props zieladam.
See #55505.
Follow-up for [53157].


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


git-svn-id: http://core.svn.wordpress.org/trunk@52749 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-12 16:02:19 +00:00
gziolo 29254bd90a Build: Enable React Fast Refresh for block development
Brings the same functionality introduced in the Gutenberg plugin with https://github.com/WordPress/gutenberg/pull/28273. In effect, it brings React Fast Refresh support to WordPress core for block development with `@wordpress/scripts`.

Props walbo, antonvlasenko.
See #51750, #55505.
Follow-up [53135].


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


git-svn-id: http://core.svn.wordpress.org/trunk@52729 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 16:10:22 +00:00
Peter Wilson cf4f9c9e61 Plugins: Update item count when plugin deleted.
Update the item count, "N items", on the plugin list when a plugin is deleted. This matches the live updating of various other counts on the screen.

Props mitogh, costdev, azouamauriac, swissspidy, kebbet.
Fixes #55316.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-11 04:51:11 +00:00
Peter Wilson 35913a6309 Script loader: Add `wp-a11y` as dependency of `wp-ajax-response`.
Ensure `wp.a11y.speak()` is available when called in `wp-ajax-response`.

Follow up to [52170].

Props afercia.
Fixes #55544.
See #42937.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-08 06:00:08 +00:00
Sergey Biryukov 9fb5112732 Docs: Add missing description for `$pagenow` global in various functions.
See #54729, #55499.
Built from https://develop.svn.wordpress.org/trunk@53060


git-svn-id: http://core.svn.wordpress.org/trunk@52649 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-04 18:26:06 +00:00
audrasjb 2f0cb02d07 Customizer: Accessibility fixes following [53024].
This changeset fixes a few issues spotted after [53024].

- Remove target blank on HelpHub link
- Remove duplicate information in `aria-label`
- Small i18n fixes

Follow-up to [53024].

Props joedolson, audrasjb, pbiron.
Fixes #54939.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52614 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 19:57:16 +00:00
audrasjb fff6998023 Customizer: When a block theme is active, add an information about Site Editor in the Customizer.
This change adds an information notice to the customizer when a block theme is active and the customizer is also available (for example when a plugin activates it), to encourage people to use the Site Editor for the best full site customization experience.

Props ironprogrammer, antonvlasenko, Clorith, audrasjb, psmits1567, tobifjellner, costdev, webcommsat.
Fixes #54939.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 19:10:14 +00:00
audrasjb 25fafd4c44 Editor: Change location of block support styles in `wp_head`.
Backports changes from https://github.com/WordPress/gutenberg/pull/39164.

Props ndiego, alexstine, cbravobernal, mamaduka.
See #55474.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 13:28:08 +00:00
davidbaumwald 31dede34c1 External Libraries: Update Jcrop to version 0.9.15.
For a full list of changes, see https://github.com/tapmodo/Jcrop/compare/v0.9.12...v0.9.15.

This change also adds a comment in `script-loader.php` indicating that this library is no longer used by core.

Follow-up to [10846], [10863], [11015], [21633], [25549].

Props hareesh-pillai, karpstrucking, SergeyBiryukov.
Fixes #54035.
Built from https://develop.svn.wordpress.org/trunk@52989


git-svn-id: http://core.svn.wordpress.org/trunk@52578 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-24 20:07:05 +00:00
audrasjb 223cda987f Administration: Replace contracted verb forms for better consistency.
This changeset replaces contracted verb forms like `doesn't`, `can't`, or `isn't` with non-contracted forms like `does not`, `cannot`, or `is not`, for better consistency across the WordPress administration. It also updates some corresponding unit tests strings.

Props Presskopp, socalchristina, aandrewdixon, francina, SergeyBiryukov, JeffPaul, audrasjb, hellofromTonya.
Fixes #38913.
See #39176.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-22 16:25:03 +00:00
audrasjb 95d72f2207 jquery-query
Built from https://develop.svn.wordpress.org/trunk@52844


git-svn-id: http://core.svn.wordpress.org/trunk@52433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 18:54:02 +00:00
davidbaumwald 658f4e9367 Media: Add a "Copy URL to clipboard" function to the list table view.
Previously, a button was added to the modal view for a single media item in the "grid" view to copy the file URL to the user's clipboard.  This change adds a similar function to the "list" view for each media item.

Follow-up to [48232].

Props pbiron, ravipatel, alexstine, afercia.
Fixes #54426.
Built from https://develop.svn.wordpress.org/trunk@52842


git-svn-id: http://core.svn.wordpress.org/trunk@52431 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 18:24:03 +00:00
hellofromTonya 76207c890b Editor: Automatically apply global styles duotone filters to render in post editor.
Global styles duotone filters were not rendering in the post editor. This fixes that by adding `wp_global_styles_render_svg_filters` to the `in_admin_header` so it renders in the body before the editor.

Follow-up [52757].

Props ajlende, abhanonstopnewsuk.
Fixes #55190.
Built from https://develop.svn.wordpress.org/trunk@52768


git-svn-id: http://core.svn.wordpress.org/trunk@52357 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 20:45:00 +00:00
Dominik Schilling f42e80b077 Script Loader: Prevent normalizing data URIs in `_wp_normalize_relative_css_links()`.
This prevents making data URIs as in `mask-image:url('data:image/svg+xml;utf8,<svg...` relative to the WordPress installation.

Props staatic.
See #54243.
Fixes #55177.
Built from https://develop.svn.wordpress.org/trunk@52754


git-svn-id: http://core.svn.wordpress.org/trunk@52343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 14:47:04 +00:00
jorgefilipecosta cb3e78b0c3 Script Loader: Improvements to the load block support styles mechanism.
This commit applies feedback given to commit 52741. It changes the new function name, the file where it is located, and improves its documentation and marks.

Follow-up to [52741].
Props hellofromtonya, swissspidy, oandregal.
See #55148.
Built from https://develop.svn.wordpress.org/trunk@52743


git-svn-id: http://core.svn.wordpress.org/trunk@52332 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-16 22:20:01 +00:00
audrasjb 8f5f8b19c5 Script Loader: Load block themes styles in the head section.
Previously, some logic was added to load the global stylesheet in the bottom of `<body>` for classic themes that opted-in into loading individual block styles instead of a single stylesheet for them all. At the time, block themes always loaded the global stylesheet in the `<head>`. When block themes landed in core during WordPress 5.9 this logic wasn’t updated to consider them, hence the global stylesheet loaded in the `<body>` for them. This changeset fixes this.

Props oandregal, aristath.
Fixes #55148.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52327 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-16 10:36:02 +00:00
audrasjb f76b77b7c3 Script Loader: Prevent normalizing HTML IDs in `_wp_normalize_relative_css_links()`.
This change fixes an issue where `_wp_normalize_relative_css_links()` was not only matching urls, but also HTML IDs.

Follow-up to [52036].

Props mahype, costdev, audrasjb, SergeyBiryukov.
Fixes #54922.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52284 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-08 23:41:00 +00:00
Clorith 2d20fd7cc1 External libraries: Update version string for hoverIntent.
Updating the version string will help invalidate caches, ensuring the new version of the library is loaded where applicable.

Follow-up to [52429].

Props david.binda.
Fixes #54904.
Built from https://develop.svn.wordpress.org/trunk@52673


git-svn-id: http://core.svn.wordpress.org/trunk@52262 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-04 10:52:08 +00:00
Clorith d09e18c5cf External libraries: Update jQuery Color to 2.2.0
The NPM package for jQuery Color was updated in [50543], but a bundled version still existed within core.
This removes that bundled version, in favor of expanding the Grunt build steps to include the package from NPM instead.

Fixes #55016. See #51405.
Built from https://develop.svn.wordpress.org/trunk@52657


git-svn-id: http://core.svn.wordpress.org/trunk@52246 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-01 01:22:04 +00:00
Clorith 7ea33988e9 External libraries: Update jQuery UI to 1.13.1
Some regressions happened alongside the release of jQuery UI 1.13.0, this brings the fixes from 1.13.1 downstream to WordPress, notably relating to Widget, Autocomplete, Sortable, and Tooltip modules.

See the changelog between version 1.13.0 and 1.13.1 at https://github.com/jquery/jquery-ui/compare/1.13.0...1.13.1

Props blogaid, linux4me2, mgol.
Fixes #54902.
Built from https://develop.svn.wordpress.org/trunk@52648


git-svn-id: http://core.svn.wordpress.org/trunk@52237 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-28 16:44:05 +00:00
Peter Wilson f7151a6f3a Script loader: Prevent DB errors during Multisite install.
Prevent the script loader from attempting to create nonces during the installation process for Multisite configurations.

Prior to this fix, multiple "Table does not exist" errors were thrown during installation if `MULTISITE` was defined in the `wp-config.php` file but the salt constants were not defined. Without the salts defined in PHP, WP was attempting to use the database fallbacks prior to table creation.

Props schlessera, johnbillion, hellofromTonya, audrasjb, costdev.
Fixes #54800.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52190 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-18 23:47:01 +00:00
jorgefilipecosta 6d30d2a5d6 Fix: WordPress default presets aren't loaded for all themes.
The default preset styles of WordPress (font sizes, colors, gradients) are now provided via the global stylesheet to avoid duplication of styles. This stylesheet can be found in the front-end with the name global-styles-inline-css.
The default presets are important to support old content that may use them and also patterns, that can use cross-theme styles.

Props oandregal.
Fixes #54781.
Built from https://develop.svn.wordpress.org/trunk@52547


git-svn-id: http://core.svn.wordpress.org/trunk@52137 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-10 17:29:03 +00:00
hellofromTonya a3dedd1d4d Script Loader: Skip getting `'can_compress_scripts'` option in `script_concat_settings()` during install.
When installing a multisite, there is a potential access to a non-existent database table that needs to be skipped to avoid warnings/errors. This fix checks is WordPress is not installing before getting the `'can_compress_scripts'` option.

Props schlessera.
Fixes #54634.
Built from https://develop.svn.wordpress.org/trunk@52395


git-svn-id: http://core.svn.wordpress.org/trunk@51987 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-20 23:53:01 +00:00
noisysocks 935058d178 Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- Image block: Set image display to grid when no alignment sent to properly align caption on resize
- Update and align template descriptions
- Site Editor - prevent loading state from showing the admin menu.
- Add client side routing for Site Editor
- Navigation: Add clearance for appender in submenus.
- Fix CSS Custom Properties for presets in the site editor
- Add/navigation blocks post processing after migration from menu items
- Allow selector ordering to ensure theme.json root selector margin takes precedence 
- Do not remove theme presets if defaults are hidden
- Format library: fix unsetting highlight color
- FSE: Fix template resolution to give precedence to child theme PHP templates over parent theme block templates with equal specificity
- ColorPalette: Improving accessibility and visibility
- Update: Make the color popover on the gradient picker appear as expected
- Site Editor: Display a notice if export fails
- Fix docs and function naming for gallery block registration in PHP
- Switch to addEventListener for load event in the navigation block view script
- Fix mistake in _remove_theme_attribute_in_block_template_content
- Better synchronisation between Gutenberg and Core code
- Move the block page templates hook into compat/5.9 folder
- Moves to the template loader hooks and functions into lib/compat folder
- Refactor the gutenberg_is_fse_theme function to use wp_is_block_theme
- Site Editor: Update support doc URL in Welcome Guide
- Global Styles: Add Welcome Guide toggle
- Hide remove control point when removing would break gradient control
- Don't request the deprecated navigation areas endpoint outside of the Gutenberg plugin
- Image: Fix resizer controls being hidden in Safari when switching between alignments
- Remove Navigation Menus from WP Admin sidebar
- Site Editor: Hide the block appender in the Template Part editor
- Site Editor: Use server definition for the Template Areas
- Synchronize wp_is_block_theme and block-templates block support with Core
- E2E: Retry login again after a bad nonce request to prevent intermittent test failures 
- Fix theme requirement validation with WP 5.8
- Fix WP 5.9 check for conditionally running code
- Fix post comment form input width
- Border Style Control: Update styling for consistency with border width control
- Fix form-submit styles by adding button classes to the submit-button in post-comments block
- Site Editor: Fix edit template part link in header dropdown
- Move duotone palette to the bottom of global styles gradients
- Fix how appearanceTools works
- Move WP 5.9 wp-admin menus compatibility code to lib/compat folder
- Revert "Site Editor: Set the <title> on the list page to be same as the CPT name"
- Site Editor: Document Actions: add SR text to heading 1
- Do not register global styles CPT in WordPress 5.9
- Global Styles: Move the 'Edit colors' button to a standard menu item
- Fix styles for previews and patterns
- Site Editor: Fix failing E2E test
- Templates: Search for old template names in the parent theme too
- Remove 4 instances of 'gutenberg' text domain from WordPress core
- Fix content loss when ungrouping template parts or reusable blocks
- Simplify the RESET_BLOCK action to fix template part focus mode content loss
- [Global Styles]: Make Blocks section more distinguishable
- Only use block markup for comment form button when using a block theme
- Navigation: Fix vertical alignment of page list in modal.
- Fix: ToggleGroupControl active state
- Remove gutenberg_ prefix from @wordpress/block-library

Props ocean90, oandregal, hellofromtonya, youknowriad.
See #54487.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 01:57:26 +00:00
hellofromTonya 5c414db9ad External Libraries: Further fix jQuery deprecations in WordPress core.
Follow-up to [50001], [50270], [50367], [50383], [50410], [50420], [50429], [50547].

Props chaion07, Clorith, costdev, desrosj, malthert, peterwilsoncc, presskopp, promz, sabernhardt, SergeyBiryukov, toro_unit, wpnomad.
Fixes #51519.
Built from https://develop.svn.wordpress.org/trunk@52285


git-svn-id: http://core.svn.wordpress.org/trunk@51877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 17:18:01 +00:00
audrasjb dc853cb0e9 Script Loader: Enqueue block stylesheet only when the corresponding block is used.
Before this change, block stylesheets were enqueued although the corresponding blocks were not used in the current post, even if the `should_load_separate_core_block_assets` filter was set to `true`.

Props shimotomoki, devutpol, audrasjb.
Fixes #54457.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51854 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-28 21:12:06 +00:00
Adam Silverstein 09b9af2c76 Media: improve error message for failed image uploads.
Clarify error language and change the maximum suggested size to match the large image threshold.

Props zodiac1978, SergeyBiryukov, antpb, webcommsat, hellofromTonya. 
Fixes 53985.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51781 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 20:01:00 +00:00
desrosj 230fa090e8 External Libraries: Update the `regenerator-runtime` package to version `0.13.9`.
Props hareesh-pillai, sourovroy, hellofromTonya.
Fixes #54027.
Built from https://develop.svn.wordpress.org/trunk@52162


git-svn-id: http://core.svn.wordpress.org/trunk@51754 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 16:35:13 +00:00
Weston Ruter 9038612705 Embeds: Conditionally enqueue `wp-embed` only if needed and send `ready` message in case script loads after post embed windows.
* Prevent loading `wp-embed` script unconditionally on every page in favor of conditionally enqueueing when a post embed is detected. The `wp-embed` script is also explicitly marked as being in the footer group. Sites which currently disable post embed scripts from being enqueued via `remove_action( 'wp_head', 'wp_oembed_add_host_js' )` will continue to do so.
* Send a `ready` message from the host page to each post embed window in case the `iframe` loads before the `wp-embed` script does. When the `ready` message is received by the post embed window, it sends the same `height` message as it sends when it loads.
* Eliminate use of `grunt-include` to inject emoji script and the post embed script. Instead obtain the script contents via `file_get_contents()` (as is done elsewhere in core) and utilize `wp_print_inline_script_tag()`/`wp_get_inline_script_tag()` to construct out the script. This simplifies the logic and allows the running of src without `SCRIPT_DEBUG` enabled.
* For the embed code that users are provided to copy for embedding outside of WP, add the `secret` on the `blockquote` and `iframe`. This ensures the `blockquote` will be hidden when the `iframe` loads. The embed code in question is accessed here via `get_post_embed_html()`.

Props westonruter, swissspidy, pento, flixos90, ocean90.
Fixes #44632, #44306.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-11 02:49:18 +00:00
John Blackbourn 62fc5121f2 Docs: Add missing documentation for the `$javascript` parameter of the `wp_inline_script_attributes` filter.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51719 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 18:41:03 +00:00
noisysocks c421e9b34a Add Site Editor and PHP changes from Gutenberg 10.1 - 11.9
- First pass at adding the site editor from the Gutenberg plugin to
  wp-admin/site-editor.php.
- Adds miscellaneous PHP changes from Gutenberg 10.1 - 11.9.

Follows [52042].
See #54337.
Props youknowriad, aristath, hellofromtonya, gziolo.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 02:17:17 +00:00
jorgefilipecosta d8fe393934 Add: Public functions for interacting with global styles & settings.
This commit ports the public functions to interact with the global styles & settings.

See #54336.
Props oandregal.
Built from https://develop.svn.wordpress.org/trunk@52054


git-svn-id: http://core.svn.wordpress.org/trunk@51646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 21:45:58 +00:00
jorgefilipecosta 065c639a2a Update theme.json classes for WordPress 5.9.
This commit ports to core the changes to the classes that deal with theme.json code.

See #54336.
Props oandregal, spacedmonkey, noisysocks, hellofromtonya, youknowriad.
Built from https://develop.svn.wordpress.org/trunk@52049


git-svn-id: http://core.svn.wordpress.org/trunk@51641 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 19:19:58 +00:00
gziolo b519028ab2 Fix relative URLs in inlined block styles that involve external assets
When styles got inlined, relative URLs break. The problem was that URLs inside CSS files are relative to the stylesheet's path, and when styles get inlined that relation is lost. This patch fixes the issue by finding relative URLs which then get modified to be relative to the site's root.

Fixes #54243.
Props aristath, cdyerkes, hellofromtonya.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51628 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 13:24:58 +00:00
antpb c1f6817cad Media: Remove security messaging in media upload failures.
Previously, when uploading a media item type that is not supported, the default error message claims that the reason it cannot upload is due to security reasons. This is not always true. Now the warning says that the type is not allowed, which is always true.

Props antpb, Presskopp, peterwilsoncc, desrosj, iluy, circlecube, mikeschroder.
Fixes #53626.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-07 23:29:56 +00:00
Sergey Biryukov aa62c253e0 External Libraries: Update the Iris color picker to version 1.1.1.
The latest version includes jQuery 3.x deprecation fixes:
* `$.isArray` → `Array.isArray`
* Event attachment/trigger shorthands → `.on()` and `.trigger()`

For a full list of changes in this update, see the PR on GitHub:
https://github.com/Automattic/Iris/pull/72

Follow-up to [22030], [22033], [22385], [22457], [22697], [22732], [23443], [26334], [30551], [30650], [38931], [50547].

Props Clorith, mattwiebe, Cybr.
Fixes #54224.
Built from https://develop.svn.wordpress.org/trunk@52006


git-svn-id: http://core.svn.wordpress.org/trunk@51595 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-03 19:40:00 +00:00
Sergey Biryukov a5926f8ece Coding Standards: Correct alignment in `wp_enqueue_global_styles()`.
This fixes an `Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space` WPCS warning.

Follow-up to [50973], [51819].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@51944


git-svn-id: http://core.svn.wordpress.org/trunk@51533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-28 14:10:59 +00:00
Sergey Biryukov 311cf99866 Docs: Document the usage of some globals in `wp-includes/script-loader.php`.
Follow-up to [44114], [44262], [49080], [50761], [51471].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@51942


git-svn-id: http://core.svn.wordpress.org/trunk@51531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-27 18:21:58 +00:00
Sergey Biryukov 6a5a0062ff Script Loader: Correct the number of arguments passed to the closure in `enqueue_block_styles_assets()`.
This avoids an `Uncaught ArgumentCountError: Too few arguments to function {closure}(), 1 passed` PHP fatal error when registering a block style with the `should_load_separate_core_block_assets` filter enabled.

Follow-up to [51471].

Props aristath, shimon246, jrf, gziolo.
Fixes #54323.
Built from https://develop.svn.wordpress.org/trunk@51941


git-svn-id: http://core.svn.wordpress.org/trunk@51530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-27 17:10:01 +00:00
Andrew Ozz aef14e6d1b External Libraries: Update jQuery UI to 1.13.0 final.
Props Clorith, mgol, azaozz.
Fixes #52163.
Built from https://develop.svn.wordpress.org/trunk@51897


git-svn-id: http://core.svn.wordpress.org/trunk@51490 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-08 18:06:00 +00:00
jorgefilipecosta 5932bb0f8e Block editor: Cache global stylesheet by theme key.
Global styles are used in a few different contexts (front, editor, customizer, the theme directory). In the last two contexts, it's important that switching themes immediately refreshes the global stylesheet, to avoid situations in which the styles of the previous theme load with the new one. This was brought up at WordPress/gutenberg#34531 (customizer) and at meta.trac.wordpress.org/ticket/5818 (theme directory).
This commit makes sure the stylesheet is regenerated upon switching themes.

Props oandregal, dd32.
See #53175.
Built from https://develop.svn.wordpress.org/trunk@51819


git-svn-id: http://core.svn.wordpress.org/trunk@51426 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-16 18:05:00 +00:00
Andrew Ozz e175db4ae1 External Libraries: Update jQuery UI to 1.13.0-rc2.
The final release is expected at the beginning of October. Updating to rc2 now gives everybody plenty of time to test and report any issues either with UI 1.13.0 or with the WordPress implementation.

Props Clorith, mgol, azaozz.
See #52163.
Built from https://develop.svn.wordpress.org/trunk@51794


git-svn-id: http://core.svn.wordpress.org/trunk@51401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-10 00:02:59 +00:00
Sergey Biryukov 09f22e5b24 External Libraries: Update `whatwg-fetch` package to version 3.6.2.
This matches the version used in the Gutenberg project.

While WordPress core no longer depends on this polyfill as of [50934], this brings the latest updates of the library to anyone still utilizing it.

For a full list of changes in this update, see the `whatwg-fetch` GitHub:
https://github.com/github/fetch/compare/v3.0.0...v3.6.2

Follow-up to [43719], [50934].

Props hareesh-pillai, rsiddharth, desrosj.
Fixes #53929.
Built from https://develop.svn.wordpress.org/trunk@51692


git-svn-id: http://core.svn.wordpress.org/trunk@51298 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-30 13:51:11 +00:00
hellofromTonya c7d3e267b8 Coding Standards: Use static closures when not using `$this`.
When a closure does not use `$this`, it can be made `static` for improved performance.

Static closures are supported in PHP since PHP 5.4. ​

Props jrf, hellofromTonya, swissspidy, SergeyBiryukov.
See #53359.
Built from https://develop.svn.wordpress.org/trunk@51657


git-svn-id: http://core.svn.wordpress.org/trunk@51263 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-26 12:59:02 +00:00
Sergey Biryukov d289b7f602 Coding Standards: Fix incorrect alignment in two comment blocks.
Tabs should only be used for indentation and not for mid-line alignment.

Props jrf.
See #53359.
Built from https://develop.svn.wordpress.org/trunk@51551


git-svn-id: http://core.svn.wordpress.org/trunk@51162 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-05 13:11:56 +00:00
Peter Wilson 67119713fc Editor: Prevent block-editor JavaScript loading in other editors.
Add a check to `wp_add_iframed_editor_assets_html()` confirming the edit post screen is using the block-editor before including block-editor specific JavaScript. For the classic and other editors the function returns early without any output.

Props swissspidy, desrosj.
Fixes #53696.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51151 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-04 05:10:56 +00:00
Sergey Biryukov 5400c50367 Code Modernization: Pass correct default value to `new DateTime()` in `wp_default_packages_inline_scripts()`.
This fixes a "Deprecated: `DateTime::__construct()`: Passing null to parameter #1 (`$datetime`) of type string is deprecated" warning on PHP 8.1.

Follow-up to [49083].

See #53635.
Built from https://develop.svn.wordpress.org/trunk@51533


git-svn-id: http://core.svn.wordpress.org/trunk@51144 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-03 12:04:58 +00:00
Sergey Biryukov 47fc56d650 Upgrade/Install: Avoid creating nonce during installation.
This avoids a "Table `wp_options` doesn't exist" database error when trying to create a nonce for password reset button.

When installing and using database-saved salts, `wp_create_nonce()` causes database errors as `wp_salt()` attempts to insert into the not-yet-created options table. Since authentication is not available during installation, we can safely skip creating a nonce.

Follow-up to [39684], [50129].

Props schlessera, swissspidy, sanketchodavadiya, hellofromTonya, SergeyBiryukov.
Fixes #53830.
Built from https://develop.svn.wordpress.org/trunk@51525


git-svn-id: http://core.svn.wordpress.org/trunk@51136 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-02 16:39:00 +00:00
gziolo 60c39d7805 Editor: Conditionally load registered styles for block variations
In WordPress 5.8 we added the ability to only load styles for blocks when these blocks are rendered. However, these optimizations left out block-styles that get added using the register_block_style() function/API.

Props aristath.
Fixes #53616.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51082 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-22 08:38:04 +00:00
desrosj 32307b45b0 External Libraries: Correct the `underscore` version used when registering.
The correct version is `1.13.1`.

Follow up to [50650], [50778].

Props david.binda.
Fixes #53713.
Built from https://develop.svn.wordpress.org/trunk@51469


git-svn-id: http://core.svn.wordpress.org/trunk@51080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-21 12:33:59 +00:00
desrosj bb6af43b34 External Libraries: Correct the `jquery-form` version used when registering.
The correct version is `4.3.0`.

Follow up to [50546].

Props david.binda.
Fixes #53714.
Built from https://develop.svn.wordpress.org/trunk@51468


git-svn-id: http://core.svn.wordpress.org/trunk@51079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-21 12:20:57 +00:00
desrosj 6574121d8a External Libraries: Correct the `hoverIntent` version used when registering.
Follow up to [50521].

Props david.binda.
Fixes #53715.
Built from https://develop.svn.wordpress.org/trunk@51467


git-svn-id: http://core.svn.wordpress.org/trunk@51078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-21 12:18:06 +00:00
Sergey Biryukov eb9d31bb11 Docs: Some documentation improvements for `wp_check_widget_editor_deps()`:
* Add missing short description for the function.
* Correct function names in `_doing_it_wrong()` calls.
* Document the usage of `$wp_scripts` and `$wp_styles` globals.
* Update syntax for multi-line comment per the documentation standards.

Follow-up to [51387], [51388].

See #53437, #53569.
Built from https://develop.svn.wordpress.org/trunk@51390


git-svn-id: http://core.svn.wordpress.org/trunk@51001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-09 10:50:56 +00:00
noisysocks c57e6f00fe Editor: Merge conflicting wp.editor objects into single, non-conflicting object
The `wp-editor` script (`@wordpress/editor` npm package) is exposed as
`window.wp.editor` in WP Admin.  This causes problems, though, as many older
scripts expect to see the older `editor` script available at `window.wp.editor`.

The solution is to export all the members of the older `window.wp.editor` module
in the newer module to maintain backwards compatibility.

See #53437.
Props zieladam, spacedmonkey, TimothyBlynJacobs, andraganescu.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-09 01:10:57 +00:00
Dominik Schilling 2f170f54ea Script Loader: Update jQuery version to 3.6.0 following the update in [50520].
Props audrasjb.
See #52707.
Built from https://develop.svn.wordpress.org/trunk@51380


git-svn-id: http://core.svn.wordpress.org/trunk@50991 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-08 07:19:57 +00:00
desrosj 3e271ba7a7 Editor: Ensure global styles are loaded in the footer when loading core assets individually.
This fixes the logic in `wp_enqueue_global_styles()` to ensure that global styles are loaded in the footer when a site opts-in to loading Core block assets individually.

This fixes a bug where styles defined in `themes.json` are not respected.

Props walbo, nosolosw, mcsf, aristath, desrosj.
Fixes #53494.
Built from https://develop.svn.wordpress.org/trunk@51309


git-svn-id: http://core.svn.wordpress.org/trunk@50918 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-02 18:47:58 +00:00
Aaron Jorbin ad14ee34eb Docs: Further Improve documentation for wp_should_load_separate_core_block_assets().
In [51256], the documentation was improved, this further improves it. As scripts are not yet a part of what this function does, they are not mentioned explicitly. Assets is used so that the docs don't need a lot of improvements when scripts do come into play..

Props desrosj, SergeyBiryukov, Jorbin.
See #53505.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50872 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-29 18:45:56 +00:00
Sergey Biryukov 600d611e0d Docs: Improve documentation for `wp_should_load_separate_core_block_assets()`.
This should clarify the purpose of the function and what effect it has on block styles loading.

Props aristath, desrosj, jorbin, SergeyBiryukov.
See #53505.
Built from https://develop.svn.wordpress.org/trunk@51256


git-svn-id: http://core.svn.wordpress.org/trunk@50865 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-29 11:12:02 +00:00
Andrew Ozz 936a38255b Media: Prevent uploading and show an error message when the server doesn't support editing of WebP images, take II. Add new, better error message for it.
Props antpb, joedolson, iandunn, azaozz.
Fixes #53475.
Built from https://develop.svn.wordpress.org/trunk@51227


git-svn-id: http://core.svn.wordpress.org/trunk@50836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-24 19:12:00 +00:00
iandunn 3801e9818a Media: Revert r51211 to restore `ms-files.php` assets.
r51211 accidentally introduced a fatal error for Multisite instances with `ms_files_rewriting` enabled. Reverting removes the error, and the original purpose of the commit can be solved in another way.

Props otto42, barry, ryelle, azaozz.
Fixes #53492. See #53475.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50832 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-23 22:20:59 +00:00
desrosj fccc020d29 Docs: Various docblock corrections for code added in 5.8.
Props johnbillion.
See #53461.
Built from https://develop.svn.wordpress.org/trunk@51221


git-svn-id: http://core.svn.wordpress.org/trunk@50830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-23 19:05:57 +00:00
desrosj c54b44e75a Build/Test Tools: Add the `regenerator-runtime` script as a dependency to `wp-polyfill`.
In [51146], the `core-js` package replaced the deprecated `@babel//polyfill` one. The `core-js` package builds `wp-polyfill` from a configuration provided by `@wordpress/babel-preset-default` instead of copying a one size fits all polyfill.

That change caused an issue where plugins and themes relying on the `regenerator-runtime` script being included in the `wp-polyfill.js` file encountering fatal JavaScript errors.

This adds the `regenerator-runtime` package to Core and registers it as a dependency for `wp-polyfill`. While Core does not require `regenerator-runtime`, it will allow for a smoother transition to using `core-js`.

This dependency will be removed in a future version of WordPress, so developers are encouraged to add `regenerator-runtime` as a dependency for any custom script that requires it.

Follow up to [51146].

Props gziolo, herregroen, jeherve, hellofromtonya, peterwilsoncc.
Fixes #52941.
Built from https://develop.svn.wordpress.org/trunk@51212


git-svn-id: http://core.svn.wordpress.org/trunk@50821 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-23 00:06:13 +00:00
Andrew Ozz e93093f7ed Media: Prevent uploading and show an error message when the server doesn't support editing of WebP files and image sub-sizes cannot be created.
Props adamsilverstein, desrosj, azaozz
Fixes #53475
Built from https://develop.svn.wordpress.org/trunk@51211


git-svn-id: http://core.svn.wordpress.org/trunk@50820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-22 23:12:57 +00:00
Sergey Biryukov 84d822fc46 I18N: Remove redundant `default` text domain parameter in some `__()` calls.
Follow-up to [43919], [44262], [48141], [50259].

See #52627.
Built from https://develop.svn.wordpress.org/trunk@51160


git-svn-id: http://core.svn.wordpress.org/trunk@50769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-15 16:16:57 +00:00
youknowriad c114304471 Block Editor: Update the WordPress packages with the fixes for 5.8 beta 2.
This includes:

**Various**

 - Fix multi selection for nested blocks https://github.com/WordPress/gutenberg/pull/32536
 - Consistently show the drop indicator while dragging blocks https://github.com/WordPress/gutenberg/pull/31896
 - Fix horizontal drop indicator https://github.com/WordPress/gutenberg/pull/32589
 - Fix Safari flickering issue https://github.com/WordPress/gutenberg/pull/32581
 - Silence useSelect zombie bug errors https://github.com/WordPress/gutenberg/pull/32088

**Template Editor**

 - Clarify the template creation modal https://github.com/WordPress/gutenberg/pull/32427
 - Only add skip links for block templates https://github.com/WordPress/gutenberg/pull/32451

**Widgets Editor**

 - Add block breadcrumb https://github.com/WordPress/gutenberg/pull/32498 https://github.com/WordPress/gutenberg/pull/32528 https://github.com/WordPress/gutenberg/pull/32569
 - Saved deleted and restored widgets. https://github.com/WordPress/gutenberg/pull/32534
 - Fix unsaved changes detection https://github.com/WordPress/gutenberg/pull/32573
 - Fix button spacing in the header https://github.com/WordPress/gutenberg/pull/32585
 - Avoid extra undo levels https://github.com/WordPress/gutenberg/pull/32572
 - Move Legacy Widget block to the `@wordpress/widgets` package https://github.com/WordPress/gutenberg/pull/32501
 - Fix Social Links color inheritance https://github.com/WordPress/gutenberg/pull/32625
 - Use Button appender https://github.com/WordPress/gutenberg/pull/32580

**Global Styles (theme.json)**
 
 - Separate the presets per origin in the block editor settings https://github.com/WordPress/gutenberg/pull/32358 https://github.com/WordPress/gutenberg/pull/32622
 - Use CSS Custom Properties for the preset styles https://github.com/WordPress/gutenberg/pull/32627

**Performance**

 - Remove is-typing classname to improve typing performance https://github.com/WordPress/gutenberg/pull/32567

Props nosolosw, jorgefilipecosta, aristath, ntsekouras, peterwilsoncc, mcsf.
See #53397.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-15 08:52:30 +00:00
desrosj bac6a83417 Script Loader: Fix 404 errors for the `jquery-masonry` script when `SCRIPT_DEBUG` is `true`.
The unminified version of `jquery-masonry` has never been included in Core. This hard codes the `.min` into the file source to prevent these errors.

Props pondermatic, isabel_brison, SergeyBiryukov, azaozz, desrosj.
Fixes #47353.
Built from https://develop.svn.wordpress.org/trunk@51094


git-svn-id: http://core.svn.wordpress.org/trunk@50703 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 14:59:59 +00:00
John Blackbourn 3024b85221 Editor: Correct some docblocks added in [50836].
See #50328, #52620.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50674 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-03 00:22:58 +00:00
Sergey Biryukov 033c742a4e Block Editor: Load the `WP_Theme_JSON_Resolver` class in `wp-admin/load-styles.php`.
This ensures correct load order when style concatenation is used, e.g. when `SCRIPT_DEBUG` is off.

Additionally, make sure the `WP_CONTENT_DIR` constant is defined for use in `get_theme_root()` via `get_stylesheet_directory()`.

Follow-up to [50992], [51001], [51013].

Props nosolosw.
See #53175.
Built from https://develop.svn.wordpress.org/trunk@51056


git-svn-id: http://core.svn.wordpress.org/trunk@50665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-01 23:09:58 +00:00
antpb e2e8120fa6 Media: Add button in media upload page for copying the media url.
Adds a button to the media upload page to make copying the url possible on the same page when a media item upload is successful.

Props anotia, ryokuhi, Mista-Flo, lukecarbis, antpb, claytoncollie, shaunandrews, joedolson.
Fixes #51754.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-26 01:40:58 +00:00
desrosj 66603b4bd7 External Libraries: Update two polyfill libraries to their latest versions.
This updates the following polyfill libraries bundled with WordPress to their latest versions:
- `formdata-polyfill` from `3.0.20` to `4.0.0`.
- `polyfill-library` from `3.104.0` to `3.105.0`.

Fixes #52854.
Built from https://develop.svn.wordpress.org/trunk@51017


git-svn-id: http://core.svn.wordpress.org/trunk@50626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 23:28:15 +00:00
Sergey Biryukov 3c3a18a957 Block Editor: Only load the `WP_Theme_JSON_Resolver` class once.
Since the class is now loaded via `wp-includes/script-loader.php`, which is required earlier in `wp-settings.php`, loading it again in `wp-settings.php` is redundant.

Follow-up to [50992], [51001].

See #53175.
Built from https://develop.svn.wordpress.org/trunk@51013


git-svn-id: http://core.svn.wordpress.org/trunk@50622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 21:40:57 +00:00
youknowriad 4ae0e4220f Block Editor: Introduce block templates for classic themes.
With this patch, users will be able to create custom block based templates
and assign them to specific pages/posts.

Themes can also opt-out of this feature

Props bernhard-reiter, carlomanf.
Fixes #53176.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 14:20:57 +00:00
youknowriad f6af848c72 Block Editor: Load theme resolver class in script loader.
script-loader.php is sometimes called directly and in these situations, the Theme_JSON_Resolver class was not defined.

Props nosolosw, noisysocks.
Fixes #53175.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50610 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 13:42:58 +00:00
noisysocks 81f62198c3 Adds the widgets block editor to widgets.php and customize.php
Moves the widgets block editor from Gutenberg into WordPress Core.

- Adds @wordpress/edit-widgets, @wordpress/customize-widgets and
  @wordpress/widgets.
- Modifies wp-admin/widgets.php to branch between the old editor and new editor
  depending on wp_use_widgets_block_editor().
- Modifies WP_Customize_Widgets to branch between the old editor control and new
  editor control depending on wp_use_widgets_block_editor().

Fixes #51506.
Props isabel_brison, TimothyBlynJacobs, andraganescu, kevin940726, talldanwp.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50605 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 08:40:25 +00:00
youknowriad 2b7ad8ad4f Block Editor: Load the classic layout stylesheet conditionallty.
Historically, the block editor has been opinionated about the size of the canvas and the alignments.
Themes with theme.json will have to define a "layout" in their settings and the classic stylesheet won't be loaded anymore for this.

Props nosolosw.
See #53175.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 07:40:56 +00:00
desrosj 0d1e4e553c General: Avoid unnecessary calls to `update_user_option()`.
The `update_user_option()` function is a way to update a user meta value after adding a blog’s prefix to the beginning of the meta key. But when the fourth parameter is `true`, the behavior is exactly the same as calling `update_user_meta()` directly.

This replaces all instances of `update_user_option()` when the fourth parameter is `true` in Core with a direct call to `update_user_meta()` to prevent an unnecessary call to `update_user_option()`.

Props johnjamesjacoby, zkancs, obenland, desrosj.
Fixes #43339.
Built from https://develop.svn.wordpress.org/trunk@50981


git-svn-id: http://core.svn.wordpress.org/trunk@50590 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 19:59:57 +00:00
jorgefilipecosta 18200cc30c Block Editor: Add Global Styles support using theme.json file.
This is the second piece of landing the theme.json processing in WordPress core. 
It includes the mechanism that outputs the CSS styles of a theme.json file.

Props nosolosw, youknowriad.
See #53175.
Built from https://develop.svn.wordpress.org/trunk@50973


git-svn-id: http://core.svn.wordpress.org/trunk@50582 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 17:39:57 +00:00
desrosj 4a20a75fa1 Script Loader: Stop loading polyfills specific to Internet Explorer
This change removes the inline JavaScript attached to the `wp-polyfill` script responsible for loading polyfill libraries included specifically for Internet Explorer support.

Support for the final version of IE supported in WordPress Core (IE11) was removed in [50784] and will on longer be supported when the next version of WordPress is released.

These scripts are still registered and available to be enqueued, but WordPress will no longer load them by default.

For more information, see https://wordpress.org/news/2021/05/dropping-support-for-internet-explorer-11/.

Props youknowriad, gziolo, sergiomdgomes, desrosj.
Fixes #53078.
Built from https://develop.svn.wordpress.org/trunk@50934


git-svn-id: http://core.svn.wordpress.org/trunk@50543 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-19 20:00:57 +00:00
gziolo b6ba5d33bc Editor: Rename `should_load_separate_core_block_assets` for consistency
Changes introduced:
- The `wp_should_load_separate_core_block_assets` function.
- The `should_load_separate_core_block_assets` filter.

Props hellofromTonya, SergeyBiryukov.
Fixes #50328.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-17 14:28:04 +00:00
Sergey Biryukov bc175dca8c Editor: Some documentation and test improvements for loading separate assets for core blocks:
* Move `should_load_separate_core_block_assets()` to a more appropriate place.
* Update DocBlocks and inline comments per the documentation standards.
* Document the `$wp_styles` global in `wp_maybe_inline_styles()`.
* List the expected result first in unit test assertions.
* Remove a duplicate unit test.
* Add missing `@covers` tags.

Follow-up to [50836], [50837].

See #50328, #52620, #53180.
Built from https://develop.svn.wordpress.org/trunk@50838


git-svn-id: http://core.svn.wordpress.org/trunk@50447 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-11 16:28:02 +00:00
gziolo 7f804f8436 Editor: Fix regression introduced with loading separate block assets
Related to [50836]. load-styles.php doesn't load the should_load_separate_core_block_assets function and that causes an error 500 - which in turn makes the dashboard appear unstyled.

Props aristath.
Fixes #53180.



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


git-svn-id: http://core.svn.wordpress.org/trunk@50446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-11 14:16:01 +00:00
gziolo 8df663cbfa Editor: Enqueue script and style assets only for blocks present on the page
Adds styles for individual core blocks to make it possible to render only styles for those blocks that are rendered on the page (frontend). This is optinal functionality for start that can be controlled with the new `separate_core_block_assets` filter.

In addition to that, styles can be inlined when `path` is passed when registering an individual styles. This functionality can be changed with the new `styles_inline_size_limit` filter. The maximum size of inlined styles in bytes defaults to 20 000.

Props aristath, aduth, westonruter, mcsf.
Fixes #50328, #52620.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50445 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-11 09:43:08 +00:00
desrosj 9d2315b409 External Libraries: Update `Moment.js` to the latest version.
This updates the `moment` script from version `2.27.0` to `2.29.1`.

Props shital-patel, hareesh-pillai.
Fixes #52853.
Built from https://develop.svn.wordpress.org/trunk@50773


git-svn-id: http://core.svn.wordpress.org/trunk@50382 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-20 19:15:21 +00:00
gziolo ad48a15387 Editor: Update WordPress packages to use with WordPress 5.8
In the response to the discussion during the Dev Chat, I'm doing a first pass to keep WordPress packages up to date in the WordPress 5.8 release cycle.

See https://github.com/WordPress/wordpress-develop/pull/1176 for more details.

Props youknowriad, aristath, andraganescu.
See #52991.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50370 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-15 15:19:43 +00:00
gziolo b31964a44b Blocks: Add is_default handling to server side block styles registry
Ensures that register_block_style lets developer pass `is_default` flag to mark one of the block style variations as the default one.

Props mukesh27, xavivars.
Fixes #53006.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50312 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-13 08:04:13 +00:00
Sergey Biryukov 3697386083 Editor: Consolidate enqueueing block editor assets in `wp-includes/default-filters.php`.
Follow-up to [44157], [46111], [48537], [50620].

See #52920.
Built from https://develop.svn.wordpress.org/trunk@50629


git-svn-id: http://core.svn.wordpress.org/trunk@50241 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-01 11:46:09 +00:00
gziolo 6d42a21103 Editor: Enqueue assets for format library for the block editor
Ensures that `wp-format-library` assets are always loaded for the block editor. Otherwise, they have to be loaded individually for every screen that needs it. It's similar to how `wp-block-directory` assets are handled.

Props ellatrix.
See #52920.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50233 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-31 05:52:10 +00:00
desrosj 5c451da5e9 External Libraries: Update polyfill versions in the script loader.
Follow up to [50615, 50617].

See #52854.
Built from https://develop.svn.wordpress.org/trunk@50619


git-svn-id: http://core.svn.wordpress.org/trunk@50232 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-30 17:57:05 +00:00
Peter Wilson a66cb4bb18 Script Loader: Escape HTML5 boolean attribute names.
Add escaping of boolean attribute names in `wp_sanitize_script_attributes()` for themes supporting HTML5 script elements.

Props tmatsuur, johnbillion, joyously.
Fixes #52894.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50188 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-25 00:27:06 +00:00
Sergey Biryukov b65d83b872 External Libraries: Further fix jQuery deprecations in WordPress core.
This includes many minor adjustments to a wide array of core files to replace shorthands with full declarations.

Follow-up to [50001], [50270], [50367].

Props Clorith, hellofromTonya, peterwilsoncc, adamsilverstein, aristath.
See #51812.
Built from https://develop.svn.wordpress.org/trunk@50420


git-svn-id: http://core.svn.wordpress.org/trunk@50031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-02-23 19:45:04 +00:00
Peter Wilson c463e94a33 Security: move Content-Security-Policy script loaders.
Move `wp_get_script_tag()`, `wp_print_script_tag()`, `wp_print_inline_script_tag()` and `wp_get_inline_script_tag()` functions from `functions.php` to `script-loader.php`.

Relocate related tests to `dependencies` sub-directory.

Follow up to [50167].
Props adamsilverstein, hellofromTonya, SergeyBiryukov.
Fixes #39941.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50020 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-02-23 02:00:06 +00:00
Peter Wilson d0cf9db65c Site Health: Update `site-health` script dependencies.
Add `wp-hooks` and `wp-i18n` to Site Health JavaScript dependencies.

Props gmariani405, Clorith, mukesh27.
Fixes #52483.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49939 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-02-12 00:10:04 +00:00