Commit Graph

19000 Commits

Author SHA1 Message Date
Sergey Biryukov
2399966d8c Themes: Correct the logic for displaying a _doing_it_wrong() notice for add_theme_support( 'html5' ).
* Calling `add_theme_support( 'html5' )` without passing an array of supported types should throw a `_doing_it_wrong()` notice: "You need to pass an array of types".
* If the second parameter is not specified, it should fall back to an array of `comment-list`, `comment-form`, and `search-form` for backward compatibility.
* If the second parameter is not an array, the function should return `false`.

The latter two points are covered by existing unit tests. The first one is now addressed by `@expectedIncorrectUsage`.

Follow-up to [25193], [25235], [25785].

Props audrasjb, peterwilsoncc, SergeyBiryukov.
Fixes #51657.
Built from https://develop.svn.wordpress.org/trunk@52828


git-svn-id: http://core.svn.wordpress.org/trunk@52417 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-07 14:44:01 +00:00
audrasjb
f33f3979ca Docs: Use third-person singular verbs for function descriptions in wp-includes/class-wp-user.php.
Props azouamauriac.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-07 13:07:03 +00:00
audrasjb
e6e88f4a2b Docs: Correct the indentation in delete_term_relationships filter.
See #54673.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52415 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-07 12:57:05 +00:00
Peter Wilson
f3d929163f General: Improve MS Edge user-agent sniff.
Update the `$is_edge` global to be `true` if the browser's user-agent contains `Edg` rather than `Edge`. Microsoft have dropped an E from the UA string.

Refer to [https://docs.microsoft.com/en-us/microsoft-edge/web-platform/user-agent-guidance#identifiers-for-microsoft-edge-on-various-platforms Microsoft's documentation on detecting edge].

Props costdev, abdullahramzan, mukesh27, Boniu91.
Fixes #55297.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52414 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-07 02:38:01 +00:00
Sergey Biryukov
c274ea83f3 Tests: Restore the original user role in the (add|remove)_user_role hooks test.
This makes sure the test does not unintentionally affect other tests.

Follow-up to [52823].

Fixes #54164.
Built from https://develop.svn.wordpress.org/trunk@52824


git-svn-id: http://core.svn.wordpress.org/trunk@52413 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-06 23:04:01 +00:00
Sergey Biryukov
78911c2f60 Users: Bring some consistency to user role hooks.
This standardizes the actions that one needs to hook to for tracking user role changes:

* `add_user_role` is only fired when the user has actually gained a new role.
* `remove_user_role` is only fired when the role was actually removed.

Both actions are now fired in `WP_User::set_role()` as appropriate.

Props dd32, SergeyBiryukov.
Fixes #54164.
Built from https://develop.svn.wordpress.org/trunk@52823


git-svn-id: http://core.svn.wordpress.org/trunk@52412 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-06 16:11:04 +00:00
Sergey Biryukov
4ae0744585 Query: Make sure WP_Query::get_queried_object() works for author_name before ::get_posts() is run.
Previously, the queried object with author data was not available before the posts loop when `author_name` is used in the query instead of `author`. With block themes, this use case appears to be more common to display the author name in the header.

This commit adjusts the logic in `WP_Query::get_queried_object()` to fall back to the `author_name` field if `author` is not present, similar to how taxonomy slugs are handled.

Follow-up to [1728], [3290], [10992].

Props dd32, swissspidy, SergeyBiryukov.
Fixes #55100.
Built from https://develop.svn.wordpress.org/trunk@52822


git-svn-id: http://core.svn.wordpress.org/trunk@52411 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-05 15:35:04 +00:00
Sergey Biryukov
c17ccc5490 Docs: Add inline comments for non-visible characters in sanitize_title_with_dashes().
This aims to clarify the list of characters that are stripped from URLs or converted to a hyphen.

Follow-up to [51984].

See #47912, #54729.
Built from https://develop.svn.wordpress.org/trunk@52821


git-svn-id: http://core.svn.wordpress.org/trunk@52410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-04 14:11:02 +00:00
audrasjb
318205d459 Coding Standards: Improve formatting in /wp-admin/user-edit.php.
This change improves the formatting of `/wp-admin/user-edit.php` to avoid PHPCS failures when adding new code, which previously required new code to be indented multiple times, breaking alignment of the HTML parts. This change avoids disabling/enabling PHPCS for failing sniffs.

Props costdev, johnregan3, peterwilsoncc.
Fixes #54673.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52409 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-04 11:29:04 +00:00
Peter Wilson
8db01b9c6b Themes: Hide block themes' live preview link following installation.
Prevent the Customizer/Live Preview button from showing for installed block themes when on the theme installation page.

Props antonvlasenko, costdev, ironprogrammer.
Fixes #54878.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52408 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-04 02:39:03 +00:00
davidbaumwald
66ed09edeb Comments: Guard against potential PHP notices in get_comment_author and get_comment_ID.
In both `get_comment_author` and `get_comment_ID`, it's possible that these functions are called without a comment context.  Specifically, `get_comment_author` can be called without passing the `$comment_ID` parameter, and `get_comment_ID` relies on the `comment` global if there's no `$comment` parameter supplied.  This leads to a PHP notice of "Trying to get property of a non-object."

This change adds a check to both functions to ensure the `$comment->comment_ID` property is not empty before actually using its value.

Follow-up to [52223].

Props dd32.
Fixes #54379.
Built from https://develop.svn.wordpress.org/trunk@52818


git-svn-id: http://core.svn.wordpress.org/trunk@52407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-03 20:33:59 +00:00
Sergey Biryukov
d71c435a82 Docs: Update the DocBlock for the wpmu_new_blog action to suggest wp_initialize_site as an alternative.
Follow-up to [43654], [52816].

See #49612.
Built from https://develop.svn.wordpress.org/trunk@52817


git-svn-id: http://core.svn.wordpress.org/trunk@52406 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-03 16:13:03 +00:00
Sergey Biryukov
b009374817 Networks and Sites: Suggest wp_initialize_site as an alternative for the deprecated wpmu_new_blog action.
The previously suggested alternative, `wp_insert_site`, does not get passed enough arguments and runs before the new site initialization routine is actually executed.

Follow-up to [43654].

Props asaquzzaman, henry.wright, MadtownLems.
Fixes #49612.
Built from https://develop.svn.wordpress.org/trunk@52816


git-svn-id: http://core.svn.wordpress.org/trunk@52405 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-03 15:58:03 +00:00
Sergey Biryukov
cc5bacb4e4 Docs: Add a @since note for WP::parse_request() about the new return value.
Includes minor code layout fixes for consistency. Additionally, this moves a more general unit test above the more specific one.

Follow-up to [52814].

See #10886.
Built from https://develop.svn.wordpress.org/trunk@52815


git-svn-id: http://core.svn.wordpress.org/trunk@52404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-02 15:40:01 +00:00
spacedmonkey
01040717aa Bootstrap/Load: Stop unnecessary queries when using the do_parse_request filter.
Developers of plugins and themes can use the `do_parse_request` filter to hot-wire requests and hook in early to render custom pages. However, even through these request may not need post queries and 404 lookups to be run, they run anyway. This can results in unnecessary SQL queries running on these requests. By adding a return value to the `parse_request` method of the `WP` class, these queries can now be skipped. 

Props junsuijin, ryan, westi, sivel, dd32, wonderboymusic, arnee, tyxla, DrewAPicture, lukecavanagh, SergeyBiryukov, davidbaumwald, Spacedmonkey, pbearne.
Fixes #10886.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-02 15:12:02 +00:00
Sergey Biryukov
f891f6f0c6 Administration: Require a valid action parameter to be set for admin-ajax.php requests.
This avoids `Array to string conversion` PHP notices when an array is passed as the `action` parameter.

Additionally, send an appropriate HTTP response status code when an invalid action is passed to `admin-post.php`.

Follow-up to [13175], [19738], [41120], [41926].

Props dd32.
Fixes #55212.
Built from https://develop.svn.wordpress.org/trunk@52813


git-svn-id: http://core.svn.wordpress.org/trunk@52402 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-02 15:00:11 +00:00
Sergey Biryukov
257b634b92 Themes: Make sure the current_theme_supports-{$feature} filter is consistently applied.
Previously, the filter was not applied if there are no arguments passed to `current_theme_supports()`.

Follow-up to [12350], [19682].

Props helgatheviking, azouamauriac, pavanpatil1, SergeyBiryukov.
Fixes #55219.
Built from https://develop.svn.wordpress.org/trunk@52812


git-svn-id: http://core.svn.wordpress.org/trunk@52401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-01 16:07:05 +00:00
Sergey Biryukov
4789371cfe External Libraries: Upgrade PHPMailer to version 6.6.0.
This is a minor feature release.

> Prior to this version, any OAuth provider needed to extend the provided `OAuth` base class, and this made it difficult to use with libraries other than ones based on the default [https://github.com/thephpleague/oauth2-client league] client packages. The OAuth property now accepts anything that implements the `OAuthProviderInterface`, making it much easier to use things like [https://github.com/googleapis/google-api-php-client Google's own OAuth classes]. Existing implementations that extend the provided `OAuth` base class will still work, as that base class now implements this interface too.
>
> When TLS errors occurred in PHPMailer, the error messages were often missing important info that might help diagnose/solve the problem. These error messages should now be more informative. A minor change is that a TLS error on SMTP connect will now throw an exception if exceptions are enabled.

Release notes:
https://github.com/PHPMailer/PHPMailer/releases/tag/v6.6.0

For a full list of changes in this update, see the PHPMailer GitHub:
https://github.com/PHPMailer/PHPMailer/compare/v6.5.4...v6.6.0

Follow-up to [50628], [50799], [51169], [51634], [51635], [52252], [52749].

Props jrf, Synchro, miken32.
Fixes #55277.
Built from https://develop.svn.wordpress.org/trunk@52811


git-svn-id: http://core.svn.wordpress.org/trunk@52400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-28 21:38:09 +00:00
Sergey Biryukov
e32e1750fd Docs: Use third-person singular verbs for function descriptions in wp-includes/formatting.php, per the documentation standards.
See #54729.
Built from https://develop.svn.wordpress.org/trunk@52810


git-svn-id: http://core.svn.wordpress.org/trunk@52399 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-28 16:03:00 +00:00
Sergey Biryukov
d0fb86dafb I18N: Add a $locale parameter for remove_accents().
This highlights the fact that `remove_accents()` is locale-aware and makes it easier to utilize the function with different locales without having to use `switch_to_locale()` or the `locale` filter.

Additionally, this commit relaxes the check for character replacements in German locales to include formal and informal variants of any `de_*` locale, even if WordPress does not have a native translation for some of them yet.

Props malthert, johnbillion, knutsp, ocean90, SergeyBiryukov.
Fixes #54415.
Built from https://develop.svn.wordpress.org/trunk@52809


git-svn-id: http://core.svn.wordpress.org/trunk@52398 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-28 15:42:05 +00:00
audrasjb
7e2b01d127 Administration: Consistency fixes on keyboard shortcuts instructions.
This changeset capitalizes the letter of keyboard shortcuts and replaces `CTRL` with `Ctrl`, for better consistency.

Props Presskopp, sabernhardt, joyously, SergeyBiryukov, audrasjb.
Fixes #40582.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-27 22:49:01 +00:00
Sergey Biryukov
01d22d18e6 Filesystem API: Include the ssh-ed25519 public key signature algorithm as an alternative to ssh-rsa.
The `ssh-rsa` signature algorithm is disabled by default as of OpenSSH 8.8, which breaks SSH2 uploads in WordPress on modern systems. `ssh-ed25519` is one of the suggested alternatives, supported since OpenSSH 6.5.

References:
* [https://www.openssh.com/txt/release-8.2 OpenSSH 8.2 release notes]
* [https://www.openssh.com/txt/release-8.7 OpenSSH 8.7 release notes]
* [https://www.openssh.com/txt/release-8.8 OpenSSH 8.8 release notes]

Follow-up to [8865].

Props richybkreckel, dd32.
Fixes #52409.
Built from https://develop.svn.wordpress.org/trunk@52807


git-svn-id: http://core.svn.wordpress.org/trunk@52396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-27 15:02:04 +00:00
joedolson
1da8de78da Media: Use consistent mirroring check in media views.
Change the mirroring property verification method to be consistent with other usages across models and attachments, since we don't care whether it's assigned directly on inherited.

Props MMDeveloper, SergeyBiryukov.
Fixes #53856.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52395 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-27 00:56:00 +00:00
Sergey Biryukov
d143c7c47e Query: Correct the "matched rule" condition in WP::parse_request().
The `WP::$matched_rule` property is always set now, so we should check that it's not empty instead.

Follow-up to [52804].

See #55222.
Built from https://develop.svn.wordpress.org/trunk@52805


git-svn-id: http://core.svn.wordpress.org/trunk@52394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-26 14:34:01 +00:00
Sergey Biryukov
a47961e80e Query: Preinitialize the WP class properties to their default values.
This avoids an `array_keys() expects parameter 1 to be array, null given` PHP warning for the `query_vars` property in `WP::build_query_string()` when disabling request parsing via the `do_parse_request` filter.

Props dd32, SergeyBiryukov.
Fixes #55222.
Built from https://develop.svn.wordpress.org/trunk@52804


git-svn-id: http://core.svn.wordpress.org/trunk@52393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-26 14:28:01 +00:00
audrasjb
e89229886b Themes: Remove the Live Preview link when installing a block theme from a zip archive.
This changeset removes the Live Preview link for block-based themes when installing for a zip archive, since the customizer is disabled by default for block themes.

Follow-up to [52353].

Props alanjacobmathew, hellofromTonya, antonvlasenko, ironprogrammer.
Fixes #54578.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-26 08:16:02 +00:00
audrasjb
f1d4f7f0f7 Administration: Further enhancements on small text fields after [52649].
This changeset replaces `#mailserver_port` to a more generic selector, fixes a coding standard issue, and adds a bigger margin to the field.

Follow-up to [52649].

Props SergeyBiryukov, kebbet, pyrobd.
Fixes #50177.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52390 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-25 15:49:02 +00:00
Sergey Biryukov
7c2fcae011 Tests: Rename the $success variable to $result in the wp_mail() test for an empty home URL.
The previously name could be a bit confusing if the function is expected to fail.

Follow-up to [52799].

See #54730.
Built from https://develop.svn.wordpress.org/trunk@52800


git-svn-id: http://core.svn.wordpress.org/trunk@52389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-25 14:09:59 +00:00
Sergey Biryukov
c2d8b48d97 Code Modernization: Check the return type of wp_parse_url() in wp_mail().
As per the PHP manual:
> If the `component` parameter is omitted, an associative array is returned.
> If the `component` parameter is specified, `parse_url()` returns a string (or an int, in the case of `PHP_URL_PORT`) instead of an array. If the requested component doesn't exist within the given URL, `null` will be returned.

Reference: [https://www.php.net/manual/en/function.parse-url.php#refsect1-function.parse-url-returnvalues PHP Manual: parse_url(): Return Values]

In PHP 8.1, if the home URL does not have a "host" component, it would lead to a `substr(): Passing null to parameter #1 ($string) of type string is deprecated` notice.

Changing the logic around and adding validation for the return type value of `wp_parse_url()` prevents that.

Follow-up to [48601], [51606], [51622], [51626], [51629], [51630].

Props dennisatyoast, jrf.
See #54730.
Built from https://develop.svn.wordpress.org/trunk@52799


git-svn-id: http://core.svn.wordpress.org/trunk@52388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-25 13:48:00 +00:00
Sergey Biryukov
7d6885bc51 Tests: Add a @ticket reference for the current_theme_supports-{$feature} filter test.
Follow-up to [19682], [495/tests].

Props azouamauriac.
See #54725.
Built from https://develop.svn.wordpress.org/trunk@52798


git-svn-id: http://core.svn.wordpress.org/trunk@52387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-25 13:09:00 +00:00
audrasjb
b26449d863 Media: Make get_post_galleries() only return galleries.
This change makes sure only gallery content is returned by `get_post_galleries()`. It fixes an issue where non gallery block content was also returned by the function.

Props BinaryMoon, costdev, glendaviesnz.
Fixes #55203.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-25 12:44:04 +00:00
spacedmonkey
2ae4784ca0 REST API: Pass WP_REST_Request object to the rest_index filter.
Props johnregan3, TimothyBlynJacobs, Spacedmonkey, hasanuzzamanshamim.
Fixes #48638. 

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


git-svn-id: http://core.svn.wordpress.org/trunk@52385 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-24 22:36:01 +00:00
audrasjb
631f08096b Docs: Correct return type for get_post_custom().
Props chouby, audrasjb.
Fixes #55249.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-24 21:26:02 +00:00
Sergey Biryukov
446c2afdc3 Docs: Add missing descriptions for some parameters of WP_Walker::paged_walk().
Props bhrugesh12.
Fixes #55225.
Built from https://develop.svn.wordpress.org/trunk@52794


git-svn-id: http://core.svn.wordpress.org/trunk@52383 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-24 13:33:01 +00:00
audrasjb
401e5d7175 Docs: Correct return type for get_block_metadata_i18n_schema().
Props jeremyfelt.
Fixes #55243.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52382 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-24 08:27:09 +00:00
joedolson
654d1477a9 Media: Stop arrow keys switching media if URL focused.
Keyboard handlers were prevented from navigating attachments in input fields, but the key handler excluded readonly fields, like the media URL field. This could prevent exploring the URL using the keyboard.

Props jrivett, joemcgill, afercia.
Fixes #43202.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52381 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-24 04:35:04 +00:00
audrasjb
4237c0a88b Themes: Avoid undefined variable warning on get_svg_filters().
This change fixes an undefined variable warning thrown when `duotone` color setting was set to null` in Block Themes `theme.json` file.

Follow-up to [52768].

Props aliakseyenkaihar, audrasjb, rafiahmedd.
Fixes #55241.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52380 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-23 23:17:01 +00:00
audrasjb
76e93c5d5f Plugins: Add focus style to plugin icon link in plugin cards.
This change adds a blue focus outline to the icon on plugin cards, for consistency with the text part of the link.

Props hitendra-chopda, SergeyBiryukov, afercia, themattroyal, imokol, sabernhardt, audrasjb.
Fixes #45209.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52379 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-23 21:20:06 +00:00
hellofromTonya
1f56c94459 Formatting: Make terms in wpautop() and shortcode_unautop() more welcoming and inclusive.
The developer facing humor in these functions were from a different era of WordPress. Tolerance for in-jokes and other developer facing humor has decreased over the years. Terms like "pee" and "tinkle" may make some folks chuckle while for others it makes them uncomfortable.

Terminology of the past is being (or has been) re-evaluated to transform words into a language that are inclusive and welcome for all. This commit is part of that effort as it replaces.

Follow-up [13], [9255].

Props ricomoorman, tzipporahwitty, ironprogrammer, peterwilsoncc, jeremyfelt, Viper007Bond, rmccue, SergeyBiryukov, hellofromTonya.
Fixes #25615.
Built from https://develop.svn.wordpress.org/trunk@52789


git-svn-id: http://core.svn.wordpress.org/trunk@52378 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-23 20:03:09 +00:00
audrasjb
2ac7dcd043 Help/About: Revert [52783].
Point releases about page changelog should not be committed to trunk. This changeset reverts [52783].

Unprops audrasjb.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52373 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-22 11:01:11 +00:00
audrasjb
9ce0a583a1 Help/About: Update the About page for WordPress 5.9.1.
Props hellofromTonya, audrasjb.
Fixes #55173.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52372 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-22 10:33:08 +00:00
audrasjb
53590e7cdc Twenty Twenty-Two: Bump theme version to 1.1.
This change bumps the version of the Twenty Twenty-Two bundled theme in preparation for release with WordPress 5.9.1.

Props peterwilsoncc, petaryoast, audrasjb, SergeyBiryukov, rafiahmedd.
Fixes #55056.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52370 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-21 20:55:02 +00:00
Sergey Biryukov
93e373b7be Docs: Use third-person singular verbs in some test descriptions in phpunit/tests/functions/.
Follow-up to [42971], [45371], [46159], [46175], [47779], [50962], [50964], [51910], [52778].

Props azouamauriac, SergeyBiryukov.
See #54725.
Built from https://develop.svn.wordpress.org/trunk@52780


git-svn-id: http://core.svn.wordpress.org/trunk@52369 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-21 14:52:06 +00:00
Sergey Biryukov
5040303d1a Docs: Fix typo in TracTickets::isTracTicketClosed() description.
Follow-up to [761/tests], [762/tests], [891/tests].

See #54729.
Built from https://develop.svn.wordpress.org/trunk@52779


git-svn-id: http://core.svn.wordpress.org/trunk@52368 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-20 10:14:04 +00:00
Sergey Biryukov
9253edeff3 Tests: Convert _wp_to_kebab_case() tests to use a data provider.
Follow-up to [51198], [51225].

See #54725.
Built from https://develop.svn.wordpress.org/trunk@52778


git-svn-id: http://core.svn.wordpress.org/trunk@52367 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-19 13:45:00 +00:00
Sergey Biryukov
38770aaf48 Docs: Correct parameter types for data_wp_validate_boolean().
Follow-up to [46159], [46224], [52775], [52776].

See #54725, #54729.
Built from https://develop.svn.wordpress.org/trunk@52777


git-svn-id: http://core.svn.wordpress.org/trunk@52366 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-19 13:26:58 +00:00
Sergey Biryukov
e7eda56175 Docs: Improve some DocBlocks in wp_validate_boolean() tests for consistency.
Follow-up to [46159], [46224], [52775].

See #54725, #54729.
Built from https://develop.svn.wordpress.org/trunk@52776


git-svn-id: http://core.svn.wordpress.org/trunk@52365 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-19 13:02:00 +00:00
Sergey Biryukov
72373078d1 Tests: Correct the order of expected and actual values in wp_validate_boolean() tests.
This corrects the order of the parameters when used in assertions so if/when they fail the failure message is correct.

Additionally, this commit moves the test function before the data provider, for consistency with other tests.

Follow-up to [46159], [46224].

See #54725.
Built from https://develop.svn.wordpress.org/trunk@52775


git-svn-id: http://core.svn.wordpress.org/trunk@52364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-19 12:42:01 +00:00
Sergey Biryukov
b7af78c1ce Tests: Correct the order of expected and actual values in wp_array_slice_assoc() tests.
This corrects the order of the parameters when used in assertions so if/when they fail the failure message is correct.

Follow-up to [45371].

See #54725.
Built from https://develop.svn.wordpress.org/trunk@52774


git-svn-id: http://core.svn.wordpress.org/trunk@52363 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-19 12:39:59 +00:00
Sergey Biryukov
bb395f9450 Tests: Correct the order of expected and actual values in get_status_header_desc() tests.
This corrects the order of the parameters when used in assertions so if/when they fail the failure message is correct.

Follow-up to [46107].

See #54725.
Built from https://develop.svn.wordpress.org/trunk@52773


git-svn-id: http://core.svn.wordpress.org/trunk@52362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-19 12:38:05 +00:00
spacedmonkey
7a48bab20c Cache API: Add wp_cache_flush_runtime function
Add a new function called `wp_cache_flush_runtime` to existing caching functions found in WordPress. This function allows users to flush the runtime (in-memory) cache, without flushing the entire persistent cache. 

Props: Spacedmonkey, tillkruess, flixos90, adamsilverstein, SergeyBiryukov, barryhughes. 
Fixes: #55080.


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


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

Follow-up [52757].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52357 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 20:45:00 +00:00
audrasjb
d8b1150a4a Editor: Update block editor packages for WordPress 5.9.1.
The following packages were updated:

- @wordpress/block-directory@3.0.27
- @wordpress/block-editor@8.0.17
- @wordpress/block-library@6.0.26
- @wordpress/components@19.2.3
- @wordpress/core-data@4.0.10
- @wordpress/customize-widgets@2.0.27
- @wordpress/e2e-tests@2.5.18
- @wordpress/edit-post@5.0.27
- @wordpress/edit-site@3.0.27
- @wordpress/edit-widgets@3.1.22
- @wordpress/editor@12.0.21
- @wordpress/format-library@3.0.23
- @wordpress/interface@4.1.18
- @wordpress/list-reusable-blocks@3.0.20
- @wordpress/nux@5.0.20
- @wordpress/reusable-blocks@3.0.23
- @wordpress/server-side-render@3.0.20
- @wordpress/widgets@2.0.23

Props Mamaduka.
See #55179.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52354 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 19:18:25 +00:00
hellofromTonya
2b94ffdbc9 Editor: Adds an additional check to guard against incompete presets.
Adds an additional guard to ensure the value of `$preset_metadata['value_key']` actually exists as a key in the `$preset` array. Fixes `Warning: Undefined array key` error. 

Intentionally adds the check into the existing `isset()` as it's native to PHP, more efficient, and a good pattern.

Follow-up [52049].

Props jeherve, swissspidy, sergeybiryukov, jrf.
Fixes #55161.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52352 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 18:47:02 +00:00
Sergey Biryukov
8f904628e9 Tests: Correct the @ticket reference in a download_url() test with the Content-Disposition header.
Move the data provider next to the test, for consistency.

Follow-up to [51939], [52734].

Props azouamauriac.
See #55109.
Built from https://develop.svn.wordpress.org/trunk@52760


git-svn-id: http://core.svn.wordpress.org/trunk@52349 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 17:40:02 +00:00
audrasjb
26667ab0e1 Editor: Backport Duotone fixes for 5.9.1.
This changeset is a backport for the following Gutenberg PRs:

- Fix duotone theme cache gutenberg#36236
- Fix duotone render in non-fse themes gutenberg#37954
- Duotone: Allow users to specify custom filters gutenberg#38442

Props oandregal, scruffian, Mamaduka.
See #55179.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 16:18:03 +00:00
hellofromTonya
9ac43b6ade Editor: Grant only admins access to the "Navigation Menus" UI for block and non-block themes.
Restricts and grants access to only admin roles for the Navigation Menu UI screen, i.e. either directly through the URL wp-admin/edit.php?post_type=wp_navigation or via the Navigation block's "Manage menu" option (in the block's toolbar).

It resolves 2 issues:

- For non-block themes, fixes the issue where admins could not access the UI.
- For block themes, restricts access to only admin roles, i.e. non-admins no longer have access to the UI.

Non-admins will receive the "Sorry, you are not allowed to edit posts in this post type" error message.

Follow-up [52069], [52145], [52330], [52400].

Props ironprogrammer, costdev, noisysocks, talldanwp, hellofromTonya, manfcarlo, pyrobd.
Fixes #54889.
Built from https://develop.svn.wordpress.org/trunk@52755


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

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


git-svn-id: http://core.svn.wordpress.org/trunk@52343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 14:47:04 +00:00
jorgefilipecosta
007dec9ec6 Global Styles: Load the global styles before the theme styles in the editor.
This commit makes the site editor follow what we do in the front-end, where theme styles are loaded after global styles by default.

Props oandregal, ntsekouras.
Fixes #55188.
Built from https://develop.svn.wordpress.org/trunk@52752


git-svn-id: http://core.svn.wordpress.org/trunk@52341 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 14:14:01 +00:00
jorgefilipecosta
95bbd4c7d1 Global Styles: Fix PHP warning in WP_REST_Global_Styles_Controller if no styles exist.
There is a PHP warning in WP_REST_Global_Styles_Controller because we are assuming that every theme.json has styles property, which is not always the case.

Props ntsekouras.
Fixes #54900.
Built from https://develop.svn.wordpress.org/trunk@52750


git-svn-id: http://core.svn.wordpress.org/trunk@52339 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 13:47:59 +00:00
Sergey Biryukov
c70e24e0ab External Libraries: Upgrade PHPMailer to version 6.5.4.
The latest release includes some minor PHP cross-version improvements and a safeguard against hosters disabling security functions. Note to hosting providers: don't disable `escapeshellarg()` and `escapeshellcmd()`; it's not safe!

Release notes:
https://github.com/PHPMailer/PHPMailer/releases/tag/v6.5.4

For a full list of changes in this update, see the PHPMailer GitHub:
https://github.com/PHPMailer/PHPMailer/compare/v6.5.3...v6.5.4

Follow-up to [50628], [50799], [51169], [51634], [51635], [52252].

Props jrf, Synchro.
Fixes #55187.
Built from https://develop.svn.wordpress.org/trunk@52749


git-svn-id: http://core.svn.wordpress.org/trunk@52338 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 13:23:04 +00:00
audrasjb
ab2c6d696b Themes: Allow extending WP_Theme_JSON and WP_Theme_JSON_Resolver classes.
This change updates methods visibility from `private` to `protected` and adds late static binding.

Original PRs from Gutenberg repository:
- https://github.com/WordPress/gutenberg/pull/38625
- https://github.com/WordPress/gutenberg/pull/38671

Props oandregal, Mamaduka, kapilpaul.
Fixes #55178.
See #55179.

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


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

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


git-svn-id: http://core.svn.wordpress.org/trunk@52332 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-16 22:20:01 +00:00
Sergey Biryukov
a5d6245d60 External Libraries: Update random_compat to version 2.0.21.
The latest release includes improved compatibility with PHP 8.1, as well as some bug fixes for Windows platforms.

Release notes:
https://github.com/paragonie/random_compat/releases/tag/v2.0.21

For a full list of changes in this update, see the random_compat GitHub:
https://github.com/paragonie/random_compat/compare/v2.0.11...v2.0.21

Follow-up to [42130].

Props jrf, paragoninitiativeenterprises.
Fixes #55181.
Built from https://develop.svn.wordpress.org/trunk@52742


git-svn-id: http://core.svn.wordpress.org/trunk@52331 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-16 21:19:04 +00:00
jorgefilipecosta
a73446f6ed Script Loader: Load block support styles in the head for block themes.
The dynamic block styles for layout and elements should be loaded in the head for block themes. While that should also be the case for classic themes, the current mechanism we use (render_block) does not allow us to do that, hence, this PR doesn't change anything for them and will be loaded the body.

Props oandregal, youknowriad, wpsoul.
Fixes #55148.
Built from https://develop.svn.wordpress.org/trunk@52741


git-svn-id: http://core.svn.wordpress.org/trunk@52330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-16 17:28:01 +00:00
Sergey Biryukov
a04ccd9c90 Twenty Seventeen: Remove bottom border (box-shadow) from linked images.
Props mikachan, sabernhardt, nidhidhandhukiya, mukesh27, scruffian.
Fixes #55141.
Built from https://develop.svn.wordpress.org/trunk@52740


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

Props oandregal, aristath.
Fixes #55148.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52327 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-16 10:36:02 +00:00
audrasjb
ca76abd7e8 Networks and Sites: Remove unnecessary commented code from remove_user_from_blog().
This change removes a call to `wp_revoke_user()` from `remove_user_from_blog()`: this line has been commented out since forever.

Props Faison.
Fixes #55170.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52326 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-15 21:21:00 +00:00
audrasjb
fd752670a2 Administration: Fix a CSS issue on the Welcome Panel when the "Dashboard" heading is missing.
This change adds a CSS exception for when the "Dashboard" heading is missing or located below the Welcome Panel.

Props critterverse, sabernhardt, rolfsiebers, audrasjb.
Fixes #54977.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52324 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-15 18:12:00 +00:00
Clorith
c3ff2a1cc6 Filesystem API: Use a temp folder for Content-Disposition files.
#38231 added support for files fetched remotely to have their filename defined by the host using the `Content-Disposition` header. This would then take priority over the existing temporary file name created with `wp_tempnam()` earlier in the process.

The change unintentionally omitted the temporary directory path used during uploads, since the `wp_tempnam()` function would have added it previously, so that files with this header ended up being stored in the WordPress root folder, or wp-admin folder, when triggered by WP_Cron or user interactions respectively.

This change makes sure the file path includes the temporary directory location when the header is used.

Follow-up to [51939].

Props antonynz, azouamauriac.
Fixes #55109.
Built from https://develop.svn.wordpress.org/trunk@52734


git-svn-id: http://core.svn.wordpress.org/trunk@52323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-15 17:49:00 +00:00
Dominik Schilling
79971103c5 Editor: Prevent front-end assets of a block from being enqueued in the block editor.
Since WordPress 5.9 you can set a view script for a block which is supposed to be only loaded on the front end. Unfortunately it's currently also loaded in the editor which can cause unexpected behaviour and also performance issues depending on the size of the scripts.
This is caused by the preloading of REST API routes via `block_editor_rest_api_preload()` which doesn't happen in an encapsulated process and so does pollute any global state like the one for scripts and styles.
Similar to the global `$post`, core now backups the globals `$wp_scripts` and `$wp_styles` and restores the backup after the preloading.

Props gziolo, ocean90.
Fixes #55151.
Built from https://develop.svn.wordpress.org/trunk@52733


git-svn-id: http://core.svn.wordpress.org/trunk@52322 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-15 17:30:02 +00:00
Sergey Biryukov
fc26a05498 Coding Standards: Rename some variables in iis7_add_rewrite_rule() for consistency.
Follow-up to [52721].

Props azouamauriac.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52732


git-svn-id: http://core.svn.wordpress.org/trunk@52321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-15 13:49:04 +00:00
audrasjb
8475350f0e Widgets: Missing markup from Widgets Group block.
This change fixes an issue in the Widgets editor: widgets group was missing a `.wp-widget-group__inner-blocks` container.

Props noisysocks, ironprogrammer.
Fixes #55072.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52319 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-15 09:58:04 +00:00
audrasjb
f4a871189a Twenty Twenty-One: Allow editor styles to control block margins.
This change removes some overrides that prevented site editor updates in 5.9 from controlling vertical margins via `var(--global--spacing-vertical)`.

Props stacimc, Boniu91, aristath, ironprogrammer, nidhidhandhukiya.
Fixes #54250.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-14 21:55:08 +00:00
Sergey Biryukov
21a51e9993 Media: Display an error message in grid view if the attachment could not be deleted.
Previously, the attachment was silently removed from the grid but reappeared after a page reload.

Follow-up to [22869].

Props kapilpaul, costdev, mukesh27, azouamauriac, SergeyBiryukov.
Fixes #55158.
Built from https://develop.svn.wordpress.org/trunk@52725


git-svn-id: http://core.svn.wordpress.org/trunk@52314 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-14 14:21:05 +00:00
audrasjb
3c27e50dd6 Twenty Fifteen: Add gradient background options using the theme color scheme.
This change implements gradient background options that fit the color scheme used in Twenty Fifteen.

Props ianbelanger, itsamoreh, pls78, audrasjb.
Fixes #49760.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52313 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-13 21:47:01 +00:00
Sergey Biryukov
556d42ac71 Coding Standards: Fix WPCS issues in wp-admin/includes/misc.php.
* Use strict comparison in various conditions.
* Fix a `Variable "$system_webServer_node" is not in valid snake_case format` WPCS warning.

Includes minor code layout fixes for better readability.

Follow-up to [10607], [11350], [22253], [26137].

Props azouamauriac, SergeyBiryukov.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52721


git-svn-id: http://core.svn.wordpress.org/trunk@52310 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-13 17:09:05 +00:00
Sergey Biryukov
77b1aa0cf3 Docs: Fix typo in a comment in wp_get_image_mime().
Follow-up to [39831].

Props dilipbheda.
Fixes #55154.
Built from https://develop.svn.wordpress.org/trunk@52719


git-svn-id: http://core.svn.wordpress.org/trunk@52308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-12 14:45:00 +00:00
Sergey Biryukov
1e1fb78c07 Code Modernization: Use file_get_contents() in wp_get_webp_info().
`file_get_contents()` is faster than `fread()`, because the PHP core can decide how to best read the remaining file; it could decide to issue just one `read()` call or `mmap()` the file first.

Per the PHP manual, `file_get_contents()` or `stream_get_contents()` is the preferred way to read the contents of a file into a string. It will use memory mapping techniques if supported by the OS to enhance performance.

Reference: [https://www.php.net/manual/en/function.file-get-contents.php PHP Manual: file_get_contents()].

Follow-up to [50810], [52696], [52698], [52701].

Props maxkellermann.
See #55069.
Built from https://develop.svn.wordpress.org/trunk@52718


git-svn-id: http://core.svn.wordpress.org/trunk@52307 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-12 13:13:59 +00:00
Sergey Biryukov
c128cd263a Coding Standards: Remove unnecessary try/catch block in wp_get_webp_info().
This appears to be redundant, as none of the functions used inside the block throw an exception.

Follow-up to [50810].

See #54728.
Built from https://develop.svn.wordpress.org/trunk@52717


git-svn-id: http://core.svn.wordpress.org/trunk@52306 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-12 13:08:01 +00:00
Sergey Biryukov
11691e8207 Docs: Improve @return tags for wp_cache_*_multiple() functions:
* `wp_cache_add_multiple()`
* `wp_cache_set_multiple()`
* `wp_cache_get_multiple()`
* `wp_cache_delete_multiple()`

This aims to provide more details about the returned value types.

Follow-up to [52700], [52702], [52703].

See #54729, #54574.
Built from https://develop.svn.wordpress.org/trunk@52708


git-svn-id: http://core.svn.wordpress.org/trunk@52297 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 19:21:01 +00:00
spacedmonkey
a4026420cc Cache: Use wp_cache_*_multiple() in core functions.
Implement the `wp_cache_add_multiple`, `wp_cache_set_multiple` and `wp_cache_delete_multiple` in a number of core functions after they were introduced in [52700]

Props: spacedmonkey, adamsilverstein, flixos90, mitogh.
Fixes: #55029.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52296 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 18:51:59 +00:00
Sergey Biryukov
6f3fcdcb4b Cache API: Reorder object cache functions and methods for consistency.
The original order was alphabetical, which became less obvious as newer functions got added, resulting in a somewhat random order.

This commits aims to organize the functions and related `WP_Object_Cache` methods in a more predictable order:

* `wp_cache_init()`
* `wp_cache_add()`
* `wp_cache_add_multiple()`
* `wp_cache_replace()`
* `wp_cache_set()`
* `wp_cache_set_multiple()`
* `wp_cache_get()`
* `wp_cache_get_multiple()`
* `wp_cache_delete()`
* `wp_cache_delete_multiple()`
* `wp_cache_incr()`
* `wp_cache_decr()`
* `wp_cache_flush()`
* `wp_cache_close()`
* `wp_cache_add_global_groups()`
* `wp_cache_add_non_persistent_groups()`
* `wp_cache_switch_to_blog()`
* `wp_cache_reset()`

Follow-up to [3011], [6543], [7986], [13066], [18580], [21403], [47938], [52700], [52703-52705].

See #54728, #54574.
Built from https://develop.svn.wordpress.org/trunk@52706


git-svn-id: http://core.svn.wordpress.org/trunk@52295 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 18:49:03 +00:00
Sergey Biryukov
d3f69d117c Docs: Correct the suggested alternative for the deprecated wp_cache_reset() function.
While this was previously added and reverted more than once as part of various documentation cleanup efforts, `wp_cache_switch_to_blog()` appears to be the correct alternative for `wp_cache_reset()`, per the latter's DocBlock.

This commit also corrects the `@deprecated` tag for `WP_Object_Cache::reset()` to link to the `::switch_to_blog()` method of the class, instead of the function of the same name.

Follow-up to [13066], [21403], [22111], [33678], [34225], [34226], [40929].

See #54729.
Built from https://develop.svn.wordpress.org/trunk@52705


git-svn-id: http://core.svn.wordpress.org/trunk@52294 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 18:33:00 +00:00
Sergey Biryukov
42e1bea8f1 Docs: Correct @since tag for wp_cache_reset().
The function was added in WordPress 3.0, not 2.6.

Follow-up to [13066].

See #54729.
Built from https://develop.svn.wordpress.org/trunk@52704


git-svn-id: http://core.svn.wordpress.org/trunk@52293 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 18:05:03 +00:00
Sergey Biryukov
7f36a90e0e Docs: Update DocBlocks for some object cache functions per the documentation standards.
Follow-up to [47060], [47938], [47944], [52700].

See #54729, #54574.
Built from https://develop.svn.wordpress.org/trunk@52703


git-svn-id: http://core.svn.wordpress.org/trunk@52292 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 17:44:01 +00:00
Sergey Biryukov
2ca9b92cef Tests: Remove some extra wp_cache_set() calls from wp_cache_set_multiple() test.
These appear to be a copy/paste from the `wp_cache_get_multiple()` test and are not required here.

Follow-up to [47938], [52700].

See #54574.
Built from https://develop.svn.wordpress.org/trunk@52702


git-svn-id: http://core.svn.wordpress.org/trunk@52291 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 17:41:01 +00:00
Sergey Biryukov
734960733e Code Modernization: Use file_get_contents() in wp_get_image_mime().
`file_get_contents()` is faster than `fread()`, because the PHP core can decide how to best read the remaining file; it could decide to issue just one `read()` call or `mmap()` the file first.

Per the PHP manual, `file_get_contents()` or `stream_get_contents()` is the preferred way to read the contents of a file into a string. It will use memory mapping techniques if supported by the OS to enhance performance.

Reference: [https://www.php.net/manual/en/function.file-get-contents.php PHP Manual: file_get_contents()].

Follow-up to [50810], [52696], [52698].

Props maxkellermann.
See #55069.
Built from https://develop.svn.wordpress.org/trunk@52701


git-svn-id: http://core.svn.wordpress.org/trunk@52290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 15:50:05 +00:00
spacedmonkey
a3f3c5c959 Cache: Add wp_cache_*_multiple functions.
Add new caching functions named `wp_cache_add_multiple`, `wp_cache_set_multiple` and `wp_cache_delete_multiple`. All of these functions allow for an array of data to be passed, so that multiple cache objects can be created / edited / deleted in a single function call. This follows on from [47938] where the `wp_cache_get_multiple` function was introduced and allowed for multiple cache objects to be received in one call. 

Props: spacedmonkey, tillkruess, adamsilverstein, flixos90, mitogh, pbearne. 
Fixes: #54574.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52289 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 12:51:59 +00:00
gziolo
a877a9806b I18n: Standardize the script paths for blocks
When providing file paths to scripts (editorScript, script or viewScript), when there is a trailing ./ included then there was a different md5 generated for the file that didn't match the one used with the file generated in the translations folder.

Props Rahe.
See #54797.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52288 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 12:14:04 +00:00
Sergey Biryukov
8a62f7dc05 Code Modernization: Use file_get_contents() in get_file_data().
`file_get_contents()` is faster than `fread()`, because the PHP core can decide how to best read the remaining file; it could decide to issue just one `read()` call or `mmap()` the file first.

Per the PHP manual, `file_get_contents()` or `stream_get_contents()` is the preferred way to read the contents of a file into a string. It will use memory mapping techniques if supported by the OS to enhance performance.

Reference: [https://www.php.net/manual/en/function.file-get-contents.php PHP Manual: file_get_contents()].

Follow-up to [12044], [49073], [52696].

Props maxkellermann.
See #55069.
Built from https://develop.svn.wordpress.org/trunk@52698


git-svn-id: http://core.svn.wordpress.org/trunk@52287 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-10 15:03:04 +00:00
audrasjb
fbb9d52774 Query: Check if the theme supports block-templates before calling locate_block_template() in get_query_template().
This change improves performance for classic themes by removing an unnecessary query and fixes an issue where a classic theme would show "Empty template: Index" on the frontend when an empty `(block-)templates/index.html` file exists.

Props johnbillion, ianatkins, Mamaduka, costdev, manfcarlo, dolphingg, audrasjb, madeinua, kapilpaul, rafiahmedd, SergeyBiryukov.
Fixes #54844.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52286 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-09 13:22:03 +00:00
Sergey Biryukov
4f856dfae0 Code Modernization: Use stream_get_contents() in POMO_FileReader::read_all().
`stream_get_contents()` is faster than `fread()`, because the PHP core can decide how to best read the remaining file; it could decide to issue just one `read()` call or `mmap()` the file first.

Per the PHP manual, `file_get_contents()` or `stream_get_contents()` is the preferred way to read the contents of a file into a string. It will use memory mapping techniques if supported by the OS to enhance performance.

Reference: [https://www.php.net/manual/en/function.file-get-contents.php PHP Manual: file_get_contents()].

Follow-up to [12174].

Props maxkellermann.
See #55069.
Built from https://develop.svn.wordpress.org/trunk@52696


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

Follow-up to [52036].

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

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


git-svn-id: http://core.svn.wordpress.org/trunk@52284 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-08 23:41:00 +00:00
Peter Wilson
2fa1d729ba Options: Disable transients while installing.
Prevent the transient setters and getters from attempting to use the database table before they exist during the installation process. 

During installation transients now use the `wp_cache_*()` functions on all sites, including those without a persistent cache, to prevent database errors. The use of the caching functions stores the data in memory for the duration of the request to account for transient data that is used multiple times during installation.

Props dd32, audrasjb, tnolte, antonvlasenko, noisysocks, peterwilsoncc.
Fixes #54849.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52283 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-08 23:30:03 +00:00
audrasjb
22c9355e2d Docs: Fix an error in wp_kses_attr() docblock.
Props kebbet.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52282 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-08 16:25:01 +00:00
audrasjb
2b8f6781bb Docs: Typo correction in class-wp-theme-json docblocks.
Props kebbet.
See #54729.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52281 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-08 16:11:03 +00:00
Sergey Biryukov
7d9b54b131 Posts, Post Types: Pass the $update parameter to wp_insert_post_data and wp_insert_attachment_data filters.
This makes it easier to determine in a callback function whether this is an existing post being updated or not.

Follow-up to [8635], [8702], [27130], [27138], [28106], [28788], [47633].

Props nhadsall, mukesh27.
Fixes #46228.
Built from https://develop.svn.wordpress.org/trunk@52691


git-svn-id: http://core.svn.wordpress.org/trunk@52280 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-08 12:24:02 +00:00
audrasjb
bab3bdf2df Twenty Twelve: Typo correction a bundled pattern.
This change fixes a typo in the "Left-aligned Large Quote" block pattern.

Props tobifjellner, rafiahmedd, mukesh27.
Fixes #55099.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52279 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-07 18:29:04 +00:00
Sergey Biryukov
602b46626c Coding Standards: Rename the $profileuser variable to $profile_user in wp-admin/user-edit.php.
This brings the naming more in line with other variables like `$current_user`.

Follow-up to [2872].

See #54728.
Built from https://develop.svn.wordpress.org/trunk@52689


git-svn-id: http://core.svn.wordpress.org/trunk@52278 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-07 15:26:01 +00:00
Sergey Biryukov
1b22e56ad0 Coding Standards: Use strict comparison in wp-admin/user-edit.php.
Follow-up to [2872], [13941], [12722], [14043], [14802], [23364], [42688].

Props azouamauriac.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52687


git-svn-id: http://core.svn.wordpress.org/trunk@52276 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-07 14:47:02 +00:00
audrasjb
ca5f3d0af6 Twenty Twenty-Two: Restore custom padding for group blocks with a background color.
This change partially reverts [52679] which accidentally removed custom padding for group blocks with a background color.

Follow-up to [52679].

Props kjellr.
Fixes #55103.
See #54944.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-07 14:38:59 +00:00
Sergey Biryukov
a584be05eb Coding Standards: Rename $r variable to $args for clarity in walk_page_tree().
Follow-up to [9830], [32617], [45667], [52684].

See #54728.
Built from https://develop.svn.wordpress.org/trunk@52685


git-svn-id: http://core.svn.wordpress.org/trunk@52274 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-07 14:21:01 +00:00
Sergey Biryukov
a39f5f9d4f Coding Standards: Rename $r variable to $args for clarity in walk_nav_menu_tree().
Follow-up to [14248], [32612], [45667].

Props uzumymw.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52684


git-svn-id: http://core.svn.wordpress.org/trunk@52273 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-07 14:01:05 +00:00
Sergey Biryukov
3015d1ca44 Tests: Rename the test file and class for wp_get_global_stylesheet() tests.
This matches the name of the function being tested.

Follow-up to [52675-52677].

See #54782.
Built from https://develop.svn.wordpress.org/trunk@52682


git-svn-id: http://core.svn.wordpress.org/trunk@52271 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-05 13:21:01 +00:00
audrasjb
54514a5451 Twenty Twenty-Two: Fix headings consistency in Pricing table pattern.
This change fixes a consistency issue where "Pigeon" was a h3, while "Sparrow" and "Falcon" were h2. Let's treat these birds equally 🐦

Props kjellr, jffng.
Fixes #54929.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-05 08:00:05 +00:00
audrasjb
68f58d46a5 Docs: Typo corrections in various API docblocks.
Props hasanuzzamanshamim.
Fixes #55073.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52269 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-04 16:28:00 +00:00
audrasjb
70fe8c8cea Twenty Twenty-Two: Remove negative side margins on group blocks with a background.
This change fixes an issue where applying a background color to a group block aligned it to the left in the editor.

Props eddystile, audrasjb, webmandesign, sabernhardt, petaryoast.
Fixes #54944.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-04 15:16:01 +00:00
Sergey Biryukov
1b81823244 Tests: Use more appropriate assertions in wp_get_global_stylesheet() tests.
This replaces instances of `assertTrue( str_contains( ... ) )` with `assertStringContainsString()` to use native PHPUnit functionality.

Follow-up to [52675], [52676].

See #54782.
Built from https://develop.svn.wordpress.org/trunk@52677


git-svn-id: http://core.svn.wordpress.org/trunk@52266 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-04 14:35:00 +00:00
Sergey Biryukov
4cbad9a9aa Coding Standards: Use strict type check for in_array() in wp_get_global_stylesheet().
Use multi-line comment syntax for some comments, per the documentation standards.

Follow-up to [52675].

See #54782.
Built from https://develop.svn.wordpress.org/trunk@52676


git-svn-id: http://core.svn.wordpress.org/trunk@52265 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-04 14:18:59 +00:00
jorgefilipecosta
e8e20a2823 Fix: Classic themes using default presets are not working.
This commit makes the presets provided by the theme via add_theme_support always create CSS Custom Properties, whether or not the theme has a theme.json file. This way, if the overwrites a core preset, the core CSS variables are also overwritten and use the theme value.

Props oandregal, hellofromTonya, desrosj, costdev, pbearne, johnstonphilip, webmandesign.
Fixes #54782.
Built from https://develop.svn.wordpress.org/trunk@52675


git-svn-id: http://core.svn.wordpress.org/trunk@52264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-04 13:52:00 +00:00
audrasjb
e175e8aa0a Toolbar: Don't hide admin bar text labels from screen readers on small screens.
This change replaces `display: none` with `screen-reader-text` styles so the text labels are available for screen readers on small screens.

Props legendusmaximus, sabernhardt, konradyoast.
Fixes #54895.

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


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

Follow-up to [52429].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52262 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-04 10:52:08 +00:00
joedolson
aa3db62410 Comments: Only render term update notices on term screens.
Prevent blank notices from appearing when adding custom fields or terms in the post editor.

Props gadhiyaravi, Boniu91, ravipatel, sabernhardt.
Fixes #54955. See #42937.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-04 01:22:02 +00:00
joedolson
f5d588bf26 Comments: Verify 'mirroring' property exists in media views.
Checks that the media collection has a mirroring property before accessing the property in media views.

Props MMDeveloper, mukesh27.
Fixes #53856.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52260 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-04 01:00:04 +00:00
Sergey Biryukov
84f61343d4 Docs: Fix typo in the is_post_status_viewable() function description.
Follow-up to [50130].

Props rafiahmedd.
Fixes #55068.
Built from https://develop.svn.wordpress.org/trunk@52670


git-svn-id: http://core.svn.wordpress.org/trunk@52259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-03 21:25:02 +00:00
spacedmonkey
db603605ac Taxonomy: Remove cache expiry limitation in WP_Term_Query.
Remove the one day expiry limitation from query caches found in the `WP_Term_Qurery` class. Removing this limitation means that the caches will remain in object caching, as long as possible. Ensure that all term / taxonomy cache clear functions invalidate query caches, by deleting the last_changed value in the terms cache group. 

Props spacedmonkey, adamsilverstein, boonebgorges, tillkruess, dlh, flixos90.
Fixes #54511.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52258 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-03 17:43:06 +00:00
audrasjb
ca9b189085 Editor: Remove standard post type UI for templates and template parts.
In [52158] the standard post type UI was added back for templates and template parts, because these features had been temporarily removed from the site editor in the rush to get 5.9 ready for December. Since 5.9 these features were properly added back to the site editor, the `show_ui` values for these post types should be returned back to `false`.

Follow-up to [52158].

Props manfcarlo, audrasjb.
Fixes #54908.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52257 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-03 09:03:04 +00:00
audrasjb
63888dec3e Twenty Twenty-Two: Make 404 pattern search label and button translatable.
This changes makes the Twenty Twenty-Two "hidden-404" pattern fully prepared for translation.

Props kjellr, walbo.
Fixes #54928.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52253 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-02 23:43:02 +00:00
Peter Wilson
69e9e78cf4 Upgrade: Add follow up ticket ID to upgrade_590() comment.
Follow up to [52656].

Props audrasjb.
See #54906.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52251 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-02 23:22:06 +00:00
Sergey Biryukov
051bd96994 Twenty Twenty: Add Noto Serif as a fallback font before Garamond.
This aims to provide better experience on Chromebooks. Noto Serif is also the fallback font for Android devices.

Follow-up to [46271].

Props sabernhardt, nmschaller.
Fixes #50723.
Built from https://develop.svn.wordpress.org/trunk@52661


git-svn-id: http://core.svn.wordpress.org/trunk@52250 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-02 15:13:04 +00:00
davidbaumwald
a5c45366cb Options, Meta APIs: Correct some inline docs for update_post_meta and delete_post_meta.
In `update_post_meta` and `delete_post_meta`, code was added to fetch the parent post if these functions were called for a revision post ID.  In [9252], the code was apparently copied from `add_post_meta`, and the inline comment describing the new block of code was not updated to mention either "updated" or "deleted" respectively.  This change corrects the comment in both functions to reflect the current action instead of "added".

Props thelovekesh, rehanali.
Fixes #54835.
Built from https://develop.svn.wordpress.org/trunk@52660


git-svn-id: http://core.svn.wordpress.org/trunk@52249 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-01 17:12:03 +00:00
Sergey Biryukov
fefd1930c5 General: Remove inaccurate reference to the link_updated field from the wp_insert_link() DocBlock.
The `link_updated` field is unused as of WordPress 3.0 and was never updated via `wp_insert_link()`, only via the `wp-admin/update-links.php` file removed in [13744].

Follow-up to [13744], [49487].

Props dshanske, dharm1025, SergeyBiryukov.
Fixes #54880.
Built from https://develop.svn.wordpress.org/trunk@52659


git-svn-id: http://core.svn.wordpress.org/trunk@52248 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-01 12:30:02 +00:00
audrasjb
4894efc122 Twenty Twenty-One: Replace GitHub with .org link in Theme URI.
Theme URI is the URL of a public web page where users can find more information about the theme. For bundled themes, it should be a link to the theme’s page on the Theme Repository.

Props kafleg.
Fixes #55018.

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


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

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


git-svn-id: http://core.svn.wordpress.org/trunk@52246 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-01 01:22:04 +00:00
Peter Wilson
1ee362004f Upgrade: Prevent warnings upgrading cron array.
An unvisited site may have an undefined cron array, resulting in `_get_cron_array()` returning the value `false`. Previously this would trigger warning in `upgrade_590()` as the function assumed `_get_cron_array()` would alway return an array.

No database version change is required as the upgrade routine was successful on sites with a cron array during 5.9.0. On sites without a cron array, the error has already been thrown if they are running db version 51917. This fix is only required for new sites or those upgrading that have skipped 5.9.0.

Follow up to [51917].

Props chrisvanpatten, kapilpaul, SergeyBiryukov.
Fixes #54906.
See #53940.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-01 00:14:06 +00:00
Sergey Biryukov
8de9cdf559 Docs: Add a comment to clarify the username_exists() check in wpmu_validate_blog_signup().
Creating a new site that matches an existing user's login name is not allowed, unless it's the user's own username.

Follow-up to [https://mu.trac.wordpress.org/changeset/550 mu:550], [https://mu.trac.wordpress.org/changeset/1364 mu:1364].

Props henry.wright, joyously, swissspidy, SergeyBiryukov.
Fixes #54326.
Built from https://develop.svn.wordpress.org/trunk@52655


git-svn-id: http://core.svn.wordpress.org/trunk@52244 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-31 13:07:03 +00:00
John Blackbourn
eb338bd22d Build/Test Tools: Switch to some more appropriate assertions.
See #54725

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


git-svn-id: http://core.svn.wordpress.org/trunk@52243 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-30 19:42:00 +00:00
John Blackbourn
aed11c4067 Role/Capability: Correct the documented accepted types for the capability argument of WP_User_Query.
See #16841, #54729

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


git-svn-id: http://core.svn.wordpress.org/trunk@52242 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-30 19:34:00 +00:00
John Blackbourn
ecc08a41f6 Docs: Increase the specificity of types in various inline documentation.
See #54729

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


git-svn-id: http://core.svn.wordpress.org/trunk@52241 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-30 19:25:03 +00:00
Sergey Biryukov
effadc5da9 Twenty Twenty-Two: Optimize the assets/images/ducks.jpg image.
The new file should have a much better balance of quality and file size.

Follow-up to [52081], [52107].

Props kafleg, kjellr, jffng, kapilpaul.
Fixes #54911.
Built from https://develop.svn.wordpress.org/trunk@52651


git-svn-id: http://core.svn.wordpress.org/trunk@52240 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-30 11:56:03 +00:00
Sergey Biryukov
b3aae615bb Users: Return a WP_Error from wp_insert_user() if the user_url field is too long.
The `user_url` database field only allows up to 100 characters, and if the value is longer than that, the function should return a proper error message instead of silently failing.

This complements similar checks for `user_login` and `user_nicename` fields.

Follow-up to [45], [1575], [32299], [34218], [34626].

Props mkox, sabernhardt, tszming, SergeyBiryukov.
Fixes #44107.
Built from https://develop.svn.wordpress.org/trunk@52650


git-svn-id: http://core.svn.wordpress.org/trunk@52239 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-29 14:25:03 +00:00
audrasjb
c0cbf007f0 Administration: Add a top margin to Mail Server Port field on small screens.
This change fixes an overlapping issue on small screens in the Writing Settings screen.

Props pravinparmar2404, afercia, utz119, thimalw, sabernhardt, audrasjb.
Fixes #50177.

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


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

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

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


git-svn-id: http://core.svn.wordpress.org/trunk@52237 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-28 16:44:05 +00:00
Sergey Biryukov
445d687680 Themes: Correct the width of theme preview on Add Themes screen.
This ensures that the preview ratio remains accurate for the user's screen size when the sidebar is open.

Follow-up to [19995], [20110], [20133], [20138], [28033].

Props shreyasikhar26, costdev, sumitsingh, SergeyBiryukov.
Fixes #54764.
Built from https://develop.svn.wordpress.org/trunk@52647


git-svn-id: http://core.svn.wordpress.org/trunk@52236 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-28 12:10:04 +00:00
audrasjb
1d561e1fa6 Media: Remove target blank attribute from media uploader edit links.
This change removes a dispensable target blank attribute from Edit links displayed in the asynchronous file uploader.

Follow-up to [22755].

Props kebbet, SergeyBiryukov.
Fixes #54945.
See #23432.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52235 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-27 22:17:00 +00:00
audrasjb
b3d3adaa2b Docs: Fix incorrect type in translations_api and translations_api_result docblocks.
Before this changeset, `translation_api` and `translation_api_result` filters were incorrectly marked as taking object as their first argument. The correct type is an array as `json_decode()` is asked to return an associative array.

Props volodymyrkolesnykov.
Fixes #54959.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52234 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-27 21:15:03 +00:00
Sergey Biryukov
66dc00211b Upgrade/Install: Make sure the "Show hidden updates" button is visible and works as expected.
The [https://api.jquery.com/toggle-event/ .toggle( handler, handler )] method signature was deprecated in jQuery 1.8 and removed in jQuery 1.9. 

This commit updates the click handler function to work with jQuery 1.9+.

Follow-up to [9441], [9543], [42785], [48323].

Props malinevskiy, SergeyBiryukov.
Fixes #54886.
Built from https://develop.svn.wordpress.org/trunk@52644


git-svn-id: http://core.svn.wordpress.org/trunk@52233 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-26 13:11:29 +00:00
Sergey Biryukov
2eaeae58ff Docs: Update spelling for inline comments in a few files.
Per the [https://make.wordpress.org/core/handbook/best-practices/spelling/ spelling] and [https://make.wordpress.org/docs/style-guide/language-grammar/word-choice/ word choice] documentation guidelines, American (US) spelling should be preferred.

Props mohadeseghasemi, subrataemfluence, rehanali, SergeyBiryukov.
Fixes #46837.
Built from https://develop.svn.wordpress.org/trunk@52640


git-svn-id: http://core.svn.wordpress.org/trunk@52229 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-25 13:55:05 +00:00
Sergey Biryukov
6329aacac8 Docs: Correct @global tag in wp_kses_xml_named_entities().
This updates the variable name in the DocBlock to the correct one.

Follow-up to [48072], [52229].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52228 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-25 11:16:05 +00:00
davidbaumwald
fe7d62fe13 Upgrade/Install: Update $_old_files for 5.9.
Props SergeyBiryukov, davidbaumwald.
Fixes #54894.
Built from https://develop.svn.wordpress.org/trunk@52637


git-svn-id: http://core.svn.wordpress.org/trunk@52225 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-24 18:24:02 +00:00
desrosj
2900d9eccf Editor: Bump editor packages to include the latest fixes.
This merges the latest package updates for the block editor to include the fix for https://github.com/WordPress/gutenberg/pull/38175.

Props hellofromTonya, mamaduka, joen, talldanwp, cbravobernal, poena.
Fixes #54487.
Built from https://develop.svn.wordpress.org/trunk@52633


git-svn-id: http://core.svn.wordpress.org/trunk@52221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-24 15:57:28 +00:00
audrasjb
0e9a48e0cb Docs: Docblock corrections for get_block_file_template().
Follow-up to [52324].

Props johnbillion, SergeyBiryukov, costdev.
Fixes #54879.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52219 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-24 15:28:02 +00:00
Dominik Schilling
70a7faa9dc Plugins/Themes: Allow to install/activate plugins/themes which require the WordPress version currently in development.
Twenty Twenty-Two requires WordPress 5.9 but currently can't be (re)activated in the 5.9 branch because `version_compare( '5.9-RC3-52627', '5.9', '>=' )` as used by `is_wp_version_compatible()` returns `false`. To appreciate the testing of upcoming versions any `-alpha`, `-RC`, `-beta` suffixes are now stripped off from the WordPress version before checking for compatibility.

Fixes #54882.
Built from https://develop.svn.wordpress.org/trunk@52628


git-svn-id: http://core.svn.wordpress.org/trunk@52216 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-24 10:41:01 +00:00
Peter Wilson
0c51a7f11b Help/About: Update Freedoms page for 5.9.
Fixes #54270.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52214 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-24 09:41:03 +00:00
noisysocks
939758a2b5 Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- Block Editor: Mark last change as persistent on save
- Site Editor: Restore ?styles=open functionality
- Site Editor: Fix resizable box scrollbars in blocks
- Add classic menus to menu switcher

See #54487.
Props talldanwp.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52212 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-24 07:46:21 +00:00
noisysocks
01cb359adc Customizer: Remove Widgets panel when a theme does not support widgets
By setting 'theme_supports' on the panel, we ensure that the Widgets panel is
removed if a theme does not have support for 'widgets'.

This makes the behaviour of the Widgets and Menus panels consistent.

Follows [52621].
See #54888.
Props hellofromTonya, costdev, peterwilsoncc.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52210 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-24 05:37:01 +00:00
noisysocks
4aaa1803ec Customizer: Remove Menus panel when a theme does not support menus
By overriding check_capabilities(), we can ensure that the Menus panel
is removed if a theme does not have support for 'menus' nor 'widgets'.

This ensures that the Menus panel does not appear when using a block
theme, which is confusing to users.

See #54888.
Props hellofromTonya, costdev, peterwilsoncc.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52209 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-24 05:34:04 +00:00
Sergey Biryukov
997f8b9921 Coding Standards: Use a more appropriate variable name in link_advanced_meta_box().
Follow-up to [45667].

Props mkox, SergeyBiryukov.
Fixes #54856.
Built from https://develop.svn.wordpress.org/trunk@52620


git-svn-id: http://core.svn.wordpress.org/trunk@52208 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-23 09:03:05 +00:00
desrosj
d332f43f60 Bundled Themes: Bump the versions for bundled themes for release.
This bumps the versions of the default bundled themes in preparation for release with WordPress 5.9.

The new versions are:
- Twenty Ten: 3.6
- Twenty Eleven: 4.0
- Twenty Twelve: 3.6
- Twenty Thirteen: 3.5
- Twenty Fourteen: 3.3
- Twenty Fifteen: 3.1
- Twenty Sixteen: 2.6
- Twenty Seventeen: 2.9
- Twenty Nineteen: 2.2
- Twenty Twenty: 1.9
- Twenty Twenty-One: 1.5

Props audrasjb.
Fixes #54783.
Built from https://develop.svn.wordpress.org/trunk@52618


git-svn-id: http://core.svn.wordpress.org/trunk@52206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-22 14:07:05 +00:00