45554 Commits

Author SHA1 Message Date
Peter Wilson
f99389a125 Customizer: Improve performance checking for published pages.
Improve the performance of `WP_Customize_Manager::has_published_pages()` by limiting the database query to a single published page, down from querying all published pages.

Props nagpai, dlh, tyxla.
Fixes #55425.



git-svn-id: https://develop.svn.wordpress.org/trunk@53057 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-04 01:23:55 +00:00
Sergey Biryukov
ecfb9d6a3e Docs: Use correct format for multi-line comments in the_block_editor_meta_boxes().
Follow-up to [44131], [44260].

See #54729.

git-svn-id: https://develop.svn.wordpress.org/trunk@53056 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-03 11:43:07 +00:00
Jb Audras
eec6c374bd Docs: Use third-person singular verbs for function descriptions in WP_Customize_Nav_Menus class, per the documentation standards.
Follow-up to [53054].

See #54729.


git-svn-id: https://develop.svn.wordpress.org/trunk@53055 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-02 16:24:24 +00:00
Jb Audras
852ea9e699 Docs: Use third-person singular verbs for function descriptions in WP_Customize_Manager class, per the documentation standards.
Props azouamauriac.
See #54729.


git-svn-id: https://develop.svn.wordpress.org/trunk@53054 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-02 16:19:58 +00:00
Sergey Biryukov
25bff41798 Docs: Further remove HTML markup from various function summaries.
Per the [https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/#summary-formerly-short-description WordPress PHP documentation standards], no HTML markup or Markdown of any kind should be used in the summary. This ensures that the summary is displayed correctly in the [https://developer.wordpress.org/reference/ WordPress Code Reference].

This commit also improves formatting of HTML special characters in descriptions in `wp-includes/formatting.php`.

Follow-up to [53048].

Props johnbillion, mukesh27.
Fixes #55506.

git-svn-id: https://develop.svn.wordpress.org/trunk@53053 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-02 13:53:06 +00:00
Joe Dolson
3dd751a914 General: Open change permalink structure links in same tab.
Remove `target="_blank"` from the link to change permalink structures and change link text to clarify link purpose. 

Props kebbet, sabernhardt.
Fixes #55252.


git-svn-id: https://develop.svn.wordpress.org/trunk@53052 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-01 20:08:30 +00:00
Joe Dolson
bc0b296237 Twenty Twenty: Fix aria-expanded handling in search toggle.
Transform search into a dialog role and fix the handling of aria-expanded to synchronize mobile and desktop buttons.

Props utz119, alexstine, mukesh27, hareesh-pillai, sabernhardt, audrasjb, afercia.
Fixes #53951.


git-svn-id: https://develop.svn.wordpress.org/trunk@53051 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-01 17:54:30 +00:00
Sergey Biryukov
c27cc8b694 Administration: Consistently escape icon URLs in the admin menu.
Follow-up to [9154], [26664].

Props chintan1896, jigar-bhanushali, mukesh27.
Fixes #55496.

git-svn-id: https://develop.svn.wordpress.org/trunk@53050 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-01 11:44:59 +00:00
Jonny Harris
5f6ff5333f Users: Fix notice error in WP_Posts_List_Table class.
Fix notice error introduced in [53011] as the variable `$authors_dropdown` is now conditionally loaded. 

Follow-up to [53011].

Props Spacedmonkey, dd32, johnbillion. 
See #38741. 



git-svn-id: https://develop.svn.wordpress.org/trunk@53049 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-01 11:41:23 +00:00
Sergey Biryukov
4118c2c7a4 Docs: Remove HTML markup from WP_REST_URL_Details_Controller class method summaries.
Per the [https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/#summary-formerly-short-description WordPress PHP documentation standards], no HTML markup or Markdown of any kind should be used in the summary. This ensures that the summary is displayed correctly in the [https://developer.wordpress.org/reference/ WordPress Code Reference].

Props gvgvgvijayan, rsiddharth, azouamauriac, SergeyBiryukov.
Fixes #55506.

git-svn-id: https://develop.svn.wordpress.org/trunk@53048 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-01 11:33:15 +00:00
Jb Audras
b43302508b Adds "select all" shortcut for Mac on permalinks page when .htaccess is not writable.
This change improves the description of the "select all" shortcut for Mac users in Permalink Settings screen.

Props Valer1e, ajoah, audrasjb, SergeyBiryukov.
Fixes #54633.


git-svn-id: https://develop.svn.wordpress.org/trunk@53047 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-01 11:07:39 +00:00
Jb Audras
1f7977d4c2 Docs: Use third-person singular verbs for function descriptions in WP_Embed class, per the documentation standards.
See #54729.


git-svn-id: https://develop.svn.wordpress.org/trunk@53046 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-01 08:30:07 +00:00
Peter Wilson
b0aefcff4a General: Validate input of wp_list_pluck().
`wp_list_pluck()` is used by WordPress to pluck items from a list. Of course, this requires a list. This validates the input of `wp_list_pluck()` to ensure it is a list.

This matches the behaviour of `wp_list_sort()` and `wp_filter_object_list()`.

Props marv2, davidbaumwald, mkox, SergeyBiryukov, dd32.
Fixes #54751.



git-svn-id: https://develop.svn.wordpress.org/trunk@53045 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-01 05:54:37 +00:00
Peter Wilson
a20c20774f Formatting: Account for HTML entities in wp_extract_urls().
Prevent `wp_extract_urls()` trimming HTML entities within URLs. Correctly escaped URLs such as https://youtube.com/watch?v=dQw4w9WgXcQ&t=1 will now be extracted as https://youtube.com/watch?v=dQw4w9WgXcQ&t=1 rather than truncated.

Props trex005, voldemortensen, johnbillion, ironprogrammer, costdev, hellofromtonya.
Fixes #30580



git-svn-id: https://develop.svn.wordpress.org/trunk@53044 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-01 03:38:55 +00:00
Peter Wilson
afc55a72de Canonical: Include all public status in 404 redirects.
In `redirect_guess_404_permalink()` search for posts using all publicly queryable statuses rather than limiting options to the `publish` status.

Props goaroundagain, costdev, htdat, audrasjb, chaion07.
Fixes #47911.



git-svn-id: https://develop.svn.wordpress.org/trunk@53043 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-01 03:23:07 +00:00
Peter Wilson
b1b305b826 Posts, Post Types: Set post filter in update_post_cache().
Ensure the post cache is primed with raw sanitized data. This resolves an inconsistency between how posts retrieved via `get_post()` vs `WP_Query` are cached.

This prevents `sanitize_post( $post, 'raw' )` being run multiple times on a cached post. This can happen over 20 times per post on some page loads so avoiding this will provide a noticeable performance boost.

Props Cybr, SergeyBiryukov, peterwilsoncc, hellofromTonya, costdev.
Fixes #50567.



git-svn-id: https://develop.svn.wordpress.org/trunk@53042 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-01 03:16:33 +00:00
Joe Dolson
16baa38779 Login and Registration: Add autocomplete attributes.
Set valid autocomplete attributes for registration and login fields for username, email, and current password. Autocomplete values are required in WCAG 2.1 at level AA for login forms.

Props johnjamesjacoby, dhanendran, rianrietveld, joedolson, peterwilsoncc.
Fixes #41136.


git-svn-id: https://develop.svn.wordpress.org/trunk@53041 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-31 17:11:36 +00:00
Sergey Biryukov
143df6e763 Docs: Add missing descriptions for WP_List_Table::get_items_per_page() parameters.
Follow-up to [53039].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #54729, #55327.

git-svn-id: https://develop.svn.wordpress.org/trunk@53040 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-31 15:23:07 +00:00
Sergey Biryukov
896ac0b6cc Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-wp-list-table.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 `$default` parameter to `$default_value` in `WP_List_Table::get_items_per_page()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.

git-svn-id: https://develop.svn.wordpress.org/trunk@53039 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-31 15:19:10 +00:00
Greg Ziółkowski
39a5bacbc1 Themes: Add "title" key to i18n schema
This is related to Gutenberg changes in WordPress/gutenberg#39936 that marks the "title" key as translatable field in "theme.json" files.

See also #54336.

Props oandregal.





git-svn-id: https://develop.svn.wordpress.org/trunk@53038 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-31 10:51:54 +00:00
Jonny Harris
ed3854948f Taxonomy: Improve performance by taxonomy queries by adding a limitting requested terms.
Add a limit to the number of terms requested in taxonomy queries. This improves the performance of the query and the likelihood of hitting an existing term query cache. 

Props Spacedmonkey, peterwilsoncc, flixos90. 
Fixes #55360. 



git-svn-id: https://develop.svn.wordpress.org/trunk@53037 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-31 10:04:25 +00:00
Jonny Harris
1d0c189f21 Comments: Improve performance of the wp_count_comments function.
Improve performance of the `wp_count_comments` function by replacing a complex query with multiple calls to the `get_comments` function. Passing the `count` parameter to the `get_comments` function results in a simple 
count query that returns quickly. Using `get_comments` also means that query is cached and run through filters. 


Props FolioVision, markjaquith, nacin, ryan, coffee2code, wonderboymusic, ComputerGuru, jb510, SergeyBiryukov, Znuff, Rahe, uday17035, spacedmonkey, peterwilsoncc.
Fixes #19901.



git-svn-id: https://develop.svn.wordpress.org/trunk@53036 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-31 09:07:02 +00:00
Jb Audras
6c7b3de79f Docs: Typo correction in wp_fuzzy_number_match DocBlock.
Props costdev, kebbet.
Fixes #55493.


git-svn-id: https://develop.svn.wordpress.org/trunk@53035 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-31 08:15:30 +00:00
Peter Wilson
cab053271e KSES: Document HTML allow list is in lowercase.
Expand documentation of the `wp_kses_allowed_html` hook to indicate that developers must add permitted HTML tags and attributes in lowercase for KSES to recognise they are permitted.

Props r-a-y, SergeyBiryukov, peterwilsoncc.
Fixes #55407.
See #53399.



git-svn-id: https://develop.svn.wordpress.org/trunk@53034 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-31 03:52:31 +00:00
Peter Wilson
d2ab3d1837 Build/Test Tools: Add unit tests for feed_links_extra().
Props costdev, hellofromTonya.
Fixes #54713.
See #54725.



git-svn-id: https://develop.svn.wordpress.org/trunk@53033 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-31 00:55:16 +00:00
Sergey Biryukov
bcb3299a37 Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-wp-importer.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 `$string` parameter to `$text` in `WP_Importer::min_whitespace()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.

git-svn-id: https://develop.svn.wordpress.org/trunk@53029 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-30 10:43:08 +00:00
Felix Arntz
0514150026 Media: Introduce wp_content_img_tag filter.
This filter allows modifying individual `img` tags within a blob of content that are by default processed by the `wp_filter_content_tags()` function. The addition of this filter facilitates plugins that tweak images to accomplish this goal without re-implementing duplicate content image parser logic, which furthermore can have a negative performance impact due to additional regular expressions.

In addition to the filterable `img` tag, the filter receives the context (typically the function or filter in which the content is parsed) and the attachment ID. The latter may be 0, in case the image is not an attachment (for example when it is an external image URL).

Props adamsilverstein, flixos90, pbearne, peterwilsoncc.
Fixes #55347.


git-svn-id: https://develop.svn.wordpress.org/trunk@53028 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-29 23:56:18 +00:00
Joe Dolson
86ed0d2e57 Media: Preserve attachment properties on cropping custom logo.
Migrate the alternative text, title, description, and caption of an image over to the cropped copy of the image after cropping. Ensure that characteristics added to an image prior to cropping are not lost.

Props flixos90, Clorith, afercia, antonvlasenko, ironprogrammer, hellofromTonya.
Fixes #37750.


git-svn-id: https://develop.svn.wordpress.org/trunk@53027 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-29 21:46:09 +00:00
Jb Audras
33e8be0976 Customizer: Accessibility fixes following [53024].
This changeset fixes a few issues spotted after [53024].

- Remove target blank on HelpHub link
- Remove duplicate information in `aria-label`
- Small i18n fixes

Follow-up to [53024].

Props joedolson, audrasjb, pbiron.
Fixes #54939.


git-svn-id: https://develop.svn.wordpress.org/trunk@53025 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-29 19:55:32 +00:00
Jb Audras
81ebc7c712 Customizer: When a block theme is active, add an information about Site Editor in the Customizer.
This change adds an information notice to the customizer when a block theme is active and the customizer is also available (for example when a plugin activates it), to encourage people to use the Site Editor for the best full site customization experience.

Props ironprogrammer, antonvlasenko, Clorith, audrasjb, psmits1567, tobifjellner, costdev, webcommsat.
Fixes #54939.


git-svn-id: https://develop.svn.wordpress.org/trunk@53024 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-29 19:07:15 +00:00
Joe Dolson
a06097a2b7 Quick/Bulk Edit: Position action buttons in close proximity.
Move the Submit and Cancel buttons in quick edit forms to be next to each other and change the order of the buttons. Improve accessibility for low vision and cognitive impairments for quick editing. 

Props afercia, marybaum.
Fixes #55364.


git-svn-id: https://develop.svn.wordpress.org/trunk@53023 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-29 19:06:54 +00:00
Jb Audras
48e814e6bf Administration: Do not specify menu order for the Widgets menu when the active theme is a block theme.
When using a block theme that declares Widgets support, it's better to not specify a menu order for the Widgets menu to avoid conflicts between menu items order.

Props Rufus87, ironprogrammer, audrasjb, hellofromTonya, davidbaumwald.
Fixes #54916.


git-svn-id: https://develop.svn.wordpress.org/trunk@53020 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-29 15:57:05 +00:00
Sergey Biryukov
ecfcb3e885 Users: Move get_user_count() and related functions to wp-includes/user.php.
The new location is next to the pre-existing `count_users()` function, along with other user-specific functions, and should be a more appropriate place in terms of consistency.

This affects:
* `get_user_count()`
* `wp_maybe_update_user_counts()`
* `wp_update_user_counts()`
* `wp_schedule_update_user_counts()`
* `wp_is_large_user_count()`

Follow-up to [53011], [53016].

See #38741.

git-svn-id: https://develop.svn.wordpress.org/trunk@53018 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-29 13:51:52 +00:00
Sergey Biryukov
57e6c4c9bb I18N: Move code out of a translatable string in get_user_count() and related functions.
Follow-up to [53011].

See #38741.

git-svn-id: https://develop.svn.wordpress.org/trunk@53016 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-29 13:36:48 +00:00
Jb Audras
82c0591117 Editor: Change location of block support styles in wp_head.
Backports changes from https://github.com/WordPress/gutenberg/pull/39164.

Props ndiego, alexstine, cbravobernal, mamaduka.
See #55474.


git-svn-id: https://develop.svn.wordpress.org/trunk@53015 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-29 13:26:38 +00:00
Sergey Biryukov
306333f9ee Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-wp-filesystem-base.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 `$echo` parameter to `$verbose` in `WP_Filesystem_Base::find_base_dir()` and `::get_base_dir()`, and updates the documentation accordingly. This matches the class property of the same name.

Follow-up to [52946], [52996], [52997], [52998], [53003].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.

git-svn-id: https://develop.svn.wordpress.org/trunk@53014 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-29 13:19:23 +00:00
Jb Audras
1cb0e9ced6 Editor: Use wp_unique_id() instead of uniqid() to generate CSS class names.
Backports changes from https://github.com/WordPress/gutenberg/pull/38891.
See https://github.com/WordPress/gutenberg/issues/38889.

Props westonruter, mamaduka.
See #55474.


git-svn-id: https://develop.svn.wordpress.org/trunk@53012 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-29 13:04:24 +00:00
Jonny Harris
e19b7ead2c Users: Introduce the concept of a large site to single site installations.
Currently in WordPress multisite there is a concept of large networks. The function `wp_is_large_network` is used to determine if a network has a large number of sites or users. If a network is marked as large, then 
expensive queries to calculate user counts are not run on page load but deferred to scheduled events. However there are a number of places in a single site installation where this functionality would also be useful, as 
expensive calls to count users and roles can make screens in the admin extremely slow.

In this change, the `get_user_count` function and related functionality around it is ported to be available in a single site context. This means that expensive calls to the `count_users` function are replaced with 
calls to `get_user_count`. This change also includes a new function called `wp_is_large_user_count` and a filter of the same name, to mark if a site is large.

Props johnbillion, Spacedmonkey, Mista-Flo, lumpysimon, tharsheblows, obenland, miss_jwo, jrchamp, flixos90, macbookandrew, pento, desrosj, johnjamesjacoby, jb510, davidbaumwald, costdev. 
Fixes #38741.



git-svn-id: https://develop.svn.wordpress.org/trunk@53011 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-29 12:41:00 +00:00
Jonny Harris
556492ad88 Menus: Convert wp_get_nav_menu_items function to use a taxonomy query.
Change the `wp_get_nav_menu_items` function to replace the call to `get_objects_in_term` with a simple taxonomy query. This change improves performance as it results in one fewer query to retrieve menu items from the 
database. 

Props Spacedmonkey, peterwilsoncc.
Fixes #55372.





git-svn-id: https://develop.svn.wordpress.org/trunk@53010 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-29 11:05:26 +00:00
Helen Hou-Sandi
921d2805a0 Build/Test Tools: First pass at a .git-blame-ignore-revs file.
This suppresses certain commits from Git blame views, notably in the GitHub UI as well as the command line. These commits are purely stylistic and excluding them from these views helps to reduce the noise when doing code archaeology.

Still to come: More coding standards commits as they are reviewed.

Props helen, costdev, peterwilsoncc.
See #55422


git-svn-id: https://develop.svn.wordpress.org/trunk@53007 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-29 03:20:29 +00:00
Jb Audras
f1e285c907 Plugins: Avoid stomping of some variables in wp-settings.php.
This changeset decreases the chance of accidentally overwriting some variables located in `wp-settings.php`, as the chance of overriding a variable called `$_wp_plugin_file` would be lower than for `$plugin`, `$mu_plugin` or `$network_plugin`.

Props stevegrunwell, joyously, peterwilsoncc, ocean90, SergeyBiryukov, jrf, azouamauriac.
Fixes #55432.


git-svn-id: https://develop.svn.wordpress.org/trunk@53004 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-28 13:57:08 +00:00
Sergey Biryukov
d0bb319a81 Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-wp-debug-data.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 `$var` parameter to `$mysql_var` in `WP_Debug_Data::get_mysql_var()`.

Additionally, `$type` is renamed to `$data_type` in `WP_Debug_Data::format()` for clarity.

Follow-up to [51522], [52946], [52996], [52997], [52998].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.

git-svn-id: https://develop.svn.wordpress.org/trunk@53003 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-28 13:22:38 +00:00
Jb Audras
e40005325e Docs: Use third-person singular verbs for function descriptions in wp-admin/includes/theme.php and wp-admin/includes/theme-install.php, per the documentation standards.
See #54729.


git-svn-id: https://develop.svn.wordpress.org/trunk@53002 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-28 13:15:36 +00:00
Jb Audras
ad70818624 Options, Meta APIs: Rephrase the description of the "Avatars" section.
This changeset clarifies the description of the "Avatars" section in Discussion Settings screen.

Props johnjamesjacoby, helen, netweb, GaryJ, sabernhardt, costdev, audrasjb, webcommsat, peterwilsoncc.
Fixes #32998.


git-svn-id: https://develop.svn.wordpress.org/trunk@53001 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-28 10:54:49 +00:00
John Blackbourn
0701a88d6c Docs: Correct the documented return types for date and time related functions and filters.
See #54729


git-svn-id: https://develop.svn.wordpress.org/trunk@53000 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-28 10:23:03 +00:00
Jb Audras
440c05e648 Docs: Use third-person singular verbs for function descriptions in wp-includes/template.php, per the documentation standards.
See #54729.


git-svn-id: https://develop.svn.wordpress.org/trunk@52999 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-28 09:43:57 +00:00
Sergey Biryukov
d5b7d494fc Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-theme-upgrader.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 `$return` variable in `Theme_Upgrader` class methods to `$response` and updates the documentation accordingly.

Follow-up to [47409], [52946], [52996], [52997].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.

git-svn-id: https://develop.svn.wordpress.org/trunk@52998 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-27 14:53:21 +00:00
Sergey Biryukov
b917c4182a Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-plugin-upgrader.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 `$return` variable in `Plugin_Upgrader` class methods to `$response` and updates the documentation accordingly.

Follow-up to [47409], [52946], [52996].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.

git-svn-id: https://develop.svn.wordpress.org/trunk@52997 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-27 14:43:25 +00:00
Sergey Biryukov
6244d515b1 Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-ftp.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 `$string` parameter of `ftp_base::glob_pattern_match()` to `$subject`.

Follow-up to [52946].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.

git-svn-id: https://develop.svn.wordpress.org/trunk@52996 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-26 15:26:15 +00:00
Jb Audras
3758272327 Editor: Optimize preload paths for post and site editors.
This patch optimizes preload paths in post and site editors so that they match the real requests:

- Remove the `/` preload as the payload is very big and the response is not needed on any critical path.
- Modify the preloaded path for `/wp/v2/taxonomies` so that it corresponds to what `loadTaxonomyEntities` requests. After Gutenberg PR 37685 was merged to core, these preloads need to be modified to use `context=view` instead of `context=edit`.
- Modify the `/wp/v2/users/me path` so that it matches the real request (no query params).
- Add a preload of `/wp/v2/settings` because it is requested on critical path (editor boot). Site editor already preloads this, the changeset is only adding it to the post editor.

This is related to Gutenberg PR 39256 which introduces compatibility code to modify the preload paths with a filter, when the Gutenberg plugin is active.

See https://github.com/WordPress/gutenberg/pull/39256.

Props jsnajdr, noisysocks.
Fixes #55337.


git-svn-id: https://develop.svn.wordpress.org/trunk@52995 602fd350-edb4-49c9-b593-d223f7449a82
2022-03-25 21:48:40 +00:00