Commit Graph

35017 Commits

Author SHA1 Message Date
audrasjb
955720d678 Users: Introduce the wp_update_user action.
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.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55583 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 16:27:29 +00:00
audrasjb
6f5741c348 Coding Standards: Fix a PHPCS issue found in wpPluginsListTable.php.
This fixes a previously existing issue, discovered after [56068].



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


git-svn-id: http://core.svn.wordpress.org/trunk@55582 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 16:11:26 +00:00
Mike Schroder
58fd744433 Filesystem API: Allow optional inclusion of hidden files in list_files().
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.
Built from https://develop.svn.wordpress.org/trunk@56069


git-svn-id: http://core.svn.wordpress.org/trunk@55581 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 16:08:27 +00:00
audrasjb
c11e87fbb8 Plugins: Introduce the plugins_list filter.
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.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55580 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 16:01:27 +00:00
audrasjb
b459be6a15 Menus: Allow themes and plugins to pass HTML attributes to various Nav Walker outputs.
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.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 15:26:27 +00:00
spacedmonkey
b80a8763c7 Database: Move the if statement outside of the loop.
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.
Built from https://develop.svn.wordpress.org/trunk@56066


git-svn-id: http://core.svn.wordpress.org/trunk@55578 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 14:35:29 +00:00
Bernhard Reiter
00401e16b3 Editor: update Wordpress npm packages.
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.
Built from https://develop.svn.wordpress.org/trunk@56065


git-svn-id: http://core.svn.wordpress.org/trunk@55577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 14:24:19 +00:00
spacedmonkey
c009f9d719 Script Loader: Fix performance issues in wp_common_block_scripts_and_styles.
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.
Built from https://develop.svn.wordpress.org/trunk@56064


git-svn-id: http://core.svn.wordpress.org/trunk@55576 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 11:28:28 +00:00
isabel_brison
d7bda1a6be Editor: allow filtering block patterns by source.
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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55575 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 11:13:27 +00:00
audrasjb
033bca66f8 Twenty Nineteen: Always set background color and foreground color together.
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.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55574 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 10:45:30 +00:00
spacedmonkey
b688be1c8c Options, Meta APIs: Prime network options in a single cache call using wp_cache_get_multiple.
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.
Built from https://develop.svn.wordpress.org/trunk@56061


git-svn-id: http://core.svn.wordpress.org/trunk@55573 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 10:41:30 +00:00
spacedmonkey
aa404f099e Themes: Block template is located twice in get_query_template().
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.
Built from https://develop.svn.wordpress.org/trunk@56060


git-svn-id: http://core.svn.wordpress.org/trunk@55572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 10:15:28 +00:00
isabel_brison
fbbe0f0a76 General: add block theme previews.
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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55571 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 09:36:21 +00:00
isabel_brison
d9e41aa9e9 Editor: refactor and stabilize selectors API.
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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55570 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 08:48:24 +00:00
audrasjb
e96961f861 Twenty Nineteen: Add fragment ID to paginated links.
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.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55569 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 08:11:23 +00:00
audrasjb
37ebdb8fa1 Site Health: Add server time debug data.
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.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55568 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 08:04:20 +00:00
isabel_brison
2e2aea02c2 Editor: stabilise layout and refactor definitions.
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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 07:25:22 +00:00
isabel_brison
c326f4855c Editor: navigation post preloading.
Adds a hook for preloading navigation posts in site editor.

Props get_dave, spacedmonkey, audrasjb, ramonopoly.
Fixes #58556.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55566 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 06:38:26 +00:00
isabel_brison
f3f4f7dd96 Editor: fix post edit navigation link.
Adds a custom link for navigation post types.

Props get_dave, spacedmonkey, ramonopoly.
Fixes #58589.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55565 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 06:02:22 +00:00
isabel_brison
161b471f0b Editor: add navigation fallback.
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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55564 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 05:54:19 +00:00
isabel_brison
54c97ab015 REST API: ignore empty templates.
Ignore empty templates when using the `/lookup` endpoint in the `WP_REST_Templates_Controller` class.

Props ramonopoly, jorgefilipecosta, spacedmonkey, youknowriad, mukesh27.
Fixes #58615.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 05:36:22 +00:00
Dion Hulse
6619429fc3 Upgrade/Install: Pass the full database version string to WordPress.org for parsing.
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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55562 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 05:11:27 +00:00
Joe McGill
e4c45c53b7 Revert unnecessary changes to .jshintrc files.
This reverts changes to the .jshintrc file that were included in r56033.

Props TobiasBg.
See #12009.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55561 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 01:29:22 +00:00
Peter Wilson
9f7555f5d5 Editor: Update block-serialization-default-parser package for WP 6.3 Beta 1.
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.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 00:45:38 +00:00
isabel_brison
7696e271f8 Editor: add iframe around post editor.
Adds an iframe around the post editor only if all registered blocks are v3 or higher.

Props ellatrix, mukesh27, costdev, oandregal, ramonopoly.
Fixes #58626.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-27 00:23:23 +00:00
isabel_brison
4e0fbeb04c Editor: add box shadow support to blocks.
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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-26 23:44:29 +00:00
audrasjb
1d66cc61ef Twenty Twenty: Remove various unused function parameters and variables.
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.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-26 21:33:23 +00:00
spacedmonkey
6adb9be81f Editor: Register core block styles in one place.
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.
Built from https://develop.svn.wordpress.org/trunk@56044


git-svn-id: http://core.svn.wordpress.org/trunk@55556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-26 21:17:22 +00:00
audrasjb
d61ec19da0 Posts, Post Types: Add a $previous_status parameter to wp_trash_post() related hooks.
This adds a `$previous_status` parameter to the `pre_trash_post`, `wp_trash_post`, and `trashed_post` hooks.

Props mujuonly, mukesh27, nihar007, dhruvishah2203, SergeyBiryukov, costdev, hugod, audrasjb, oglekler.
Fixes #58392.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55555 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-26 20:57:22 +00:00
Felix Arntz
13a38d84f9 General: Introduce WP_DEVELOPMENT_MODE constant to signify context-specific development mode.
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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-26 19:57:25 +00:00
audrasjb
ddd50e3782 Editor: Add a description key to theme.json style variations.
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

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


git-svn-id: http://core.svn.wordpress.org/trunk@55553 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-26 18:15:22 +00:00
audrasjb
6b47f4d436 Twenty Twenty: Revert [56034] pending further investigation.
This changeset reverts [56034] as the Test Default Themes & Create ZIPs workflow is failing.

Follow-up to [56034], [56039].

See #58396.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55552 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-26 17:29:21 +00:00
audrasjb
abcb0a0f35 Twenty Twenty: Fix an RTL style issue leading to failed Test Default Themes & Create ZIPs workflow.
Follow-up to [56034].

Props sabernhardt, davidbaumwald.
Fixes #58396.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-26 17:01:47 +00:00
Weston Ruter
33f71c4662 Editor: Use static closures to avoid memory leaks.
Backports Gutenberg changes from https://github.com/WordPress/gutenberg/pull/50723.

Amends [55822].

Fixes #58323.
Props westonruter, spacedmonkey, flixos90. 

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


git-svn-id: http://core.svn.wordpress.org/trunk@55550 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-26 17:00:25 +00:00
Felix Arntz
5ca27acd20 Media: Automatically add fetchpriority="high" to hero image to improve load time performance.
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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55549 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-26 16:17:23 +00:00
audrasjb
e8d4e05333 Twenty Nineteen: Ensure Separator block supports theme colors in editor.
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.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55548 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-26 15:50:23 +00:00
Bernhard Reiter
af31e18ab4 Tools: Fix unresolvable conflicts computation in package sync script.
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.
Built from https://develop.svn.wordpress.org/trunk@56035


git-svn-id: http://core.svn.wordpress.org/trunk@55547 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-26 15:43:30 +00:00
audrasjb
5914cb8939 Twenty Twenty: Fix left margin in Latest Posts & Latest Comments blocks.
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.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-26 15:06:25 +00:00
Joe McGill
53e7cc3ddf Script Loader: Add support for HTML 5 "async" and "defer" attributes.
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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-26 13:42:23 +00:00
Sergey Biryukov
28e2911898 Code Modernization: Use str_contains() in a few more places.
`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.
Built from https://develop.svn.wordpress.org/trunk@56032


git-svn-id: http://core.svn.wordpress.org/trunk@55544 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-26 10:44:23 +00:00
Sergey Biryukov
ad16732d27 Code Modernization: Use str_contains() in a few more places.
`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.
Built from https://develop.svn.wordpress.org/trunk@56031


git-svn-id: http://core.svn.wordpress.org/trunk@55543 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-26 10:17:25 +00:00
isabel_brison
69f9f902aa Editor: rename reusable blocks to patterns.
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.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55542 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-26 08:57:25 +00:00
isabel_brison
8a03512912 Editor: fix site editor layout bug.
Removes additional wrapper introduced in [56025], which interfered with the site editor flex layout.

Props ramonopoly, kevin940726, joedolson.
Fixes 56228.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55541 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-26 04:48:24 +00:00
isabel_brison
2fbd7aeb8f Editor: add support for block-level link hover colors.
Adds the ability to set link hover colors for individual blocks from the block inspector color panel.

Props @youknowriad, @peterwilsoncc, @kebbet.
Fixes #58575.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55540 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-26 01:15:21 +00:00
joedolson
c4a22d5a34 Upgrade/Install: Update 'show details' button change.
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.
Built from https://develop.svn.wordpress.org/trunk@56027


git-svn-id: http://core.svn.wordpress.org/trunk@55539 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-25 22:57:26 +00:00
joedolson
993e1093eb Administration: Fix visual regression in media search input.
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.
Built from https://develop.svn.wordpress.org/trunk@56026


git-svn-id: http://core.svn.wordpress.org/trunk@55538 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-25 21:13:21 +00:00
joedolson
5fc049a79c Editor: Add no-js fallback for site editor.
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.
Built from https://develop.svn.wordpress.org/trunk@56025


git-svn-id: http://core.svn.wordpress.org/trunk@55537 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-25 19:54:22 +00:00
joedolson
8d987eef49 Upgrade/Install: Add aria-describedby for input descriptions.
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.
Built from https://develop.svn.wordpress.org/trunk@56024


git-svn-id: http://core.svn.wordpress.org/trunk@55536 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-25 18:44:23 +00:00
joedolson
abc3ea5422 Administration: Consistent positioning and size of search form.
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.
Built from https://develop.svn.wordpress.org/trunk@56023


git-svn-id: http://core.svn.wordpress.org/trunk@55535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-25 17:21:28 +00:00
joedolson
69692d50cb Quick/Bulk Edit: Don't set publish date when editing drafts.
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.
Built from https://develop.svn.wordpress.org/trunk@56022


git-svn-id: http://core.svn.wordpress.org/trunk@55534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-25 15:20:22 +00:00
Sergey Biryukov
c2603744aa Code Modernization: Use str_contains() in a few more places.
`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.
Built from https://develop.svn.wordpress.org/trunk@56021


git-svn-id: http://core.svn.wordpress.org/trunk@55533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-25 10:50:24 +00:00
Sergey Biryukov
e28f97b887 Code Modernization: Use str_starts_with() and str_ends_with() in a few more places.
`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.
Built from https://develop.svn.wordpress.org/trunk@56020


git-svn-id: http://core.svn.wordpress.org/trunk@55532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-24 17:17:23 +00:00
Sergey Biryukov
32e94b4de1 Code Modernization: Use str_starts_with() and str_ends_with() in a few more places.
`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.
Built from https://develop.svn.wordpress.org/trunk@56019


git-svn-id: http://core.svn.wordpress.org/trunk@55531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-24 16:50:24 +00:00
joedolson
b3eb7b301c Editor: Improve accessibility of new custom field UI.
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.
Built from https://develop.svn.wordpress.org/trunk@56018


git-svn-id: http://core.svn.wordpress.org/trunk@55530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-24 14:32:20 +00:00
Sergey Biryukov
9a33056097 Coding Standards: Use Yoda condition in str_ends_with().
This resolves a WPCS error:
{{{
Use Yoda Condition checks, you must.
}}}

Follow-up to [56015], [56016].

See #58220.
Built from https://develop.svn.wordpress.org/trunk@56017


git-svn-id: http://core.svn.wordpress.org/trunk@55529 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-24 13:54:23 +00:00
Sergey Biryukov
e0ffbee0aa General: Return early from str_ends_with() polyfill if both haystack and needle are empty.
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.
Built from https://develop.svn.wordpress.org/trunk@56016


git-svn-id: http://core.svn.wordpress.org/trunk@55528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-24 13:40:21 +00:00
Sergey Biryukov
848e8cbaec General: Replace substr_compare() usage in the str_ends_with() polyfill.
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.
Built from https://develop.svn.wordpress.org/trunk@56015


git-svn-id: http://core.svn.wordpress.org/trunk@55527 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-24 13:02:23 +00:00
Sergey Biryukov
cded028e59 Code Modernization: Use str_ends_with() in a few more places.
`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.
Built from https://develop.svn.wordpress.org/trunk@56014


git-svn-id: http://core.svn.wordpress.org/trunk@55526 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-24 09:52:19 +00:00
audrasjb
6628bb32a3 Administration: Reduce translation calls after [55969].
Follow-up to [55969].

Props swissspidy, sabernhardt.
Fixes #57675.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55525 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-24 05:30:21 +00:00
audrasjb
62416ac9ce Twenty Seventeen: Make twentyseventeen_is_static_front_page() an alias of twentyseventeen_is_frontpage().
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.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55524 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-24 05:14:19 +00:00
audrasjb
58341e16ce Coding Standards: Fix undeclared variable issue.
Follow-up to [56009], [56010].

See #40966.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55523 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-24 04:22:25 +00:00
audrasjb
3c84117a95 Coding Standards: Fix missing semicolon after [56009].
See #40966.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-24 04:10:23 +00:00
audrasjb
c77c814942 Upgrade/Install: Prevent users from sending multiple bulk plugin updates.
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.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55521 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-24 04:00:30 +00:00
joedolson
549163d3e9 Upgrade/Install: Show/hide toggle on password fields.
Add a show/hide toggle for new passwords in initial user creation and database access during install and setup process using the same model as on user profiles. Add a new password toggle script. Change setup config table to two columns, matching the install table layout.

Props xmarcos, matt, markjaquith, nazgul, akbigdog, intoxination, rob1n, MichaelH, empireoflight, rmccue, markoheijnen, r0uter, amansurov, bi0xid, DrewAPicture, Narthur, wpnook, markparnell, costdev, clorith, ryokuhi, sabernhardt, bgoewert, ironprogrammer, adeltahri, joedolson, mukesh27, audrasjb, sergeybiryukov.
Fixes #3534.
Built from https://develop.svn.wordpress.org/trunk@56008


git-svn-id: http://core.svn.wordpress.org/trunk@55520 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-23 23:09:29 +00:00
Sergey Biryukov
41361625fa Bootstrap/Load: Require wp-includes/compat.php earlier in wp-settings.php.
This allows for using polyfill functions in more files, including the `advanced-cache.php` drop-in.

Follow-up to [6108], [46183], [55988], [55990], [56006].

See #58206.
Built from https://develop.svn.wordpress.org/trunk@56007


git-svn-id: http://core.svn.wordpress.org/trunk@55519 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-23 20:06:24 +00:00
Sergey Biryukov
83351a7243 Bootstrap/Load: Require wp-includes/compat.php in wp-load.php.
This allows for using polyfill functions if the site is not installed yet.

Follow-up to [28978], [55988].

Props joedolson, dd32.
See #58206.
Built from https://develop.svn.wordpress.org/trunk@56006


git-svn-id: http://core.svn.wordpress.org/trunk@55518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-23 19:54:23 +00:00
Felix Arntz
df12352e16 Editor: Fix block editor styles being registered with frontend stylesheets.
This changeset fixes a bug where WordPress core's own block editor styles (`wp-block-{$block_name}-editor`) were referencing the same CSS files as their frontend equivalents (`wp-block-{$block_name}`). This would result in incorrect frontend styles potentially being loaded in the block editor.

Tests for the related logic have been added.

Props flixos90, joemcgill, mukesh27, spacedmonkey.
Fixes #58605.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55517 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-23 19:01:24 +00:00
joedolson
d1717e60b9 Administration: Backwards compatibility for new sortable keys.
Replace use of `list` to parse array keys into variables. `list` throws errors if the keys don't exist, and many extenders will not define the new array keys. The code path already falls back effectively for empty values.

Also add translator comments to screen reader hidden text, fix a docblock, and fix an HTML error.

Follow up to [r55971].

Props kebbet, chouby, joedolson.
Fixes #32170.
Built from https://develop.svn.wordpress.org/trunk@56004


git-svn-id: http://core.svn.wordpress.org/trunk@55516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-23 17:49:28 +00:00
Pascal Birchler
72fda0359f I18N: Ensure determine_locale() does not potentially return an empty string.
Call `get_locale()` as a last resort in case the sanitized locale is an empty string.

Also swaps conditionals to cater for more typical use case and adds tests.

Follow-up to [55862]

Props Cybr, swissspidy.
Fixes #58317.
Built from https://develop.svn.wordpress.org/trunk@56003


git-svn-id: http://core.svn.wordpress.org/trunk@55515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-23 16:03:25 +00:00
Sergey Biryukov
6efef07ff8 Script Loader: Replace str_contains() usage in wp-includes/script-loader.php.
This avoids fatal errors on PHP < 8.0 if the file is included via `wp-admin/load-scripts.php` or `wp-admin/load-styles.php`, in which case the polyfills from `wp-includes/compat.php` are not loaded.

Follow-up to [55703], [55710], [55988].

Props ryelle.
See #58206.
Built from https://develop.svn.wordpress.org/trunk@56002


git-svn-id: http://core.svn.wordpress.org/trunk@55514 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-23 15:45:21 +00:00
audrasjb
73922adc1e Upgrade/Install: Move location of $upgrade_notice for better consistency.
Since the `$auto_upgrade_notice` has been added to the `update-core.php` table listing if an `$upgrade_notice` is present by virtue of the `readme.txt` 
containing data in the `== Upgrade Notice ==` section, this text will appear in between the compatibility information and the auto update information.

This changeset provides a more consistent appearance in the interface.

Props afragen, costdev, zunaid321.
Fixes #57939.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-23 15:03:22 +00:00
audrasjb
f50a00bce4 Twenty Twenty: Fix Letter Case implementation.
This changeset fixes Letter Case control implementation on the Button block, on both front-end and in the Editor.

Props thakordarshil, pateljaymin, sabernhardt, panchalhimani711, mukesh27.
See #58526.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-23 14:53:24 +00:00
audrasjb
5c0b2fb6d6 Twenty Sixteen: Fix Letter Case implementation.
This changeset fixes Letter Case control implementation on the Button block, on both front-end and in the Editor.

Props thakordarshil, pateljaymin, sabernhardt, panchalhimani711, mukesh27.
See #58526.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55511 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-23 14:45:20 +00:00
audrasjb
199961962a Twenty Fifteen: Fix Letter Case implementation.
This changeset fixes Letter Case control implementation on the Button block, on both front-end and in the Editor.

Props thakordarshil, pateljaymin, sabernhardt, panchalhimani711, mukesh27.
See #58526.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55510 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-23 14:42:19 +00:00
audrasjb
730c198901 Twenty Fourteen: Fix Letter Case implementation.
This changeset fixes Letter Case control implementation on the Button block, on both front-end and in the Editor.

Props thakordarshil, pateljaymin, sabernhardt, panchalhimani711, mukesh27.
See #58526.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55509 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-23 14:40:22 +00:00
audrasjb
547f6aadcb Themes: Allow non-block themes to add theme support for link color settings.
This changeset themes without theme.json to opt-in to block link color tools via `add_theme_support( 'link-color' );`.

Follow-up to [55067], [55273].

Props poena, audrasjb.
Fixes #58597.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55508 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-23 13:50:20 +00:00
audrasjb
a7dd1ad7d6 Themes: Allow non-block themes to add theme support for border settings.
This changeset allows themes without `theme.json` to opt-in to block border tools via `add_theme_support( 'border' );`.

Follow-up to [55067], [55273].

Props poena, audrasjb.
Fixes #58598.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55507 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-23 13:37:26 +00:00
Sergey Biryukov
3e3c741d08 Database: Replace str_contains() and str_ends_with() usage in wpdb methods.
This avoids fatal errors on PHP < 8.0 if the file is included directly outside of WordPress core, e.g. by HyperDB.

While WordPress core does include polyfills for these functions, they are not directly loaded in the `wpdb` class.

Follow-up to [54384], [55157], [55158], [55988], [55990].

Props dd32, ryelle, joedolson.
See #58206.
Built from https://develop.svn.wordpress.org/trunk@55994


git-svn-id: http://core.svn.wordpress.org/trunk@55506 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-23 12:17:24 +00:00
oandregal
cbe4f15279 Fix block template utils test: use template part instead of template object.
Note that the PHP unit tests didn't fail in the CI job because the date for both the template and template part was the same.

Props ramonopoly.
Fixes #58540.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55505 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-23 09:30:19 +00:00
isabel_brison
19dda6b262 REST API: return post modified datetime for Templates.
Adds a `modified` field to the template and template part objects in the rest response for `WP_REST_Templates_Controller`.

Props ramonopoly, andrewserong, mukesh27, timothyblynjacobs.
Fixes #58540.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55504 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-23 06:29:23 +00:00
Peter Wilson
bfce1cef9a Build/Test Tools: Store artefacts of failing E2E test runs.
Modify the E2E workflow to store the screenshots and HTML files generated during failing tests as an artifact in the workflow.

No artefact is stored for passing test runs.

Props peterwilsoncc, isabel_brison.
Fixes #58596.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55503 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-22 22:37:24 +00:00
Sergey Biryukov
84e9601e5a Code Modernization: Replace usage of substr() with str_starts_with() and str_ends_with().
`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.

This commit uses `str_starts_with()` and `str_ends_with()` in core files where appropriate:
* `$needle === substr( $string, 0, $length )`, where `$length` is the length of `$needle`, is replaced with `str_starts_with( $haystack, $needle )`.
* `$needle === substr( $string, $offset )`, where `$offset` is negative and the absolute value of `$offset` is the length of `$needle`, is replaced with `str_ends_with( $haystack, $needle )`.

This aims to make the code more readable and consistent, as well as better aligned with modern development practices.

Follow-up to [52039], [52040], [52326], [55703], [55710], [55987], [55988].

Props Soean, spacedmonkey, Clorith, ocean90, azaozz, sabernhardt, SergeyBiryukov.
Fixes #58220.
Built from https://develop.svn.wordpress.org/trunk@55990


git-svn-id: http://core.svn.wordpress.org/trunk@55502 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-22 14:57:24 +00:00
joedolson
372d9c07e5 Administration: Fix password layout for RTL and mobile.
Adjust hide password field to be full width on mobile and remove 5rem left padding inside input.

Props sabernhardt.
Fixes #9883.
Built from https://develop.svn.wordpress.org/trunk@55989


git-svn-id: http://core.svn.wordpress.org/trunk@55501 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-22 14:38:19 +00:00
Sergey Biryukov
1ce5dc7444 Code Modernization: Replace usage of strpos() with str_contains().
`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 [52039], [52040], [52326], [55703], [55710], [55987].

Props Soean, spacedmonkey, costdev, dingo_d, azaozz, mikeschroder, flixos90, peterwilsoncc, SergeyBiryukov.
Fixes #58206.
Built from https://develop.svn.wordpress.org/trunk@55988


git-svn-id: http://core.svn.wordpress.org/trunk@55500 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-22 14:36:26 +00:00
Sergey Biryukov
b916b71dde Code Modernization: Use str_starts_with() in WP_Theme_JSON class methods.
This aims to make the code more readable and consistent, as the function is already used extensively in core files.

WordPress core includes a polyfill for `str_starts_with()` on PHP < 8.0 as of WordPress 5.9.

Follow-up to [55703], [55959].

Props spacedmonkey.
Fixes #58012.
Built from https://develop.svn.wordpress.org/trunk@55987


git-svn-id: http://core.svn.wordpress.org/trunk@55499 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-22 14:14:25 +00:00
oandregal
f3ea3c57cb wp_get_global_styles: allow transforming the CSS Custom Properties into the values they represent.
Props samnajian, ramonopoly, isabel_brison.
Fixes #58588.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55498 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-22 08:44:26 +00:00
isabel_brison
2183172222 Editor: add text columns to typography support.
Adds a text columns feature to the typography block support that uses CSS `column-count` for multi-column text.

Props ramonopoly, aaronrobertshaw.
Fixes #58549.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55497 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-22 08:18:19 +00:00
audrasjb
a8efd010bd Help/About: Improve Dashboard screen options behavior on small screens.
This changeset improve Dashboard screen options by stacking them vertically on small screens.

Props dhrumilk, prashantbhivsane, marybaum, dhruvishah2203, ababir, mukesh27, chiragrathod103, oglekler, tb1909, jahidcse, audrasjb.
Fixes #57977.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55496 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-22 07:54:23 +00:00
oandregal
045b72564b Rename wp_get_remote_patterns to wp_get_theme_directory_pattern_slugs.
Props dd32, ntsekouras.

Fixes #58460.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55495 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-22 07:16:19 +00:00
audrasjb
eac207ed52 Twenty Thirteen: Remove IE specific resources.
This changeset switches the `wp_enqueue_*` functions to `wp_register_*` for IE-related resources, which maintains handles, source references, etc., keeps all 
IE-specific files within the theme package to avoid errors, and requires site admins to opt in to loading them in the theme.

It also replaces the content of `html5.js` shiv with a comment (to avoid 404s), and removes IE specific code from `header.php`.

Props desrosj, sabernhardt, audrasjb, neychok, oglekler.
See #56699.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55494 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-22 06:22:23 +00:00
audrasjb
7df806c930 Twenty Fifteen: Remove IE specific resources.
This changeset switches the `wp_enqueue_*` functions to `wp_register_*` for IE-related resources, which maintains handles, source references, etc., keeps all 
IE-specific files within the theme package to avoid errors, and requires site admins to opt in to loading them in the theme.

It also replaces the content of `html5.js` shiv with a comment (to avoid 404s), removes IE-specific code in general stylesheets, and removes IE specific code 
from Customizer, header.php and custom-header.php.

Props desrosj, sabernhardt, audrasjb, neychok, oglekler.
See #56699.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-22 06:11:26 +00:00
audrasjb
5cf8f0125b Twenty Seventeen: Remove IE specific resources.
This changeset switches the `wp_enqueue_*` functions to `wp_register_*` for IE-related resources, which maintains handles, source references, etc., keeps all 
IE-specific files within the theme package to avoid errors, and requires site admins to opt in to loading them in the theme.

It also replace the content of `html5.js` shiv with a comment (to avoid 404s) and removes IE-specific code in general stylesheets.

Props desrosj, sabernhardt, audrasjb, neychok, oglekler.
See #56699.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55492 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-22 06:01:25 +00:00
Sergey Biryukov
d28b747cfd Tests: Update the test for pre_wp_setup_nav_menu_item filter.
This ensures that not only is the filter applied in `wp_setup_nav_menu_item()`, but also the actual output is tested.

Follow-up to [55867], [55868].

Props azaozz, ugyensupport.
Fixes #56577.
Built from https://develop.svn.wordpress.org/trunk@55979


git-svn-id: http://core.svn.wordpress.org/trunk@55491 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-22 05:55:19 +00:00
audrasjb
c176dfe21e Twenty Ten: Improve Pullquote block line height for better readability.
Props melchoyce, sabernhardt, ugyensupport, Heiko_Mamerow, pooja1210.
Fixes #52546.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55490 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-22 05:35:21 +00:00
audrasjb
017d2df5d0 Administration: Replace contracted verb forms for better consistency.
Previously: [52979], [52978].
Props sabernhardt.
See #30796.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55489 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-22 05:25:29 +00:00
Peter Wilson
98ec0401b6 Build/Test Tools: Update URL of theme unit test data.
Update the performance tests to account for the relocation of the theme unit test data repository to the WordPress organisation on GitHub.

Props costdev, kafleg, williampatton, dd32, otto42, poena, jrf, joemcgill, peterwilsoncc, mukesh27.
Fixes #58569.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55488 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-22 04:21:22 +00:00
isabel_brison
cf320a85d3 Editor: add grid layout type
Add a new `grid` type to the layout block support.

Props andrewserong, costdev, ramonopoly.
Fixes #58554.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55487 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-22 04:06:26 +00:00
joedolson
2d7dafe2b8 Administration: Hide password in options/writing.
Hide the password for the "Post via e-mail" settings in writing options. Use the same password hiding mechanisms in use elsewhere in core.

Props mastrup, denis-de-bernardy, ryan, brookedot, wojtek.szkutnik, dd32, sabreuse, sergeybiryukov, costdev, peterwilsoncc, zgrkaralar, clorith, renyot, sabernhardt, boniu91, ironprogrammer, bgoewert.
Fixes #9883.
Built from https://develop.svn.wordpress.org/trunk@55974


git-svn-id: http://core.svn.wordpress.org/trunk@55486 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-22 00:32:21 +00:00
audrasjb
fe6a2cc7d9 Twenty Thirteen: Remove an unnecessary border from Table block.
This changeset removes an unwanted border showing up at the bottom of the Table block.

Props nidhidhandhukiya, sabernhardt, maxcgparis, pooja1210, audrasjb.
Fixes #56538.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55485 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-21 22:55:26 +00:00
audrasjb
444733ed27 Twenty Nineteen: Fix a JS coding standard issue found after [55970].
Follow-up to [55970].

See #46474.



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


git-svn-id: http://core.svn.wordpress.org/trunk@55484 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-21 21:54:22 +00:00