This changeset introduces the `wp_update_user` action hook, which fires after the user has been updated and emails have been sent.
Props tanner-m, desrosj, lphoumpakka, oglekler, audrasjb, azzaoz.
Fixes#57843.
git-svn-id: https://develop.svn.wordpress.org/trunk@56071 602fd350-edb4-49c9-b593-d223f7449a82
Adds a new optional `$include_hidden` parameter to allow the inclusion of hidden (`.` prefixed) files.
Defaults to false for backward compatibility.
Props yani.iliev, sabernhardt, costdev, rutviksavsani, zunaid321, azaozz.
Fixes#53659.
git-svn-id: https://develop.svn.wordpress.org/trunk@56069 602fd350-edb4-49c9-b593-d223f7449a82
This changeset adds the `plugins_list` hook, which can be use to filter the list of plugin displayed on WP Admin Plugins screen.
Props nateallen, fischfood, mukesh27, peterwilsoncc, SergeyBiryukov, audrasjb, costdev, ecorica, zunaid321.
Fixes#57278.
git-svn-id: https://develop.svn.wordpress.org/trunk@56068 602fd350-edb4-49c9-b593-d223f7449a82
This introduces a new set of hooks that can be used to filter various HTML elements of the Nav Walker, in order to output the desired HTML attributes:
- List items: `nav_menu_item_attributes`
- Submenu `<ul>` element: `nav_menu_submenu_attributes`
Props davidwebca, danyk4, costdev, peterwilsoncc, audrasjb, oglekler.
Fixes#57140.
git-svn-id: https://develop.svn.wordpress.org/trunk@56067 602fd350-edb4-49c9-b593-d223f7449a82
In the foreach loop of last results, move the if statement outside of the loop. There is no need to check every element in the array for the output type. Do this once outside of the loop. For large database queries with lots of rows returned, this should improve PHP performance.
Props spacedmonkey, Cybr, johnbillion, costdev, joemcgill.
Fixes#56541.
git-svn-id: https://develop.svn.wordpress.org/trunk@56066 602fd350-edb4-49c9-b593-d223f7449a82
Updates the wordpress npm packages and their dependencies to the latest versions, as well as auto-updates to relevant core PHP files.
Props youknowriad, joemcgill, spacedmonkey, ramonopoly, peterwilsoncc, bernhard-reiter, tyxla, dmsnell.
Fixes#58623.
git-svn-id: https://develop.svn.wordpress.org/trunk@56065 602fd350-edb4-49c9-b593-d223f7449a82
In [52069] the function `wp_common_block_scripts_and_styles` was changed load individual theme stylesheets, if the current theme supports block styles and loading separate core block assets. To do this, the function calls many expensive file operation functions, such as `glob`, `file_exists` and `file_get_contents`. This is wasteful, as these functions are loaded on every page request, even request that do not include blocks, like REST API calls. In [56044] all core block styles are registered in a single place. In `register_core_block_style_handles` calls `glob` to get all css styles in block directories. While registering style and editor styles, also register block theme styles, under a new style handle. Example `wp-block-avatar-theme`. If the current theme supports block styles, also request the block to enqueue the theme style on the front end. As these new stylesheets have a path attribute set, the function `wp_maybe_inline_styles` will automatically inline the styles for you.
Props spacedmonkey, flixos90, oandregal, costdev, audrasjb, mukesh27.
Fixes#58560.
git-svn-id: https://develop.svn.wordpress.org/trunk@56064 602fd350-edb4-49c9-b593-d223f7449a82
Extends the REST API endpoint for block patterns to provide a source attribute that can be used to filter patterns.
Props aaronrobertshaw, mukesh27, talldanwp, ramonopoly.
Fixes 58622.
git-svn-id: https://develop.svn.wordpress.org/trunk@56063 602fd350-edb4-49c9-b593-d223f7449a82
On the `<body>` element, as a best practice background color and text color should always be set together. This makes it easier to quickly understand the
underlying color scheme.
Follow-up to [55960], [55964].
Props sabernhardt, audrasjb, kebbet.
Fixes#45916.
git-svn-id: https://develop.svn.wordpress.org/trunk@56062 602fd350-edb4-49c9-b593-d223f7449a82
Tweak the `wp_load_core_site_options` function, to also prime network options using `wp_cache_get_multiple` if persistent object cache is present.
Props mukesh27, oglekler, peterwilsoncc, costdev, jeremyfelt, spacedmonkey.
Fixes#56913.
git-svn-id: https://develop.svn.wordpress.org/trunk@56061 602fd350-edb4-49c9-b593-d223f7449a82
When the function `_template_loader_filters` was ported to core from gutenberg, it retained the filter to load block templates. However, the function `locate_block_template` is called manually in `get_query_template`, so this filter is not needed. Calling `locate_block_template` twice, results in performance issue, as `locate_block_template` is a expensive function to run, as it does database and file lookups.
Props dlh, mukesh27, flixos90, SergeyBiryukov, bernhard-reiter, spacedmonkey.
Fixes#58299.
git-svn-id: https://develop.svn.wordpress.org/trunk@56060 602fd350-edb4-49c9-b593-d223f7449a82
Adds a preview link to block themes in the themes screen, opening the previews in the site editor.
Props onemaggie, andraganescu, audrasjb, flixos90, peterwilsoncc, spacedmonkey, scruffian.
Fixes#58561.
git-svn-id: https://develop.svn.wordpress.org/trunk@56059 602fd350-edb4-49c9-b593-d223f7449a82
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