Commit Graph

35045 Commits

Author SHA1 Message Date
Sergey Biryukov
e1ada2ac21 Twenty Twenty-Three: Remove redundant px unit in a few inline styles.
Follow-up to [54312], [54629].

Props ankitmaru.
Fixes #58485.
Built from https://develop.svn.wordpress.org/trunk@55898


git-svn-id: http://core.svn.wordpress.org/trunk@55410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-08 14:00:20 +00:00
Pascal Birchler
3077d883cf Embeds: Add support for TikTok creator profiles.
Follow-up to initial support in [47216] / #49083.

Props mukesh27, anveshika, Ankit K Gupta.
Fixes #55784.
Built from https://develop.svn.wordpress.org/trunk@55897


git-svn-id: http://core.svn.wordpress.org/trunk@55409 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-08 13:28:20 +00:00
joedolson
5bb4f1dcd7 Media: Fix CSS layout issues in Replace media dialog.
Make focus outline fully visible at all media query breakpoints, prevent the date filter from becoming hidden, and match the heading styles to other screens.

Props sabernhardt, hareesh-pillai, alvitazwar052.
Fixes #54395.
Built from https://develop.svn.wordpress.org/trunk@55896


git-svn-id: http://core.svn.wordpress.org/trunk@55408 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-08 11:16:18 +00:00
Dominik Schilling
dbf0e1bf9e Query: Allow queries by wp_dashboard_recent_posts() to be cached.
Set the `cache_results` argument to `true` for `WP_Query` to ensure the posts queries on the dashboard can also be cached.

Props benjgrolleau.
Fixes #57055.
Built from https://develop.svn.wordpress.org/trunk@55895


git-svn-id: http://core.svn.wordpress.org/trunk@55407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-08 10:02:24 +00:00
Aaron Jorbin
1031b96997 Multisite: Require a site title when a site is created
The UI for adding a site says that title is required, however the actual code wasn't requiring it.

Props ideag.
Fixes #54012.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55406 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-08 09:07:20 +00:00
audrasjb
759544181d Docs: Mark apply_filters() third parameter $args as optional.
The `$args` parameter of `apply_filters()` is optional. This changeset updates the related Docblock description accordingly so the parameter is not marked as 
`required` on DevHub.

Props gaeldenysiak, audrasjb, gilles66.
Fixes #58481.
See #57840.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55405 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-08 07:54:22 +00:00
audrasjb
f6ee7d285f Users: Use type="hidden" for hidden input on User edit administration panel.
This hidden field added in [24552] to fix an issue with Chrome that was ignoring `autocomplete="off"` in `<input>`, by using a hidden, non-named, non-empty 
input right before the password field. However this input was only hidden via CSS and didn't have any label, which is considered as an accessibility issue. 
This changeset replaces `class="hidden"` with `type="hidden"` to properly indicate to user agents that it is an hidden field.

Follow-up to [24552].

Props smit08, audrasjb, sabernhardt, ryokuhi, tushar284, ashikurwp, siddhantwadhwani, pavanpatil1.
Fixes #56776.
 --Cette ligne, et les suivantes 
ci-dessous, seront ignorées--

M    trunk/src/wp-admin/user-edit.php
M    trunk/src/wp-admin/user-new.php

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


git-svn-id: http://core.svn.wordpress.org/trunk@55404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-07 21:25:18 +00:00
danielbachhuber
f08039702e Bootstrap/Load: Revert [55890].
As it turns out, WP-CLI *also* doesn't `define( 'WP_USE_THEMES', true );`, which means an active theme's `functions.php` isn't loaded by default and causes a backwards compatibility break.

See #57928.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-07 20:29:19 +00:00
danielbachhuber
88461977b1 Load: Avoid loading a theme's functions.php when ! wp_using_themes().
Updates `wp_get_active_and_valid_themes()` to return early when `wp_using_themes()` returns `false`. This prevents a theme's `functions.php` from being loaded erroneously when the site isn't using themes.

Also adds `define( 'WP_USE_THEMES', true );` to the test suite bootstrap. Some tests randomly break without it because they were dependent on the previous buggy behavior.

Props bpayton, costdev, danielbachhuber, hellofromtonya, sergeybiryukov, spacedmonkey.
Fixes #57928.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55402 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-07 20:09:23 +00:00
audrasjb
2d5927cb92 Administration: Improve alignment in the Activity dashboard widget.
This changeset sets column layout to posts listed in the Activity dashboard widget to prevent alignement issues on line breaks.

Props sumitsingh, dhrumilk, chiragrathod103, kebbet, audrasjb, pooja1210.
Fixes #58114.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-07 07:09:19 +00:00
spacedmonkey
abee3f00a1 Script Loader: Improve performance of wp_maybe_inline_styles function.
The `wp_maybe_inline_styles` function is called twice on the average page load. On it's second run however, it did not check to see if the style had already been processed on the first run. This resulted in calling `filesize` and `get_file_contents` unnecessarily, which was bad for performance. Now, the loop around the queued styles, checks to see if the source is set to false, meaning it has already been processed. This change also replaces calls to `filesize` with the core function `wp_filesize`, which improves extensibility. 

Props spacedmonkey, flixos90, peterwilsoncc, joemcgill.
Fixes #58394.
Built from https://develop.svn.wordpress.org/trunk@55888


git-svn-id: http://core.svn.wordpress.org/trunk@55400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-07 06:56:19 +00:00
audrasjb
b62f326588 Docs: Improve various docblock in WP_Query class, as per docblock standards.
See #57840.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55399 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-07 06:53:19 +00:00
Sergey Biryukov
d3d5fbbfc7 Coding Standards: Use strict comparison in wp-includes/class-wp-http-streams.php.
Follow-up to [12424], [25224], [25303], [29852], [45667], [47808], [51825].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.
Built from https://develop.svn.wordpress.org/trunk@55886


git-svn-id: http://core.svn.wordpress.org/trunk@55398 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-07 06:40:20 +00:00
spacedmonkey
8a18492160 Themes: Replace file_exists checks with call to is_block_theme method in WP_Theme class.
In `WP_Theme` class, replace two calls to `file_exists` with a call to the method `is_block_theme`. This method `is_block_theme` does the same file exists check, but it then caches the result for improved performance. 

Props nihar007, spacedmonkey, mukesh27, costdev, juzar.
Fixes #58405.
Built from https://develop.svn.wordpress.org/trunk@55885


git-svn-id: http://core.svn.wordpress.org/trunk@55397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-06 16:19:19 +00:00
audrasjb
c613855594 Docs: Fix a few more typos in Docblocks.
Follow-up to [6779], [10565], [12023], [25224], [27533], [32806], [34777], [45262], [46594], [55823], [55824], [55827].

Props nazmulhudadev, mukesh27.
Fixes #58338.
See #57840.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-06 15:09:28 +00:00
Sergey Biryukov
02009f6df2 Coding Standards: Use strict comparison in wp-includes/class-walker-category.php.
Follow-up to [3033], [3704], [4576], [4580], [5530], [15847], [36008].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.
Built from https://develop.svn.wordpress.org/trunk@55883


git-svn-id: http://core.svn.wordpress.org/trunk@55395 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-06 00:30:20 +00:00
audrasjb
8c533a8442 Docs: Various docblock improvements in Custom Header Image related functions, as per docblocks standards.
See #57840.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-05 21:35:20 +00:00
audrasjb
6279dc749b I18N: Provide gettext context to disambiguate various translation strings.
This changeset adds context to various strings:
- `'Background'` string when referring to Custom Background appearance screens
- `'Header'` string when referring to Custom Header appearance screens
- `'General'`, `'Header'` and `'Footer'` strings when referring to template part areas

Props gonzomir, SergeyBiryukov, mukesh27, costdev, ankitmaru.
Fixes #58424.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-05 21:05:22 +00:00
Sergey Biryukov
fa14ed343d Coding Standards: Use strict comparison in wp-includes/category.php.
Follow-up to [3511], [4173], [5525].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.
Built from https://develop.svn.wordpress.org/trunk@55880


git-svn-id: http://core.svn.wordpress.org/trunk@55392 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-05 11:16:18 +00:00
spacedmonkey
1634a10025 Editor: Use register_block_type_from_metadata in register_core_block_types_from_metadata.
Use `register_block_type_from_metadata` in `register_core_block_types_from_metadata` function instead of `register_block_type`. This saves an unnecessary call to `file_exists` in `register_block_type` as core block files will always exist. 

Props nihar007, spacedmonkey, mukesh27, gziolo, sudipatel007.
Fixes #58342.
Built from https://develop.svn.wordpress.org/trunk@55879


git-svn-id: http://core.svn.wordpress.org/trunk@55391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-05 09:31:23 +00:00
Sergey Biryukov
5a35e1a831 Coding Standards: Use strict comparison in wp-admin/users.php.
Includes minor code layout fixes for better readability.

Follow-up to [3061], [31941], [47848], [55622], [55623].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.
Built from https://develop.svn.wordpress.org/trunk@55878


git-svn-id: http://core.svn.wordpress.org/trunk@55390 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-04 02:35:19 +00:00
Sergey Biryukov
8e22eaa87c Coding Standards: Use strict comparison in wp-admin/network/users.php.
Follow-up to [12603], [18562].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.
Built from https://develop.svn.wordpress.org/trunk@55877


git-svn-id: http://core.svn.wordpress.org/trunk@55389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-03 16:18:21 +00:00
Sergey Biryukov
01121c3440 Coding Standards: Use strict comparison in wp-admin/network/sites.php.
Follow-up to [12603], [18562], [55676].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.
Built from https://develop.svn.wordpress.org/trunk@55876


git-svn-id: http://core.svn.wordpress.org/trunk@55388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-02 12:40:22 +00:00
Weston Ruter
a04d9a32b3 Emoji: Remove extraneous sprintf() from _print_emoji_detection_script().
The `sprintf()` is not being passed any values, and there is no placeholder to replace.
This originated in r52132 in which I erroneously included this `sprintf()` in
two places. I fixed one of the cases in r52151 but I missed the other.

Follow-up to [52132], [52151].

Fixes #58436.
See #44632.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-01 18:09:18 +00:00
Sergey Biryukov
eaafce587e Coding Standards: Use strict comparison in wp-admin/includes/update.php.
Includes minor code layout fixes for better readability.

Follow-up to [9441], [25540].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.
Built from https://develop.svn.wordpress.org/trunk@55874


git-svn-id: http://core.svn.wordpress.org/trunk@55386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-06-01 15:14:27 +00:00
Sergey Biryukov
3d1140c898 Coding Standards: Use strict comparison in wp-admin/includes/menu.php.
Includes minor code layout fixes for better readability.

Follow-up to [3536], [4093], [9578], [11092], [18034].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.
Built from https://develop.svn.wordpress.org/trunk@55873


git-svn-id: http://core.svn.wordpress.org/trunk@55385 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-31 14:53:26 +00:00
John Blackbourn
f3b93e6b3a Media: Correct the fallback value passed to the $mimes parameter of wp_check_filetype_and_ext() from _wp_handle_upload(), and update corresponding documentation.
Previously when the `mimes` element was not specified in the overrides array passed to `_wp_handle_upload()` it resulted in boolean false being passed to this parameter, which is incorrect. The fallback value should be `null`.

Props platonkristinin, pkbhatt

Fixes #58349

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


git-svn-id: http://core.svn.wordpress.org/trunk@55384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-30 19:46:22 +00:00
John Blackbourn
ffd2a5bb95 Cron API: Attempt to raise the PHP memory limit for cron event processing.
Since cron events often consume extra memory by nature, it makes sense to give them the full amount available by default. In practice this means the memory will be increased to `WP_MAX_MEMORY_LIMIT` (which is 256MB by default) during cron event processing if the default memory limit is lower than this value.

The new `cron_memory_limit` filter can be used to adjust this value if necessary.

Note that this change will not by default affect external means of processing cron events, such as the `wp cron` command in WP-CLI, server-level crontab events, or any other cron event processing mechanism that bypasses `wp-cron.php`.

Props iandunn, thakkarhardik

Fixes #56628

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


git-svn-id: http://core.svn.wordpress.org/trunk@55383 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-30 18:48:19 +00:00
John Blackbourn
bb9b9d17f4 Docs: Miscellaneous corrections and improvements to docblocks.
See #57840

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


git-svn-id: http://core.svn.wordpress.org/trunk@55382 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-30 17:45:21 +00:00
Sergey Biryukov
37e599fb3e Upgrade/Install: Avoid an extra database query in populate_network().
This moves the query for user ID of the new network's administrator closer to where the value is actually used.

Includes removing unnecessary `get_userdata()` call, as user ID is the only data needed here.

Follow-up to [12756], [35575], [43628].

Props nihar007, sakibmd, mukesh27, costdev, SergeyBiryukov.
Fixes #58423.
Built from https://develop.svn.wordpress.org/trunk@55869


git-svn-id: http://core.svn.wordpress.org/trunk@55381 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-30 14:34:22 +00:00
Sergey Biryukov
6d16bbc088 Docs: Add a @since tag for the pre_wp_setup_nav_menu_item filter.
Includes moving the unit test next to the other `wp_setup_nav_menu_item()` tests and using the `MockAction` class to confirm that the filter runs.

Follow-up to [55867].

Props TobiasBg.
Fixes #56577.
Built from https://develop.svn.wordpress.org/trunk@55868


git-svn-id: http://core.svn.wordpress.org/trunk@55380 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-30 14:13:22 +00:00
Andrew Ozz
91b653f5cd Menus: Add a short-circuit filter to wp_setup_nav_menu_item().
Props: davidbinda, ironprogrammer, andizer.
Fixes: #56577.
Built from https://develop.svn.wordpress.org/trunk@55867


git-svn-id: http://core.svn.wordpress.org/trunk@55379 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-30 11:21:26 +00:00
Sergey Biryukov
f4b232f74c Coding Standards: Use strict comparison in wp-admin/includes/schema.php.
Follow-up to [12756], [12862], [12880], [13070], [14485], [17928], [18899], [41348], [43628].

Props faisalahammad, aristath, poena, afercia, SergeyBiryukov.
Fixes #58042, #58047. See #57839.
Built from https://develop.svn.wordpress.org/trunk@55866


git-svn-id: http://core.svn.wordpress.org/trunk@55378 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-29 16:26:22 +00:00
Pascal Birchler
30593b01b4 I18N: Improve _load_textdomain_just_in_time() logic when there are no translation files.
Fixes a performance issue where the JIT logic is invoked for every translation call if the there are no translations in the current locale. With this change, the information is cached by adding `Noop_Translations` instances to the global `$l10n` array. This way, `get_translations_for_domain()` returns earlier, thus avoiding subsequent `_load_textdomain_just_in_time()` calls.

Props swissspidy, johnbillion, ocean90.
Fixes #58321.
Built from https://develop.svn.wordpress.org/trunk@55865


git-svn-id: http://core.svn.wordpress.org/trunk@55377 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-29 08:36:23 +00:00
Sergey Biryukov
4581452e2b Users: Make sure bulk actions are only executed with the Apply button, not Change.
The Change button is supposed to perform the “Change role to...” action only, but could unintentionally be used for other bulk actions if the role was not selected.

This commit removes an extra check and ensures the correct error message is displayed in that case:

 Sorry, you are not allowed to give users that role.

Follow-up to [6990], [8691], [9028], [15576], [15642], [34636], [49944].

Props haritpanchal, costdev, ankit-k-gupta, SergeyBiryukov.
Fixes #57952.
Built from https://develop.svn.wordpress.org/trunk@55864


git-svn-id: http://core.svn.wordpress.org/trunk@55376 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-28 11:46:24 +00:00
Sergey Biryukov
ac66d2f01e Themes: Use correct escaping function for aria-label in _navigation_markup().
Follow-up to [46236].

Props sabernhardt, costdev, mukesh27.
Fixes #58387.
Built from https://develop.svn.wordpress.org/trunk@55863


git-svn-id: http://core.svn.wordpress.org/trunk@55375 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-27 09:53:25 +00:00
Pascal Birchler
afd88c4ac7 I18N: Refactor determine_locale() for performance and readability.
Refactors the function to avoid unnecessary `get_locale()` calls and slightly improve performance, while keeping it readable.

Adds tests.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55374 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-26 17:57:23 +00:00
Weston Ruter
4e30de26c6 Bundled Themes: Remove/disable obsolete IE-specific skip-link-focus-fix.
* Removes script from the `wp_print_footer_scripts` action in Twenty Nineteen, Twenty Twenty, and Twenty Twenty-One.
* Switches enqueue functions to just register the scripts in Twenty Fifteen, Twenty Sixteen, and Twenty Seventeen.
* Rearranges Twenty Seventeen's scripts to connect `twentyseventeenScreenReaderText` with the global script instead of the unused skip link fix.
* Updates scripts in Twenty Fifteen and Twenty Sixteen with code from Twenty Seventeen _to run on Internet Explorer only_. Twenty Sixteen needed to keep an adjustment that offsets the toolbar and border.
* Removes the script from JS files in Twenty Thirteen and Twenty Fourteen and edits their modified dates.

Props sabernhardt, westonruter, joedolson, flixos90, mukesh27.
Fixes #54421.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55373 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-26 17:25:23 +00:00
Sergey Biryukov
9296612464 External Libraries: Update jQuery to version 3.7.0.
This release includes bug fixes, a new `.uniqueSort()` method, and a performance improvement for some use cases when using manipulation methods like `.append()`.

References:
* [https://blog.jquery.com/2023/05/11/jquery-3-7-0-released-staying-in-order/ jQuery 3.7.0 release notes]
* [https://github.com/jquery/jquery/compare/3.6.4...3.7.0 Full list of changes in jQuery 3.7.0]

Follow-up to [49101], [50445], [50520], [54202], [55012], [55491].

Props mgol, jorbin, hbhalodia, desrosj, TobiasBg, audrasjb, mukesh27, naeemhaque, nuhel, SergeyBiryukov.
Fixes #58083.
Built from https://develop.svn.wordpress.org/trunk@55860


git-svn-id: http://core.svn.wordpress.org/trunk@55372 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-26 11:33:35 +00:00
antpb
d4c39df308 Media: Prevent scaling up of images in the Image Editor.
Previously, when scaling an image larger than the source size in the image edit states the image would silently fail the scaling action. This patch provides an error when someone attempts to scale an image larger than the source size while also disabling the button to initiate the action. 

Props brookedot, joedolson, markoheijnen, mikeschroder, desrosj, Mista-Flo, costdev.
Fixes #26381.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55371 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-25 15:17:19 +00:00
audrasjb
1dc049b06c Formatting: Add support for schwa in remove_accents().
This changeset adds support for schwa character. Ə (U+018F) and ə (U+0259) are part of Latin Extended-B and used in 
several languages like Azerbaijani or also in gender neutral Italian.

Props suleymankenar, audrasjb, przemekhernik.
Fixes #57609.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55370 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-25 13:14:20 +00:00
Sergey Biryukov
956be813b6 Coding Standards: Improve formatting of some SQL queries for better readability.
This corrects the placement of double quotes around the query and makes sure the alignment is consistent.

Props umeshmcakadi, mukesh27, krupalpanchal, dhrumilk, SergeyBiryukov.
Fixes #58372.
Built from https://develop.svn.wordpress.org/trunk@55857


git-svn-id: http://core.svn.wordpress.org/trunk@55369 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-25 12:55:19 +00:00
spacedmonkey
d8c4000c53 Comments: Move wp_queue_comments_for_comment_meta_lazyload function to the correct file.
As of [55855] wp_queue_comments_for_comment_meta_lazyload was deprecated. But deprecate to wp-admin/deprecated.php and not wp-includes/deprecated.php.This is incorrect, as this is a public function and not an admin function. 

Props SergeyBiryukov, spacedmonkey.
See #58301.
Built from https://develop.svn.wordpress.org/trunk@55856


git-svn-id: http://core.svn.wordpress.org/trunk@55368 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-25 10:55:19 +00:00
spacedmonkey
3c5d179fc9 Comments: Deprecate wp_queue_comments_for_comment_meta_lazyload function.
As of [55749] wp_queue_comments_for_comment_meta_lazyload is no longer used in core. This commit, deprecates this function. Update docs and tests accordingly.

Props sh4lin, spacedmonkey, costdev, peterwilsoncc.
Fixes #58301.
Built from https://develop.svn.wordpress.org/trunk@55855


git-svn-id: http://core.svn.wordpress.org/trunk@55367 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-25 10:31:23 +00:00
spacedmonkey
2cd27b2349 Options, Meta APIs: Change the option can_compress_scripts to be autoloaded.
Ensure that the option `can_compress_scripts` is autoloaded on single sites, as this option is used in all requests. This change saves one database query per page request. 

Props RavanH, spacedmonkey, costdev, azaozz, flixos90.
Fixes #55270.
Built from https://develop.svn.wordpress.org/trunk@55854


git-svn-id: http://core.svn.wordpress.org/trunk@55366 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-24 17:35:18 +00:00
Sergey Biryukov
f93e6ec4e8 Help/About: Reverse the order of conditionals for displaying the "Go to Updates" link.
`isset()` is faster than `current_user_can()`, so should be checked first.

Includes updating code layout for better readability.

Follow-up to [19442], [19524], [28477], [33466], [55848].

See #57839.
Built from https://develop.svn.wordpress.org/trunk@55853


git-svn-id: http://core.svn.wordpress.org/trunk@55365 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-24 10:15:20 +00:00
oandregal
7311e69b59 Loading assets for the editor: Revert [55695].
The changeset [55695] introduced a regression in the order of styles for the editor, causing the styles registered for the block (both editor and front) to be loaded after any other styles enqueued using the `enqueue_block_editor_assets` hook.

Since the original behavior was introduced in WordPress 5.0 changing it breaks the expectations of the ecosystem.

Props ellatrix.
Fixes #58208.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-24 09:24:23 +00:00
Sergey Biryukov
0ecaf73f34 General: Improve performance of the _wp_array_get() function.
When using a block theme, `_wp_array_get()` is the most called function on the front end of a site.

This commit makes a few minor performance optimizations, which add up to a noticeable improvement.

Follow-up to [49135], [49143], [49580].

Props aristath, jrf, afercia, costdev, swissspidy, flixos90, spacedmonkey, mukesh27, samiamnot, SergeyBiryukov.
Fixes #58376.
Built from https://develop.svn.wordpress.org/trunk@55851


git-svn-id: http://core.svn.wordpress.org/trunk@55363 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-23 22:00:21 +00:00
Felix Arntz
8f8114fb06 Media: Fix lazy-loading bug by avoiding to modify content images when creating an excerpt.
The `wp_filter_content_tags()` function, which modifies image tags for example to optimize performance, is hooked into the `the_content` filter by default. When rendering an excerpt for a post that doesn't have a manually provided excerpt, the post content is used to generate the excerpt, handled by the `wp_trim_excerpt()` function.

Prior to this changeset, this led to `wp_filter_content_tags()` being called on the content when generating the excerpt, which is wasteful as all tags are stripped from the excerpt, and it furthermore could result in a lazy-loading bug when the post content contained images, as those images were being counted even though they would never be rendered as part of the excerpt.

This changeset fixes the bug and slightly improves performance for generating an excerpt by temporarily unhooking the `wp_filter_content_tags()` function from the `the_content` filter when using it to generate the excerpt.

Props costdev, flixos90, joemcgill, mukesh27, salvoaranzulla, spacedmonkey, thekt12, westonruter.
Fixes #56588.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-23 18:25:19 +00:00
Sergey Biryukov
03436e6d3a Coding Standards: Use strict comparison in wp-includes/theme-compat/comments.php.
Follow-up to [31941], [41285], [55420].

Props sarequl.
See #57839.
Built from https://develop.svn.wordpress.org/trunk@55849


git-svn-id: http://core.svn.wordpress.org/trunk@55361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-23 15:25:24 +00:00
audrasjb
6c9c6cd6ef Help/About: Remove unwanted space in a link located on about.php.
This fixes a small interface glitch in the `Go to Updates` link located on 
the the About screen.

Props NekoJonez, mukesh27, sumitbagthariya16, ahsannayem.
Fixes #58373.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55360 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-22 20:04:22 +00:00
Felix Arntz
c6f9238b77 Media: Conditionally skip lazy-loading on images before the loop to improve LCP performance.
When the logic to exclude images that likely appear above the fold from being lazy-loaded was introduced in WordPress 5.9, initially only images that appear within the main query loop were being considered. However, there is a good chance that images above the fold are rendered before the loop starts, for example in the header template part.

It is particularly common for a theme to display the featured image for a single post in the header. Based on HTTP Archive data from February 2023, the majority of LCP images that are still being lazy-loaded on WordPress sites use the `wp-post-image` class, i.e. are featured images.

This changeset enhances the logic in `wp_get_loading_attr_default()` to not lazy-load images that appear within or after the header template part and before the query loop, using a new `WP_Query::$before_loop` property.

For block themes, this was for the most part already addressed in [55318], however this enhancement implements the solution in a more generally applicable way that brings the improvement to classic themes as well.

Props thekt12, flixos90, spacedmonkey, costdev, zunaid321, mukesh27.
Fixes #58211.
See #53675, #56930.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55359 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-22 19:13:21 +00:00
Sergey Biryukov
e182459c6d Administration: Add missing escaping for CSS classes on the body tag in the admin.
Follow-up to [5892], [10823], [10868], [18882], [21014], [22000], [48060].

Propos rafiem, costdev, dd32, audrasjb, westonruter, SergeyBiryukov.
Fixes #58336.
Built from https://develop.svn.wordpress.org/trunk@55846


git-svn-id: http://core.svn.wordpress.org/trunk@55358 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-22 14:16:19 +00:00
spacedmonkey
a88a66b0bd Posts, Post Types: Add a new filter for query arguments in get_pages.
In [55569] `get_pages` was converted to use `WP_Query` internally. But for plugins that were extending the `get_pages` filters and filter `WP_Query` query arguments, this could result in a conflict. Add a filter `get_pages_query_args` to allow developers to change arguments passed to `WP_Query` but also have the context of the original arguments passed to the `get_pages` function. 

This change also expands test coverage of `get_pages` to ensure no breakages in the future. 

Props spacedmonkey, westonruter, costdev, flixos90, kenwins, marianne38.
See #12821.
Built from https://develop.svn.wordpress.org/trunk@55845


git-svn-id: http://core.svn.wordpress.org/trunk@55357 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-22 10:03:22 +00:00
Sergey Biryukov
fc3f62f4a2 Docs: Improve a few DocBlocks in wp-includes/formatting.php.
This addresses missing hyphens, typos and unnecessarily complex language.

Follow-up to [8540], [8743], [11615], [11907], [28670], [42056].

Props apermo.
Fixes #58316.
Built from https://develop.svn.wordpress.org/trunk@55844


git-svn-id: http://core.svn.wordpress.org/trunk@55356 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-21 10:41:22 +00:00
Sergey Biryukov
cdc9d4766f Docs: Fix a few more typos in DocBlocks.
Follow-up to [39493], [41726], [55823], [55824], [55827].

See #57840.
Built from https://develop.svn.wordpress.org/trunk@55843


git-svn-id: http://core.svn.wordpress.org/trunk@55355 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-20 10:19:23 +00:00
desrosj
2bb3a51695 Editor: Restore shortcode support for block templates.
Follow up to [55761].

Props youknowriad, Clorith, desrosj, antpb, Otto42, johnbillion, jorbin, rmccue, timothyblynjacobs, mikeschroder, peterwilsoncc, audrasjb, matveb, noisysocks, xknown, ehtis, isabel_brison, talldanwp, gziolo, chriscct7, davidbaumwald.
Fixes #58333.
Built from https://develop.svn.wordpress.org/trunk@55828


git-svn-id: http://core.svn.wordpress.org/trunk@55340 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-20 03:58:47 +00:00
Sergey Biryukov
046b9afcb7 Docs: Fix a few more typos in DocBlocks and inline comments.
Follow-up to [6779], [10565], [12023], [25224], [27533], [32806], [34777], [45262], [46594], [55823], [55824].

Props Presskopp.
See #57840.
Built from https://develop.svn.wordpress.org/trunk@55827


git-svn-id: http://core.svn.wordpress.org/trunk@55339 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-19 13:27:20 +00:00
spacedmonkey
0670401bae Networks and Sites: Load WP_Metadata_Lazyloader class file if class in meta.php.
In [55818] did a check to see if `WP_Metadata_Lazyloader` class existed and the loaded in the class file if it did not. However, require in wp-settings.php was not removed and resulted in the class being loaded twice. To be safe, only include the class file in meta.php and remove from wp-settings.php file.

Props spacedmonkey, ryelle.
See #58185.
Built from https://develop.svn.wordpress.org/trunk@55826


git-svn-id: http://core.svn.wordpress.org/trunk@55338 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-19 12:46:24 +00:00
Felix Arntz
2b28fea7c9 Media: Prevent special images within post content to skew image counts and cause lazy-loading bugs.
In order to skip lazy-loading the first few images on a page, as of WordPress 5.9 there has been logic to count images that are eligible based on certain criteria. One of those groups are images that appear within the content of a post.

This changeset fixes a bug where images created via `get_the_post_thumbnail()` or `wp_get_attachment_image()` that are injected into the post content would skew the count and therefore result in all images to be lazy-loaded, potentially hurting load time performance. This is relevant for example when those functions are called in server-side rendered blocks, or any other filter callbacks hooked into `the_content`.

Props flixos90, antpb, joedolson, spacedmonkey, mukesh27, thekt12, costdev, jrf.
Fixes #58089.
See #53675.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55337 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-18 19:55:23 +00:00
Sergey Biryukov
be4b739a49 Docs: Fix a few more typos in inline comments.
Follow-up to [9117], [11005], [12097], [18632], [26192], [55823].

Props Presskopp.
See #58334, #57840.
Built from https://develop.svn.wordpress.org/trunk@55824


git-svn-id: http://core.svn.wordpress.org/trunk@55336 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-18 12:36:24 +00:00
Sergey Biryukov
5f054d2079 Docs: Fix typo in a comment in Bulk_Upgrader_Skin::header() and ::footer().
Follow-up to [13602].

Props kamplugins, costdev, mukesh27, afragen.
Fixes #58334.
Built from https://develop.svn.wordpress.org/trunk@55823


git-svn-id: http://core.svn.wordpress.org/trunk@55335 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-18 11:37:27 +00:00
Weston Ruter
4c2394eed5 General: Use static on closures whenever $this is not used to avoid memory leaks.
Props westonruter, jrf, spacedmonkey.
Fixes #58323.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55334 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-17 22:46:24 +00:00
Felix Arntz
8db8a24e46 Media: Introduce wp_get_attachment_image_context filter.
Since WordPress 5.9, a "context" value of "wp_get_attachment_image" has been used in the `wp_get_attachment_image()` function to provide context to underlying functions where that is relevant, e.g. `wp_get_loading_attr_default()`. Since that value used to be not customizable, it required a workaround in `get_the_post_thumbnail()` to avoid calling those functions in `wp_get_attachment_image()`, which resulted in unnecessary complexity and was prone to errors.

This changeset introduces a `wp_get_attachment_image_context` filter and leverages it with private filter callback functions that are leveraged by default when `get_the_post_thumbnail()` is called. This avoids the need for the previous workaround and furthermore provides flexibility for other callers of `wp_get_attachment_image()` to provide their own contexts.

Props flixos90, costdev, thekt12, westonruter, spacedmonkey.
Fixes #58212.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55333 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-17 18:31:24 +00:00
Sergey Biryukov
95bcde947f Docs: Correct default value for the $optimize option in Style Engine.
The default value is set to `true` in `WP_Style_Engine_Processor::get_css()`, but was previously documented as `false` in various DocBlocks.

Follow-up to [54156], [55719], [55733], [55819].

See #57840.
Built from https://develop.svn.wordpress.org/trunk@55820


git-svn-id: http://core.svn.wordpress.org/trunk@55332 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-17 12:06:19 +00:00
Sergey Biryukov
c14343ba25 Docs: Improve Style Engine DocBlocks per the documentation standards.
Follow-up to [54156], [55719], [55733].

See #57840.
Built from https://develop.svn.wordpress.org/trunk@55819


git-svn-id: http://core.svn.wordpress.org/trunk@55331 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-17 11:58:26 +00:00
spacedmonkey
c459098d7b Networks and Sites: Load WP_Metadata_Lazyloader class file if class does not exist.
Follow on from [55747].

As `get_sites` can be called very early in the bootstrap process, like in the sunrise.php file, it means that the `WP_Metadata_Lazyloader` may not have been loaded yet in the wp-settings.php file. Add a simple check to see if the class exists and if it does not exist then load the class file in. 

Props spacedmonkey, peterwilsoncc, dd32.
See #58185.
Built from https://develop.svn.wordpress.org/trunk@55818


git-svn-id: http://core.svn.wordpress.org/trunk@55330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-17 09:44:18 +00:00
spacedmonkey
2949e05862 Editor: Disable lazy loading term meta in get_block_templates.
Pass false to the `lazy_load_term_meta` parameter given to the `WP_Query` found in `get_block_templates`. Template post types only ever have one term assigned to them. So priming term meta, does not help performance as lazy loading term meta is only useful if loading multiple terms. As `get_block_templates` is run multiple times on a block theme request, this saves processing time. 

Props spacedmonkey, andraganescu, ntsekouras, oandregal, westonruter.
Fixes #58230.
Built from https://develop.svn.wordpress.org/trunk@55817


git-svn-id: http://core.svn.wordpress.org/trunk@55329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-17 09:23:24 +00:00
Felix Arntz
1aeba57f4b Media: Increase default for wp_omit_loading_attr_threshold to 3.
The previous default threshold for how many content images to skip lazy-loading on (which was just 1) has proven to be too strict: HTTP Archive data shows that >70% of sites have up to 3 equal-sized images in the initial viewport, each of which could be the LCP image and therefore should not be lazy-loaded. Lazy-loading too many images has adverse effects on load time performance, while increasing the default threshold will not negatively affect load time performance even for sites where a threshold of 1 would be the perfect choice.

The change of default value in this changeset will improve performance for more WordPress sites out of the box. The `wp_omit_loading_attr_threshold` filter can still be used to customize and fine tune the value where needed.

Props thekt12, spacedmonkey, westonruter, flixos90.
Fixes #58213.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55328 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-16 18:52:23 +00:00
audrasjb
d9d303f812 Media: Prevent CSRF setting attachment thumbnails.
Props martinkrcho, paulkevan, peterwilsoncc, xknown, peterwilsoncc.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55276 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-16 14:27:21 +00:00
audrasjb
d81f522a57 Embeds: Add protocol validation for WordPress Embed code.
Validate that links within auto-discovered embeds are using the `http` or `https` protocols before following links.

Props xknown, dd32, peterwilsoncc.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-16 14:25:21 +00:00
audrasjb
f477c00fdc Editor: Ensure block comments are of a valid form.
Ensures that the block delimiter comments are of a valid form: opening with `<!--` and closing with `-->`.

Props xknown, isabel_brison, peterwilsoncc.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55274 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-16 14:23:19 +00:00
audrasjb
6a077b35f1 Editor: Remove shortcode support from block templates.
Props youknowriad, xknown, timothyblynjacobs, matveb.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55273 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-16 14:21:18 +00:00
audrasjb
02a131ec30 I18N: Introduce sanitization function for locale.
Introduce the `sanitize_locale_name()` for sanitizing user input of locales.

Props xknown, timothyblynjacobs, ocean90, peterwilsoncc.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55272 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-16 14:18:20 +00:00
spacedmonkey
b49912434d Taxonomy: Do not prime term meta in wp_get_object_terms.
Passing `update_term_meta_cache` argument value false by default resulting in `get_terms` to not prime the term meta cache in `wp_get_object_terms`. Priming of term meta is not needed in this context. 

Props spacedmonkey, rutviksavsani.
Fixes #57701.
Built from https://develop.svn.wordpress.org/trunk@55759


git-svn-id: http://core.svn.wordpress.org/trunk@55271 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-16 12:31:21 +00:00
audrasjb
a0bcd7d56a Docs: Clarify @param types on get_sample_permalink_html filter.
`$new_title` and `$new_slug` can be null if `get_sample_permalink_html()` 
was called with default parameters, and they are documented as 
`string|null` in the function DocBlock.

Follow-up to [34347].

Props Enchiridion, audrasjb, SergeyBiryukov.
Fixes #58322.
See #33927. --Cette ligne, et les 
suivantes 
ci-dessous, seront ignorées--

M    trunk/src/wp-admin/includes/post.php

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


git-svn-id: http://core.svn.wordpress.org/trunk@55270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-16 05:25:23 +00:00
Sergey Biryukov
fe928b2e9a General: Remove a few is_object() checks followed by instanceof operator.
This is a minor performance enhancement:

* If an object is passed, the call to `is_object()` will be redundant.
* If a non-object is passed, the `instanceof` operator (a variant of `is_a()`) will first [https://github.com/php/php-src/blob/f42992f/Zend/zend_builtin_functions.c#L630-L631 check if it is an object] before doing any further processing.

Therefore, no additional processing cycles should be wasted in both cases.

Follow-up to [6779], [48798], [48905], [49194], [55748].

Props Presskopp, costdev.
Fixes #58309.
Built from https://develop.svn.wordpress.org/trunk@55757


git-svn-id: http://core.svn.wordpress.org/trunk@55269 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-15 10:28:23 +00:00
Sergey Biryukov
c26ddc3eae Tests: Remove expectation of a deprecation notice from WP_Posts_List_Table tests.
With `get_the_author()` returning an empty string instead of `null` if called before `$authordata` is set, and no longer causing a PHP 8.1 "null to non-nullable" deprecation notice, there is no need for these tests to ignore the notice.

Follow-up to [51968], [55755].

See #58157.
Built from https://develop.svn.wordpress.org/trunk@55756


git-svn-id: http://core.svn.wordpress.org/trunk@55268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-14 18:45:20 +00:00
Sergey Biryukov
ae3c5a4be6 Code Modernization: Correct fallback return value in get_the_author().
If the `$authordata` global is not set, `get_the_author()` returned `null`, causing a PHP 8.1 "null to non-nullable" deprecation notice in `ent2ncr()` hooked via `the_author` filter:
{{{
str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
}}}

This commit updates `get_the_author()` to return an empty string if called before `$authordata` is set, bringing consistency with a few other similar functions which also return an empty string in this case:

* `get_the_author_meta()`
* `get_the_author_posts_link()`
* `get_the_modified_author()`

Follow-up to [695/tests], [2858], [11138], [12284], [20575], [34677], [44616], [53187].

Props Soean, jrf, sabernhardt, salvoaranzulla, antpb, ebai4, sajjad67, tijmensmit, SergeyBiryukov.
Fixes #58157.
Built from https://develop.svn.wordpress.org/trunk@55755


git-svn-id: http://core.svn.wordpress.org/trunk@55267 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-14 17:58:24 +00:00
Sergey Biryukov
8abc201cfe Tests: Split the tests from user/author.php into individual test classes.
This aims to make `get_the_author_*()` tests more discoverable and easier to expand.

Follow-up to [691/tests], [692/tests], [695/tests], [28362], [31098], [34687], [53147], [54717], [54726], [55591].

See #57841.
Built from https://develop.svn.wordpress.org/trunk@55754


git-svn-id: http://core.svn.wordpress.org/trunk@55266 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-13 13:35:22 +00:00
John Blackbourn
a714bc03ee Docs: Various corrections and improvements to inline docs and docblocks.
See #57840

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


git-svn-id: http://core.svn.wordpress.org/trunk@55265 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-12 21:35:21 +00:00
Sergey Biryukov
fe6b65c44b Code Modernization: Explicitly declare all properties in Text_Diff_Engine_native.
Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0.

There are a number of ways to mitigate this:
* If it is an accidental typo for a declared property: fix the typo.
* For known properties: declare them on the class.
* For unknown properties: add the magic `__get()`, `__set()`, et al. methods to the class or let the class extend `stdClass` which has highly optimized versions of these magic methods built in.
* For unknown ''use'' of dynamic properties, the `#[AllowDynamicProperties]` attribute can be added to the class. The attribute will automatically be inherited by child classes.

In this case, the properties, as used in the class methods, fall in the “known property” category.

Reference: [https://wiki.php.net/rfc/deprecate_dynamic_properties PHP RFC: Deprecate dynamic properties].

Follow-up to [53942], [53948], [53949], [53952], [53953], [53954], [53957], [54037].

Props jrf, thomask.
See #58298.
Built from https://develop.svn.wordpress.org/trunk@55752


git-svn-id: http://core.svn.wordpress.org/trunk@55264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-12 08:51:22 +00:00
audrasjb
0fd73d7a72 Coding Standards: Use esc_url() to escape link URL value in wp-admin/edit-link-form.php.
Props dilipbheda, mukesh27.
Fixes #58282.
See #57839.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55263 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-11 15:05:22 +00:00
audrasjb
ad55717715 I18N: Replace "Roll back" with "Restore" in user facing strings.
The terms "roll back" and "rolled back" are used in user facing strings since [55720]. These termes are not that clear for novice users and may be difficult to translate in some locales. This changeset replaces "roll back" with "restore" and "rolled back" with "restored" or "not applied" depending of the context of the screen.

Follow-up to [55720].

Props kebbet, costdev, NekoJonez, audrasjb, SergeyBiryukov, davidbaumwald.
Fixes #58282.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55262 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-11 14:50:20 +00:00
spacedmonkey
fda9000c7b Comments: Always lazily load comment meta.
In [34270] introduced lazy loading of comment meta. However, this was only in the context of `WP_Query`. Other parts of the codebase, like `WP_Comment_Query` did not lazily load comment meta. In this change, calls to `update_meta_cache` are now replaced with `wp_lazyload_comment_meta`, that instead of priming comment meta caches, just adds them to the queue to be primed it ever called. This results in far less database queries, as there a number of places where comment meta is being primed unnecessarily and never used. Adding everything to the comment meta queue, also means that if comment meta is used, that is all loaded in a single database / cache call.

Follow on from [55671], [55747].

Props spacedmonkey, peterwilsoncc, flixos90, mukesh27.
Fixes #57801.
Built from https://develop.svn.wordpress.org/trunk@55749


git-svn-id: http://core.svn.wordpress.org/trunk@55261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-11 12:27:22 +00:00
Sergey Biryukov
d35d467c9c Plugins: Remove is_object() check in WP_Hook:build_preinitialized_hooks().
This is a minor performance enhancement:

* If an object is passed, the call to `is_object()` will be redundant.
* If a non-object is passed, the `instanceof` operator (a variant of `is_a()`) will first [https://github.com/php/php-src/blob/f42992f/Zend/zend_builtin_functions.c#L630-L631 check if it is an object] before doing any further processing.

Therefore, no additional processing cycles should be wasted in both cases.

Follow-up to [38571].

Props bor0, johnbillion, davidbaumwald.
Fixes #58290.
Built from https://develop.svn.wordpress.org/trunk@55748


git-svn-id: http://core.svn.wordpress.org/trunk@55260 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-11 11:43:21 +00:00
spacedmonkey
3ac5fd72d0 Networks and Sites: Lazy load site meta.
In [36566] a framework to lazily load metadata was introduced. This supported term and comment meta by default. In this commit, extends support for site ( blog ) meta. Site meta is not heavily used by core and is used by developers to extend multisite. In this change, `_prime_site_caches` and `WP_Site_Query` now call the new function `wp_lazyload_site_meta`. The function `wp_lazyload_site_meta` accepts an array of ids and adds them to the queue of metadata to be lazily loaded. The function `get_blogs_of_user` was updated to now lazily load site meta. 

Follow on from [55671].

Props spacedmonkey, johnjamesjacoby, peterwilsoncc, mukesh27.
Fixes #58185.
Built from https://develop.svn.wordpress.org/trunk@55747


git-svn-id: http://core.svn.wordpress.org/trunk@55259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-11 11:15:24 +00:00
spacedmonkey
041f2d982f Tests: Partial revert of r55745
Revert package-lock.json changes committed by mistake in [55745].

Props mukesh27.
See #57841.
Built from https://develop.svn.wordpress.org/trunk@55746


git-svn-id: http://core.svn.wordpress.org/trunk@55258 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-11 10:33:20 +00:00
spacedmonkey
19217af74d Tests: Use the function get_num_queries across all unit tests.
Replace use of `$wpdb->num_queries` with a function call to `get_num_queries`. This improves readability and consistency between tests. 

Props SergeyBiryukov, peterwilsoncc, spacedmonkey.
See #57841.
Built from https://develop.svn.wordpress.org/trunk@55745


git-svn-id: http://core.svn.wordpress.org/trunk@55257 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-11 10:07:23 +00:00
oandregal
7119126dc3 Docs: describe return type of _get_block_template_file().
Props: desrosj, mukesh27, costdev, johnbillion.
Fixes #57756.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55256 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-11 09:03:26 +00:00
davidbaumwald
fe27bb8d0b Revisions: Add edit link functionality for the wp_template and wp_template_part post types.
In preparation for viewing revisions of templates and template parts in the editor, this set changes adds the `_edit_link` argument when registering the `wp_template` and `wp_template_part` post types.  This commit also updates `get_edit_post_link` to account for the unique edit URLs for these post types.

Finally, this commit also adds new unit tests for the `get_edit_post_link` function, including tests for the `post`, `wp_template`, and `wp_template_part` post types.

Fixes #57709.
Props andraganescu, spacedmonkey, antonvlasenko, youknowriad, ramonopoly, ironprogrammer, annezazu.
Built from https://develop.svn.wordpress.org/trunk@55743


git-svn-id: http://core.svn.wordpress.org/trunk@55255 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-10 17:36:21 +00:00
Sergey Biryukov
9e840bbc8d Tests: Move wp_cache_flush_runtime() next to wp_cache_flush().
This matches the function's placement in `wp-includes/cache.php` and brings more consistency.

Follow-up to [52772], [55741].

See #57841.
Built from https://develop.svn.wordpress.org/trunk@55742


git-svn-id: http://core.svn.wordpress.org/trunk@55254 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-10 14:02:20 +00:00
spacedmonkey
795758f265 Build/Test Tools: Call wp_cache_flush_runtime in WP_UnitTestCase.
In `WP_UnitTestCase::flush_cache` method, the properties of the global `$wp_object_cache` object were manaully being reset to flush the cache. The function `wp_cache_flush_runtime` was added in [52772] and is designed to reset any class properties to default values. Using `wp_cache_flush_runtime` improve compatibility with third party object caches, as it allows developers to define their own `wp_cache_flush_runtime` function. 

Props rmccue, johnbillion, wonderboymusic, boonebgorges, voldemortensen, dd32, DrewAPicture, tillkruess, spacedmonkey.
Fixes #31463.
Built from https://develop.svn.wordpress.org/trunk@55741


git-svn-id: http://core.svn.wordpress.org/trunk@55253 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-10 09:11:24 +00:00
audrasjb
4935678150 Editor: Update block editor packages to the latest patch releases.
This updates the block editor related npm dependencies to their latest patch versions ahead of WordPress 6.2.1 RC1.

Updated packages:
 - @wordpress/annotations@2.26.4
 - @wordpress/block-directory@4.3.12
 - @wordpress/block-editor@11.3.10
 - @wordpress/block-library@8.3.12
 - @wordpress/components@23.3.7
 - @wordpress/customize-widgets@4.3.12
 - @wordpress/edit-post@7.3.12
 - @wordpress/edit-site@5.3.12
 - @wordpress/edit-widgets@5.3.12
 - @wordpress/editor@13.3.10
 - @wordpress/format-library@4.3.10
 - @wordpress/interface@5.3.8
 - @wordpress/list-reusable-blocks@4.3.7
 - @wordpress/preferences@3.3.7
 - @wordpress/reusable-blocks@4.3.10
 - @wordpress/rich-text@6.3.4
 - @wordpress/server-side-render@4.3.7
 - @wordpress/widgets@3.3.10

This changeset includes the following fixes:
- i18n: Add context to labels related to CSS position properties gutenberg#49135
- Comments: Fix 'sprintf requires more than 1 params' error gutenberg#49054
- Fix the site editor loading in multi-site installs gutenberg#49861
- Fix quick inserter going off-screen in some situations gutenberg#49881
- Site Editor: Decode the site title properly gutenberg#49685
- Firefox: fix input rules (React async state issue) gutenberg#48210
- Only show alignment info when parent layout is constrained. gutenberg#49703
- [Inserter]: Fix onHover error on patterns tab in mobile gutenberg#49450
- Fix site editor redirection after creating new template or template part gutenberg#49364

Props mamaduka, audrasjb, wildworks, ocean90, aristath, costdev, hellofromtonya, youknowriad, mdxfr, oandregal, mattwiebe, bph, ndiego, talldanwp, joen, ellatrix, kevin940726, isabel_brison, andrewserong, ntsekouras, welcher.
Fixes #58274.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55249 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-09 14:13:25 +00:00
Sergey Biryukov
5e0592d8f4 Docs: Improve HTML API file and class headers per the documentation standards.
Follow-up to [55203], [55304], [55718], [55724], [55727].

See #57840.
Built from https://develop.svn.wordpress.org/trunk@55734


git-svn-id: http://core.svn.wordpress.org/trunk@55246 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-09 11:19:21 +00:00
Sergey Biryukov
5da872aa27 Docs: Improve Style Engine file and class headers per the documentation standards.
Follow-up to [54156], [55719].

See #57840.
Built from https://develop.svn.wordpress.org/trunk@55733


git-svn-id: http://core.svn.wordpress.org/trunk@55245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-09 10:37:22 +00:00
John Blackbourn
5ef972680a Docs: A host of corrections and improvements to inline documentation.
See #57840

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


git-svn-id: http://core.svn.wordpress.org/trunk@55244 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-08 22:37:24 +00:00
Sergey Biryukov
2ffb7ef083 Docs: Update code examples formatting in WP_HTML_Tag_Processor documentation.
Per the [https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/#description documentation standards], code samples should be created by indenting every line of the code by 4 spaces, with a blank line before and after. This matches the format used by the rest of core.

Follow-up to [55203], [55304], [55718], [55724].

Props juanmaguitar, coffee2code, azaozz, costdev, dmsnell, johnbillion, SergeyBiryukov.
Fixes #58028.
Built from https://develop.svn.wordpress.org/trunk@55727


git-svn-id: http://core.svn.wordpress.org/trunk@55239 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-08 17:32:24 +00:00
Sergey Biryukov
f28299d504 Coding Standards: Bring more consistency to PHP 8.0 string function polyfills.
This adjusts `str_contains()` code layout to have an early exit for an empty `$needle`, matching similar fragments in `str_starts_with()` and `str_ends_with()` for better readability.

Follow-up to [52039], [52040].

See #57839.
Built from https://develop.svn.wordpress.org/trunk@55726


git-svn-id: http://core.svn.wordpress.org/trunk@55238 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-07 11:44:21 +00:00
Sergey Biryukov
8b53b81183 Docs: Remove @return void from various DocBlocks.
Per the documentation standards, it should not be used outside of the default bundled themes.

Follow-up to [52049], [52051], [53331], [54156], [54214], [55203], [55719].

See #57840.
Built from https://develop.svn.wordpress.org/trunk@55725


git-svn-id: http://core.svn.wordpress.org/trunk@55237 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-06 11:40:24 +00:00
Sergey Biryukov
24eb807cbd Docs: Correct the placement of @see tags in WP_HTML_Tag_Processor class.
This moves a reference link in `::get_attribute_names_with_prefix()` below the code example, so that it is correctly displayed in the Developer Resources.

Includes updating some other `@see` tags for consistency as per the documentation standards.

Additionally, the example code for `WP_HTML_Tag_Processor::get_tag()` is updated to show lowercase tag names in the input HTML, so that it does not convey the wrong impression that the uppercase output from `::get_tag()` depends on the case of the input HTML.

Follow-up to [55203].

Props dmsnell, johnbillion, audrasjb, SergeyBiryukov.
Fixes #58254.
Built from https://develop.svn.wordpress.org/trunk@55724


git-svn-id: http://core.svn.wordpress.org/trunk@55236 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-05 12:43:21 +00:00
audrasjb
3911398ec5 HTML API: Restore mistakenly-removed content in documentation.
In [55718] the Unicode replacement character was mistakenly removed. The purpose of including the character was to communicate what it looks like and why the Tag Processor won't insert it into the document.

This changeset brings the character back and adds a small clue to fix the confusion that may lead to its removal.

Follow-up to [55718].

Props dmsnell.
Fixes #58256
See #57840.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55235 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-05 10:58:23 +00:00
Bernhard Reiter
f2d315036b HTML API: Adjust coding style to pass Gutenberg linter.
This patch adjusts some minor neutral whitespace that the Gutenberg linting rejects.
There are no code changes otherwise.

Props dmsnell.
Fixes #58250.
Built from https://develop.svn.wordpress.org/trunk@55721


git-svn-id: http://core.svn.wordpress.org/trunk@55233 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-04 08:42:22 +00:00
Sergey Biryukov
7e9421e4d0 Upgrade/Install: Create a temporary backup of plugins and themes before updating.
This aims to make the update process more reliable and ensures that if a plugin or theme update fails, the previous version can be safely restored.

* When updating a plugin or theme, the old version is moved to a temporary backup directory:
 * `wp-content/upgrade-temp-backup/plugins/[plugin-slug]` for plugins
 * `wp-content/upgrade-temp-backup/themes/[theme-slug]` for themes.

* If the update fails, then the backup kept in the temporary backup directory is restored to its original location.
* If the update succeeds, the temporary backup is deleted.

To further help troubleshoot plugin and theme updates, two new checks were added to the Site Health screen:
* A check to make sure that the `upgrade-temp-backup` directory is writable.
* A check that there is enough disk space available to safely perform updates.

To avoid confusion: The temporary backup directory will NOT be used to “roll back” a plugin to a previous version after a completed update. This directory will simply contain a transient backup of the previous version of a plugin or theme being updated, and as soon as the update process finishes, the directory will be empty.

Follow-up to [55204], [55220].

Props afragen, costdev, pbiron, azaozz, hellofromTonya, aristath, peterwilsoncc, TJNowell, bronsonquick, Clorith, dd32, poena, TimothyBlynJacobs, audrasjb, mikeschroder, a2hosting, KZeni, galbaras, richards1052, Boniu91, mai21, francina, TobiasBg, desrosj, noisysocks, johnbillion, dlh, chaion07, davidbaumwald, jrf, thisisyeasin, ignatggeorgiev, SergeyBiryukov.
Fixes #51857.
Built from https://develop.svn.wordpress.org/trunk@55720


git-svn-id: http://core.svn.wordpress.org/trunk@55232 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-04 02:36:23 +00:00
John Blackbourn
7a343e478e Docs: Correct and improve inline docs relating to the style engine.
See #57840

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


git-svn-id: http://core.svn.wordpress.org/trunk@55231 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-03 23:57:18 +00:00
John Blackbourn
89cbdce5c3 Docs: Improve formatting of markup in the docs for WP_HTML_Tag_Processor.
Code blocks wrapped inside backtacks don't need to be indented.

See #57840

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


git-svn-id: http://core.svn.wordpress.org/trunk@55230 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-03 23:55:16 +00:00
John Blackbourn
c3e63b8046 Build/Test Tools: Fix the permissions that are granted to the Slack notifications workflow.
Follow-up to [55715].

See #57865

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


git-svn-id: http://core.svn.wordpress.org/trunk@55229 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-03 23:22:17 +00:00
audrasjb
8547f7b820 Help/About: Left-align 6.2 about page subheading.
This changeset removes the `aligncenter` class from `h2` and `is-subheading` items in the WordPress 6.2 About Page, for more consistent alignment. Also, future minor releases will add more left-aligned paragraphs under the "Maintenance Releases" section.

Props shagors, sabernhardt, mukesh27, amin7, costdev, pavanpatil1, audrasjb.
Fixes #57387.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55228 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-03 22:32:19 +00:00
John Blackbourn
5f1d229cbf Build/Test Tools: Restrict the permissions granted to jobs on GitHub Actions
The `permissions` key in a job declares the GitHub permissions that are granted to the token that's used by the job. Restricting the permissions reduces the impact that a vulnerability in the CI system can have.

Props desrosj, johnbillion

See #57865

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


git-svn-id: http://core.svn.wordpress.org/trunk@55227 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-03 22:17:18 +00:00
John Blackbourn
bd393654cc Filesystem API: Correct and improve the return type documentation for the dirlist() method in WP_Filesystem_Base and its extending classes.
Props mat-lipe, szepeviktor, costdev, audrasjb, johnbillion

Fixes #58229
See #57840

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


git-svn-id: http://core.svn.wordpress.org/trunk@55226 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-03 21:30:19 +00:00
audrasjb
12c65b6076 Script Loader: Update jQuery version to 3.6.4 to match the current version.
This changeset updates the jQuery version to 3.6.4 in `script-loader.php` to correcly match the current version used in WordPress.

This was accidentally missed in [55491].

Props nickpap, TobiasBg, dhrumilk.
Fixes #58203.
See #57324.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55225 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-03 21:27:21 +00:00
John Blackbourn
b155956792 Docs: Miscellaneous formatting corrections to inline docs and whitespace.
See #57840

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


git-svn-id: http://core.svn.wordpress.org/trunk@55224 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-03 19:46:21 +00:00
John Blackbourn
c83f4cb97a Docs: Corrections and improvements to docblocks for global styles, global settings, theme.json parsing, and shortcodes.
See #57840

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


git-svn-id: http://core.svn.wordpress.org/trunk@55223 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-03 18:48:22 +00:00
Sergey Biryukov
27c4548f19 General: Restore strpos() check in wp-admin/load-styles.php.
This resolves a fatal error on PHP < 8.0, as `wp-includes/compat.php` is not loaded in this file, so `str_starts_with()` may not be available.

Follow-up to [55703].

Props dd32, flixos90, DigTek.
Fixes #58244. See #58012.
Built from https://develop.svn.wordpress.org/trunk@55710


git-svn-id: http://core.svn.wordpress.org/trunk@55222 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-03 15:46:22 +00:00
Andrea Fercia
6064478fa7 Post Types: Add the view_items label to the wp_block post type.
The `view_items` post type label is used in the Editor, for the `aria-label` of the link to go back to the Posts list. When editing a Reusable block, it fallbacks to 'View Posts'. It should be 'View Reusable blocks'.

Fixes #58209.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-03 14:08:18 +00:00
Bernhard Reiter
5a32396d8f HTML API: Accumulate shift for internal parsing pointer.
A bug was discovered where where the parser wasn't returning to the
start of the affected tag after making some updates.

In few words, the Tag Processor has not been treating its own internal
pointer `bytes_already_parsed` the same way it treats its bookmarks.
That is, when updates are applied to the input document and then
`get_updated_html()` is called, the internal pointer transfers to
the newly-updated content as if no updates had been applied since
the previous call to `get_updated_html()`.

In this patch we're creating a new "shift accumulator" to account for
all of the updates that accrue before calling `get_updated_html()`.
This accumulated shift will be applied when swapping the input document
with the output buffer, which should result in the pointer pointing to
the same logical spot in the document it did before the udpate.

In effect this patch adds a single workaround for treating the
internal pointer like a bookmark, plus a temporary pointer which points
to the beginning of the current tag when calling `get_updated_html()`.
This will preserve the assumption that updating a document doesn't
move that pointer, or shift which tag is currently matched.

Props dmsnell, zieladam.
Fixes #58179.
Built from https://develop.svn.wordpress.org/trunk@55706


git-svn-id: http://core.svn.wordpress.org/trunk@55218 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-03 11:31:18 +00:00
audrasjb
59e90bba48 Docs: Various improvements in Bookmark Administration API function descriptions, as per docblocks standards.
Follow-up to [55704].

See #57840.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55217 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-03 10:03:21 +00:00
audrasjb
66016f2c12 Coding Standards: Remove unnecessary variable escapement in Bookmark Administration API.
This changeset removes an unnecessary `esc_html()` escapement for `link_url`, as `esc_url()` already does the job.

Follow-up to [11383].

Props utsav72640, audrasjb.
Fixes #58239.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55216 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-03 09:58:25 +00:00
Sergey Biryukov
2ec23a82ed Code Modernization: Replace usage of strpos() with str_starts_with().
`str_starts_with()` was introduced in PHP 8.0 to perform a case-sensitive check indicating if the string to search in (haystack) begins with the given substring (needle).

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

This commit replaces `0 === strpos( ... )` with `str_starts_with()` in core files, making the code more readable and consistent, as well as improving performance.

While `strpos()` is slightly faster than the polyfill on PHP < 8.0, `str_starts_with()` is noticeably faster on PHP 8.0+, as it is optimized to avoid unnecessarily searching along the whole haystack if it does not find the needle.

Follow-up to [52039], [52040], [52326].

Props spacedmonkey, costdev, sabernhardt, mukesh27, desrosj, jorbin, TobiasBg, ayeshrajans, lgadzhev, SergeyBiryukov.
Fixes #58012.
Built from https://develop.svn.wordpress.org/trunk@55703


git-svn-id: http://core.svn.wordpress.org/trunk@55215 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-02 15:45:22 +00:00
spacedmonkey
c1facaa4ce Cache API: Add helper function wp_cache_set_last_changed.
Add a helper function called `wp_cache_set_last_changed` to set the last changed value for cache groups. This function has a new action called `wp_cache_set_last_changed`, allowing for developers to cache invalidate when last changed value is changed. 

Props tillkruess, spacedmonkey, peterwilsoncc, mukesh27, johnjamesjacoby. 
Fixes #57905.
Built from https://develop.svn.wordpress.org/trunk@55702


git-svn-id: http://core.svn.wordpress.org/trunk@55214 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-02 11:26:24 +00:00
spacedmonkey
4bdeb57ac5 Taxonomy: Remove redundant call to get_term in wp_queue_posts_for_term_meta_lazyload.
In [55252] the function `wp_queue_posts_for_term_meta_lazyload` was refactored to use `wp_cache_get_multiple`. This refactor included a call to `get_term`. However, calling get_term calls `sanitize_term`, which sanitizes all fields in a term. The full term object is not needed in this context as term meta only needs to the term id, which is already in the function. Saving calls to `sanitize_term` will improve performance of this function. 

Props spacedmonkey, joemcgill, mukesh27. 
Fixes #57966.
Built from https://develop.svn.wordpress.org/trunk@55701


git-svn-id: http://core.svn.wordpress.org/trunk@55213 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-02 10:57:24 +00:00
Sergey Biryukov
fe8c41f574 External Libraries: Update license URL in Text_Diff library.
The former URL used to refer to LGPL 2.1 at the time, but does not redirect to its current location.

Includes updating the `Algorithm::Diff` Perl module URL.

Props jigar-bhanushali, utsav72640.
Fixes #58217.
Built from https://develop.svn.wordpress.org/trunk@55700


git-svn-id: http://core.svn.wordpress.org/trunk@55212 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-01 11:06:23 +00:00
Sergey Biryukov
a8390f5f7c Upgrade/Install: Update sodium_compat to v1.20.0.
The latest version of sodium_compat includes a fix for the Poly1305 implementation.

References:
* [https://github.com/paragonie/sodium_compat/releases/tag/v1.20.0 sodium_compat 1.20.0 release notes]
* [https://github.com/paragonie/sodium_compat/compare/v1.19.0...v1.20.0 Full list of changes in sodium_compat 1.20.0]

Follow-up to [49741], [51002], [51591], [52988], [54150], [54310].

Props jrf, costdev, paragoninitiativeenterprises, mukesh27.
Fixes #58224.
Built from https://develop.svn.wordpress.org/trunk@55699


git-svn-id: http://core.svn.wordpress.org/trunk@55211 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-30 14:08:23 +00:00
Sergey Biryukov
9954d0a927 Coding Standards: Break out of the inner loop in make_site_theme_from_default().
This more closely matches the previous behavior with multiple `if`/`elseif` statements.

Follow-up to [55688].

See #56982.
Built from https://develop.svn.wordpress.org/trunk@55698


git-svn-id: http://core.svn.wordpress.org/trunk@55210 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-29 18:30:23 +00:00
Sergey Biryukov
225fe28e9f Coding Standards: Bring some consistency to REST API revisions initialization.
The autosaves and revisions controllers used to set the same class properties in a slightly different order.

This commit makes the `::__construct()` methods of both classes more consistent to simplify future maintenance.

Follow-up to [46272], [51962].

See #57839.
Built from https://develop.svn.wordpress.org/trunk@55697


git-svn-id: http://core.svn.wordpress.org/trunk@55209 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-28 15:06:21 +00:00
Sergey Biryukov
19b456f9f8 REST API: Remove unused variable from the permissions check for deleting a revision.
`WP_REST_Revisions_Controller::delete_item_permissions_check()` no longer uses the value of the `$parent_post_type` variable anywhere. 

Follow-up to [45812], [47547], [47850].

Props Soean, mukesh27.
Fixes #58218.
Built from https://develop.svn.wordpress.org/trunk@55696


git-svn-id: http://core.svn.wordpress.org/trunk@55208 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-28 10:05:21 +00:00
oandregal
a14d6d04e6 Enqueue registered assets once.
This PR removes the `wp_enqueue_registered_block_scripts_and_styles` callback from the `enqueue_block_editor_assets` action.

There are two actions to enqueue block assets: `enqueue_block_editor_assets` and `enqueue_block_assets`. The former enqueues the assets to the editor and the later enqueues them to the front-end and the editor. Given `wp_enqueue_registered_block_scripts_and_styles` is already bound to the `enqueue_block_assets` (front-end and editor), it is unnecessary to bind it to `enqueue_block_editor_assets` (editor) as well.

This was originally introduced at [44157] and hasn't been modified since.

Props ellatrix, costdev.
Fixes #58208.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-28 08:51:17 +00:00
John Blackbourn
f14f3ba995 Docs: All sorts of improvements and corrections to function and hook docs.
See #57840

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


git-svn-id: http://core.svn.wordpress.org/trunk@55206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-27 23:15:17 +00:00
John Blackbourn
cc24b047eb Docs: Correct and improve various documented types for properties, functions, and hooks.
See #57840

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


git-svn-id: http://core.svn.wordpress.org/trunk@55205 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-27 22:29:18 +00:00
audrasjb
4c8a5d8d28 Docs: Typo fix in WP_REST_Block_Pattern_Categories_Controller docblock.
Props Soean.
Fixes #58204.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55204 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-27 22:25:26 +00:00
Sergey Biryukov
9953e9e51d Coding Standards: Use __DIR__ magic constant in wp-admin/options-privacy.php.
This replaces the only remaining instance of `dirname( __FILE__ )` in core to avoid the performance overhead of a function call.

Follow-up to [47198], [50161], [50631].

Props hztyfoon, rudlinkon.
Fixes #58207.
Built from https://develop.svn.wordpress.org/trunk@55691


git-svn-id: http://core.svn.wordpress.org/trunk@55203 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-27 13:14:23 +00:00
audrasjb
86d5add906 Text Changes: Typo fix in README.md.
Follow-up to [47752].

Props neychok.
Fixes #58177.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55202 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-26 22:28:19 +00:00
audrasjb
514f7f723c Editor: Improve the tag field loading spinner alignment.
This changeset improves the loading spinner alignment of the Classic Editor's tag field.

Follow-up to [19897], [31611].

Props Presskopp, SergeyBiryukov, audrasjb.
Fixes #58136.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55201 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-26 21:38:21 +00:00
Sergey Biryukov
ddc749868c Coding Standards: Remove an empty else statement in dbDelta().
Use `continue` to help separate each case for better readability, instead of having a wall of `if`/`elseif`.

Includes simplifying a similar fragment in `make_site_theme_from_default()`.

Follow-up to [1575], [2037], [2040], [2044], [2346], [7999], [14080], [14485].

Props costdev, krunal265, hellofromTonya, brookedot, SergeyBiryukov.
Fixes #56982.
Built from https://develop.svn.wordpress.org/trunk@55688


git-svn-id: http://core.svn.wordpress.org/trunk@55200 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-26 15:10:23 +00:00
oandregal
dafa13a0b9 Themes: improve performance of get_block_templates().
`get_block_templates()` is responsible for finding block templates that match a given search. The function receives a query parameter with the relevant metadata (slugs of the templates, areas of the template parts, etc) to find the user templates (database) and theme templates (file directory).

This function can be made more performant by changing how it works. Before this change, it processed all the block templates and discarded the ones that didn't match the query after it occurred. This commit makes it so it discards the templates that don't match the query before processing them. As a result, it only has to process the subset of templates that will be used, instead of all of them.

This change impacts any theme with block templates. TwentyTwentyThree reports a 15% improvement in Time To First Byte.

Props spacedmonkey, jorgefilipecosta, youknowriad, flixos90, mukesh27.
Fixes #57756.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55199 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-26 14:40:19 +00:00
oandregal
293f895c67 Themes: remove unused parameter in query for get_block_templates().
Remove the `theme` parameter from the query passed to `get_block_templates()`. It is not used or documented. This removal doesn't have any effect in the code, as the data is ignored anyway.

Props draganescu, audrasjb, davidbaumwald, hellofromTonya.
Fixes #57736.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55198 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-26 14:27:24 +00:00
Sergey Biryukov
b1474a8a20 General: Don't pass $action to wp_get_session_token() in wp_create_nonce().
The parameter appears to have been passed by accident, as the function does not accept any parameters.

Follow-up to [54218].

Props malavvasita, hztyfoon, dd32.
Fixes #58181.
Built from https://develop.svn.wordpress.org/trunk@55685


git-svn-id: http://core.svn.wordpress.org/trunk@55197 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-25 14:57:23 +00:00
audrasjb
5afe551668 I18N: Use correct translation function in wp-admin/includes/media.php.
This changeset replaces `echo __()` with the appropriate `_e()` function. It also ensures the punctuation is included in the translation string.

Props mujuonly, audrasjb, vladytimy, krupalpanchal, mukesh27.
Fixes #58138.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55196 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-24 21:28:18 +00:00
Sergey Biryukov
4f73468485 Coding Standards: Update code layout in default_password_nag() for readability.
This aims to better match similar fragments in other core functions.

Follow-up to [11162], [13844], [14170], [55682].

See #57839.
Built from https://develop.svn.wordpress.org/trunk@55683


git-svn-id: http://core.svn.wordpress.org/trunk@55195 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-24 16:57:20 +00:00
audrasjb
0192ff842c Coding Standards: Escape edit profile URL in default_password_nag().
Props utsav72640, mukesh27.
Fixes #58182.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55194 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-24 16:44:19 +00:00
audrasjb
b556c3aa25 Docs: Use third-person singular verbs in various function descriptions, as per docblocks standards.
Props laurentmagnin, pouicpouic, jbcouton, audrasjb.
See #57840.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55193 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-24 16:37:22 +00:00
spacedmonkey
3d744b601c Users: Change cache group from users-queries to user-queries.
The cache group `users-queries` was added in [55657]. This global cache group, was named to be inline with cache groups added in [55526]. However, the naming of the group does not match, as other cache groups, do not end with s at the end. This change fix this naming. 

Props spacedmonkey, SergeyBiryukov, peterwilsoncc. 
See #40613.
Built from https://develop.svn.wordpress.org/trunk@55680


git-svn-id: http://core.svn.wordpress.org/trunk@55192 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-24 13:53:22 +00:00
Sergey Biryukov
6f745b9fca Coding Standards: Use strict comparison in wp-admin/includes/class-wp-site-icon.php.
Follow-up to [32994], [35299].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.
Built from https://develop.svn.wordpress.org/trunk@55678


git-svn-id: http://core.svn.wordpress.org/trunk@55190 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-23 04:02:18 +00:00
Sergey Biryukov
0c5a04d541 Coding Standards: Use strict comparison where strtolower() is involved.
Follow-up to [649], [7736], [18821], [19444], [20886], [20893], [23303], [55642], [55652], [55653], [55654].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.
Built from https://develop.svn.wordpress.org/trunk@55677


git-svn-id: http://core.svn.wordpress.org/trunk@55189 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-22 15:19:22 +00:00
Sergey Biryukov
ead3a2ec81 Coding Standards: Remove unused $key variable in wp-admin/network/sites.php.
Rename `$val` to `$site_id` for clarity.

Follow-up to [12603], [18562], [30020].

See #57839.
Built from https://develop.svn.wordpress.org/trunk@55676


git-svn-id: http://core.svn.wordpress.org/trunk@55188 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-21 13:34:18 +00:00
zieladam
8659101491 HTML API: Fix a case where updates are overlooked when seeking to earlier locations.
This retains the WP_HTML_Tag_Processor attribute updates applied before calling seek() – they were erroneously erased in some cases.

Props dmsnell.
Fixes #58160.




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


git-svn-id: http://core.svn.wordpress.org/trunk@55187 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-21 13:32:25 +00:00
zieladam
1919350606 HTML API: Update code style so it passes when backported into Gutenberg.
This changes the indentation of a variable in class-wp-html-tag-processor.php 
to satisfy both WordPress and Gutenberg linters.

Props dmsnell, ntsekouras.
Fixes #58170.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55186 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-21 12:33:23 +00:00
gziolo
56145f874a Editor: Add selectors field to block type definition
Adds support for the new selectors property for block types. It adds it to the allowed metadata when registering a block type, makes the WP_Block_Type class aware of it, exposes it through the block types REST API, and the get_block_editor_server_block_settings function.

Corresponding work in the Gutenberg plugin: https://github.com/WordPress/gutenberg/pull/46496.

Fixes #57585.
Props aaronrobertshaw, hellofromTonya.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55185 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-21 10:43:25 +00:00
Sergey Biryukov
47ef384731 Networks and Sites: Use is_main_site() in a few more places.
This updates some more instances of comparing site IDs on Sites and Users screens in network admin to use `is_main_site()` for clarity.

Follow-up to [12603], [13918], [22064], [38814], [41131], [55666].

See #58150.
Built from https://develop.svn.wordpress.org/trunk@55672


git-svn-id: http://core.svn.wordpress.org/trunk@55184 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-21 09:50:19 +00:00
spacedmonkey
469d8a5e24 Taxonomy: Always lazily load term meta.
In [34529] introduced lazy loading of term meta. However, this was only in the context of `WP_Query`. Other parts of the codebase, like `WP_Term_Query` did not lazily load term meta. In this change, calls to `update_termmeta_cache` are now replaced with `wp_lazyload_term_meta`, that instead of priming term meta caches, just adds them to the queue to be primed it ever called. This results in far less database queries, as there a number of places where term meta is being primed unnecessarily and never used. Adding everything to the term meta queue, also means that if term meta is used, that is all loaded in a single database / cache call.

Props spacedmonkey, mukesh27, peterwilsoncc. 
Fixes #57645.
Built from https://develop.svn.wordpress.org/trunk@55671


git-svn-id: http://core.svn.wordpress.org/trunk@55183 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-21 09:24:22 +00:00
Peter Wilson
769915b890 Security: Update GitHub security policy to refer to H1.
Update the security policy displayed on GitHub, `SECURITY.md`, to refer visitors to the [https://hackerone.com/wordpress HackerOne WordPress program] for the full policy.

This allows the project to maintain a single source of truth and avoid the potential for conflicting information across the two sites.

Props desrosj, hellofromTonya, costdev.
Fixes #57937.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55182 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-21 03:19:18 +00:00
Andrew Ozz
b1a6d31cfe Script Loader: Improve code style and readability in _wp_normalize_relative_css_links().
Props: westonruter.
See: 58069.
Built from https://develop.svn.wordpress.org/trunk@55669


git-svn-id: http://core.svn.wordpress.org/trunk@55181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-21 03:13:22 +00:00
Bernhard Reiter
b116fcdb27 HTML API: Add support for a few invalid HTML comment forms.
- Comments created by means of a tag closer with an invalid tag name, e.g. `</3>`.
 - Comments closed with the invalid `--!>` closer. (Comments should be closed by `-->` but if the `!` appears it will also close it, in error.)
 - Empty tag name elements, which are technically skipped over and aren't comments, e.g. `</>`.

Props dmsnell, costdev.
Fixes #58007.
Built from https://develop.svn.wordpress.org/trunk@55667


git-svn-id: http://core.svn.wordpress.org/trunk@55179 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-20 17:10:20 +00:00
Sergey Biryukov
19d36bfdd2 Networks and Sites: Simplify the check for main site on Network Admin → Sites screen.
This replaces a site ID comparison when displaying action links in `WP_MS_Sites_List_Table::handle_row_actions()` with a dedicated function call, `is_main_site()`, for clarity.

Follow-up to [13918], [25125], [26120], [32644], [38814].

Props ecorica, spacedmonkey, SergeyBiryukov.
Fixes #58150.
Built from https://develop.svn.wordpress.org/trunk@55666


git-svn-id: http://core.svn.wordpress.org/trunk@55178 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-20 14:30:19 +00:00
Sergey Biryukov
150781cb41 Site Health: Bump the recommended MariaDB version to 10.4.
MariaDB 10.3 reaches EOL (“End of Life”) in May 2023. The recommended minimum is bumped to 10.4 for now.

References:
* [https://mariadb.org/about/#maintenance-policy MariaDB Maintenance policy]
* [https://make.wordpress.org/hosting/handbook/server-environment/#database Hosting team handbook: Server Environment: Database]

Follow-up to [52420], [53435], [54069], [54076].

Props JavierCasares.
See #58158.
Built from https://develop.svn.wordpress.org/trunk@55665


git-svn-id: http://core.svn.wordpress.org/trunk@55177 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-20 13:54:18 +00:00
audrasjb
d52a8492ea Docs: Use third-person singular verbs for WP_Importer related function descriptions, as per docblocks standards.
Props pouicpouic.
See #57840.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55176 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-20 10:41:20 +00:00
Sergey Biryukov
8a6e056ad2 Tests: Correct the expected quotes in get_comment_author_url_link() tests.
Follow-up to [55660].

See #57839.
Built from https://develop.svn.wordpress.org/trunk@55661


git-svn-id: http://core.svn.wordpress.org/trunk@55173 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-19 14:51:18 +00:00
Sergey Biryukov
91deaf5017 Coding Standards: Use more meaningful variable names in various comment functions.
This aims to bring more consistency between the functions, as well as in filter parameters.

Includes minor code layout fixes for better readability.

Follow-up to [45667], [47287], [48579], [53719], [53723], [55308].

See #57839.
Built from https://develop.svn.wordpress.org/trunk@55660


git-svn-id: http://core.svn.wordpress.org/trunk@55172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-19 14:40:19 +00:00
Bernhard Reiter
3b58785908 HTML API: Ensure attribute updates happen only once for case variants.
When setting a new value for an attribute multiple times and providing
multiple case variations of the attribute name the Tag Processor has
been appending multiple copies of the attribute into the updated HTML.

This means that only the first attribute set determines the value in
the final output, plus the output will //appear// wrong.

In this patch we're adding a test to catch the situation and resolving it
by using the appropriate comparable attribute name as a key for storing
the updates as we go. Previously we stored updates to the attribute by
its given `$name`, but when a new update of the same name with a
case variant was queued, it would not override the previously-enqueued
value as it out to have.

Props dmsnell, zieladam.
Fixes #58146.
Built from https://develop.svn.wordpress.org/trunk@55659


git-svn-id: http://core.svn.wordpress.org/trunk@55171 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-19 09:27:22 +00:00
Weston Ruter
189c1ee49a Script Loader: Optimize performance of _wp_normalize_relative_css_links() by more than 2x.
* Replace `preg_match_all()` and its secondary `str_replace()` call with `preg_replace_callback()`.
* Fix case where paths beginning with `http` and `https` (but not `http:` and `https:`) were erroneously not counted as relative.
* Improve code style and readability by consolidating conditions and returning once.
* Use `str_starts_with()` consistently instead of `strpos()`.

Follow-up to [52036], [52695], and [52754].

Fixes #58069.
See #54243.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55170 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-19 01:26:28 +00:00
spacedmonkey
2a82f1527d Users: Cache database queries within WP_User_Query class.
Cache the results of database queries within `WP_User_Query` class. Only cache queries that are requesting 3 or less fields so that caches are not storing full user objects. Cache results are stored in a new global cache group named `users-queries`. Add a new parameter to `WP_User_Query` called `cache_results` to allow developers to opt out of a receiving cached results. `cache_results` parameter defaults to true. Also add a new helper function called `wp_cache_set_users_last_changed`, similar to `wp_cache_set_posts_last_changed` that incroments last changed value in cache group `users`.  Ensure that `wp_cache_set_users_last_changed` is called whenever user / user meta is modified for proper cache invalidation. 

Props johnjamesjacoby, spacedmonkey, westi, dd32, strategio, srikanthmeenakshi, OllieJones, khoipro, rjasdfiii, flixos90, mukesh27, peterwilsoncc. 
Fixes #40613.
Built from https://develop.svn.wordpress.org/trunk@55657


git-svn-id: http://core.svn.wordpress.org/trunk@55169 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-18 11:50:27 +00:00
Sergey Biryukov
cc03c195c1 Coding Standards: Use strict comparison in wp-admin/includes/class-wp-ms-sites-list-table.php.
Includes minor code layout fixes for better readability.

Follow-up to [12603], [32630], [32755], [46441].

Props mujuonly, audrasjb, jankyz, krupalpanchal, SergeyBiryukov.
Fixes #58139.
Built from https://develop.svn.wordpress.org/trunk@55656


git-svn-id: http://core.svn.wordpress.org/trunk@55168 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-18 08:37:19 +00:00
audrasjb
c34fad6c8b Twenty Nineteen: Fix a translation issue in Comments navigation text.
This changeset combines text strings for "Previous Comments" and "Next Comments" links to ensure translators can control word order in each string. The `span` tags are included in the translation to give more control over what is hidden on small screens.

Props sabernhardt.
Fixes #58149.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55167 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-18 08:24:25 +00:00
Sergey Biryukov
0e7e4ef0d5 Coding Standards: Use strict comparison where trim() is involved.
Follow-up to [17189], [24623], [55642], [55652], [55653].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.
Built from https://develop.svn.wordpress.org/trunk@55654


git-svn-id: http://core.svn.wordpress.org/trunk@55166 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-17 17:01:24 +00:00
Sergey Biryukov
800b2b4261 Coding Standards: Use strict comparison where substr() is involved.
Follow-up to [3606], [10738], [33359], [55642], [55652].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.
Built from https://develop.svn.wordpress.org/trunk@55653


git-svn-id: http://core.svn.wordpress.org/trunk@55165 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-16 10:48:22 +00:00
Sergey Biryukov
4d6f46401f Coding Standards: Use strict comparison where strlen() is involved.
Follow-up to [649], [1345], [3034], [6132], [6314], [6974], [55642].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.
Built from https://develop.svn.wordpress.org/trunk@55652


git-svn-id: http://core.svn.wordpress.org/trunk@55164 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-15 12:11:24 +00:00
Sergey Biryukov
f0352db3e4 Coding Standards: Rename the $myHTML parameter to $text in htmlentities2().
This resolves a WPCS warning:
{{{
Variable "$myHTML" is not in valid snake_case format, try "$my_h_t_m_l"
}}}

It also matches other formatting functions with the `$text` parameter, e.g. `esc_html()`, `ent2ncr()`, etc.

Follow-up to [1727], [3717], [8662], [8743], [54927].

Props victoranto, audrasjb, jrf.
Fixes #58129.
Built from https://develop.svn.wordpress.org/trunk@55651


git-svn-id: http://core.svn.wordpress.org/trunk@55163 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-14 01:27:23 +00:00
Sergey Biryukov
97ffc006b0 Coding Standards: Use strict comparison in wp-includes/http.php.
Follow-up to [17914], [55642].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.
Built from https://develop.svn.wordpress.org/trunk@55650


git-svn-id: http://core.svn.wordpress.org/trunk@55162 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-13 15:43:21 +00:00
joedolson
996fe7077e Media: Render attachment custom fields for new uploads.
Initialize attachment custom fields during the `add` callback, so that fields are present as soon as an attachment is uploaded but do not refresh when field values are changed. Follow up to #40909.

Props trepmal, adamsilverstein, joedolson.
Fixes #58051.
Built from https://develop.svn.wordpress.org/trunk@55649


git-svn-id: http://core.svn.wordpress.org/trunk@55161 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-12 23:44:22 +00:00
Sergey Biryukov
7478b8d5af Coding Standards: Rename the $qtInit and $mceInit variables in _WP_Editors.
This resolves 37 WPCS warnings along the lines of:
{{{
Variable "$qtInit" is not in valid snake_case format, try "$qt_init"
Variable "$mceInit" is not in valid snake_case format, try "$mce_init"
}}}

Follow-up to [18498].

See #57839.
Built from https://develop.svn.wordpress.org/trunk@55648


git-svn-id: http://core.svn.wordpress.org/trunk@55160 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-12 09:43:21 +00:00
audrasjb
ac160bcd14 Media: Deprecate wp-admin/media.php.
The `wp-admin/media.php` file was introduced in [7262], then removed from the Media workflow in [21948].
This changeset finally deprecates it as it is not used anymore.

Follow-up to [7262], [21948].

Props kebbet, costdev, SergeyBiryukov, jrf, antpb, audrasjb.
Fixes #57612.
See #6181, #21391, #57608.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55159 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-11 22:26:18 +00:00
audrasjb
d85d579ba1 Docs: Revise comments using “we” in various docblocks.
This updates some inline comments to better match the guidelines and recommendations set forth in the make/core and make/docs handbooks:

> In general, use second person in your documentation. Second person depicts a friendly tone, with a perfect focus on the reader. In addition to this, directly addressing the reader helps avoid passive voice; thereby preventing unwanted confusion. The word “we” should be avoided (...) unless its made very clear which group is speaking.

References:
- [https://make.wordpress.org/docs/style-guide/language-grammar/grammatical-person/ Style Guide: Grammatical person]
- [https://make.wordpress.org/docs/handbook/documentation-team-handbook/handbooks-style-and-formatting-guide/ Handbooks & HelpHub Style and Formatting Guide]
- [https://make.wordpress.org/core/handbook/best-practices/post-comment-guidelines/#style-and-substance Post & Comment Guidelines: Style and Substance]

Follow-up to [2176], [3430], [4676], [6009], [7991], [12688], [12762], [26008], [28978], [44488], [44962], [51979], [53131], [53132], [53156], [53131], [54200], [54866].

Props majaloncar, leamcaleese, annebovelett.
Fixes #57052.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55158 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-11 22:06:22 +00:00
Sergey Biryukov
968156d9ee Coding Standards: Use strict comparison in wp-admin/maint/repair.php.
Follow-up to [12092], [19757].

Props azouamauriac, aristath, poena, afercia, SergeyBiryukov.
See #57839.
Built from https://develop.svn.wordpress.org/trunk@55645


git-svn-id: http://core.svn.wordpress.org/trunk@55157 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-11 16:30:22 +00:00
audrasjb
8bbfa10e2f Docs: Fix a typo in wp-includes/rss.php inline comments.
This changeset replaces "wc3dtf" with "W3C date/time formats" to fix a typo and to provide a better description of the related code.

Props lanacodes, sabernhardt, nithins53.
Fixes #57467.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55156 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-10 19:31:18 +00:00
audrasjb
537cf32fb4 Twenty Twenty-Three: Add style-variations tag in style.css.
The `style-variations` tag was recently added on the Theme repository. As Twenty Twenty-Three proposes several Style variations, let's add a `style-variations` tag to the header of its stylesheet.

Props kafleg, SergeyBiryukov, mukesh27.
Fixes #58110.
See meta#6545.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55155 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-10 18:39:19 +00:00
Sergey Biryukov
bdfe3d5a46 Coding Standards: Use strict comparison where count() is involved.
Follow-up to [1636], [6974], [8114], [10322], [13326], [14760], [18006], [18541], [19743], [23249], [24115], [33359].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.
Built from https://develop.svn.wordpress.org/trunk@55642


git-svn-id: http://core.svn.wordpress.org/trunk@55154 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-10 12:56:21 +00:00
Sergey Biryukov
0008d8df06 Coding Standards: Replace include_once with require_once for required files.
Per [https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#writing-include-require-statements WordPress PHP coding standards], it is ''strongly recommended'' to use `require[_once]` for unconditional includes. When using `include[_once]`, PHP will throw a warning when the file is not found but will continue execution, which will almost certainly lead to other errors/warnings/notices being thrown if your application depends on the file loaded, potentially leading to security leaks. For that reason, `require[_once]` is generally the better choice as it will throw a `Fatal Error` if the file cannot be found.

Follow-up to [1674], [1812], [1964], [6779], [8540], [10521], [11005], [11911], [16065], [16149], [25421], [25466], [25823], [37714], [42981], [45448], [47198], [54276], [55633].

Props kausaralm, SergeyBiryukov.
See #57839.
Built from https://develop.svn.wordpress.org/trunk@55641


git-svn-id: http://core.svn.wordpress.org/trunk@55153 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-09 11:57:22 +00:00
audrasjb
2193d75aa1 Networks and Sites: Fix incorrect color for Theme enabling admin notices.
This changeset replaces a `notice-updated` class with `notice-success` to fix an issue where the notices were using a gray border color instead of green when enabling or disabling a theme for a network.

Follow-up to [55418].

Props ocean90, audrasjb, marineevain, SergeyBiryukov, dhrumilk, chiragrathod103.
Fixes #58096.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55149 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-08 09:31:18 +00:00
Sergey Biryukov
6b72fd183f Twenty Twenty-One: Replace include_once with require_once for required classes.
Per [https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#writing-include-require-statements WordPress PHP coding standards], it is ''strongly recommended'' to use `require[_once]` for unconditional includes. When using `include[_once]`, PHP will throw a warning when the file is not found but will continue execution, which will almost certainly lead to other errors/warnings/notices being thrown if your application depends on the file loaded, potentially leading to security leaks. For that reason, `require[_once]` is generally the better choice as it will throw a `Fatal Error` if the file cannot be found.

Follow-up to [49216], [49633].

Props wpfy.
See #57839.
Built from https://develop.svn.wordpress.org/trunk@55633


git-svn-id: http://core.svn.wordpress.org/trunk@55145 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-08 09:05:22 +00:00
Sergey Biryukov
b4c66d31ac Comments: Add missing arguments for get_comment_time() in comment_time().
In a recent change, `comment_time()` was updated to accept a `$comment_id` parameter for consistency with `comment_date()`, following a similar change for `get_comment_time()`.

However, the new parameter was not correctly passed to `get_comment_time()` inside the function. It should be passed as the fourth parameter after `$format`, `$gmt` and `$translate`, not the second.

This commit adds the missing arguments and a few unit tests to confirm the correct behavior.

Follow-up to [55284], [55287], [55308].

Props costdev, tmatsuur, ugyensupport, johnbillion.
Fixes #58064.
Built from https://develop.svn.wordpress.org/trunk@55632


git-svn-id: http://core.svn.wordpress.org/trunk@55144 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-07 14:36:21 +00:00
Sergey Biryukov
03c3f90824 Coding Standards: Correct sprintf() calls for messages in wp-admin/upload.php.
This ensures that `sprintf()` is not unnecessarily applied to strings without any placeholders.

Follow-up to [31941], [31619], [36328], [55178].

See #57839.
Built from https://develop.svn.wordpress.org/trunk@55631


git-svn-id: http://core.svn.wordpress.org/trunk@55143 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-06 17:39:24 +00:00
Sergey Biryukov
4f6e5a3b7f I18N: Correct translator comments placement in wp-admin/edit-comments.php.
This ensures that the translator comments are displayed for the strings they refer to, e.g. to explain placeholders in comment action messages, and are not displayed for unrelated strings, e.g. "Undo", to avoid confusion.

Includes minor code layout fixes and wrapping a few long lines for better readability.

Follow-up to [35549], [45926], [45932].

Props afercia.
See #57839.
Built from https://develop.svn.wordpress.org/trunk@55630


git-svn-id: http://core.svn.wordpress.org/trunk@55142 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-06 16:44:22 +00:00
Sergey Biryukov
94b55b2643 External Libraries: Update the Requests library to version 2.0.6.
This is a maintenance release with minor changes:
* Fix typo in deprecation notice.
* Minor internal improvements for passing the correct type to function calls.
* Confirmed compatibility with PHP 8.2. No changes were needed, so Requests 2.0.1 and higher can be considered compatible with PHP 8.2.
* Various documentation improvements and other general housekeeping.

References:
* [https://github.com/WordPress/Requests/releases/tag/v2.0.6 Requests 2.0.6 release notes]
* [https://github.com/WordPress/Requests/compare/v2.0.5...v2.0.6 Full list of changes in Requests 2.0.6]

Follow-up to [54997], [55007], [55046], [55225], [55296].

Props jrf, costdev.
Fixes #58079.
Built from https://develop.svn.wordpress.org/trunk@55629


git-svn-id: http://core.svn.wordpress.org/trunk@55141 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-05 13:12:26 +00:00
Peter Wilson
a0de188b5d Script Loader: Remove unused wp-nux CSS dependency.
Neither `wp-edit-post` nor `wp-editor` use the styles included in the `wp-nux` CSS file. This removes nux as a dependency from the registration of the two files.

Props flixos90, youknowriad, peterwilsoncc.
Fixes #57827.
See #57643.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55140 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-04 23:37:20 +00:00
audrasjb
e63019817f Help/About: Fix the Support Forums URL in wp-admin/includes/class-wp-site-health.php.
This updates a link to Support Forums by replacing `https://wordpress.org/support/` URL with `https://wordpress.org/support/forums/`.

Follow-up to [55412], [55413], [55414], [55624], [55625], [55626].

Props sabernhardt, audrasjb.
See #58052, #57726.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55139 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-04 23:01:23 +00:00
audrasjb
c320cf8980 Help/About: Use the new /documentation/ URLs in options-permalink.php.
As `https://wordpress.org/support/` was redirected to `https://wordpress.org/documentation/`, this changeset replaces various `/support/*` links with `/documentation/*` to avoid extra redirects.

Follow-up to [55412], [55413], [55414], [55624], [55625].

Props sabernhardt, audrasjb.
See #58052, #57726.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55138 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-04 22:52:19 +00:00
audrasjb
66bb73798b Help/About: Use the new /documentation/ URLs for links about WordPress version.
As `https://wordpress.org/support/` was redirected to `https://wordpress.org/documentation/`, this changeset replaces various `/support/*` links with `/documentation/*` to avoid extra redirects. This addresses a missed occurrence from [55624].

Follow-up to [55412], [55413], [55414], [55624].

Props wildworks.
See #58052, #57726.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55137 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-04 22:43:23 +00:00
audrasjb
9fe7d42f6a Help/About: Use the new /documentation/ URLs for links about WordPress version.
As `https://wordpress.org/support/` was redirected to `https://wordpress.org/documentation/`, this changeset replaces various `/support/*` links with `/documentation/*` to avoid extra redirects.

Follow-up to [55412], [55413], [55414].

Props wildworks.
See #58052, #57726.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55136 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-04 22:38:22 +00:00
audrasjb
3b39b2c99c Coding Standards: Use strict comparison in wp-admin/users.php.
Follow-up to [10990], [11162], [11217], [37059], [55592], [55622].
Props faisalahammad.
Fixes #58040.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-04 21:12:24 +00:00
audrasjb
69bbd538d5 Coding Standards: Use strict comparison in wp-admin/users.php.
Follow-up to [10990], [11162], [11217], [37059], [55592].
Props moinrrahmed.
Fixes #58056.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55134 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-04 21:02:26 +00:00
Sergey Biryukov
24f3ba70f5 Upgrade/Install: Include the removed Windows Live Writer manifest in $_old_files.
This ensures that the file and a few related images are also removed from existing installations on update.

Follow-up to [55620].

Props ocean90.
Fixes #41404.
Built from https://develop.svn.wordpress.org/trunk@55621


git-svn-id: http://core.svn.wordpress.org/trunk@55133 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-04 17:37:25 +00:00
Sergey Biryukov
e3360c89e2 General: Remove Windows Live Writer manifest file.
The XML manifest was originally added in WordPress 2.3.1 to turn on tagging support in Windows Live Writer.

Given that the last major release of the software came out in 2012, and it was completely discontinued in January 2017, including this file in core no longer provides any benefit.

Follow-up to [6192], [49904].

Props joostdevalk, ayeshrajans, flixos90, jhabdas, frank-klein, wtranch, SergeyBiryukov.
Fixes #41404.
Built from https://develop.svn.wordpress.org/trunk@55620


git-svn-id: http://core.svn.wordpress.org/trunk@55132 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-04 14:56:22 +00:00
Bernhard Reiter
fbc006e2b2 HTML API: Add has_self_closing_flag() to Tag Processor.
In this patch we're adding `has_self_closing_flag()` to the HTML Tag Processor.
This exposes whether a currently-matched tag contains the self-closing flag `/`.

This information is critical for the evolution of the HTML API in order
to track and parse HTML structure, specifically, knowing whether an
HTML foreign element is self-closing or not.

Props dmsnell, zieladam.
Fixes #58009.
Built from https://develop.svn.wordpress.org/trunk@55619


git-svn-id: http://core.svn.wordpress.org/trunk@55131 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-04 10:06:27 +00:00
Sergey Biryukov
6af7679802 Coding Standards: Correct the closing PHP tag placement in some admin files.
Follow-up to [1596], [1818], [11009], [16183], [16582], [16592].

Props faisalahammad, audrasjb.
Fixes #58053.
Built from https://develop.svn.wordpress.org/trunk@55618


git-svn-id: http://core.svn.wordpress.org/trunk@55130 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-03 12:00:27 +00:00
Sergey Biryukov
a415951b8f Docs: Document default values for optional parameters in wp_insert_attachment().
This adds the missing mentions of default value for the `$file` and `$parent_post_id` parameters.

Follow-up to [2921], [3092], [3303], [3851], [6155], [6379], [8669], [15590], [28788], [38408], [49936], [55021].

Props wpfy.
Fixes #58043.
Built from https://develop.svn.wordpress.org/trunk@55617


git-svn-id: http://core.svn.wordpress.org/trunk@55129 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-02 13:01:23 +00:00
Sergey Biryukov
df4ed4015a Coding Standards: Escape the whole attributes in wp-admin/includes/nav-menu.php.
It is best to always escape the complete value of an attribute, not a partial value, as otherwise the escaping could be (partially) undone when the values are joined together.

While the hardcoded prefix/suffix values in this case don't necessarily create that risk, those may change to values which could be problematic, so making it a habit to escape the value in one go is best practice.

Includes:
* Moving a few `esc_url()` calls closer to the actual output and escaping the hash parts too.
* Wrapping a few long lines for better readability.

Follow-up to [14248], [23707], [42217], [55615].

Props jrf, SergeyBiryukov.
Fixes #57110.
Built from https://develop.svn.wordpress.org/trunk@55616


git-svn-id: http://core.svn.wordpress.org/trunk@55128 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-04-01 08:37:20 +00:00
Sergey Biryukov
6ccbf0e9bc Coding Standards: Escape some variables in wp-admin/includes/nav-menu.php.
This ensures that post type or taxonomy name is consistently escaped in:
* `wp_nav_menu_item_post_type_meta_box()`
* `wp_nav_menu_item_taxonomy_meta_box()`

Follow-up to [14248], [23707].

Props zenaulislam, SergeyBiryukov.
Fixes #57110.
Built from https://develop.svn.wordpress.org/trunk@55615


git-svn-id: http://core.svn.wordpress.org/trunk@55127 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-31 16:00:25 +00:00
Sergey Biryukov
7714010f60 Comments: Use correct escaping function in get_cancel_comment_reply_link().
Follow-up to [9112], [9406], [11011], [11380], [11383], [44659].

Props chintan1896, ankitmaru.
Fixes #58025.
Built from https://develop.svn.wordpress.org/trunk@55614


git-svn-id: http://core.svn.wordpress.org/trunk@55126 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-30 15:18:17 +00:00
spacedmonkey
5219039dd3 Tests: Fix tests introduced in [55612].
In [55612] a change was added that made two unit tests fail. Fix these test by forcing `get_merged_data` method to run.  

Props spacedmonkey, mukesh27.
See #57814.
Built from https://develop.svn.wordpress.org/trunk@55613


git-svn-id: http://core.svn.wordpress.org/trunk@55125 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-30 12:17:21 +00:00
spacedmonkey
dd5f6c7b10 Script Loader: Return early in _wp_theme_json_webfonts_handler if theme.json not present.
Check to see if the theme.json file exists before processing the rest of the code in `_wp_theme_json_webfonts_handler`. This improves performance by not trying to parse the theme.json, early in the bootstrap process. 

Props spacedmonkey, hellofromTonya, flixos90.
Fixes #57814.
Built from https://develop.svn.wordpress.org/trunk@55612


git-svn-id: http://core.svn.wordpress.org/trunk@55124 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-30 11:08:21 +00:00
spacedmonkey
2da45425ae Options, Meta APIs: Improve the lazy loading meta API to include current object id.
The existing lazy loading meta api, creates a queue of ids, to be primed, if the `get_comment_meta` or `get_term_meta` functions are called. However, it did not check to see if the requested id was in the queue, before prime all the ids in the queue. Now, it adds the id to the queue, is not already in the queue, saving a cache lookup / database query. 

Props spacedmonkey, peterwilsoncc, mukesh27, flixos90.
Fixes #57901.
Built from https://develop.svn.wordpress.org/trunk@55608


git-svn-id: http://core.svn.wordpress.org/trunk@55120 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-29 10:50:18 +00:00
spacedmonkey
90b94aeddc Comments: Use wp_cache_get_multiple in WP_Comment_Query.
In the `fill_descendants` method in `WP_Comment_Query`, there is a loop the calls `wp_cache_get` to get `child comments. Instead of getting one key at a time, use `wp_cache_get_multiple` and get all keys at once.

Props spacedmonkey, tillkruess, mukesh27.
Fixes #57803.
Built from https://develop.svn.wordpress.org/trunk@55607


git-svn-id: http://core.svn.wordpress.org/trunk@55119 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-29 10:20:20 +00:00
Sergey Biryukov
f940bc822d Coding Standards: Apply various alignment corrections from composer format.
This fixes a few WPCS warnings along the lines of:
* Array double arrow not aligned correctly
* Equals sign not aligned with surrounding statements
* Usage of ELSE IF is discouraged; use ELSEIF instead

Follow-up to [55099], [55192], [55194], [55271].

Props davidbaumwald, jrf, SergeyBiryukov.
Fixes #57994.
Built from https://develop.svn.wordpress.org/trunk@55606


git-svn-id: http://core.svn.wordpress.org/trunk@55118 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-29 07:13:23 +00:00
hellofromTonya
08e9393f23 Help/About: Make Field Guide link translatable.
On the About page, wraps the Field Guide's link in `__()` to provide a localized field guide, when available.

Follow-up to [55600].

Props davidbaumwald, sergeybiryukov, desrosj, javiercasares, oglekler, mukesh27, clorith, eboxnet, costdev, ocean90.
Fixes #57477.
Built from https://develop.svn.wordpress.org/trunk@55601


git-svn-id: http://core.svn.wordpress.org/trunk@55113 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-28 15:36:18 +00:00
hellofromTonya
7237836b1a Help/About: Add Field Guide link.
In the About page, replaces the `#` placeholder with the link to the Field Guide.

Follow-up to [55573], [55449], [55499], [55545].

Props vladytimy, ocean90.
Fixes #57998.
Built from https://develop.svn.wordpress.org/trunk@55600


git-svn-id: http://core.svn.wordpress.org/trunk@55112 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-28 15:14:19 +00:00
hellofromTonya
b1d826fb6e Date/Time: Revert [55054].
This changeset introduced a regression for partial-hour timezones such as +05:30 UTC which is India and Sri Lanka. How? These timezones are in float. The change made in [55054] type casted them to integer which dropped the decimal for the partial-hour, making the time inaccurate. For example, +05:30 UTC (India and Sri Lanka)'s `'gmt_offset'` is `5.5`, but with the changeset, it was changed to `5`.

Reverting the changeset restores the original state of `current_time()` and thus resolves the regression.

Props reputeinfosystems, Rarst, hellofromTonya, desrosj, audrasjb, sergeybiryukov, costdev, priethor, francina, nekojonez, codingchicken, cbringmann.
See #57035.
Fixes #57998.
Built from https://develop.svn.wordpress.org/trunk@55598


git-svn-id: http://core.svn.wordpress.org/trunk@55110 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-28 14:22:21 +00:00
Sergey Biryukov
f0f0173e40 Docs: Use typed array notation for search_columns in WP_Query::parse_query().
Follow-up to [55248].

Props tmatsuur.
Fixes #57996.
Built from https://develop.svn.wordpress.org/trunk@55597


git-svn-id: http://core.svn.wordpress.org/trunk@55109 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-28 10:56:23 +00:00
Dion Hulse
5ce81844a8 Coding Standards: Use the correct variable.
Follow-up to [55593].

See #57318.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55108 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-28 05:34:21 +00:00
Sergey Biryukov
79d6ac7fd7 Docs: Clarify the ::hide_process_failed() return value in plugin and theme installer.
Follow-up to [48390].

Props sakibmd, jrf, patelmohip, akmelias.
Fixes #57680.
Built from https://develop.svn.wordpress.org/trunk@55595


git-svn-id: http://core.svn.wordpress.org/trunk@55107 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-27 15:11:20 +00:00
Sergey Biryukov
b7ef3ffdd3 Docs: Add missing @return tag for WP_Automatic_Updater::is_disabled().
Follow-up to [25421], [25823], [25859].

Props sakibmd, jrf, patelmohip, akmelias.
See #57680.
Built from https://develop.svn.wordpress.org/trunk@55594


git-svn-id: http://core.svn.wordpress.org/trunk@55106 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-27 14:13:22 +00:00
Sergey Biryukov
7127052046 Coding Standards: Use strict comparison in wp-admin/includes/nav-menu.php.
Follow-up to [14248], [15008], [37748].

Props jenilk, johnbillion.
Fixes #57318.
Built from https://develop.svn.wordpress.org/trunk@55593


git-svn-id: http://core.svn.wordpress.org/trunk@55105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-26 10:06:18 +00:00
Sergey Biryukov
95a52be05d Coding Standards: Use strict comparison in wp-admin/includes/user.php.
Follow-up to [10990], [11162], [11217], [37059].

Props jenilk.
Fixes #57317.
Built from https://develop.svn.wordpress.org/trunk@55592


git-svn-id: http://core.svn.wordpress.org/trunk@55104 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-25 15:25:26 +00:00
Sergey Biryukov
7278aadd72 Tests: Split the tests from post/template.php into individual test classes.
This aims to bring some consistency to the location of post template function tests, as well as to make the tests more discoverable and easier to expand.

Includes:
* Adding `@covers` tags.
* Renaming `get_post_parent()` and `has_post_parent()` tests to match the names of the functions.

Follow-up to [28398], [31522], [34654], [34950], [50127], [50396], [54717], [54726], [55590].

See #57841.
Built from https://develop.svn.wordpress.org/trunk@55591


git-svn-id: http://core.svn.wordpress.org/trunk@55103 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-24 17:12:21 +00:00
Sergey Biryukov
33346784dc Tests: Move wp_dropdown_pages() tests to their own file.
This aims to make the tests more discoverable and easier to expand.

Includes removing a basic test hidden among `get_pages()` tests, as there is already a more comprehensive set of tests available.

Follow-up to [1279/tests], [28399], [31338].

See #57841.
Built from https://develop.svn.wordpress.org/trunk@55590


git-svn-id: http://core.svn.wordpress.org/trunk@55102 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-24 16:14:22 +00:00
Sergey Biryukov
d32720d67c Tests: Add a @ticket reference for wp_list_pages() CSS classes test.
Follow-up to [55588].

See #57841.
Built from https://develop.svn.wordpress.org/trunk@55589


git-svn-id: http://core.svn.wordpress.org/trunk@55101 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-24 15:07:21 +00:00
Sergey Biryukov
a9e3cb71bb Tests: Move the wp_list_pages() test for CSS classes to a more appropriate place.
Back when this test was introduced, `wp_list_pages()` did not have its own test class.

It does now, so the test can be moved there, instead of being hidden among `get_pages()` tests.

Includes:
* Updating the test name for clarity.
* Adding an unique message for each assertion.

Follow-up to [27755], [28400].

See #57841.
Built from https://develop.svn.wordpress.org/trunk@55588


git-svn-id: http://core.svn.wordpress.org/trunk@55100 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-24 15:00:28 +00:00
audrasjb
1764cee3d1 Login and Registration: Revert [55358] and [55360].
This reverts the changes implemented in [55358] and [55360].

Changeset [55358] was committed to prevent login name collision when one user registers with the email address `user@example.com` and a second user tries to register with the username `user@example.com`. However, it also introduced a potential backward compatibility issues for plugins that use `wp_update_user()`. When updating an existing user, it throws an `existing_user_email_as_login` error if the email address is also used for the user login, due to the code introduced in [55358].

This changeset removes the new scenario added in [55358] and [55360], restoring the `wp_insert_user()` function back to its previous state.

Props polevaultweb, audrasjb, costdev, peterwilsoncc, hellofromTonya, SergeyBiryukov, azaozz.
See #57967, #57394.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55096 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-23 13:54:23 +00:00
Sergey Biryukov
a0fdeb36dd Tests: Improve get_pages() tests organization.
Includes:
* Renaming some tests for clarity.
* Moving some tests to a more appropriate place.
* Moving the `@covers` tag to the top of the class.
* Using consistent formatting for assertion messages.

Follow-up to [27767], [41849], [44587], [55569].

See #57841.
Built from https://develop.svn.wordpress.org/trunk@55583


git-svn-id: http://core.svn.wordpress.org/trunk@55095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-23 11:37:23 +00:00
audrasjb
1b393fbb15 Login and Registration: Fix margin for language switcher button on small screens.
This fixes an alignement issue on small screens in the language switcher button displayed on the Login screen.

Follow-up to [52058], [52417].

Props sabernhardt.
Fixes #57617.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55094 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-22 12:50:18 +00:00
Sergey Biryukov
93a4991c01 Tests: Consistently sanitize expiration in the test suite's Memcached implementation.
In a previous commit, the `::sanitize_expiration()` call in the `::add()` method was moved closer to where the value is used.

This commit does the same for the other methods:
* `::cas()`
* `::replace()`
* `::set()`
* `::setMulti()`

Follow-up to [40561], [55577].

See #57841, #57963.
Built from https://develop.svn.wordpress.org/trunk@55581


git-svn-id: http://core.svn.wordpress.org/trunk@55093 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-22 09:27:23 +00:00
hellofromTonya
f28f9194e2 Code Modernization: Fix dynamic properties in WP_Admin_Bar.
To fix the dynamic properties, the following changes are included:
* Removes `WP_Admin_Bar::__get()`.
* Declares `menu` as a property on the class, deprecates it, and initializes it to an empty array.
* Removes the unused 'proto' dynamic property.

Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0.

== Why remove the `WP_Admin_Bar::__get()` magic method?

tl;dr
The magic method is no longer needed.

The magic method only handled the `menu` and `proto` dynamic properties. Introducing a full set of magic methods is overkill for this class. Instead of having to maintain magic methods, this changeset instead directly addresses the 2 properties (see below).

== Why declare the `menu` property on the class?

tl;dr
To simplify the code while maintaining backwards compatibility for extenders who are using this deprecated property.

The `menu` property was introduced during the 3.1.0 ''development cycle'' as a declared property [15671]. Its purpose was to ''internally'' hold the menu structure.

During the WP 3.3.0 development cycle, it was replaced by a new `private` property called `nodes` (see [19120]).

But breakage reports from extenders caused it to be restored. [19501] added the `__get()` magic method, i.e. for handling it as a dynamic property, and deprecated it.

>We're not going to maintain compat for $menu. Suggest we make it array() and plugins will have to deal. We can throw a _deprecated_argument() and push them to use the new methods.
~ Source: [https://core.trac.wordpress.org/ticket/19371#comment:17 see #19371 comment 17]

[https://wpdirectory.net/search/01GSTW1X69TBN8FH3SY7V8KPY5 A search of the wp.org plugins and themes repository] shows that a few plugins are still using this deprecated property. To maintain backwards compatibility, `menu` is moved back to the class as a declared property, set to an empty array (as it's been since 3.3.0), and deprecated in the property's description.

== Why remove the `proto` dynamic property?

tl;dr
* It was not intended to be released in 3.1.
* There are no usages of it in Core or in the WP.org's plugin or theme directories.
* It should be safe to remove.

This property was first introduced in the WP 3.1.0 ''development cycle'' to replace the `PROTO` constant (see [16038]) for protocol handling for the admin bar's hyperlinks. [16077] replaced the property's usages with URL functions such as `get_admin_url()` and `admin_url()`. But it missed removing the property, which was no longer needed or used.

It was relocated to the `__get()` magic method as a dynamic property when the `menu` property was restored (see [19501]).

A search of WP.org's plugins and themes repositories shows no usages of the property. Core hasn't used it since the removed in [16038] before 3.1 final release. It should be safe to remove it, but committing very early in the 6.3 alpha cycle to give time for reports of usages, if there are any.

References:
* A [https://www.youtube.com/watch?v=vDZWepDQQVE&t=9362s live open public working session] where these changes were discussed and agreed to.
* [https://wiki.php.net/rfc/deprecate_dynamic_properties PHP RFC: Deprecate dynamic properties].

Follow-up to [19501], [19120], [16308], [16038], [15671].

Props antonvlasenko, hellofromTonya, jrf, markjaquith, desrosj, ironprogrammer, peterwilsoncc, SergeyBiryukov.
See #56876, #56034.
Built from https://develop.svn.wordpress.org/trunk@55580


git-svn-id: http://core.svn.wordpress.org/trunk@55092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-21 20:00:19 +00:00
spacedmonkey
e30068eb49 Build/Test Tools: Fix issue with add method in object-cache.php.
In the object-cache.php file used for unit tests, the add method did not work as expected. Other object cache plugins and core, have a check to see if the key exists in memory before writing it. Without this check, it used to write unnecessarily to the cache.  

Props spacedmonkey, SergeyBiryukov.
Fixes #57963.
Built from https://develop.svn.wordpress.org/trunk@55577


git-svn-id: http://core.svn.wordpress.org/trunk@55089 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-21 17:02:19 +00:00
ryelle
cee125e1f4 Administration: Update dashboard welcome panel colors, remove broken link
Remove the green background from the "dot" accent, to prevent low contrast for the dismiss button. Use menu colors for the background on alternate color schemes. Remove the "Edit styles" link as there is no longer a direct link to the global styles section of the site editor.

Follow-up to [55451].

Props sabernhardt, ryokuhi, laurlittle, richtabor.
Fixes #57759.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-21 15:37:21 +00:00
ryelle
1aba63dc46 Help/About: Updates to About page.
Remove link to release video, update split controls image.

Follow-up to [55449], [55499], [55545].

Props laurlittle, richtabor.
Fixes #57477.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-21 15:27:19 +00:00
hellofromTonya
9f559f452a Tests: Rename test class and improve tests for wp_get_global_stylesheet().
Changes include:
* Renames the test class to be compliant with test coding standards.
* Converts the test class to extend `WP_Theme_UnitTestCase` to reuse test fixtures.
* Implements data providers to encapsulate datasets and reduce code repetition.
* Adds a `@covers` annotation.
* Improves assertion messages to help with diagnosing failed tests.

Follow-up to [55567], [55148], [52682], [53916], [52675-52677].

Props costdev, hellofromTonya.
See #57841, #57958.
Built from https://develop.svn.wordpress.org/trunk@55572


git-svn-id: http://core.svn.wordpress.org/trunk@55084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-21 13:54:22 +00:00
Sergey Biryukov
94a1aed064 Coding Standards: Remove unused variable in WP_Plugins_List_Table::single_row().
Follow-up to [47835], [48669].

Props azouamauriac.
Fixes #55132.
Built from https://develop.svn.wordpress.org/trunk@55571


git-svn-id: http://core.svn.wordpress.org/trunk@55083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-21 13:27:21 +00:00
spacedmonkey
7dde8c4440 Posts, Post Types: Use WP_Query internally in get_pages.
Convert `get_pages` to use `WP_Query` internally. Using WP_Query means that a lot of code has been removed however existing parameters supported by get_pages are transformed in to query arguments. The custom caching solution found in the old version of this function is replaced with the caching found in WP_Query (added in [53941]). This change adds consistency to the codebase, as improvements and changes to `WP_Query` will filter down to the `get_pages` function. 

Props mikeschinkel, spacedmonkey, nacin, scribu, filosofo, jane, garyc40, markoheijnen, grandslambert, kevinB, wlindley, dbernar1, atimmer, mdawaffe, helen, benjibee, johnbillion, peterwilsoncc, costdev, flixos90, joemcgill.
Fixes #12821.
Built from https://develop.svn.wordpress.org/trunk@55569


git-svn-id: http://core.svn.wordpress.org/trunk@55081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-21 12:49:18 +00:00
hellofromTonya
90b5db421c Editor: Update @wordpress packages for 6.2 RC3.
Updates the `@wordpress` packages to include the fixes for these regressions introduced in the 6.2 cycle:

* [Regression] Navigation Block: Category/Custom taxonomy links are not searchable in the Link inserter [https://github.com/WordPress/gutenberg/pull/49126 Gutenberg PR 49126]. See #57929 
* [Regression] Post Editor: List View has no close button on mobile viewports [https://github.com/WordPress/gutenberg/pull/49200 Gutenberg PR 49200] 

References:
* [811da1ab3a Packages x.3.11 publish commit].

Follow-up to [55548].

Props andraganescu, costdev, get_dave, hellofromTonya, mamaduka, ntsekouras, scruffian, talldanwp, thomask.
See #57471.
Fixes #57929.
Built from https://develop.svn.wordpress.org/trunk@55568


git-svn-id: http://core.svn.wordpress.org/trunk@55080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-21 12:43:46 +00:00
hellofromTonya
69a5893569 Tests: Add test class for wp_enqueue_stored_styles().
[54214] added the `wp_enqueue_stored_styles()` tests and `clean_up_global_scope()` reset global method to `Tests_Theme_wpGetGlobalStylesheet`.

This changeset relocates those tests a new test class specifically for `wp_enqueue_stored_styles()` and removes `Tests_Theme_wpGetGlobalStylesheet::clean_up_global_scope()` method.

Why not relocate the `clean_up_global_scope()` method to the new test class?
The test class extends from `WP_Theme_UnitTestCase` which includes this method.

Follow-up to [54214], [54703].

Props costdev.
See #57841.
Built from https://develop.svn.wordpress.org/trunk@55567


git-svn-id: http://core.svn.wordpress.org/trunk@55079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-20 18:22:19 +00:00
Sergey Biryukov
fc43b28dec Cache API: Correct the second parameter's name in _get_non_cached_ids().
The parameter represents the cache group, not the cache key.

Follow-up to [19918].

Props johnjamesjacoby, spacedmonkey.
Fixes #40420.
Built from https://develop.svn.wordpress.org/trunk@55566


git-svn-id: http://core.svn.wordpress.org/trunk@55078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-20 16:42:19 +00:00
hellofromTonya
5b0a2e6d06 Tests: Add test class for wp_script_is().
Changes:
* Adds a test class for `wp_script_is()`.
* Moves `WP_Dependencies_jQuery::test_wp_script_is_dep_enqueued()` into this test class and splits it into 2 separate tests, happy and unhappy paths.
* Adds `WP_Scripts::query` `@covers`, as `wp_script_is()` is helper function for it.
* Relocates the global resetting from the test method to the `clean_up_global_scope()` method.

Follow-up to [52010], [29252].

Props hellofromTonya, antonvlasenko.
See #57841, #57958.
Built from https://develop.svn.wordpress.org/trunk@55565


git-svn-id: http://core.svn.wordpress.org/trunk@55077 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-20 16:18:20 +00:00
Sergey Biryukov
6740fd5821 KSES: Allow filter property to accept a URL in safecss_filter_attr().
CSS filters can accept `url()` as a reference to an SVG filter element:
{{{
filter: url( file.svg#filter-element-id );
}}}
This commit allows for that syntax to be used in inline CSS.

Original PR from Gutenberg repository:
* [https://github.com/WordPress/gutenberg/pull/48281 #48281 Duotone: Use the style engine to generate CSS for Duotone]

References:
* [https://developer.mozilla.org/en-US/docs/Web/CSS/filter MDN Web Docs: filter()]
* [https://developer.mozilla.org/en-US/docs/Web/CSS/url MDN Web Docs: url()]

Follow-up to [44136], [52049].

Props scruffian, jeryj, ironprogrammer, azaozz, hellofromTonya, SergeyBiryukov.
Fixes #57780.
Built from https://develop.svn.wordpress.org/trunk@55564


git-svn-id: http://core.svn.wordpress.org/trunk@55076 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-20 08:25:22 +00:00
Sergey Biryukov
4630e311e7 Tests: Improve documentation and variable names in some formatting tests.
Includes documenting data provider values using hash notation in the tests for:
* `convert_smilies()`
* `get_url_in_content()`
* `links_add_target()`
* `normalize_whitespace()`

Follow-up to [26191], [26327], [26328], [26972], [55562].

See #57841.
Built from https://develop.svn.wordpress.org/trunk@55563


git-svn-id: http://core.svn.wordpress.org/trunk@55075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-19 12:53:17 +00:00
Sergey Biryukov
77fe35a423 Tests: Use the data_ prefix for various data provider methods.
This aims to bring more consistency to the test suite, as the vast majority of data providers already use that prefix.

Includes moving some data providers next to the tests they are used in.

Follow-up to [55464].

See #57841.
Built from https://develop.svn.wordpress.org/trunk@55562


git-svn-id: http://core.svn.wordpress.org/trunk@55074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-19 12:05:21 +00:00
joedolson
d49897485b Editor: Show scheduled text when changing to new future dates.
In the classic editor, fix the publish status change text shown when a future post's date is changed to a different future date. Show 'scheduled' statement instead of 'publish' statement.

Props tyxla, sdavis2702, joedolson.
Fixes #31040.
Built from https://develop.svn.wordpress.org/trunk@55561


git-svn-id: http://core.svn.wordpress.org/trunk@55073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-18 16:35:18 +00:00
joedolson
514460e505 Quick/Bulk Edit: Show scheduled in status for future drafts.
Change the quick edit status `select` to use the 'Scheduled' status instead of the 'Published' status or posts where the date is in the future. 

Props ipstenu, MrFlannagan, sabernhardt, oglekler.
Fixes #38834.
Built from https://develop.svn.wordpress.org/trunk@55560


git-svn-id: http://core.svn.wordpress.org/trunk@55072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-18 15:47:24 +00:00
Sergey Biryukov
123b819f4f Coding Standards: Remove unused variables in WP_Comment_Query.
* `$unapproved_ids` and `$unapproved_emails` in `WP_Comment_Query::get_comment_ids()` were added in [29965] and appear to never have been used.
* `$wpdb` in `WP_Comment_Query::fill_descendants()` was replaced with `$this->db` in [38275], removed in [38446], and accidentally reinstated in [38768].

Follow-up to [29965], [34546], [37625], [38275], [38446], [38768], [44546].

Props upadalavipul, dingo_d, audrasjb, SergeyBiryukov.
Fixes #57482.
Built from https://develop.svn.wordpress.org/trunk@55559


git-svn-id: http://core.svn.wordpress.org/trunk@55071 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-18 12:34:21 +00:00
spacedmonkey
0e55b6ab84 Date / Time: Remove usage of mysql2date in generate_postdata method.
Remove usage of `mysql2date` in `generate_postdata`. `mysql2date` has a performance overhead, as it creates a `DateTimeZone` object each time it is called. Use a simple 
sub string function to generate the values needed for the `currentmonth` and `currentday` global variables. 

Props spacedmonkey, Rarst, SergeyBiryukov, flixos90.
Fixes #57683.
Built from https://develop.svn.wordpress.org/trunk@55558


git-svn-id: http://core.svn.wordpress.org/trunk@55070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-17 15:58:23 +00:00
Sergey Biryukov
215ecfc7ad External Libraries: Upgrade PHPMailer to version 6.8.0.
This is a maintenance release with a new feature: DSN URL parsing, which allows you to create a PHPMailer instance with most important settings by passing in a single URL, ideal for configuring PHPMailer from an environment variable.

Note: This commit does not include new DSN class, as it is not particularly relevant for WordPress core at this time.

References:
* [https://github.com/PHPMailer/PHPMailer/releases/tag/v6.8.0 PHPMailer 6.8.0 release notes]
* [https://github.com/PHPMailer/PHPMailer/compare/v6.7...v6.8.0 Full list of changes in PHPMailer 6.8.0]

Follow-up to [50628], [50799], [51169], [51634], [51635], [52252], [52749], [52811], [53500], [53535], [53917], [54427], [54937].

Props ayeshrajans, jrf, Synchro.
Fixes #57873.
Built from https://develop.svn.wordpress.org/trunk@55557


git-svn-id: http://core.svn.wordpress.org/trunk@55069 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-17 14:22:22 +00:00
Sergey Biryukov
07b35de70a Filesystem API: Return false for empty paths in FTP ::exists() methods.
When `ftp_nlist()` receives an empty path, it checks the current working directory and may return `true`.

This affects:
* `WP_Filesystem_FTPext::exists()`
* `WP_Filesystem_ftpsockets::exists()`

As the purpose of the API is to provide a consistent interface for various filesystem implementations, this commit updates the affected methods to returns `false` when an empty path is provided, bringing consistency with the other filesystem abstraction classes, specifically `WP_Filesystem_Direct` and `WP_Filesystem_SSH2`.

Follow-up to [6779], [11821], [25274], [31815].

Props mkox, costdev, Zdrobau, dd32, pbiron, azaozz, mukesh27, SergeyBiryukov.
Fixes #33058.
Built from https://develop.svn.wordpress.org/trunk@55556


git-svn-id: http://core.svn.wordpress.org/trunk@55068 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-16 16:14:22 +00:00
hellofromTonya
95f3aceea7 HTML API: Add bookmark invalidation logic.
While `WP_HTML_Tag_Processor` currently only supports changing a given tag's attributes, the plan is to provide methods to make broader changes (possibly through a subclass of `WP_HTML_Tag_Processor`). The API will have the potential of replacing a tag that a bookmark points to. To prepare, this changeset makes sure that all bookmarks affected by a HTML replacement are invalidated (i.e. released).

Changes:
* Extends the existing loop in `WP_HTML_Tag_Processor::apply_attributes_updates()` that adjusts bookmarks' start and end positions upon HTML changes to check if the entire bookmark is within a portion of the HTML that has been replaced.
* Adds `WP_HTML_Tag_Processor::has_bookmark() to check whether the given bookmark name exists.

References:
* [https://github.com/WordPress/gutenberg/pull/47559 Gutenberg PR 47559]
* [https://github.com/WordPress/gutenberg/releases/tag/v15.3.0 Released in Gutenberg 15.3.0]

Follow-up to [55203].

Props bernhard-reiter, dmsnell, zieladam.
Fixes #57788.
Built from https://develop.svn.wordpress.org/trunk@55555


git-svn-id: http://core.svn.wordpress.org/trunk@55067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-16 13:11:24 +00:00
spacedmonkey
bef2674152 Build/Test Tools: Revert [55553].
Revert package-lock.json changes in [55553].

See #57864.
Built from https://develop.svn.wordpress.org/trunk@55554


git-svn-id: http://core.svn.wordpress.org/trunk@55066 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-15 11:55:20 +00:00
spacedmonkey
d409e8ad50 Widgets: Defer register inline script in WP_Widget_Custom_HTML and WP_Widget_Text.
In [41376] an inline script was added to push `idBases` for the custom html and text widgets. However, this script is not used unless the widget script is output in the widget screen / customizer. Deferring registering this script until it is needed, results in a faster server response times. 


Props spacedmonkey, sakibmd, flixos90, westonruter.
Fixes #57864.
Built from https://develop.svn.wordpress.org/trunk@55553


git-svn-id: http://core.svn.wordpress.org/trunk@55065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-15 11:38:20 +00:00
Sergey Biryukov
26852dbac7 Administration: Define the $title global on the Menus screen for classic themes.
This brings more consistency with other screens and avoids a PHP warning in `get_plugin_page_hookname()`:
{{{
preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
}}}

Follow-up to [13257], [13366], [55263].

Props nendeb55, costdev, SergeyBiryukov.
Fixes #57918.
Built from https://develop.svn.wordpress.org/trunk@55552


git-svn-id: http://core.svn.wordpress.org/trunk@55064 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-15 09:05:22 +00:00
Sergey Biryukov
0c53d8ef73 Docs: Fix typo in _validate_cache_id() description.
Includes:
* Capitalizing "ID" in a consistent way.
* Expanding the comment on not using `filter_var()`.
* Adding a `@covers` tag for the function in unit tests.
* Minor tweak to the `_doing_it_wrong()` message.

Follow-up to [53818], [55543].

See #57593.
Built from https://develop.svn.wordpress.org/trunk@55549


git-svn-id: http://core.svn.wordpress.org/trunk@55061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-14 16:55:19 +00:00
Sergey Biryukov
00803d3e5f Coding Standards: Use single quotes for strings without variables in register_block_style_handle().
This resolves two WPCS errors:
{{{
String ".css" does not require double quotes; use single quotes instead
String "-rtl.css" does not require double quotes; use single quotes instead
}}}
Follow-up to [55544].

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


git-svn-id: http://core.svn.wordpress.org/trunk@55059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-14 16:26:18 +00:00
ryelle
42bedb5164 Help/About: Add CDN images to About page.
Props richtabor.
See #57477.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-14 16:05:17 +00:00
Sergey Biryukov
74ca5659a2 Editor: Correctly load RTL stylesheets for non-core blocks.
If `SCRIPT_DEBUG` is disabled, `register_block_style_handle()` loads core blocks' styles with the `.min` suffix, while non-core ones never use the minified files, but the suffix was still mistakenly included in the `-rtl` file lookup.

This commit updates the logic to match the style path set earlier in the function, ensuring that RTL stylesheets are loaded properly for both core and non-core blocks, with or without `SCRIPT_DEBUG`.

Follow-up to [49982], [50836], [54330], [55486].

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


git-svn-id: http://core.svn.wordpress.org/trunk@55056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-14 16:00:19 +00:00
spacedmonkey
8a8216c1c7 Cache API: Add a warning when calling _get_non_cached_ids with invalid ids.
Sanitize the array of ids passed to the `_get_non_cached_ids` function and add a `_doing_it_wrong` call, if an invalid type is passed. 

Props tillkruess, spacedmonkey, peterwilsoncc, flixos90, SergeyBiryukov.
Fixes #57593.
Built from https://develop.svn.wordpress.org/trunk@55543


git-svn-id: http://core.svn.wordpress.org/trunk@55055 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-14 15:53:18 +00:00
hellofromTonya
48deabccbe Editor: Update @wordpress packages for 6.2 RC2.
Updates the `@wordpress` packages to include the following changes:

- [Regression] Don't offer Classic block as a recovery action when not registered [https://github.com/WordPress/gutenberg/pull/49051 Gutenberg PR 49051]  
- [i18n Change] Fix typo in the media-categories component [https://github.com/WordPress/gutenberg/pull/49047 Gutenberg PR 49047] 
- Hide navigation screen in site editor [https://github.com/WordPress/gutenberg/pull/49043 Gutenberg PR 49043]  
 [https://make.wordpress.org/core/2023/03/14/fyi-navigation-section-of-new-site-editor-experienced-removed-for-6-2-rc-2/ Feature is not ready for 6.2]
- [i18n Change] Site editor: Fix non-us spelling in sidebar [https://github.com/WordPress/gutenberg/pull/48976 Gutenberg PR 48976]  See Trac #57895.
- [Regression] Site Editor: Fix lingering insertion point within template parts [https://github.com/WordPress/gutenberg/pull/48913 Gutenberg PR 48913]  > Regression introduced in 6.2 cycle.
- Navigation Link: Remove color generation code [https://github.com/WordPress/gutenberg/pull/48927 Gutenberg PR 48927] and [https://github.com/WordPress/gutenberg/pull/49064 Gutenberg PR 49064] 
- Fix settings tab active state border in block inspector [https://github.com/WordPress/gutenberg/pull/48945 Gutenberg PR 48945] 
- Fix text alignment in the Site Editor sidebar  [https://github.com/WordPress/gutenberg/pull/48959 Gutenberg PR 48959]  Making template descriptions more prominent is part of 6.2.

References:
* [f22a3cbf0c Packages x.3.9 publish commit]
* [356298f91f Packages x.3.10 publish commit]

Follow-up to [55496].

Props mamaduka, tobifjellner, davidbaumwald, costdev, audrasjb, hellofromTonya.
See #57471.
Fixes #57895.
Built from https://develop.svn.wordpress.org/trunk@55542


git-svn-id: http://core.svn.wordpress.org/trunk@55054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-14 15:45:47 +00:00
spacedmonkey
9caf1c4ade Editor: Move variables to where used in wp_render_layout_support_flag.
Improves the performance of wp_render_layout_support_flag() function by moving variables to where each is used.
If a return happens before the variable is needed, this change avoids unnecessary processing and memory.

Props spacedmonkey, hellofromTonya, mukesh27.
Fixes #57815.
Built from https://develop.svn.wordpress.org/trunk@55541


git-svn-id: http://core.svn.wordpress.org/trunk@55053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-13 16:32:20 +00:00
Sergey Biryukov
34662ac6d6 Coding Standards: Bring some consistency to wp_validate_redirect() existence checks.
The `wp_get_referer()` and `wp_get_original_referer()` functions both depend on `wp_validate_redirect()` and check whether it is defined by the time they run, but do so in a slightly different way.

This commit ensures both functions return early if they are called before `wp_validate_redirect()` is defined.

Follow-up to [3908], [25399], [25400].

See #57839.
Built from https://develop.svn.wordpress.org/trunk@55540


git-svn-id: http://core.svn.wordpress.org/trunk@55052 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-13 10:54:22 +00:00
Sergey Biryukov
a2c7bba031 Docs: Improve some DocBlock formatting in wp-includes/class-wp-xmlrpc-server.php.
Includes clarifying the list of fields passed to the `xmlrpc_default_*_fields` filters by default.

Follow-up to [16046], [17647], [27730], [32550], [37492], [55316].

See #57840.
Built from https://develop.svn.wordpress.org/trunk@55539


git-svn-id: http://core.svn.wordpress.org/trunk@55051 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-12 14:50:24 +00:00
Sergey Biryukov
8d7d99289d Filesystem API: Return correct error data from copy_dir() if the directory listing failed.
The `::dirlist()` method is run on the `$from` directory, so `basename( $from )` is the correct thing to pass to the `WP_Error` object.

Follow-up to [50149].

Props afragen, costdev, pravinparmar2404.
Fixes #57907.
Built from https://develop.svn.wordpress.org/trunk@55538


git-svn-id: http://core.svn.wordpress.org/trunk@55050 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-11 11:34:24 +00:00
spacedmonkey
fe32dc4241 Cache API: Make network-queries and site-queries global cache groups.
Fixes a bug introduced in [55526]. The cache groups `network-queries` and `site-queries` store query results for network and site. These are network level data and should be stored in a global cache group. 

Props spacedmonkey, tillkruess, flixos90.
See #57625.
Built from https://develop.svn.wordpress.org/trunk@55537


git-svn-id: http://core.svn.wordpress.org/trunk@55049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-10 17:51:23 +00:00
spacedmonkey
1bf93a87a4 Cache API: Introduce new queries cache groups.
Give developers more control over how query caches are handled within an object caches. Now all caches that cache the result of a query, are cached in a group that is suffixed with -queries. Developers can use these groups, to add custom cache invalidation rules or to make them none persistent.

Props spacedmonkey, owi, tillkruess, skithund, peterwilsoncc, flixos90, sergeybiryukov, mukesh27.
Fixes #57625.
Built from https://develop.svn.wordpress.org/trunk@55526


git-svn-id: http://core.svn.wordpress.org/trunk@55048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-10 16:30:03 +00:00
spacedmonkey
df7b417d64 Networks and Sites: Replace get_blog_details with get_site.
Replace usage of the function get_blog_details with more lightweight get_site. 

Props spacedmonkey, kapilpaul, flixos90.
Fixes #57571.
Built from https://develop.svn.wordpress.org/trunk@55515


git-svn-id: http://core.svn.wordpress.org/trunk@55047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-10 15:49:18 +00:00
spacedmonkey
49692206c0 Date/Time: Save a call to wp_timezone in mysql2date.
Save a call to wp_timezone in mysql2date by saving the timezone to a variable and pass it into wp_date function call.

Props spacedmonkey, costdev, SergeyBiryukov, audrasjb.
Fixes #57705.
Built from https://develop.svn.wordpress.org/trunk@55514


git-svn-id: http://core.svn.wordpress.org/trunk@55046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-10 15:36:20 +00:00
spacedmonkey
39e6d6d348 Comments: Prime post caches in WP_Comments_List_Table.
In the `WP_Comments_List_Table` class, when the function `get_comments` is called, pass the parameter `update_comment_post_cache` set to true. This primes all the related posts for the displayed comments. This improves performance, as all posts are primed at once. 

Props spacedmonkey, adarshposimyth.
Fixes #57802.
Built from https://develop.svn.wordpress.org/trunk@55513


git-svn-id: http://core.svn.wordpress.org/trunk@55045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-10 15:26:22 +00:00
zieladam
c80f206e94 Build/Test tools: Prevent registering the same private JavaScript API twice.
This sets the IS_WORDPRESS_CORE global variable to true in the webpack build script to enable extra safeguards around private JavaScript APIs.

Props costdev, hellofromTonya, gziolo, peterwilsoncc.
Fixes #57795.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-10 12:37:24 +00:00
Sergey Biryukov
e636fcd30c Coding Standards: Use strict comparison in wp-admin/includes/taxonomy.php.
Follow-up to [4490], [9481], [55190].

Props ankitmaru, costdev, dhrumilk.
Fixes #57859.
Built from https://develop.svn.wordpress.org/trunk@55511


git-svn-id: http://core.svn.wordpress.org/trunk@55043 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-10 07:04:20 +00:00
desrosj
e296294486 Build/Test Tools: Add the workflow_dispatch event to the performance workflow.
This allows workflow runs to be initiated through the GitHub API.

Follow up to [55507].

See #57687.
Built from https://develop.svn.wordpress.org/trunk@55508


git-svn-id: http://core.svn.wordpress.org/trunk@55040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-10 00:17:18 +00:00
desrosj
080b49902e Build/Test Tools: Test the new performance workflow regularly.
This adds the new performance measurement workflow introduced in [55459] to the one that tests old branches on a regular schedule.

This ensures it continues to work as expected over time, even if the branches with this workflow are not updated for a bit of time.

Props flixos90, joemcgill, desrosj.
See #57687.
Built from https://develop.svn.wordpress.org/trunk@55507


git-svn-id: http://core.svn.wordpress.org/trunk@55039 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-10 00:06:19 +00:00
hellofromTonya
86580c7802 Build/Test Tools: Add 6.2 branch to the workflow for testing branches.
Built from https://develop.svn.wordpress.org/trunk@55506


git-svn-id: http://core.svn.wordpress.org/trunk@55038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-09 21:59:22 +00:00
hellofromTonya
b1185f8be9 Trunk is now 6.3 alpha.
Built from https://develop.svn.wordpress.org/trunk@55505


git-svn-id: http://core.svn.wordpress.org/trunk@55037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-09 21:38:20 +00:00
audrasjb
dc079079c0 Post WordPress 6.2 RC1 version bump.
Built from https://develop.svn.wordpress.org/trunk@55503


git-svn-id: http://core.svn.wordpress.org/trunk@55035 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-09 17:37:17 +00:00
audrasjb
1adf240bfd WordPress 6.2 RC1.
Built from https://develop.svn.wordpress.org/trunk@55502


git-svn-id: http://core.svn.wordpress.org/trunk@55034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-09 17:16:19 +00:00
hellofromTonya
8031a399be Editor: Combine Date template description translations.
Combine the 2 translatable strings into 1 string. Why? The example URL does not require a separate translation. Combining makes the string easier to view in context.

Follow-up to [55500].

Props SergeyBiryukov.
See #57892.
Built from https://develop.svn.wordpress.org/trunk@55501


git-svn-id: http://core.svn.wordpress.org/trunk@55033 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-09 16:55:20 +00:00
hellofromTonya
230a23206d Editor: Add more details to template descriptions.
The template descriptions in `get_default_block_template_types()` are updated to add more details. Why? These descriptions are now more prominent in 6.2 to provide a better UX experience with more helpful information.

References:
* [https://github.com/WordPress/gutenberg/pull/48934 Gutenberg PR 48934]

Follow-up to [54761], [54104], [54269], [53129], [52331], [52062].

Props ntsekouras, andrewserong, bph, davidbaumwald, greenshady, glendaviesnz, hellofromTonya, jameskoster, mamaduka, peterwilsoncc, sabernhardt, SergeyBiryukov.
Fixes #57892.
Built from https://develop.svn.wordpress.org/trunk@55500


git-svn-id: http://core.svn.wordpress.org/trunk@55032 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-09 16:32:19 +00:00
ryelle
b16599e760 Help/About: Update copy & style for About page and subpages.
Minor copy updates. Update heading style, text size, spacing in smaller columns. Remove columns placement code to simplify CSS. This was necessary for IE11, but modern browsers can use auto-placement. Move navigation out of the banner to keep size & background placement consistent across About section.

Props marybaum, sereedmedia, annezazu, jpantani, laurlittle, richtabor, markoserb, fcoveram, joen, kebbet.
See #57477.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-09 16:30:19 +00:00
hellofromTonya
338b45ddba Editor: Update @wordpress packages for 6.2 RC1.
Updates the `@wordpress` packages to include the following changes:

- Site Editor: Move "Add Template"'s descriptions to tooltips
- Update template descriptions with more detail
- Distraction Free Mode: Don't show the metaboxes
- Remove actions from SidebarNavigationScreenWrapper
- Fix: Navigation sidebar shows a wrong submenu popover.
- Fix: Site button metrics
- Fix navigation block off-canvas appender for empty menus
- Style Book: Move iframe to root of content area to support styles that overflow block previews
- Fix navigation block off-canvas appender for empty

Reference:
* [446428841b Package publish commit in Gutenberg]

Follow-up to [55475].

Props mamaduka.
See #57471.
Built from https://develop.svn.wordpress.org/trunk@55496


git-svn-id: http://core.svn.wordpress.org/trunk@55029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-09 13:55:07 +00:00
Sergey Biryukov
8743a96dfe Formatting: Restore consistent quotes in _make_web_ftp_clickable_cb().
After the introduction of `_make_clickable_rel_attr()` in an earlier commit, the function ended up returning link markup with a mix of single and double quotes.

This commit ensures that `_make_web_ftp_clickable_cb()` always returns double quotes, restoring consistency with other similar callback functions used by `make_clickable()`:
* `_make_url_clickable_cb()`
* `_make_email_clickable_cb()`

Follow-up to [55289].

See #53290, #56444.
Built from https://develop.svn.wordpress.org/trunk@55495


git-svn-id: http://core.svn.wordpress.org/trunk@55028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-09 00:20:18 +00:00
Andrew Ozz
11d4f1b3bf Build/Test Tools: Fix cleaning of old CSS files in wp-includes/blocks/*. Have to be cleaned earlier, before Webpack runs. Not together with the rest of the CSS files.
Props: ironprogrammer, petitphp, hellofromTonya, azaozz.
Fixes: #57891. 
Built from https://develop.svn.wordpress.org/trunk@55494


git-svn-id: http://core.svn.wordpress.org/trunk@55027 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-09 00:05:24 +00:00
hellofromTonya
956dd0d50c Site Editor: Revert r54860.
[54860] caused a regression. Changes to a parent theme's template part (i.e.e when a child theme does not override that template part) no longer saved in the Site Editor. Reverting the changeset resolves the regression.

Props mreishus, hellofromTonya, azaozz, ironprogrammer, antonvlasenko.

Fixes #57630.
See #55437.
Built from https://develop.svn.wordpress.org/trunk@55493


git-svn-id: http://core.svn.wordpress.org/trunk@55026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-08 22:45:19 +00:00
audrasjb
abac5af424 Docs: Add security warning in remove_query_arg() docblock to make it consistent with add_query_arg().
Props roytanck.
Fixes #57885.
See #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-08 22:19:23 +00:00
Aaron Jorbin
2f20a88190 External Libraries: Update jQuery to 3.6.4.
Update the jQuery library from 3.6.1 to 3.6.3.

[3.6.4 release announcement](https://blog.jquery.com/2023/03/08/jquery-3-6-4-released-selector-forgiveness/)
[Full changelog](https://github.com/jquery/jquery/compare/3.6.3...3.6.4)

Props TobiasBg, audrasjb, hellofromTonya.
See #57324.
Fixes 57888.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55024 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-08 18:37:33 +00:00
desrosj
66ea2b293f Build/Test Tools: Update several GitHub Actions.
This updates three GitHub Actions to their latest versions:
- `shivammathur/setup-php`
- `actions/cache`
- `wow-actions/welcome`

The welcome action now uses the `GITHUB_TOKEN` by default, so it no longer needs to be passed manually.

See #57572.
Built from https://develop.svn.wordpress.org/trunk@55487


git-svn-id: http://core.svn.wordpress.org/trunk@55020 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-08 16:35:22 +00:00
Sergey Biryukov
4711b88811 Tests: Add a unit test for register_block_style_handle() with an RTL locale.
The test ensures that the function loads RTL stylesheets when a locale with the right-to-left text direction is set.

Follow-up to [54330].

Props costdev, thomasplevy, audrasjb, mukesh27.
Fixes #56797.
Built from https://develop.svn.wordpress.org/trunk@55486


git-svn-id: http://core.svn.wordpress.org/trunk@55019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-08 15:02:18 +00:00
audrasjb
91787c363c Docs: Add missing 6.2.0 @since mention in get_the_privacy_policy_link().
Follow-up to #55261.

See #56792, #56345.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55018 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-08 13:36:22 +00:00
Andrew Ozz
e437ae83f3 Build/Test Tools: Remove all previously built files when running clean:files.
Cleans old JS, CSS and Webpack files from /src so they are not automatically copied to /build when running `grunt build`. Fixes errors that may be caused by copying outdated files and/or directories to /build.

Props: desrosj, isabel_brison, SergeyBiryukov, ironprogrammer, mukesh27, robinwpdeveloper, razthee007, costdev, peterwilsoncc, azaozz.

Fixes: #47749.
Built from https://develop.svn.wordpress.org/trunk@55484


git-svn-id: http://core.svn.wordpress.org/trunk@55017 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-08 01:03:28 +00:00
davidbaumwald
4959927285 Post WordPress 6.2 Beta 5 version bump.
Built from https://develop.svn.wordpress.org/trunk@55481


git-svn-id: http://core.svn.wordpress.org/trunk@55014 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-07 17:44:18 +00:00
davidbaumwald
7f213f7829 WordPress 6.2 Beta 5.
Built from https://develop.svn.wordpress.org/trunk@55480


git-svn-id: http://core.svn.wordpress.org/trunk@55013 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-07 17:23:26 +00:00
Joe McGill
01833f5fb2 Build/Test Tools: Update the URL for logging performance workflows.
This is a follow up to r55459, which fixes the hostname used for logging performance metrics by adding the correct www subdomain.

See #57687.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55012 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-07 17:00:19 +00:00
desrosj
1ee2032699 Bundled Themes: Add missing trailing / in HelpHub links.
HelpHub links without trailing slashes with anchors present result in an unnecessary redirect.

These were introduced with the `/` missing in [55476].

Props audrasjb.
See #57689, #57726.
Built from https://develop.svn.wordpress.org/trunk@55478


git-svn-id: http://core.svn.wordpress.org/trunk@55011 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-07 16:50:18 +00:00
hellofromTonya
2257e9b451 HTML API: Document shorthand usage of the next_tag().
Documents the shorthand usage, i.e. `$this->next_tag( 'img' )`, of `WP_HTML_Tag_Processor::next_tag()`.

Also includes table alignments and formatting adjustments in the class docs.

Follow-up to [55203], [55206].

Props zieladam, poena, dmsnell, costdev, hellofromTonya.
Fixes #57863.
See #57575.
Built from https://develop.svn.wordpress.org/trunk@55477


git-svn-id: http://core.svn.wordpress.org/trunk@55010 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-07 16:48:21 +00:00
desrosj
741c88b2ef Bundled Themes: Bump version numbers for WordPress 6.2.
In coordination with the release of 6.2, a new version of each bundled theme will also be released. This bumps the version of each theme to the following:

- Twenty Ten: 3.8
- Twenty Eleven: 4.3
- Twenty Twelve: 3.9
- Twenty Thirteen: 3.8
- Twenty Fourteen: 3.6
- Twenty Fifteen: 3.4
- Twenty Sixteen: 2.9
- Twenty Seventeen: 3.2
- Twenty Nineteen: 2.5
- Twenty Twenty: 2.2
- Twenty Twenty-One: 1.8
- Twenty Twenty-Two: 1.4
- Twenty Twenty-Three: 1.1

Props robinwpdeveloper, costdev, audrasjb, sabernhardt, desrosj.
Fixes #57689.
Built from https://develop.svn.wordpress.org/trunk@55476


git-svn-id: http://core.svn.wordpress.org/trunk@55009 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-07 16:27:18 +00:00
hellofromTonya
67abdca2cc Editor: Update @wordpress packages for 6.2 Beta 5.
Updates the `@wordpress` packages to include the following changes:

- Add border radius to off canvas navigation menu items
- Remove border from quick inserter child elements
- Show variant patterns even if there are no patterns for the Query Loop block
- Order initial block items in Navigation with PrivateInserter
- Update: Add descriptions to all panels in the Site Editor's dark side
- Fix typo in template parts description
- Fix: Browse mode descriptions margin
- Fix: Show creation popover on empty page links in the navigation sidebar
- Make sure the directly inserted block in the Nav block is a Page link
- Fix browser history when synchronising state with urls
- Navigation Sidebar: Change the logic about which navigation gets selected for the sidebar
- Fixes extra UI in navigation block inspector
- Renames parent selection boolean param and improves docs
- Widget Importer: Fix Widget Group block imports
- Don't add Post Content layout styles to title in the post editor
- Site editor: Add hover animation to site editor canvas
- Prevent the saving button from showing when renaming templates
- Navigation Block: Fix big spinner
- Navigation: Don't save the level of the link in an attribute
- Focus 1st parent block on block remove, if no previous block is available
- Navigation: Performance: improve params in `block_core_navigation_get_most_recently_published_navigation()`
- Navigation Block inspector: fix link UI popover opening on links that have a url
- Fix for `WP_Theme_JSON_Resolver::get_merged_data()`
- Site Editor: Add page details when viewing a specific page.
- Fix site editor sidebar scrollbars
- Fix: Custom link UI does appears outside canvas on the sidebar navigation
- Fix: Make navigation page list load its items on navigation sidebar

References:
* [d14fea64bd Gutenberg's commit for publishing the packages]
* [dbe47a5e8f Gutenberg's commit for `blocks/navigation-link.php` and `blocks/navigation-submenu.php`]
* [ea74a306e5 Gutenberg's commit for `blocks/navigation.php`]

Follow-up to [55441], [55440].

Props ntsekouras, mamaduka, gziolo, costdev, hellofromTonya.
See #57471. 
Built from https://develop.svn.wordpress.org/trunk@55475


git-svn-id: http://core.svn.wordpress.org/trunk@55008 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-07 15:31:49 +00:00
audrasjb
c41d5e69d3 Media: Revert wp_ajax_save_attachment_updated hook.
This changeset removes the `wp_ajax_save_attachment_updated` hook by reverting [55106], [55111], and [55450], to give it more time for further discussions as there are still concerns about whether this hook is necessary.

Follow-up to [55106], [55111], [55450].

Props costdev, SergeyBiryukov, peterwilsoncc, azaozz.
See #23148.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-07 13:13:22 +00:00
Sergey Biryukov
3958c2b23b Build/Test Tools: Check if the Docker is available when running npm run env:start.
This aims to display a more helpful error message if the Docker service is not running.

Follow-up to [45783], [45819].

Props mkox, cnspecialcolor, pento, hasanuzzamanshamim, bgoewert, robinwpdeveloper, costdev, mukesh27.
Fixes #51898.
Built from https://develop.svn.wordpress.org/trunk@55473


git-svn-id: http://core.svn.wordpress.org/trunk@55006 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-07 09:09:17 +00:00
audrasjb
dac1d3fb8d Bundled Themes: Improve various globals documentation, as per docblock standards.
Props viralsampat, audrasjb, costdev.
See #56792, #57069.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55005 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-07 08:30:17 +00:00
Peter Wilson
14801a97a5 Build/Tests Tools: Add unit tests for Gallery blocks.
Introduces unit tests for the following blocks

* Gallery block with caption
* Gallery block, deprecations 1 thru 7

Updates the unit tests for the following blocks to match the counterparts stored in the Gutenberg repository:

* Gallery block
* Gallery block with columns

Modifies `Tests_Blocks_Render::test_do_block_output()` to ignore white space at the end of lines to account for whitespace equivalence in HTML.

Props peterwilsoncc, isabel_brison, gziolo.
Fixes #55571.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55004 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-07 05:48:17 +00:00
Adam Silverstein
a6c33c8a3b Media: improve display of cropped image in media editor.
Correctly display edits after you crop an image and return to the attachments page. 

Prefer the `full` over the `large` size image on the edit image screen.

Props andy786, antpb, sanketchodavadiya, antonvlasenko, ironprogrammer.
Fixes #55070.


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


git-svn-id: http://core.svn.wordpress.org/trunk@55003 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-07 04:47:22 +00:00
hellofromTonya
39308664bf HTML API: Fix finding RCData and Script tag closers.
Fixes finding the following tag closers `</script>`, `</textarea>`, and `</title>` in `WP_HTML_Tag_Processor`.

Follow-up to [55407], [55203].

Props zieladam, dmsnell, hellofromTonya.
Fixes #57852.
See #57575.
Built from https://develop.svn.wordpress.org/trunk@55469


git-svn-id: http://core.svn.wordpress.org/trunk@55002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-06 18:55:21 +00:00
hellofromTonya
c2cd23a06b Tests: Use assertSame() in Tests_Theme_wpThemeJson.
Change from assertEquals() to assertSame(). Why? To ensure both the return value and data type match the expected results.

Follow-up to [55216].

Props costdev, peterwilsoncc, mukesh27, ankitmaru.
See #56800, #57621.
Built from https://develop.svn.wordpress.org/trunk@55468


git-svn-id: http://core.svn.wordpress.org/trunk@55001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-06 17:46:21 +00:00
hellofromTonya
e4402cfe1a Tests: Improve Tests_Media::test_wp_generate_attachment_metadata_doesnt_generate_sizes_for_150_square_image().
Changes:

* from `assertEquals()` to `assertSame()`. Why? To ensure both the return value and data type match the expected results.

* the expected height and width from `string` to `integer` data types. Why integer? `getimagesize()` (within `wp_getimagesize()`) will return an integer for both height and weight.

* adds the ticket annotation.

* adds assertion failure messages. Why? To denote which assertion failed, which aids in debugging efforts.

Follow-up to [55278].

Props costdev, peterwilsoncc, mukesh27, ankitmaru, hellofromTonya.
See #56800, #57370.
Built from https://develop.svn.wordpress.org/trunk@55467


git-svn-id: http://core.svn.wordpress.org/trunk@55000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-06 16:29:21 +00:00
hellofromTonya
a7a66100ff Build/Test Tooling: Use assertSame() in Tests_Comment::test_update_comment_from_privileged_user_by_privileged_user().
Change from `assertEquals()` to `assertSame()`. Why? To ensure both the return value and data type match the expected results.

Follow-up to [c].

Props costdev, peterwilsoncc, mukesh27, ankitmaru.
See #56800.
Built from https://develop.svn.wordpress.org/trunk@55466


git-svn-id: http://core.svn.wordpress.org/trunk@54999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-06 15:03:17 +00:00
hellofromTonya
1fd3cfa2c2 Build/Test Tooling: Use assertSame() in WP_Date_Query tests.
Change from `assertEquals()` to `assertSame()`. Why? To ensure both the return value and data type match the expected results.

Follow-up to [54530].

Props costdev, peterwilsoncc, mukesh27, ankitmaru.
See #56800.
Built from https://develop.svn.wordpress.org/trunk@55465


git-svn-id: http://core.svn.wordpress.org/trunk@54998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-06 14:46:20 +00:00
Sergey Biryukov
961e38f063 Tests: Move some data providers in Tests_Functions next to the tests they are used in.
Includes renaming some data provider methods to use the `data_` prefix for consistency.

Follow-up to [36832], [40124], [40397], [50810], [53457].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@55464


git-svn-id: http://core.svn.wordpress.org/trunk@54997 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-06 13:10:19 +00:00
Sergey Biryukov
37d9040897 Tests: Adjust the expected mime type for WOFF fonts on PHP 8.1.12+.
As of PHP 8.1.12, which includes libmagic/file update to version 5.42, the expected mime type for WOFF files has changed to `font/woff`, so the type needs to be adjusted accordingly in `wp_check_filetype_and_ext()` tests.

References:
* [https://github.com/php/php-src/issues/8805 php-src: #8805: finfo returns wrong mime type for woff/woff2 files]
* [https://www.php.net/ChangeLog-8.php#8.1.12 PHP 8.1.12 changelog]

Follow-up to [40124], [54508], [54509], [54724].

Props costdev, SergeyBiryukov.
Fixes #56817.
Built from https://develop.svn.wordpress.org/trunk@55462


git-svn-id: http://core.svn.wordpress.org/trunk@54995 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-06 12:41:23 +00:00
Sergey Biryukov
aa10c88a86 Docs: Use the new /documentation/ URL for HelpHub link in readme.html.
Follow-up to [55412], [55413], [55414], [55415], [55416], [55431], [55432], [55434].

See #57726.
Built from https://develop.svn.wordpress.org/trunk@55461


git-svn-id: http://core.svn.wordpress.org/trunk@54994 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-05 00:52:19 +00:00