Commit Graph

19023 Commits

Author SHA1 Message Date
spacedmonkey
7613aaf9b1 Menus: Improve cache priming in the wp_get_nav_menu_items function.
In `wp_get_nav_menu_items` multiple function calls to `get_terms` and `get_posts` were being used to load post/term objects into 
memory. This change replaces calls to `get_terms` and `get_posts` with calls to `_prime_post_caches` and 
`_prime_term_caches`. These functions are designed to prime object caches and do not have the overhead of a query object. This 
change also replaces multiple queries with a single query, saving many SQL queries per page load. 

Props Spacedmonkey, peterwilsoncc. 
Fixes #55428.
 --This line, and those below, 
will be ignored--

M    src/wp-includes/nav-menu.php

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


git-svn-id: http://core.svn.wordpress.org/trunk@52564 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-22 09:58:07 +00:00
Sergey Biryukov
41de51364a Coding Standards: Remove a one-time $pieces variable in wp-includes/class-wp-*-query.php.
Use the existing `$clauses` variable instead for consistency.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-21 12:22:01 +00:00
Sergey Biryukov
38dbd506e7 Coding Standards: Wrap the $this->request property in wp-includes/class-wp-*-query.php.
This aims to improve readability by fitting the values on a single screen to avoid horizontal scrolling. 

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


git-svn-id: http://core.svn.wordpress.org/trunk@52562 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-21 12:05:04 +00:00
Sergey Biryukov
83c4cdf92b Coding Standards: Simplify some long conditions in wp-includes/class-wp-term-query.php.
This aims to improve readability and make the logic easier to parse at a glance.

Follow-up to [40293], [52970].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52561 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-21 11:56:04 +00:00
audrasjb
7fda1f8e69 Menus: Improve padding on bulk action labels for small screens.
Props sumitsingh, sabernhardt, ryokuhi, priyank9033, audrasjb, pbiron.
Fixes #54855.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-21 10:32:03 +00:00
Peter Wilson
284308048e Taxonomy: Increase cache hits in WP_Term_Query.
Increase the number of cache hits in `WP_Term_Query` by normalizing data included in the cache key.

Arguments that do not affect the SQL query, eg `update_term_meta_cache`, are removed from cache key generation. Arguments that are accepted in multiple formats, eg a string and an array, are normalized for both the cache key and the SQL query.

Props spacedmonkey.
Fixes #55352.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-21 03:55:03 +00:00
Sergey Biryukov
dcf9c33bc6 KSES: Add support for <ruby> and related elements.
`<ruby>` element and its friends are used to attach annotation text onto a piece of text. This is especially commonly used in Japanese content, but it can also been seen in content of other languages like Chinese.

The set of elements to enable such functionality consists of `<ruby>`, `<rt>`, and `<rp>` in the [https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-ruby-element HTML Standard], while some browsers (like Firefox) additionally support `<rb>` and `<rtc>` for more advanced formatting, which are not yet included in the official HTML spec, but can be found in a [https://www.w3.org/TR/html-ruby-extensions/ W3C extension].

Props upsuper, mukesh27, SergeyBiryukov.
Fixes #54698.
Built from https://develop.svn.wordpress.org/trunk@52969


git-svn-id: http://core.svn.wordpress.org/trunk@52558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-21 00:30:04 +00:00
Peter Wilson
d89f6097c4 KSES: Allow lang, xml:lang, dir attributes globally.
Globally permit the `lang`, `xml:lang`, and `dir` attributes on all elements rather than a subset in accordance with the HTML specification.

Props upsuper, SergeyBiryukov, mukesh27, audrasjb.
Fixes #54699.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-21 00:13:05 +00:00
Sergey Biryukov
799d6d616c Coding Standards: Escape the comment post URL in _wp_dashboard_recent_comments_row().
Follow-up to [6705].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 17:39:01 +00:00
Sergey Biryukov
0fc4e7d73a Coding Standards: Use strict comparison in wp-includes/class-wp-http-curl.php.
Follow-up to [17692], [25303], [29968].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52555 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 16:24:03 +00:00
Sergey Biryukov
b30c9f51c0 Coding Standards: Rename the $theBody variable to $body in WP_Http_Curl::request().
This fixes a `Variable "$theBody" is not in valid snake_case format` WPCS warning.

Follow-up to [8516], [51825], [51929], [51931], [51940], [52025], [52960], [52961], [52962], [52963], [52964].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 16:12:06 +00:00
Sergey Biryukov
010c5d4f89 Coding Standards: Rename the $strResponse variable to $response in WP_Http_Streams::request().
This fixes a `Variable "$strResponse" is not in valid snake_case format` WPCS warning.

For consistency, this commit also renames the `WP_Http::processResponse()` argument to `$response`.

Follow-up to [8516], [51825], [51929], [51940], [52025], [52960], [52961], [52962], [52963].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52553 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 16:02:04 +00:00
Sergey Biryukov
0c8714dcda Coding Standards: Rename the $headerValue variable to $header_value in WP_Http_Streams::request().
This fixes a `Variable "$headerValue" is not in valid snake_case format` WPCS warning.

Follow-up to [8516], [51825], [51929], [51940], [52960], [52961], [52962].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52552 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 15:52:06 +00:00
Sergey Biryukov
6c3ea94f97 Coding Standards: Rename the $strHeaders variable to $headers in WP_Http_Streams::request().
This fixes a `Variable "$strHeaders" is not in valid snake_case format` WPCS warning.

Follow-up to [8516], [51825], [51929], [51940], [52960], [52961].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 15:50:06 +00:00
Sergey Biryukov
236e1d4ee3 Coding Standards: Rename the $requestPath variable to $request_path in WP_Http_Streams::request().
This fixes a `Variable "$requestPath" is not in valid snake_case format` WPCS warning.

Follow-up to [8516], [51825], [51929], [51940], [52960].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52550 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 15:43:04 +00:00
Sergey Biryukov
47d2a73beb Coding Standards: Rename the $bodyStarted variable to $body_started in WP_Http_Streams::request().
This fixes a `Variable "$bodyStarted" is not in valid snake_case format` WPCS warning.

Follow-up to [17555], [51825], [51929], [51940].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52549 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 15:37:06 +00:00
Sergey Biryukov
60ca4af9e1 Docs: Correct variable references in get_category_feed_link() and get_term_feed_link() @return tags.
The `$cat_id` and `$term_id` variables were replaced by `$cat` and `$term`, respectively.

Follow-up to [52180].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52548 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 15:05:05 +00:00
Sergey Biryukov
845f4f00fd Coding Standards: Rename the $cat_ID argument to $cat_id in get_the_category_by_ID().
This fixes a `Variable "$cat_ID" is not in valid snake_case format` WPCS warning.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52547 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 14:57:07 +00:00
Sergey Biryukov
8cdec43675 Coding Standards: Use esc_url() instead of esc_attr() for some URLs.
Follow-up to [2063], [2182], [4656], [6952], [9098], [11109], [11204], [17887], [22505], 

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


git-svn-id: http://core.svn.wordpress.org/trunk@52546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-19 20:31:12 +00:00
John Blackbourn
280aabee27 I18N: Avoid translating wp_locale strings several times.
This avoids 26 unnecessary duplicate translations.

Props Chouby

Fixes #54564

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


git-svn-id: http://core.svn.wordpress.org/trunk@52545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 21:18:03 +00:00
John Blackbourn
7f9c9dc731 Formatting: Add support for formatting sizes as PB, EB, ZB, and YB.
Props henry.wright, Presskopp

Fixes #40875

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


git-svn-id: http://core.svn.wordpress.org/trunk@52544 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 20:48:02 +00:00
davidbaumwald
35c5e74706 Users: Check maximum length of user_nicename after filters are applied.
Similar to other checks on `user_login` and `user_url`, this change moves the maximum length check on `user_nicename` after the `pre_user_nicename` filter has been applied, to account for any changes to the value prior to saving.

Props SergeyBiryukov, ravipatel, muhammadfaizanhaidar, mukesh27, csesumonpro, azouamauriac.
Fixes #54987.
Built from https://develop.svn.wordpress.org/trunk@52954


git-svn-id: http://core.svn.wordpress.org/trunk@52543 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 20:44:01 +00:00
davidbaumwald
ee85a17cf2 Taxonomy: Consider HTML5 input types when resetting form values after adding a new tag.
When adding a new tag, the form is reset by clearing values for `input[type=text]` and `textarea`s.  However, the reset doesn't account for any HTML5 input types, like `number` or `url`, that may be added by plugins or themes.

This change updates the form resetting jQuery to clear any values from `input` types that are not hidden and neither a `checkbox` nor `radio` type.

Props stevegrunwell.
Fixes #48030.
Built from https://develop.svn.wordpress.org/trunk@52953


git-svn-id: http://core.svn.wordpress.org/trunk@52542 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 20:12:06 +00:00
John Blackbourn
6571e44299 Plugins: Convert apply_filters() into a proper variadic function.
This makes its signature more correct by implementing the spread operator, and adjusts the internal logic correspondingly without affecting performance.

Props jrf, SergeyBiryukov, davidbaumwald, mauriac, johnbillion

Fixes #53218

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


git-svn-id: http://core.svn.wordpress.org/trunk@52541 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 18:23:04 +00:00
davidbaumwald
92a1067f1d Comments: Disable "close on escape" for inline replies when using an IME.
When using an Input Method Editor(IME), pressing escape to perform actions in the IME is common.  However, if this was done while replying to a comment, the "close on escape" feature was also triggered which cleared the current textarea and closed it.

This change checks if an IME is in use by binding the `compositionstart` event to the reply text box and setting a flag if it's triggered.  The "close on escape" feature will now only be triggered if this new flag is not set after typing a reply.

Props BettyJJ, sabernhardt, alexstine, konradyoast, audrasjb, rafiahmedd, afercia.
Fixes #54548.
Built from https://develop.svn.wordpress.org/trunk@52951


git-svn-id: http://core.svn.wordpress.org/trunk@52540 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 18:14:02 +00:00
davidbaumwald
df3dae33cc Administration: Add a media_date_column_time filter to the media list table date column.
Similar to the existing `post_date_column_time` filter in the posts list table, this change adds a new hook to filter the "Date" column output in the media list view.

Props ivanlutrov, lopo, audrasjb.
Fixes #42942.
Built from https://develop.svn.wordpress.org/trunk@52950


git-svn-id: http://core.svn.wordpress.org/trunk@52539 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 16:39:02 +00:00
Sergey Biryukov
fc469e56ca Themes: Use esc_url() for theme screenshots on the Themes screen.
This brings consistency with how screenshots are escaped elsewhere.

Follow-up to [52020], [52947].

See #53370.
Built from https://develop.svn.wordpress.org/trunk@52949


git-svn-id: http://core.svn.wordpress.org/trunk@52538 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 13:44:03 +00:00
audrasjb
775ae0b5f6 Themes: Add version to theme screenshot URL in WP_Themes_List_Table.
Follow-up to [52947].

See #53370.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52537 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 12:44:04 +00:00
audrasjb
a32545f854 Themes: Add version to theme screenshot URL for better browser cache handling.
This change appends the theme version number to the URL of screenshots that appear in various place of the WordPress Admin. As a result, browsers will be able to refresh the screenshot as needed when the theme is updated.

Props codente, desrosj, audrasjb, SergeyBiryukov.
Fixes #53370.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52536 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-17 22:21:07 +00:00
Sergey Biryukov
d6589948ca Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-custom-image-header.php.
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit renames the `$object` variable in `Custom_Image_Header` class methods to `$attachment` for clarity and consistency, as the variable type is actually an array, and updates the documentation accordingly.

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@52946


git-svn-id: http://core.svn.wordpress.org/trunk@52535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-17 20:19:10 +00:00
Peter Wilson
5c2f80f60f Registration/Login: Coding standards fixes for wp-login.php.
Props alkesh7, Presskopp, audrasjb.
Fixes #54746.
See #54728.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-17 04:57:03 +00:00
Peter Wilson
e24bf8c2c9 Themes: Use pointer when hovering on theme details button.
Use the pointer cursor when hovering over the theme details button for consistency with the theme card. Clicking in either area performs the same action.

Props multidots1896, rehanali, ravipatel, sabernhardt, ryokuhi.
Fixes #54971.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-17 04:34:01 +00:00
Peter Wilson
88e428a2e1 Editor/Docs: Add blockTypes argument to WP_Block_Patterns_Registry::register() docblock.
Add the optional `blockTypes` argument in the patten properties for `WP_Block_Patterns_Registry::register()`.

Props vlad.olaru.
Fixes #55303.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-17 04:13:07 +00:00
noisysocks
d2c2dc1c10 Add WP_Block_Editor_Context::$name
Adds a new `WP_Block_Editor_Context::$name` and field. This allows plugin
developers to tell which block editor is being loaded when using filters such as
`allowed_block_types_all` and `block_editor_rest_api_preload_paths`.

Fixes #55301.
Props talldanwp, gziolo, andraganescu.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-17 03:37:05 +00:00
Sergey Biryukov
7e6d939911 Docs: Add a @since note about Twenty Twenty-Two for WP_Theme::$default_themes.
Follow-up to [51328], [52093].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-16 19:32:03 +00:00
Sergey Biryukov
0538720bba Themes: Allow block themes to be activated without index.php.
This removes the requirement for block themes to have an unused `index.php` template just for activation, as they use a `templates/index.html` file instead.

The updated requirements are as follows:

* Standalone themes need to have a `templates/index.html` or `index.php` template file.
* Child themes need to have a `Template` header in the `style.css` stylesheet.

Follow-up to [52069], [52247].

Props poena, sabbirshouvo, scruffian, manfcarlo, overclokk, andraganescu, SergeyBiryukov.
Fixes #54272.
Built from https://develop.svn.wordpress.org/trunk@52940


git-svn-id: http://core.svn.wordpress.org/trunk@52529 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-16 18:30:03 +00:00
gziolo
54bdc31c99 Editor: Fix broken asset URLs when using WP outside of the regular directory
Both CSS and JS URLs were totally broken for some of the newer blocks (e.g. the navigation block in the 2022 theme) when WP core is outside of the current directory using a different prefix.

Props pgpagely, Mamaduka.
Fixes #55311.



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


git-svn-id: http://core.svn.wordpress.org/trunk@52528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-16 10:22:03 +00:00
Peter Wilson
65d06b7cdc Tests: Include special characters in term names for wp_set_term_objects().
Test `wp_set_term_objects()` using terms with special characters in the name, for example ampersand, bullet and other symbols and punctuation.

Props kapacity, costdev.
Fixes #53152.
See #54725.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52527 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-16 03:06:06 +00:00
Dominik Schilling
14f7f05190 I18N, Script Loader: Don't register empty locale data objects.
For `wp.i18n` the library [https://github.com/messageformat/Jed Jed] was initially used which was throwing an error if a domain was not registered but used in a translate function. Later, the library was replaced by [https://github.com/aduth/tannin Tannin] which no longer requires the domain to be registered and thus we can avoid printing an empty-ish translations script that doesn't add any translations.

Props jsnajdr.
Fixes #55250.
Built from https://develop.svn.wordpress.org/trunk@52937


git-svn-id: http://core.svn.wordpress.org/trunk@52526 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-15 16:00:02 +00:00
Sergey Biryukov
0e95737d10 Plugins: Move the introduction text from install_dashboard() to display_plugins_table().
This brings some consistency to how the introduction is displayed for the Beta Testing, Featured, and Recommended tabs of the Add Plugins screen.

This commit also reorders the `switch` cases for the text in the same order as they are displayed.

Follow-up to [9141], [30889], [36297].

Props sabbir1991, kapilpaul.
Fixes #55389.
Built from https://develop.svn.wordpress.org/trunk@52936


git-svn-id: http://core.svn.wordpress.org/trunk@52525 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-15 15:58:02 +00:00
audrasjb
1cd42e3cbe Docs: Misc. fixes in wp-includes/post-template.php and wp-includes/post-thumbnail-template.php.
Props azouamauriac, audrasjb.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52524 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-15 15:22:05 +00:00
Sergey Biryukov
3d5b1eac13 Docs: Further clarify the description for install_dashboard().
Follow-up to [52931].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52523 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-14 18:14:00 +00:00
Sergey Biryukov
0d747500ba I18N: Move wp_get_list_item_separator() to a more appropriate place.
Follow-up to [52929].

See #39733.
Built from https://develop.svn.wordpress.org/trunk@52933


git-svn-id: http://core.svn.wordpress.org/trunk@52522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-14 18:01:02 +00:00
hellofromTonya
316aa2544f Media: Relocate wp_filesize() function for use in frontend and backend.
A new function `wp_filesize()` was added with [52837]. The function lived in the `wp-admin/includes/file.php` file. However, this admin specific function is not loaded into memory when hitting `media/edit` endpoint. The result was a `500` Internal Server Error. Why? The function is invoked with that endpoint, but the function does not exist in memory.

This commit relocates the new function to the `wp-includes/functions.php` file. In doing so, the function is available for both the frontend and backend.

Follow-up to [52837].

Props talldanwp, spacedmonkey, costdev, antonvlasenko.
Fixes #55367.
Built from https://develop.svn.wordpress.org/trunk@52932


git-svn-id: http://core.svn.wordpress.org/trunk@52521 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-14 16:32:06 +00:00
audrasjb
d1fe2eec5c Docs: Miscellaneous fixes in wp-admin/includes/plugin-install.php and wp-admin/includes/plugin.php.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52520 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-13 21:56:01 +00:00
audrasjb
837cb1e93b Docs: Use third-person singular verbs for function descriptions in wp-includes/class-wp-locale.php.
Follow-up to [52929].

See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52519 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-13 21:06:01 +00:00
audrasjb
30a77d5fa4 i18n: Define List item separator as a WP_Locale property.
The list item separator is a locale property, and it doesn't make much sense to translate it separately in multiple projects. This changeset implements the following modifications:

- Define list item separator as a new WP_Locale property
- Add `wp_get_list_item_separator()` as a wrapper for `WP_Locale::get_list_item_separator`
- Replace `$wp_locale->get_list_item_separator()` calls with `wp_get_list_item_separator()`
- Added a compatibility layer for bundled themes

Props SergeyBiryukov, swissspidy, rsiddharth, johnbillion, audrasjb.
Fixes #39733.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-13 20:03:01 +00:00
audrasjb
3046b5b3e1 Twenty Thirteen: Add gradient background options using the theme color scheme.
This change implements gradient background options that fit the color scheme used in Twenty Thirteen.

Props ianbelanger, tomjdevisser, audrasjb.
Fixes #49762.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52517 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-13 09:50:06 +00:00
audrasjb
b9033d9203 Twenty Nineteen: Display Image block at the same size whether the image is linked or not.
This change makes sure the `max-width` value is assigned for linked images.

Props JarretC, sabernhardt.
Fixes #48697.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-12 22:53:04 +00:00
audrasjb
b972ba13bd Twenty Sixteen: Remove .entry-content selector from button styles.
This change applies the default button styles to all button blocks in Twenty Sixteen, instead of only targeting those in `entry-content`. This means that any buttons added outside of `.entry-content`, such as in a widget area, will be styled the same as any other button blocks. This change also makes the theme custom colors work outside of `.entry-content`.

Follow-up to [44306].

Props mikachan, costdev, audrasjb.
Fixes #55167.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-12 21:55:08 +00:00
audrasjb
2594c68d9f Twenty Nineteen: avoid columns set to full width to extend beyond editor bounds.
This changeset applies `max-width` and `margin` CSS rules when `block-editor-writing-flow` and `editor-styles-wrapper` classes are on the same element.

Props charleyparkerdesign, sabernhardt, smit08, sclayf1.
Fixes #54169.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52514 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-12 19:13:05 +00:00
davidbaumwald
3172eac11b Formatting: Use safecss_filter_attr in wp_get_layout_style().
Previously, `safecss_filter_attr` did not allow for `calc` and `var` in parsed CSS.  Because of this, `wp_strip_all_tags` was used in `wp_get_layout_style` to allow for the use of these CSS functions to account for responsive widths.  [50923] added support for both of these CSS functions in KSES, so `safecss_filter_attr` can now be used in `wp_get_layout_style` as originally intended.

Follow-up to [52069].

Props grapplerulrich.
Fixes #55356.
Built from https://develop.svn.wordpress.org/trunk@52924


git-svn-id: http://core.svn.wordpress.org/trunk@52513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-12 00:29:04 +00:00
davidbaumwald
29574d03bd Site Editor: Rename the default attachment template from "Media" to "Attachment".
Follow-up to [52062].

Props scruffian, costdev.
Fixes #55373.
Built from https://develop.svn.wordpress.org/trunk@52923


git-svn-id: http://core.svn.wordpress.org/trunk@52512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-11 23:30:07 +00:00
Sergey Biryukov
08b97d13b8 Site Editor: Fix typo in the description of the tag template.
Follow-up to [52331].

Props scruffian.
Fixes #55374.
Built from https://develop.svn.wordpress.org/trunk@52922


git-svn-id: http://core.svn.wordpress.org/trunk@52511 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-11 15:24:02 +00:00
spacedmonkey
4c23c2f079 Taxonomy: Use get_terms instead of a database lookup in term_exists().
Replace raw SQL queries to the terms table, with a call to the `get_terms` function. Using `get_terms` means that `term_exists` is now cached. For developers using `term_exists` where cache invalidation is disabled, such as importing, a workaround was added to ensure that queries are uncached. 

Props Spacedmonkey, boonebgorges, flixos90, peterwilsoncc. 
Fixes #36949. 

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


git-svn-id: http://core.svn.wordpress.org/trunk@52510 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-11 11:07:05 +00:00
jorgefilipecosta
28b6093061 Block Editor: Improve Global Styles filtering order.
From the conceptual point it makes sense to execute global styles filters before post filters. So the post filters are always the last.

Props xknown, sergey, audrasjb, vortfu, oandregal, get_dave.
Built from https://develop.svn.wordpress.org/trunk@52895


git-svn-id: http://core.svn.wordpress.org/trunk@52484 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 23:27:04 +00:00
davidbaumwald
8cda35ebd3 Privacy: Fix "Retry" action after a personal data export failure.
When exporting personal data for a user request, if the export fails for any reason, a "Retry" link is displayed inline.  However, up to this point, clicking this link performed no action.  This change adds the `export-personal-data-handle` CSS class to the link to make sure it's picked up by the same delegated listener as the initial action.  Clicking this link will now retry the export.

Props hellofromTonya, nomnom99, rafiahmedd, SergeyBiryukov, hasanuzzamanshamim.
Fixes #53032.
Built from https://develop.svn.wordpress.org/trunk@52846


git-svn-id: http://core.svn.wordpress.org/trunk@52435 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 19:22:01 +00:00
audrasjb
95d72f2207 jquery-query
Built from https://develop.svn.wordpress.org/trunk@52844


git-svn-id: http://core.svn.wordpress.org/trunk@52433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 18:54:02 +00:00
davidbaumwald
8fdb20e0f8 Media: Note ClipboardJS as a global in /js/_enqueues/admin/media.js.
Follow-up to [52842].

See #54426.
Built from https://develop.svn.wordpress.org/trunk@52843


git-svn-id: http://core.svn.wordpress.org/trunk@52432 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 18:43:02 +00:00
davidbaumwald
658f4e9367 Media: Add a "Copy URL to clipboard" function to the list table view.
Previously, a button was added to the modal view for a single media item in the "grid" view to copy the file URL to the user's clipboard.  This change adds a similar function to the "list" view for each media item.

Follow-up to [48232].

Props pbiron, ravipatel, alexstine, afercia.
Fixes #54426.
Built from https://develop.svn.wordpress.org/trunk@52842


git-svn-id: http://core.svn.wordpress.org/trunk@52431 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 18:24:03 +00:00
Sergey Biryukov
c771c6a79d Quick/Bulk Edit: Check the show_in_quick_edit taxonomy property when populating the data for the posts list table.
Previously, setting the `show_in_quick_edit` property to `false` removed the taxonomy from the inline edit form, but the terms were still being populated in the data for each table row via the `get_inline_data()` function, which only checked the `$taxonomy->show_ui` property.

This commit:
* Improves performance by ensuring that taxonomy terms are not unnecessarily populated for each table row when `show_in_quick_edit` is `false`.
* Properly populates the taxonomy terms when `show_in_quick_edit` is `true` and `show_ui` is `false`.

Follow-up to [31307].

Props jazbek, figureone, sabernhardt, ovidiul, webcommsat, SergeyBiryukov.
Fixes #42916, #49701.
Built from https://develop.svn.wordpress.org/trunk@52841


git-svn-id: http://core.svn.wordpress.org/trunk@52430 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 18:22:01 +00:00
davidbaumwald
12134c3435 Coding Standards: Fix minor alignment issue in wp_ajax_install_theme().
Follow-up to [52819].

See #54728.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52429 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 17:32:03 +00:00
hellofromTonya
2c9525edc3 Build/Test Tools: Add trash and restore of a single post e2e tests.
Adds an end-to-end (e2e) test case for:
* Emptying a post from the trash.
* Restoring a post from the trash.

Props pavanpatil1, pooja1210, justinahinon, kevin940726.
Fixes #54843.
Built from https://develop.svn.wordpress.org/trunk@52839


git-svn-id: http://core.svn.wordpress.org/trunk@52428 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 16:28:03 +00:00
hellofromTonya
d1565514e4 HTTP API: Fix typo in and improve readability of wp_parse_url() docblock.
Removes the "starting" word from "starting containing" as this is a typo. Includes minor formatting adjustments to improve readability.

Follow-up to [38726].

Props mehedi890, SergeyBiryukov, mukesh27.
Fixes #55355.
Built from https://develop.svn.wordpress.org/trunk@52838


git-svn-id: http://core.svn.wordpress.org/trunk@52427 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 16:02:01 +00:00
spacedmonkey
bbf017e550 Media: Store attachment’s file size in metadata.
Store the file size of all newly uploaded attachments, as part of the metadata stored in post meta. Storing file size means, developers will not have to resort to doing `filesize` function calls, that can be time consuming on assets on offloaded to services like Amazon’s S3. 

This change also introduces a new helper function called, `wp_filesize`. This is a wrapper around the `filesize` php function, that adds some helpful filters and ensures the return value is an integer.

Props Cybr, Spacedmonkey, SergeyBiryukov, johnwatkins0, swissspidy, desrosj, joemcgill, azaozz, antpb, adamsilverstein, uday17035. 
Fixes #49412. 


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


git-svn-id: http://core.svn.wordpress.org/trunk@52426 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 13:10:02 +00:00
spacedmonkey
8771a658ad Taxonomy: Only store term_ids and object_ids in WP_Term_Query query caches.
The query cache currently implemented in `WP_Term_Query` caches the final output of the query, depending on what fields are requested. This is wasteful, as if a user requests `fields` => `all`, then an unlimited array of `WP_Term` objects could be stored in the object cache. Instead of storing the whole WP_Term object, this change only the term_id is stored. To get an array the full WP_Term objects, the `_prime_term_caches` function is called with an array of ids. In instances where a persistent object cache is not in use, then this will result in another SQL query to be run. After `_prime_term_caches` is called if this term is requested again in the same page load, then it will already be loaded into memory.  If a user runs `WP_Term_Query` with the fields param set to `all_with_object_id`, an array of objects containing both the term_id and object_ids are stored in cache. 

This change also improves the logic to load term meta caches. This change ensures that term meta is always primed for all terms loaded in the term query. 

Props Spacedmonkey, boonebgorges, jbpaul17, peterwilsoncc, flixos90, pbearne.
Fixes #37189.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 10:58:09 +00:00
Peter Wilson
fa364267d4 Twenty Twenty-One: Reverse logic for prefers-reduced-motion media query.
Reverse the logic of the `prefers-reduced-motion` to enable transitions based on `no-preference` rather than disable them based on the `reduce` preference. This removes the need to disable transitions with the `! important` tag and unintended interactions with plugins as a result.

Props gregoiresailland, sabernhardt, ryokuhi.
Fixes #54174.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52424 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 05:21:03 +00:00
Peter Wilson
8752a2392a Sitemaps: Pass term object to wp_sitemaps_taxonomies_entry filter.
Add a forth parameter to the `wp_sitemaps_taxonomies_entry` filter to pass the entire `WP_Term` object. 

Correct the documentation for the second parameter of the `wp_sitemaps_taxonomies_entry` filter to indicate it is a term ID rather than term object.

Props RavanH, swissspidy, audrasjb.
Fixes #55239.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52423 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 04:01:05 +00:00
Sergey Biryukov
a1d974a2e1 Canonical: Check if the URL scheme exists in strip_fragment_from_url().
This avoids an "Undefined index" PHP notice when a schemeless URI is passed.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-09 15:08:06 +00:00
Peter Wilson
a793be201b Media: Revert query string support for wp_check_filetype().
Revert [52829] due to fatal errors in some Multisite configurations.

Props dd32, SergeyBiryukov, audrasjb.
See #30377.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-09 00:48:05 +00:00
Sergey Biryukov
ac9f203a88 REST API: Correct the wording for show_in_nav_menus property description in post type visibility settings.
Follow-up to [51959].

Props pedromendonca.
Fixes #55340.
Built from https://develop.svn.wordpress.org/trunk@52831


git-svn-id: http://core.svn.wordpress.org/trunk@52420 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-08 14:51:07 +00:00
Peter Wilson
1b72380e10 Taxonomy: Improve code quality within _prime_term_caches().
Remove the second parameter on the call to `update_term_cache()` from within the function `_prime_term_caches()`. The since deprecated parameter of the former was at one point a string, never a boolean.

Props david.binda, SergeyBiryukov, azouamauriac.
Fixes #55162.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-08 04:25:06 +00:00
audrasjb
28f7345fce Media: Allow wp_check_filetype() to support query strings in URLs.
This changeset adjusts the regex in `wp_check_filetype()` to support query strings in URLs.

Follow-up to [30640], [32172].

Props voldemortensen, johnbillion, layotte, dd32, atomicjack, supercleanse, spencercameron, ianmjones, audrasjb.
Fixes #30377.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52418 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-07 22:52:05 +00:00
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