45296 Commits

Author SHA1 Message Date
Sergey Biryukov
10875b1e42 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52936 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-15 15:56:37 +00:00
Jb Audras
0a136d072a Docs: Misc. fixes in wp-includes/post-template.php and wp-includes/post-thumbnail-template.php.
Props azouamauriac, audrasjb.
See #54729.


git-svn-id: https://develop.svn.wordpress.org/trunk@52935 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-15 15:20:12 +00:00
Sergey Biryukov
26bb0d7479 Docs: Further clarify the description for install_dashboard().
Follow-up to [52931].

See #54729.

git-svn-id: https://develop.svn.wordpress.org/trunk@52934 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-14 18:12:29 +00:00
Sergey Biryukov
abfaf6df00 I18N: Move wp_get_list_item_separator() to a more appropriate place.
Follow-up to [52929].

See #39733.

git-svn-id: https://develop.svn.wordpress.org/trunk@52933 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-14 17:59:20 +00:00
Tonya Mork
f6b39a9d66 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52932 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-14 16:30:35 +00:00
Jb Audras
3bbfc064e9 Docs: Miscellaneous fixes in wp-admin/includes/plugin-install.php and wp-admin/includes/plugin.php.
See #54729.


git-svn-id: https://develop.svn.wordpress.org/trunk@52931 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-13 21:54:14 +00:00
Jb Audras
e0c37a6a13 Docs: Use third-person singular verbs for function descriptions in wp-includes/class-wp-locale.php.
Follow-up to [52929].

See #54729.


git-svn-id: https://develop.svn.wordpress.org/trunk@52930 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-13 21:04:43 +00:00
Jb Audras
a37a72077e 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@52929 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-13 20:01:05 +00:00
Jb Audras
89de8f3b35 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@52928 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-13 09:48:08 +00:00
Jb Audras
43275e1af5 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@52927 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-12 22:51:52 +00:00
Jb Audras
05445a51f8 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@52926 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-12 21:53:50 +00:00
Jb Audras
8ed6ec721b 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@52925 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-12 19:11:32 +00:00
David Baumwald
cc2712502c 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52924 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-12 00:27:25 +00:00
David Baumwald
4374801beb Site Editor: Rename the default attachment template from "Media" to "Attachment".
Follow-up to [52062].

Props scruffian, costdev.
Fixes #55373.

git-svn-id: https://develop.svn.wordpress.org/trunk@52923 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-11 23:28:44 +00:00
Sergey Biryukov
86843cc2c5 Site Editor: Fix typo in the description of the tag template.
Follow-up to [52331].

Props scruffian.
Fixes #55374.

git-svn-id: https://develop.svn.wordpress.org/trunk@52922 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-11 15:22:28 +00:00
Jonny Harris
34d46cd501 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. 


git-svn-id: https://develop.svn.wordpress.org/trunk@52921 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-11 11:05:02 +00:00
Jorge Costa
1bcd722fd6 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52895 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-10 23:25:10 +00:00
David Baumwald
1ceb716ae0 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52846 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-10 19:19:50 +00:00
Jb Audras
6adff3d989 jquery-query
git-svn-id: https://develop.svn.wordpress.org/trunk@52844 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-10 18:52:20 +00:00
David Baumwald
16ac67ae1e Media: Note ClipboardJS as a global in /js/_enqueues/admin/media.js.
Follow-up to [52842].

See #54426.

git-svn-id: https://develop.svn.wordpress.org/trunk@52843 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-10 18:41:46 +00:00
David Baumwald
d238f31fab 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52842 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-10 18:22:57 +00:00
Sergey Biryukov
e4955f67c2 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52841 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-10 18:20:33 +00:00
David Baumwald
7d42ae5768 Coding Standards: Fix minor alignment issue in wp_ajax_install_theme().
Follow-up to [52819].

See #54728.


git-svn-id: https://develop.svn.wordpress.org/trunk@52840 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-10 17:30:04 +00:00
Tonya Mork
e5cb4986f1 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52839 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-10 16:26:56 +00:00
Tonya Mork
cb8f300d81 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52838 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-10 16:00:27 +00:00
Jonny Harris
7fc225aa87 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. 



git-svn-id: https://develop.svn.wordpress.org/trunk@52837 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-10 13:08:19 +00:00
Jonny Harris
4a9f5fe3be 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@52836 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-10 10:56:09 +00:00
Peter Wilson
a276b69451 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@52835 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-10 05:19:50 +00:00
Peter Wilson
dcb118ef8f 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@52834 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-10 03:59:35 +00:00
Sergey Biryukov
6b224e3ac0 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52833 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-09 15:06:09 +00:00
Peter Wilson
4d29532b9b 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@52832 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-09 00:46:24 +00:00
Sergey Biryukov
7611ed8c2f 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52831 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-08 14:49:41 +00:00
Peter Wilson
87844a6eb2 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@52830 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-08 04:23:34 +00:00
Jb Audras
176afff375 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@52829 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-07 22:50:12 +00:00
Sergey Biryukov
4cee32dd66 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52828 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-07 14:42:49 +00:00
Jb Audras
c3a8e5c9fd Docs: Use third-person singular verbs for function descriptions in wp-includes/class-wp-user.php.
Props azouamauriac.
See #54729.


git-svn-id: https://develop.svn.wordpress.org/trunk@52827 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-07 13:05:52 +00:00
Jb Audras
a66f7ef477 Docs: Correct the indentation in delete_term_relationships filter.
See #54673.


git-svn-id: https://develop.svn.wordpress.org/trunk@52826 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-07 12:55:57 +00:00
Peter Wilson
177c315c12 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@52825 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-07 02:36:01 +00:00
Sergey Biryukov
34d98887a2 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52824 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-06 23:02:12 +00:00
Sergey Biryukov
864ab55b33 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52823 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-06 16:09:06 +00:00
Sergey Biryukov
f0fdad1c8e 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52822 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-05 15:33:05 +00:00
Sergey Biryukov
73fdc6ada2 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52821 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-04 14:09:59 +00:00
Jb Audras
157d127fef 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@52820 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-04 11:27:54 +00:00
Peter Wilson
567b2518f8 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@52819 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-04 02:37:58 +00:00
David Baumwald
77561d0a30 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52818 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-03 20:32:20 +00:00
Sergey Biryukov
9defe855e6 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52817 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-03 16:11:44 +00:00
Sergey Biryukov
3788002728 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52816 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-03 15:56:07 +00:00
Sergey Biryukov
b28dcfd832 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52815 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-02 15:38:27 +00:00
Jonny Harris
69b9940da2 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.



git-svn-id: https://develop.svn.wordpress.org/trunk@52814 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-02 15:10:48 +00:00
Sergey Biryukov
99fd93c7df 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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52813 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-02 14:58:09 +00:00