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
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
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
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
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
`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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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