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.
Built from https://develop.svn.wordpress.org/trunk@53014
git-svn-id: http://core.svn.wordpress.org/trunk@52603 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
Built from https://develop.svn.wordpress.org/trunk@53011
git-svn-id: http://core.svn.wordpress.org/trunk@52600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
Built from https://develop.svn.wordpress.org/trunk@53010
git-svn-id: http://core.svn.wordpress.org/trunk@52599 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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
Built from https://develop.svn.wordpress.org/trunk@53007
git-svn-id: http://core.svn.wordpress.org/trunk@52596 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
Built from https://develop.svn.wordpress.org/trunk@53004
git-svn-id: http://core.svn.wordpress.org/trunk@52593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
Built from https://develop.svn.wordpress.org/trunk@53003
git-svn-id: http://core.svn.wordpress.org/trunk@52592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
Built from https://develop.svn.wordpress.org/trunk@52998
git-svn-id: http://core.svn.wordpress.org/trunk@52587 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
Built from https://develop.svn.wordpress.org/trunk@52997
git-svn-id: http://core.svn.wordpress.org/trunk@52586 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
Built from https://develop.svn.wordpress.org/trunk@52996
git-svn-id: http://core.svn.wordpress.org/trunk@52585 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.
Built from https://develop.svn.wordpress.org/trunk@52995
git-svn-id: http://core.svn.wordpress.org/trunk@52584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This change updates Twenty Nineteen bundled theme to fix the DOM order in the comment form, and to add a new `.comment-form-wrapper` class to change `flex` display to `block` for this specific area.
Props garrett-eclipse, audrasjb, sabernhardt.
Fixes#46600.
Built from https://develop.svn.wordpress.org/trunk@52993
git-svn-id: http://core.svn.wordpress.org/trunk@52582 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In [52921] `term_exists` was converted to use `get_terms`. This change adds a filter called `term_exists_default_query_args`
to the `term_exists` function to allow developers to modify the arguments passed to `get_terms` before the query is run.
Props Chouby, Spacedmonkey, peterwilsoncc.
Fixes#55439.
Built from https://develop.svn.wordpress.org/trunk@52987
git-svn-id: http://core.svn.wordpress.org/trunk@52576 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The current docblock for `WP_Upgrader::run` indicates the default value for the `clear_working` key of the `$options` argument is `false`. However, in the code directly below, the default is shown to be `true. This change updates the docblock to correct the default.
This commit also reorders the `$defaults` to match the order they appear in the docblock.
Props paulkevan.
Fixes#55450.
Built from https://develop.svn.wordpress.org/trunk@52986
git-svn-id: http://core.svn.wordpress.org/trunk@52575 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Ensure that the parameters `update_post_meta_cache`, `update_post_term_cache`, `cache_results`, `suppress_filters` and
`lazy_load_term_meta` that are passed to WP_Query, are also passed down to the secondary query used to get sticky
posts.
Props Spacedmonkey, peterwilsoncc, rehanali, uday17035.
Fixes#36907.
Built from https://develop.svn.wordpress.org/trunk@52982
git-svn-id: http://core.svn.wordpress.org/trunk@52571 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset replaces contracted verb forms like `doesn't`, `can't`, or `isn't` with non-contracted forms like `does not`, `cannot`, or `is not`, for better consistency across the WordPress administration. It also updates some corresponding unit tests strings.
Follow-up to [52978].
See #38913.
Built from https://develop.svn.wordpress.org/trunk@52979
git-svn-id: http://core.svn.wordpress.org/trunk@52568 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset replaces contracted verb forms like `doesn't`, `can't`, or `isn't` with non-contracted forms like `does not`, `cannot`, or `is not`, for better consistency across the WordPress administration. It also updates some corresponding unit tests strings.
Props Presskopp, socalchristina, aandrewdixon, francina, SergeyBiryukov, JeffPaul, audrasjb, hellofromTonya.
Fixes#38913.
See #39176.
Built from https://develop.svn.wordpress.org/trunk@52978
git-svn-id: http://core.svn.wordpress.org/trunk@52567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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
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
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
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