Restructures the block.json selectors API by moving `__experimentalSelector` props into their own config, stabilizing the selectors API, and enabling more flexible styling options.
Props ramonopoly, spacedmonkey, aaronrobertshaw, onemaggie.
Fixes#58586.
git-svn-id: https://develop.svn.wordpress.org/trunk@56058 602fd350-edb4-49c9-b593-d223f7449a82
This changeset adds the `#content` fragment identifier to paginated links so the screen scrolls down to the content section when clicking on pagination links
located on paginated pages.
Props laurelfulford, mukesh27, joyously, poena, alvitazwar052, oglekler, audrasjb.
Fixes#45920.
git-svn-id: https://develop.svn.wordpress.org/trunk@56057 602fd350-edb4-49c9-b593-d223f7449a82
This changeset adds "Current time, "Current UTC time" and "Current Server time" under the "Server" section of Site Health debug infos. This provides the
current time, the server time, and allow for comparison if there's some time-related issues.
Props sebastienserre, Clorith, audrasjb, kebbet, robinwpdeveloper, hrrarya, mukesh27, hareesh-pillai, costdev.
Fixes#56378.
git-svn-id: https://develop.svn.wordpress.org/trunk@56056 602fd350-edb4-49c9-b593-d223f7449a82
Marks the layout support stable and moves layout definitions from `theme.json` into `wp-includes/block-supports/layout.php`.
Props andrewserong, poena, ramonopoly, peterwilsoncc.
Fixes#58550.
git-svn-id: https://develop.svn.wordpress.org/trunk@56055 602fd350-edb4-49c9-b593-d223f7449a82
Adds a hook for preloading navigation posts in site editor.
Props get_dave, spacedmonkey, audrasjb, ramonopoly.
Fixes#58556.
git-svn-id: https://develop.svn.wordpress.org/trunk@56054 602fd350-edb4-49c9-b593-d223f7449a82
Creates a fallback menu for the Navigation block including an API endpoint to retrieve it.
Props get_dave, spacedmonkey, kebbet, flixos90, mikeschroder, ramonopoly, audrasjb.
Fixes 58557.
git-svn-id: https://develop.svn.wordpress.org/trunk@56052 602fd350-edb4-49c9-b593-d223f7449a82
Ignore empty templates when using the `/lookup` endpoint in the `WP_REST_Templates_Controller` class.
Props ramonopoly, jorgefilipecosta, spacedmonkey, youknowriad, mukesh27.
Fixes#58615.
git-svn-id: https://develop.svn.wordpress.org/trunk@56051 602fd350-edb4-49c9-b593-d223f7449a82
This aims to make the provided statistical data more complete, by correctly identifying the version for a wider selection of database types and servers.
Props mukesh27, costdev, spacedmonkey, johnbillion.
Fixes#58584.
git-svn-id: https://develop.svn.wordpress.org/trunk@56050 602fd350-edb4-49c9-b593-d223f7449a82
Update the `@wordpress/block-serialization-default-parser` to 4.35.1 for WordPress 6.3 Beta 1. These changes split the following classes in to their own files in order to match the WordPress PHP coding standards:
* `WP_Block_Parser_Block`
* `WP_Block_Parser_Frame`
* `WP_Block_Parser`
These classes were previously all included in the `src/wp-includes/class-wp-block-parser.php` file. In order to maintain backward compatibly for developers requiring the file directly, the relocated classes are replaced with `require_once` calls in the original file.
In order to retain the commit history of the new files, they have been created using the `svn copy` command.
Props aristath, rajanpanchal2028, jrf, SergeyBiryukov, costdev, manfcarlo, spacedmonkey, mukesh27, isabel_brison, dd32.
Fixes#57832.
See #58623.
git-svn-id: https://develop.svn.wordpress.org/trunk@56048 602fd350-edb4-49c9-b593-d223f7449a82
Adds an iframe around the post editor only if all registered blocks are v3 or higher.
Props ellatrix, mukesh27, costdev, oandregal, ramonopoly.
Fixes#58626.
git-svn-id: https://develop.svn.wordpress.org/trunk@56047 602fd350-edb4-49c9-b593-d223f7449a82
Adds the ability for blocks to declare support for CSS box-shadow and processing of necessary styles.
Props madhudollu, sabernhardt, ramonopoly, spacedmonkey, mukesh27.
Fixes#58590.
git-svn-id: https://develop.svn.wordpress.org/trunk@56046 602fd350-edb4-49c9-b593-d223f7449a82
This removes the `$n` variable from `TwentyTwenty_Walker_Page` class `start_el()` function, removes an unused global and the last parameter from
`twentytwenty_filter_wp_list_pages_item_classes()` and `twentytwenty_add_sub_toggles_to_main_menu()`.
Props upadalavipul, sabernhardt, mukesh27.
Fixes#57371.
git-svn-id: https://develop.svn.wordpress.org/trunk@56045 602fd350-edb4-49c9-b593-d223f7449a82
Register all core blocks in a new function called `register_core_block_style_handles`. This mirrors the function `wp_default_styles` where all core styles are registered in one place. This improves block registration performance, as it avoids expensive file lookups, like realpath in `register_block_style_handle`. The new function `register_core_block_style_handles` uses `glob` to get all css files in the blocks directory. This glob is cached in a transient to save lookups on subsequent requests. The function `register_block_style_handle` now checks to see if the style handle is already registered before trying to register it again.
Props mukesh27, westonruter, flixos90, joemcgill, spacedmonkey.
Fixes#58528.
git-svn-id: https://develop.svn.wordpress.org/trunk@56044 602fd350-edb4-49c9-b593-d223f7449a82
In recent releases, WordPress core added several instances of cache usage around specific files. While those caches are safe to use in a production context, in development certain nuances apply for whether or not those caches make sense to use. Initially, `WP_DEBUG` was used as a temporary workaround, but it was clear that a more granular method to signify a specific development mode was required: For example, caches around `theme.json` should be disabled when working on a theme as otherwise it would disrupt the theme developer's workflow, but when working on a plugin or WordPress core, this consideration does not apply.
This changeset introduces a `WP_DEVELOPMENT_MODE` constant which, for now, can be set to either "core", "plugin", "theme", or an empty string, the latter of which means no development mode, which is also the default. A new function `wp_get_development_mode()` is the recommended way to retrieve that configuration value.
With the new function available, this changeset replaces all existing instances of the aforementioned `WP_DEBUG` workaround to use `wp_get_development_mode()` with a more specific check.
Props azaozz, sergeybiryukov, peterwilsoncc, spacedmonkey.
Fixes#57487.
git-svn-id: https://develop.svn.wordpress.org/trunk@56042 602fd350-edb4-49c9-b593-d223f7449a82
This changeset adds `description` to `VALID_TOP_LEVEL_KEYS` in `class-wp-theme-json.php` to allow for accessibility improvements. The description is added to
the ARIA label of the style variation container. If the style variation has no description, only the title is used. One purpose is to use the text description
to improve the style variation preview in the WordPress.org theme directory.
See https://github.com/WordPress/gutenberg/pull/45242.
Props ramonopoly, poena.
Fixes#58614.
--Cette ligne, et les suivantes ci-dessous, seront ignorées--
M trunk/src/wp-includes/class-wp-theme-json.php
git-svn-id: https://develop.svn.wordpress.org/trunk@56041 602fd350-edb4-49c9-b593-d223f7449a82
This changeset reverts [56034] as the Test Default Themes & Create ZIPs workflow is failing.
Follow-up to [56034], [56039].
See #58396.
git-svn-id: https://develop.svn.wordpress.org/trunk@56040 602fd350-edb4-49c9-b593-d223f7449a82
This changeset adds support for the `fetchpriority` attribute, which is typically added to a single image in each HTML response with a value of "high". This enhances load time performance (also Largest Contentful Paint, or LCP) by telling the browser to prioritize this image for downloading even before the layout of the page has been computed. In lab tests, this has shown to improve LCP performance by ~10% on average.
Specifically, `fetchpriority="high"` is added to the first image that satisfies all of the following conditions:
* The image is not lazy-loaded, i.e. does not have `loading="lazy"`.
* The image does not already have a (conflicting) `fetchpriority` attribute.
* The size of of the image (i.e. width * height) is greater than 50,000 squarepixels.
While these heuristics are based on several field analyses, there will always be room for optimization. Sites can customize the squarepixel threshold using a new filter `wp_min_priority_img_pixels` which should return an integer for the value.
Since the logic for adding `fetchpriority="high"` is heavily intertwined with the logic for adding `loading="lazy"`, yet the features should work decoupled from each other, the majority of code changes in this changeset is refactoring of the existing lazy-loading logic to be reusable. For this purpose, a new function `wp_get_loading_optimization_attributes()` has been introduced which returns an associative array of performance-relevant attributes for a given HTML element. This function replaces `wp_get_loading_attr_default()`, which has been deprecated. As another result of that change, a new function `wp_img_tag_add_loading_optimization_attrs()` replaces the more specific `wp_img_tag_add_loading_attr()`, which has been deprecated as well.
See https://make.wordpress.org/core/2023/05/02/proposal-for-enhancing-lcp-image-performance-with-fetchpriority/ for the original proposal and additional context.
Props thekt12, joemcgill, spacedmonkey, mukesh27, costdev, 10upsimon.
Fixes#58235.
git-svn-id: https://develop.svn.wordpress.org/trunk@56037 602fd350-edb4-49c9-b593-d223f7449a82
This fixes a bug in the Editor, where the Separator block did not support background color selections other than white and light gray.
Props nidhidhandhukiya, sabernhardt, shailu25, harshgajipara, mukesh27, costdev, zunaid321.
Fixes#58558.
git-svn-id: https://develop.svn.wordpress.org/trunk@56036 602fd350-edb4-49c9-b593-d223f7449a82
Computation of unresolvable version conflicts in the Gutenberg package
sync script had a few issues that were causing it to fail, among them
two type errors in the destructuring of function arguments.
Furthermore, de-duplication of required package versions was missing,
leading to false positives being reported, when multiple instances of
the same package all required the same version.
Props dmsnell.
Fixes#58628.
git-svn-id: https://develop.svn.wordpress.org/trunk@56035 602fd350-edb4-49c9-b593-d223f7449a82
This fixes a bug where the `margin-left: auto` property was being overwritten to `margin-left: 0` causing an inconsistency in the alignment of these blocks.
Props nkeller15, nadimcse, sabernhardt, tb1909, poena.
Fixes#58396.
git-svn-id: https://develop.svn.wordpress.org/trunk@56034 602fd350-edb4-49c9-b593-d223f7449a82
This allows developers to register scripts with an intended loading strategy by changing the `$in_footer` parameter of `wp_register_script` and `wp_enqueue_script` to an array that accepts both an `in_footer` and `strategy` argument. If present, the loading strategy attribute will be added to the script tag when that script is printed to the page as long as it is not a dependency of any blocking scripts, including any inline scripts attached to the script or any of its dependents.
Props 10upsimon, thekt12, westonruter, costdev, flixos90, spacedmonkey, adamsilverstein, azaozz, mukeshpanchal27, mor10, scep, wpnook, vanaf1979, Otto42.
Fixes#12009.
git-svn-id: https://develop.svn.wordpress.org/trunk@56033 602fd350-edb4-49c9-b593-d223f7449a82
`str_contains()` was introduced in PHP 8.0 to perform a case-sensitive check indicating if the string to search in (haystack) contains the given substring (needle).
WordPress core includes a polyfill for `str_contains()` on PHP < 8.0 as of WordPress 5.9.
This commit replaces `false !== strpos( ... )` with `str_contains()` in core files, making the code more readable and consistent, as well as better aligned with modern development practices.
Follow-up to [55988], [56021], [56031].
See #58206.
git-svn-id: https://develop.svn.wordpress.org/trunk@56032 602fd350-edb4-49c9-b593-d223f7449a82
`str_contains()` was introduced in PHP 8.0 to perform a case-sensitive check indicating if the string to search in (haystack) contains the given substring (needle).
WordPress core includes a polyfill for `str_contains()` on PHP < 8.0 as of WordPress 5.9.
This commit replaces `false !== strpos( ... )` with `str_contains()` in core files, making the code more readable and consistent, as well as better aligned with modern development practices.
Follow-up to [55988], [56021].
See #58206.
git-svn-id: https://develop.svn.wordpress.org/trunk@56031 602fd350-edb4-49c9-b593-d223f7449a82
Renames the Reusable blocks to Patterns and adds an option to convert a block or collection of blocks to a non-synced Pattern.
Props glendaviesnz, ramonopoly, peterwilsoncc, timothyblynjacobs, flixos90.
Fixes#58577.
git-svn-id: https://develop.svn.wordpress.org/trunk@56030 602fd350-edb4-49c9-b593-d223f7449a82
Removes additional wrapper introduced in [56025], which interfered with the site editor flex layout.
Props ramonopoly, kevin940726, joedolson.
Fixes 56228.
git-svn-id: https://develop.svn.wordpress.org/trunk@56029 602fd350-edb4-49c9-b593-d223f7449a82
Adds the ability to set link hover colors for individual blocks from the block inspector color panel.
Props @youknowriad, @peterwilsoncc, @kebbet.
Fixes#58575.
git-svn-id: https://develop.svn.wordpress.org/trunk@56028 602fd350-edb4-49c9-b593-d223f7449a82
Add a up/down arrow for visual affordance about the purpose of the button link; change button text from "Show details" to "More details".
Props krupajnanda, subrataemfluence, audrasjb, afercia, nrqsnchz, joedolson.
Fixes#44714.
git-svn-id: https://develop.svn.wordpress.org/trunk@56027 602fd350-edb4-49c9-b593-d223f7449a82
Follow up to [r56023]. Improve handling of breakpoint between 782 and 1000px for media grid view & repair styles for media modal search input.
Props kebbet, joedolson.
Fixes#57949.
git-svn-id: https://develop.svn.wordpress.org/trunk@56026 602fd350-edb4-49c9-b593-d223f7449a82
Add a fallback condition with heading and error notice to handle a no JavaScript state for the site editor, comparable to what already exists in the post editor.
Props afercia, joedolson, fencermonir, zebaafiashama, alexstine, rudlinkon.
Fixes#56228.
git-svn-id: https://develop.svn.wordpress.org/trunk@56025 602fd350-edb4-49c9-b593-d223f7449a82
Accessibly associate field description text with relevant input fields. Add `aria-describedby` and target IDs for each description field. Update privacy text note to better reflect relevancy to specific fields.
Props costdev, joedolson.
Fixes#58613.
git-svn-id: https://develop.svn.wordpress.org/trunk@56024 602fd350-edb4-49c9-b593-d223f7449a82
Move the visual positioning of the posts search form into it's DOM position. Fixes an accessibility bug where the keyboard focus sequence did not match the visual order. Change the media search form in list view to match the format of other post views. Give search forms a consistent layout on mobile.
Props oglekler, sabernhardt, joedolson.
Fixes#57949.
git-svn-id: https://develop.svn.wordpress.org/trunk@56023 602fd350-edb4-49c9-b593-d223f7449a82
Ensure that quick edit does not define a publish date if the post status is one of 'draft', 'pending', or 'auto-draft'.
Props uxtremist, SergeyBiryukov, Denis-de-Bernardy, jane, rfischmann, mista-flo, rutviksavsani, oglekler, joedolson.
Fixes#19907.
git-svn-id: https://develop.svn.wordpress.org/trunk@56022 602fd350-edb4-49c9-b593-d223f7449a82
`str_contains()` was introduced in PHP 8.0 to perform a case-sensitive check indicating if the string to search in (haystack) contains the given substring (needle).
WordPress core includes a polyfill for `str_contains()` on PHP < 8.0 as of WordPress 5.9.
This commit replaces `false !== strpos( ... )` with `str_contains()` in core files, making the code more readable and consistent, as well as better aligned with modern development practices.
Follow-up to [55988].
Props spacedmonkey.
See #58220.
git-svn-id: https://develop.svn.wordpress.org/trunk@56021 602fd350-edb4-49c9-b593-d223f7449a82
`str_starts_with()` and `str_ends_with()` were introduced in PHP 8.0 to perform a case-sensitive check indicating if the string to search in (haystack) begins or ends with the given substring (needle).
WordPress core includes a polyfill for these functions on PHP < 8.0 as of WordPress 5.9.
Follow-up to [55990], [56014], [56019].
See #58220.
git-svn-id: https://develop.svn.wordpress.org/trunk@56020 602fd350-edb4-49c9-b593-d223f7449a82
`str_starts_with()` and `str_ends_with()` were introduced in PHP 8.0 to perform a case-sensitive check indicating if the string to search in (haystack) begins or ends with the given substring (needle).
WordPress core includes a polyfill for these functions on PHP < 8.0 as of WordPress 5.9.
Follow-up to [55990], [56014].
See #58220.
git-svn-id: https://develop.svn.wordpress.org/trunk@56019 602fd350-edb4-49c9-b593-d223f7449a82
Add labels; change Enter new/Cancel link to a button; move focus to input when creating new field; move Add Custom Field out of fields table.
Props jane, batmoo, karmatosed, franrosa, sabernhardt, annashopina, oglekler, joedolson.
Fixes#15631.
git-svn-id: https://develop.svn.wordpress.org/trunk@56018 602fd350-edb4-49c9-b593-d223f7449a82
This resolves a WPCS error:
{{{
Use Yoda Condition checks, you must.
}}}
Follow-up to [56015], [56016].
See #58220.
git-svn-id: https://develop.svn.wordpress.org/trunk@56017 602fd350-edb4-49c9-b593-d223f7449a82
Prior to PHP 7.0, `substr( '', -0, 0 )` returns `false` instead of an empty string, so the strict comparison further in the function did not work as expected.
This commit addresses a test failure on PHP < 7.0, making the function consistently return `true` if both haystack and needle are an empty string.
Follow-up to [52040], [56014], [56015].
See #58220.
git-svn-id: https://develop.svn.wordpress.org/trunk@56016 602fd350-edb4-49c9-b593-d223f7449a82
This avoids a warning on PHP < 7.2.18 if haystack is an empty string:
{{{
Warning: substr_compare(): The start position cannot exceed initial string length
}}}
Follow-up to [52040], [55158], [55990], [56014].
See #58220.
git-svn-id: https://develop.svn.wordpress.org/trunk@56015 602fd350-edb4-49c9-b593-d223f7449a82
`str_ends_with()` was introduced in PHP 8.0 to perform a case-sensitive check indicating if the string to search in (haystack) ends with the given substring (needle).
WordPress core includes a polyfill for `str_ends_with()` on PHP < 8.0 as of WordPress 5.9.
Follow-up to [55990].
See #58220.
git-svn-id: https://develop.svn.wordpress.org/trunk@56014 602fd350-edb4-49c9-b593-d223f7449a82
Since both functions return the exact same thing, this changeset makes `twentyseventeen_is_static_front_page()` an alias of `twentyseventeen_is_frontpage()`
and updates the related docblocks and function callback.
Props mukesh27, soulseekah, swissspidy, sabernhardt, audrasjb, SergeyBiryukov, hareesh-pillai.
Fixes#43515.
git-svn-id: https://develop.svn.wordpress.org/trunk@56012 602fd350-edb4-49c9-b593-d223f7449a82
This changeset improves `update.js` by adding `is-enqueued` class to enqueued plugin updates to prevent users from asking for several updates for the same
plugin at the same time, which previously resulted to …an interesting experience.
Props bitnissen, swissspidy, MarcGuay, xkon, afercia, swissspidy, bookdude13, simonemanfre, vasilism, costdev, zunaid321.
Fixes#40966.
git-svn-id: https://develop.svn.wordpress.org/trunk@56009 602fd350-edb4-49c9-b593-d223f7449a82