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:
* `get_option()`
* `get_user_setting()`
* `get_site_option()`
* `get_network_option()`
* `filter_default_option()`
Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273], [53274], [53275], [53276], [53277], [53281], [53283], [53284], [53285], [53287], [53364], [53365], [54927], [54929], [54930], [54931], [54932], [54933], [54938], [54943], [54944], [54945], [54946], [54947].
Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #56788.
Built from https://develop.svn.wordpress.org/trunk@54948
git-svn-id: http://core.svn.wordpress.org/trunk@54500 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 `$public` parameter to `$is_public` in `wp_update_blog_public_option_on_site_update()`.
* Amends the `$value` parameter of the `update_blog_public` filter for consistency.
Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273], [53274], [53275], [53276], [53277], [53281], [53283], [53284], [53285], [53287], [53364], [53365], [54927], [54929], [54930], [54931], [54932], [54933], [54938], [54943], [54944], [54945], [54946].
Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #56788.
Built from https://develop.svn.wordpress.org/trunk@54947
git-svn-id: http://core.svn.wordpress.org/trunk@54499 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 to `$email_or_login` in `get_user_id_from_string()`.
Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273], [53274], [53275], [53276], [53277], [53281], [53283], [53284], [53285], [53287], [53364], [53365], [54927], [54929], [54930], [54931], [54932], [54933], [54938], [54943], [54944], [54945].
Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #56788.
Built from https://develop.svn.wordpress.org/trunk@54946
git-svn-id: http://core.svn.wordpress.org/trunk@54498 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 `$default` parameter to `$default_value` in `get_blog_option()`.
Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273], [53274], [53275], [53276], [53277], [53281], [53283], [53284], [53285], [53287], [53364], [53365], [54927], [54929], [54930], [54931], [54932], [54933], [54938], [54943], [54944].
Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #56788.
Built from https://develop.svn.wordpress.org/trunk@54945
git-svn-id: http://core.svn.wordpress.org/trunk@54497 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 `$object` parameter to `$input_object` in `wp_clone()`.
Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273], [53274], [53275], [53276], [53277], [53281], [53283], [53284], [53285], [53287], [53364], [53365], [54927], [54929], [54930], [54931], [54932], [54933], [54938], [54943].
Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #56788.
Built from https://develop.svn.wordpress.org/trunk@54944
git-svn-id: http://core.svn.wordpress.org/trunk@54496 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 to `$url` in `user_trailingslashit()`.
* Renames the `$echo` parameter to `$display` in:
* `edit_term_link()`
* `next_posts()`
* `previous_posts()`
* Renames the `$class` parameter to `$css_class` in:
* `edit_post_link()`
* `_navigation_markup()`
Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273], [53274], [53275], [53276], [53277], [53281], [53283], [53284], [53285], [53287], [53364], [53365], [54927], [54929], [54930], [54931], [54932], [54933], [54938].
Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #56788.
Built from https://develop.svn.wordpress.org/trunk@54943
git-svn-id: http://core.svn.wordpress.org/trunk@54495 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Follow up from [54423].
Change the `wp_cache_get_multiple` function to call the `getMulti` method in the object cache object, to get cache keys in a single call to memcache. This speeds up test by loading caches faster.
Props spacedmonkey, SergeyBiryukov.
See #54864.
Built from https://develop.svn.wordpress.org/trunk@54942
git-svn-id: http://core.svn.wordpress.org/trunk@54494 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When rendering a list of attachments in `WP_Media_List_Table` class, none image attachments, show a generic icon. However, attachment types like audio and video support adding a featured image. For attachments that have featured images, us this image instead of the icon. This featured image is a better preview than a generic icon.
Props spacedmonkey, samful, johnbillion, JavierCasares, seanchayes, antpb, cadic, JeffPaul.
Fixes#49852.
Built from https://develop.svn.wordpress.org/trunk@54941
git-svn-id: http://core.svn.wordpress.org/trunk@54493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Unlike other clean cache functions like `clean_post_cache`, `clean_user_cache` did not also clear user meta caches. This is inconsistent and can result in some strange side effects. Update the `clean_user_cache` function to also clear user meta caches when called.
Props dd32, spacedmonkey, peterwilsoncc.
Fixes#54316.
Built from https://develop.svn.wordpress.org/trunk@54940
git-svn-id: http://core.svn.wordpress.org/trunk@54492 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 to `$text` in `before_last_bar()`.
Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273], [53274], [53275], [53276], [53277], [53281], [53283], [53284], [53285], [53287], [53364], [53365], [54927], [54929], [54930], [54931], [54932], [54933].
Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #56788.
Built from https://develop.svn.wordpress.org/trunk@54938
git-svn-id: http://core.svn.wordpress.org/trunk@54490 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The Homepage Settings section on the customizer uses `WP_Customize_Manager::has_published_pages()` as `active_callback`. [53057] introduced an error on the logical check when the queried page is not a top-level page, which leads `has_published_pages` to incorrectly return an empty array.
This changeset fixes the issue by adding `'hierarchical' => 0` to `get_pages()` arguments.
Follow-up to [53057].
Props felipelavinz, dlh, costdev.
Fixes#57198.
Built from https://develop.svn.wordpress.org/trunk@54935
git-svn-id: http://core.svn.wordpress.org/trunk@54487 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 to `$content` in:
* `wp_kses()`
* `wp_kses_hook()`
* `wp_kses_split()`
* `wp_kses_split2()`
* `wp_kses_bad_protocol()`
* `wp_kses_no_null()`
* `wp_kses_stripslashes()`
* `wp_kses_bad_protocol_once()`
* `wp_kses_normalize_entities()`
* `wp_kses_decode_entities()`
* Renames the `$string` parameter to `$attr` in:
* `wp_kses_one_attr()`
* `wp_kses_html_error()`
* Renames the `$match` parameter to `$matches` in:
* `_wp_kses_split_callback()`
* `_wp_kses_decode_entities_chr()`
* `_wp_kses_decode_entities_chr_hexdec()`
* Renames the `$string` parameter to `$scheme` in `wp_kses_bad_protocol_once2()`.
Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273], [53274], [53275], [53276], [53277], [53281], [53283], [53284], [53285], [53287], [53364], [53365], [54927], [54929], [54930], [54931], [54932].
Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #56788.
Built from https://develop.svn.wordpress.org/trunk@54933
git-svn-id: http://core.svn.wordpress.org/trunk@54485 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 `$echo` parameter to `$display` in:
* `wp_loginout()`
* `wp_register()`
* `get_calendar()`
* `the_date()`
* `the_modified_date()`
* `checked()`
* `selected()`
* `disabled()`
* `wp_readonly()`
* `__checked_selected_helper()`
* Renames the `$readonly` parameter to `$readonly_value` in `wp_readonly()`.
Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273], [53274], [53275], [53276], [53277], [53281], [53283], [53284], [53285], [53287], [53364], [53365], [54927], [54929], [54930], [54931].
Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #56788.
Built from https://develop.svn.wordpress.org/trunk@54932
git-svn-id: http://core.svn.wordpress.org/trunk@54484 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 `$list` parameter to `$status` in `wp_style_is()`.
Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273], [53274], [53275], [53276], [53277], [53281], [53283], [53284], [53285], [53287], [53364], [53365], [54927], [54929], [54930].
Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #56788.
Built from https://develop.svn.wordpress.org/trunk@54931
git-svn-id: http://core.svn.wordpress.org/trunk@54483 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 `$function` parameter to `$function_name` in `_wp_scripts_maybe_doing_it_wrong()`.
* Renames the `$list` parameter to `$status` in `wp_script_is()`.
Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273], [53274], [53275], [53276], [53277], [53281], [53283], [53284], [53285], [53287], [53364], [53365], [54927], [54929].
Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #56788.
Built from https://develop.svn.wordpress.org/trunk@54930
git-svn-id: http://core.svn.wordpress.org/trunk@54482 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 `$echo` parameter to `$display` in:
* `wp_nonce_field()`
* `wp_referer_field()`
* `wp_original_referer_field()`
* Renames the `$string` parameter to `$input_string` in
* `_wp_json_convert_string()`
* `_wp_to_kebab_case()`
* Renames the `$list` parameter to `$input_list` in:
* `wp_parse_list()`
* `wp_parse_id_list()`
* `wp_parse_slug_list()`
* `wp_filter_object_list()`
* `wp_list_filter()`
* `wp_list_pluck()`
* `wp_list_sort()`
* Renames the `$array` parameter to `$input_array` in:
* `add_magic_quotes()`
* `wp_array_slice_assoc()`
* `_wp_array_get()`
* `_wp_array_set()`
* Renames the `$function` parameter to `$function_name` in:
* `_deprecated_function()`
* `_deprecated_argument()`
* `_doing_it_wrong()`
* Renames the `$class` parameter to `$class_name` in `_deprecated_constructor()`.
* Renames the `$default` parameter to `$default_value` in `apache_mod_loaded()`.
* Renames the `$var` parameter to `$value` in `wp_validate_boolean()`.
* Amends the `$input` parameter in `wp_parse_str()` for consistency.
Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273], [53274], [53275], [53276], [53277], [53281], [53283], [53284], [53285], [53287], [53364], [53365], [54927].
Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #56788.
Built from https://develop.svn.wordpress.org/trunk@54929
git-svn-id: http://core.svn.wordpress.org/trunk@54481 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 to `$text` in:
* `_wp_specialchars()`
* `wp_specialchars_decode()`
* `wp_check_invalid_utf8()`
* `remove_accents()`
* `_split_str_by_whitespace()`
* `wp_strip_all_tags()`
* Renames the `$string` parameter to `$value` in:
* `backslashit()`
* `trailingslashit()`
* `untrailingslashit()`
* Renames the `$string` parameter to `$subject` in `wp_iso_descrambler()`.
* Renames the `$match` parameter to `$matches` in `_wp_iso_convert()`.
* Renames the `$string` parameter to `$date_string` in:
* `get_gmt_from_date()`
* `get_date_from_gmt()`
* Renames the `$string` parameter to`$input` in `wp_parse_str()`.
* Renames the `$string` parameter to `$content` in `wp_pre_kses_block_attributes()`.
* Amends the `$text` parameter in `wp_pre_kses_less_than()` for consistency.
Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216], [53220], [53230], [53232], [53236], [53239], [53240], [53242], [53243], [53245], [53246], [53257], [53269], [53270], [53271], [53272], [53273], [53274], [53275], [53276], [53277], [53281], [53283], [53284], [53285], [53287], [53364], [53365].
Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #56788.
Built from https://develop.svn.wordpress.org/trunk@54927
git-svn-id: http://core.svn.wordpress.org/trunk@54479 1a063a9b-81f0-0310-95a4-ce76da25c4cd
As the filter is only intended for a single test, it can be converted to a closure instead of being declared as a function in the global namespace. The `remove_filter()` part is redundant, as `WP_UnitTestCase_Base` saves the state of filter-related globals at `set_up()` and restores them on `tear_down()`.
Follow-up to [54175].
Props jrf, SergeyBiryukov.
See #56791.
Built from https://develop.svn.wordpress.org/trunk@54917
git-svn-id: http://core.svn.wordpress.org/trunk@54469 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Add some minimal e2e test coverage to install and activate the Gutenberg plugin.
This will catch naming collisions between Core and Gutenberg and help avoid crashing WordPress installations that run the stable version of the Gutenberg plugin on top of Core trunk.
Props costdev.
Fixes#57197.
Built from https://develop.svn.wordpress.org/trunk@54913
git-svn-id: http://core.svn.wordpress.org/trunk@54465 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This fixes the currently flagged `WordPress.PHP.StrictInArray.MissingTrueStrict` issues:
* `Not using strict comparison for in_array; supply true for third argument.`
These all do comparisons with strings, so all the more reason why it is imperative that a strict comparison is used.
Follow-up to [47550], [47557], [54155], [53480].
Props jrf.
See #56791.
Built from https://develop.svn.wordpress.org/trunk@54895
git-svn-id: http://core.svn.wordpress.org/trunk@54447 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In [54352] `update_post_caches()` was replaced by `_prime_post_caches()` to reduce excessive object cache calls. That's because `_prime_post_caches()` checks first if post IDs aren't already cached. Unfortunately this becomes an issue if a post itself is cached but not the meta/terms.
To fix this regression, `_prime_post_caches()` now always calls `update_postmeta_cache()` and `update_object_term_cache()` depending on the arguments passed to it. Both functions internally check whether IDs are already cached so the fix from [54352] remains in place.
Props peterwilsoncc, spacedmonkey, ocean90.
Fixes#57163.
Built from https://develop.svn.wordpress.org/trunk@54894
git-svn-id: http://core.svn.wordpress.org/trunk@54446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Adds a `private` visibility to some test class properties where it was not explicitly specified. This continues the previous efforts to make sure visibility is declared on all properties.
Note: This will be enforced by WPCS 3.0.0.
Follow-up to [49184], [51919], [52009], [52010], [54889].
Props jrf.
See #56791.
Built from https://develop.svn.wordpress.org/trunk@54890
git-svn-id: http://core.svn.wordpress.org/trunk@54442 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Adds a `public` visibility to test fixtures, tests, data providers, and callbacks methods. This continues the previous efforts to make sure visibility is declared on all methods.
Note: This will be enforced by WPCS 3.0.0.
Follow-up to [51919], [52009], [52010].
Props jrf.
See #56791.
Built from https://develop.svn.wordpress.org/trunk@54889
git-svn-id: http://core.svn.wordpress.org/trunk@54441 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `check_comment()` and `wp_check_comment_disallowed_list()` functions are expected to be case-insensitive, but that only worked for words using Latin script and consisting of ASCII characters.
This commit adds the Unicode flag to the regular expression used for the check in these functions, so that both pattern and subject can be treated as UTF-8 strings.
Reference: [https://www.php.net/manual/en/reference.pcre.pattern.modifiers.php PHP Manual: Pattern Modifiers].
Follow-up to [984], [2075], [48121], [48575].
Props bonjour52, SergeyBiryukov.
Fixes#57207.
Built from https://develop.svn.wordpress.org/trunk@54888
git-svn-id: http://core.svn.wordpress.org/trunk@54440 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In the "Blog (alternative)" page template, turn post titles into links. This is to better align with user expectations that individual post titles in a blog-like list of recent posts will be links to the corresponding blog posts.
Props scruffian.
Fixes#57175.
Built from https://develop.svn.wordpress.org/trunk@54887
git-svn-id: http://core.svn.wordpress.org/trunk@54439 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The handle source can be set to `false`, which means the item is an alias of other items it depends on.
Follow-up to [7970], [25518], [43661], [47170], [48462], [54470].
Props mehulkaklotar, swissspidy, costdev.
Fixes#57206.
Built from https://develop.svn.wordpress.org/trunk@54875
git-svn-id: http://core.svn.wordpress.org/trunk@54427 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Since `ABSPATH` is defined and documented to end with a forward slash `/`, this changeset removes the first `/` from strings appended to `ABSPATH` in various files, leading to `//` in the resulting path.
Props TobiasBg, audrasjb, SergeyBiryukov, emanuelx.
Fixes#57074.
See #57071.
Built from https://develop.svn.wordpress.org/trunk@54872
git-svn-id: http://core.svn.wordpress.org/trunk@54424 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset removes the "flexible-header" tag from Twenty Nineteen, since the requirements for using this tag is that the theme includes support for a custom header with the flex-height and/or flex-width parameters, and Twenty Nineteen does not have support for header image.
Props poena, mukesh27, laurelfulford, audrasjb.
Fixes#46213.
Built from https://develop.svn.wordpress.org/trunk@54869
git-svn-id: http://core.svn.wordpress.org/trunk@54421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This updates some inline comments to better match the guidelines and recommendations set forth in the make/core and make/docs handbooks:
> In general, use second person in your documentation. Second person depicts a friendly tone, with a perfect focus on the reader. In addition to this, directly addressing the reader helps avoid passive voice; thereby preventing unwanted confusion.
> ...
> the word “we” should be avoided (...) unless its made very clear which group is speaking.
Includes:
* Replacing first-person usage of "we" with second person point of view.
* Making small clarification adjustments where the voice is much too casual or lacks clear context, especially for non-native English speakers.
References:
* [https://make.wordpress.org/docs/style-guide/language-grammar/grammatical-person/ Style Guide: Grammatical person]
* [https://make.wordpress.org/docs/handbook/documentation-team-handbook/handbooks-style-and-formatting-guide/ Handbooks & HelpHub Style and Formatting Guide]
* [https://make.wordpress.org/core/handbook/best-practices/post-comment-guidelines/#style-and-substance Post & Comment Guidelines: Style and Substance]
Follow-up to [2176], [3430], [4676], [6009], [7991], [12688], [12762], [26008], [28978], [44488], [44962], [51979], [53131], [53132], [53156], [53131], [54200].
Props ironprogrammer, costdev, jorbin, SergeyBiryukov.
See #57052.
Built from https://develop.svn.wordpress.org/trunk@54866
git-svn-id: http://core.svn.wordpress.org/trunk@54418 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `setUp()` and `tearDown()` methods were renamed to `set_up()` and `tear_down()`, respectively, as part of implementing the `void` return type solution for PHPUnit 8.0.
Follow-up to [29120], [29251], [30277], [32173], [32806], [38829], [42379], [50450], [51276], [51568].
See #56793.
Built from https://develop.svn.wordpress.org/trunk@54865
git-svn-id: http://core.svn.wordpress.org/trunk@54417 1a063a9b-81f0-0310-95a4-ce76da25c4cd
These tests ensure that `wp_generate_attachment_metadata()` stores the file size of all newly uploaded attachments under the `filesize` array key. The tests were initially supposed to be committed with [52837].
Follow-up to [52837], [52932], [54861].
Props spacedmonkey, johnwatkins0, mitogh, adamsilverstein, pbearne, SergeyBiryukov.
Fixes#57171.
Built from https://develop.svn.wordpress.org/trunk@54863
git-svn-id: http://core.svn.wordpress.org/trunk@54415 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This aims to make the tests more discoverable and easier to expand.
Includes splitting the `wp_filesize` and `pre_wp_filesize` filter tests into a separate test case.
Follow-up to [52837], [52932], [54402].
Props pbearne, spacedmonkey, SergeyBiryukov.
See #57171.
Built from https://develop.svn.wordpress.org/trunk@54861
git-svn-id: http://core.svn.wordpress.org/trunk@54413 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Child themes inherit templates and template parts from the parent theme. In Site Editor, the "Added by" column for a template defaults to displaying the child theme, even though it is inherited from the parent, creating confusion as to where the actual templates are located.
This commit ensures that the parent theme is correctly displayed in that scenario.
Follow-up to [51003], [52062].
Props ptahdunbar, WoutPitje, petaryoast, costdev, poena, audrasjb, SergeyBiryukov.
Fixes#55437.
Built from https://develop.svn.wordpress.org/trunk@54860
git-svn-id: http://core.svn.wordpress.org/trunk@54412 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit adds inline comments instructing PHPCS to ignore some lines for database queries. An explanation is provided with each instruction.
This resolves a few WPCS warnings along the lines of:
{{{
Use placeholders and $wpdb->prepare(); found interpolated variable $table_name at "DESC $table_name"
}}}
Follow-up to [236], [265], [5778].
Props jipmoors, costdev, jrf, SergeyBiryukov.
Fixes#43761.
Built from https://develop.svn.wordpress.org/trunk@54858
git-svn-id: http://core.svn.wordpress.org/trunk@54410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
While the `$type` and `$label` variables are set to values that do not currently require escaping, this may change in the future, so it is preferable to add the escaping as a defensive coding measure.
Follow-up to [16294], [29030].
Props monzuralam, rudlinkon, hztyfoon, peterwilsoncc.
Fixes#57133.
Built from https://develop.svn.wordpress.org/trunk@54857
git-svn-id: http://core.svn.wordpress.org/trunk@54409 1a063a9b-81f0-0310-95a4-ce76da25c4cd
To improve how Composer dependencies are installed and managed within GitHub Actions, the `ramsey/composer-install` third-party action is now used consistently throughout all workflows.
Previously, some workflows manually ran `composer` commands while others already used `ramsey/composer-install`.
The `ramsey/composer-install` action manages caching dependencies across workflow runs internally, which is something that was manually handled before this change.
Props jrf, desrosj.
Fixes#53841.
Built from https://develop.svn.wordpress.org/trunk@54856
git-svn-id: http://core.svn.wordpress.org/trunk@54408 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Includes minor formatting edits for consistency.
Follow-up to [53/tests], [12179], [12946], [35288], [37884], [38810], [38928], [46596], [48131], [52955], [53548], [53813], [53873], [54118], [54316], [54420], [54421], [54803].
See #56792.
Built from https://develop.svn.wordpress.org/trunk@54855
git-svn-id: http://core.svn.wordpress.org/trunk@54407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This adds additional inline context as to why the MacOS job is separate from the Windows and Ubuntu ones in the Test npm workflow.
While it is preferable to combine all of these to avoid repeated code, there is currently no way to determine the runner’s OS within the `if` workflow key.
MacOS jobs use GitHub Action minutes at by a multiple of 10. Being more strict about when to run these jobs ensures minutes are not unintentionally consumed within private forks and mirrors.
See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability for more details.
See #56793.
Built from https://develop.svn.wordpress.org/trunk@54852
git-svn-id: http://core.svn.wordpress.org/trunk@54404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This applies several types of improvements to GitHub Action workflows:
- Updates to inline documentation to ensure accuracy.
- Removal of repetitive or unnecessary debug logging.
- Reorganization of some steps to have configuration steps towards the beginning of jobs.
- Step name updates for consistency across workflows.
Props desrosj, jrf.
See #56793.
Built from https://develop.svn.wordpress.org/trunk@54851
git-svn-id: http://core.svn.wordpress.org/trunk@54403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Because themes are updated independently of Core updates, any deleted files from bundled themes should not be included in the `$_old_files` list.
Any file included in this list is deleted on update, which could cause problems for sites with a given theme active if the removed files were required in earlier versions of that theme and that theme is not updated at the same time.
Props desrosj, costdev, SergeyBiryukov.
Fixes#56936.
Built from https://develop.svn.wordpress.org/trunk@54849
git-svn-id: http://core.svn.wordpress.org/trunk@54401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The parameter was documented as `WP_Post`, but it contains the value of `get_adjacent_post()`, which returns an empty string if there is no corresponding post, so the correct type is `WP_Post|string`.
Follow-up to [11243], [16951], [28111], [32606].
Props apermo, audrasjb.
Fixes#57047.
Built from https://develop.svn.wordpress.org/trunk@54841
git-svn-id: http://core.svn.wordpress.org/trunk@54393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This properly deletes the now empty `src/wp-includes/blocks/comments-query-loop` directory and adds that directory to the `$_old_files` array.
The files in this directory were removed in [54257], but the directory was not marked as deleted in SVN.
Props azaozz, jorbin, SergeyBiryukov.
Fixes#57080.
Built from https://develop.svn.wordpress.org/trunk@54836
git-svn-id: http://core.svn.wordpress.org/trunk@54388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
[54768] added a few tests to verify that caching within `WP_Query` is bypassed when the `SELECT` clause has been modified via a filter, to avoid cache key collisions and the returning of incomplete or unexpected results.
However, creating several posts with the same date/time fields can result in inconsistent sort ordering between MySQL and MariaDB, as each engine refines the order further using a different index.
This commit aims to stabilize the tests by using `assertEqualSets()` instead of `assertEquals()`, since testing the order is out of their scope. Includes removing `array_unshift()` and `array_reverse()` calls as no longer needed.
This resolves a few test failures on MariaDB along the lines of:
{{{
Tests_Query_FieldsClause::test_should_limit_fields_to_id_and_parent_subset
Posts property for first query is not of expected form.
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
Array (
0 => stdClass Object (
- 'ID' => 36019
+ 'ID' => 36015
'post_parent' => 0
)
1 => stdClass Object (
- 'ID' => 36018
+ 'ID' => 36016
'post_parent' => 0
)
2 => stdClass Object (...)
3 => stdClass Object (
- 'ID' => 36016
+ 'ID' => 36018
'post_parent' => 0
)
4 => stdClass Object (
- 'ID' => 36015
+ 'ID' => 36019
'post_parent' => 0
)
)
/tmp/wp-test-runner/tests/phpunit/tests/query/fieldsClause.php:67
/tmp/wp-test-runner/phpunit-5.7.phar:598
}}}
Follow-up to [54768].
Props peterwilsoncc, SergeyBiryukov.
See #57012.
Built from https://develop.svn.wordpress.org/trunk@54829
git-svn-id: http://core.svn.wordpress.org/trunk@54381 1a063a9b-81f0-0310-95a4-ce76da25c4cd
- Where no fluid max values are set (e.g., single or custom font size values), the "size" value will act as the maximum value in a `clamp()` function.
- In the absence of any fluid `min`/`max` values, the lower bound rule of `>16px` will be enforced. This applies to custom values from the editor or single-value `theme.json` styles. Font sizes below this will not be clamped.
- In a preset, if a `fluid.min` value has been specified, the lower bound rule of `>16px` won't be enforced on this value. Presets with a fluid object therefore, give precedence to theme author's values.
- In a preset, if there is NOT a `fluid.max` but there is `fluid.min`, use the incoming "size" value as the `max`.
- In a preset, if there is NOT a `fluid.min` but there is a `fluid.max`, use `size * min_size_factor` as the `min`. The lower bound rule of `>16px` is enforced here, because the block editor is computing the `min` value. This is consistent with the way minimum sizes are calculated for single or custom values.
Props ramonopoly, mamaduka, andrewserong, aristath, joen, desrosj.
Fixes#57075.
Built from https://develop.svn.wordpress.org/trunk@54823
git-svn-id: http://core.svn.wordpress.org/trunk@54375 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When separator blocks are configured using only a `background-color`, they are shown correctly within the editor but not on the front end.
This changes `WP_Theme_JSON` to detect this scenario and move the `background-color` value to just `color` when both `color` and `border-color` are missing.
Props cbravobernal, flixos90, davidbaumwald, hellofromTonya, desrosj, andrewserong, czapla, glendaviesnz, wildworks.
Fixes#56903.
Built from https://develop.svn.wordpress.org/trunk@54821
git-svn-id: http://core.svn.wordpress.org/trunk@54373 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Calling the `wp_get_theme` function creates a instance of the `WP_Theme` class. This can be a performance issue, if all you need is one property of the class instance. This change replaces the usage of `wp_get_theme()->get_stylesheet()` with `get_stylesheet()` to improve performance.
Props spacedmonkey, flixos90, peterwilsoncc, desrosj.
Fixes#57057.
Built from https://develop.svn.wordpress.org/trunk@54817
git-svn-id: http://core.svn.wordpress.org/trunk@54369 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This partially reverts [53860] and [53862], which refactored the `exists()` method to rely on `ftp_rawlist()` instead of `ftp_nlist()`.
[53860] makes a similar attempt to the ones made in [33648] and [34733] (which were also reverted in [35944]). Being compliant with the specifications while continuing to work without issue for all FTP servers continues seem impossible. These little ghosts are the ones we’re scared of the most.
Props jsh4, afragen, costdev, pkolenbr, SergeyBiryukov, dd32, peterwilsoncc, gamecreature, desrosj.
Fixes#56966.
See #51170, #28013.
Built from https://develop.svn.wordpress.org/trunk@54815
git-svn-id: http://core.svn.wordpress.org/trunk@54367 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This applies to:
* `normalizer_is_normalized()`
* `normalizer_normalize()`
Includes removing the `Normalizer::FORM_C` constant as a parameter, since it is the default value for both functions and does not need to be explicitly passed. This avoids a fatal error if a plugin includes polyfill for any of the functions but the `Normalizer` class has a different namespace, for example when using the Symfony polyfill.
Follow-up to [53754].
Props hellofromTonya, costdev, desrosj, mukesh27, zodiac1978, jchambo, gisgeo, SergeyBiryukov.
Fixes#56980.
Built from https://develop.svn.wordpress.org/trunk@54813
git-svn-id: http://core.svn.wordpress.org/trunk@54365 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This updates the block editor related npm dependencies to their latest patch versions ahead of WordPress 6.1.1.
For a full list of what’s included in this update, see 432ed388f8...6566f5fe9e.
Props aaronrobertshaw, ntsekouras, bernhard-reiter, ramonopoly, isabel_brison, andrewserong, get_dave, scruffian, andraganescu, talldanwp, mciampini, noisysocks, cbravobernal, bph, tyxla, ellatrix, czapla, mcsf, ironprogrammer, wildworks, peterwilsoncc, mamaduka, mikachan, spacedmonkey, cybr, youknowriad, alexstine, aristath, kevin940726, ndiego, 0mirka00, poena, joen, ryankienstra, desrosj, vtad, nithins53, audrasjb, kacper3355, sabernhardt.
Fixes#57038, #56818, #56955, #56923.
Built from https://develop.svn.wordpress.org/trunk@54811
git-svn-id: http://core.svn.wordpress.org/trunk@54363 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In many scenarios array functions are more expensive than using simpler `for` or `foreach` loops.
This changeset results in roughly 4% faster `wp_head` execution time for both block themes and classic themes. While this may seem like a small win, it is a worthwhile enhancement and only one part of several other little performance tweaks which are being worked on to improve performance of `theme.json` parsing further.
Props aristath, desrosj, jrf, spacedmonkey.
Fixes#56974.
See #57067.
Built from https://develop.svn.wordpress.org/trunk@54804
git-svn-id: http://core.svn.wordpress.org/trunk@54356 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Initialize `WP_Textdomain_Registry` in `wp_load_translations_early()`. This ensures the global `$wp_textdomain_registry` is set up prior to loading the translations.
Props azurseisme, TimothyBlynJacobs, costdev, ocean90, flixos90, swissspidy.
Fixes#57051.
Built from https://develop.svn.wordpress.org/trunk@54803
git-svn-id: http://core.svn.wordpress.org/trunk@54355 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Workaround `wp_img_tag_add_decoding_attr()` potentially breaking JavaScript and JSON data by limiting the addition of the decoding attribute to image tags using unescaped double quoted attributes `src` attributes.
Props rodricus, TimothyBlynJacobs, joelmadigan, mw108, adamsilverstein, flixos90, desrosj, mukesh27.
Fixes#56969.
Built from https://develop.svn.wordpress.org/trunk@54802
git-svn-id: http://core.svn.wordpress.org/trunk@54354 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Ensure the `menu-item-has-children` class is added to sub-menu items when `wp_nav_menu()` is called with the `depth` parameter specified to a non-zero value.
Follow up to [54478].
Props davidvongries, fpodhorsky, hellofromTonya, innovext, larsmqller, LeonidasMilossis, mattkeys, mukesh27, nuvoPoint, ocean90, outrankjames, petitphp, SergeyBiryukov, sippis, webmandesign.
Fixes#56946.
See #28620.
Built from https://develop.svn.wordpress.org/trunk@54801
git-svn-id: http://core.svn.wordpress.org/trunk@54353 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Here's what it does:
* Do not load and parse `theme-i18n.json` schema if the theme does not have a `theme.json` file.
* Fix the variable caching layer around the theme's `theme.json` parsing so that a parent's theme `theme.json` is cached as well.
* Do not run a `WP_Query` for global styles for a user when the theme does not have a `theme.json`.
In a basic WordPress setup, this changeset improves `wp_head` execution time for classic themes by 10%, and overall response time for both block themes and classic themes by 4%. This may seem like a small win, but 4% reduced overall response time is actually quite a bit for one change, and it is worth mentioning that this is just one of several other little performance tweaks which are being worked on to improve performance of `theme.json` parsing further.
Props flixos90, manuilov, oandregal, peterwilsoncc, spacedmonkey.
Fixes#56945.
Built from https://develop.svn.wordpress.org/trunk@54799
git-svn-id: http://core.svn.wordpress.org/trunk@54351 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In [53874] the optional `$locale` parameter was added to `load_textdomain()`. While most `load_textdomain()` calls in core were were updated, some were missed. Passing the original locale avoids the need to call `determine_locale()` by `load_textdomain()` which is used as a fallback.
Props ocean90, swissspidy, desrosj.
See #57060.
Built from https://develop.svn.wordpress.org/trunk@54797
git-svn-id: http://core.svn.wordpress.org/trunk@54349 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Due to auto-increment, when running various test groups or classes separately, in this case running all of the tests under `phpunit/tests/multisite/` by including the `--filter Tests_Multisite` parameter, it is entirely possible for the blog ID 42 to actually exist, making the test's assumption incorrect.
By using `PHP_INT_MAX` instead, we can avoid a collision with a fixture of another test.
Follow-up to [31157].
See #56793.
Built from https://develop.svn.wordpress.org/trunk@54791
git-svn-id: http://core.svn.wordpress.org/trunk@54343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Resolves a fatal error due to `get_template_hierarchy()` due to incompatible older Gutenberg versions.
[54269] introduced this new function for 6.1. The function was introduced in Gutenberg 13.9.0. However, it was not guarded to protect the plugin from when the function was loaded in Core. Gutenberg 14.1.0 added the `function_exists()` guard to protect the plugin from the fatal error.
Minimum compatible version:
This commit changes the Gutenberg minimum compatible version number to 14.1. For versions older than 14.1, the plugin will deactivate when upgrading Core to 6.1 or newer.
Function rename:
Past commits renamed the upgrade function by changing Core's version number. This commit renames the function to be generic, i.e. `_upgrade_core_deactivate_incompatible_plugins()` and adopts the `@since [reason]` strategy to track historical changes to the function.
Follow-up to [54269], [52199], [52166], [52165], [51180].
Props namithjawahar, hellofromTonya, azaozz, desrosj, ironprogrammer.
Fixes#56985.
Built from https://develop.svn.wordpress.org/trunk@54789
git-svn-id: http://core.svn.wordpress.org/trunk@54341 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Prevent term `NOT EXISTS` queries causing `redirect_canonical()` to throw a fatal error in PHP 8 and above, or a warning in earlier versions.
This ensures the `tax_query`'s `terms` property both exists and is countable before attempting to count it.
Props codesdnc, SergeyBiryukov, kadamwhite, costdev, miguelaxcar.
Fixes#55955.
Built from https://develop.svn.wordpress.org/trunk@54785
git-svn-id: http://core.svn.wordpress.org/trunk@54337 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Revert to legacy database query in `get_pages_by_title()`. Due to the lack of `orderby` clause in the previous database query, it is not possible to gain consistent results by converting the function to a `WP_Query` wrapper.
Reverts [54271, 54242, 54234].
Props Bjorn2404, 10upsimon, dilipbheda, mukesh27, spacedmonkey, TimothyBlynJacobs, rjasdfiii, stentibbing, pbiron, pento.
Fixes#57039, #56991.
See #57041.
Built from https://develop.svn.wordpress.org/trunk@54782
git-svn-id: http://core.svn.wordpress.org/trunk@54334 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset fixes the `$preload_paths` parameter type for `block_editor_rest_api_preload()` and related hooks. This parameter expects an array of strings OR an array where the path is the first element (index 0) of this array.
Props chouby.
Fixes#56810.
See #56792.
Built from https://develop.svn.wordpress.org/trunk@54776
git-svn-id: http://core.svn.wordpress.org/trunk@54328 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Re-order the link pseudo classes to follow the long term LoVe (F)HA rule when set via `theme.json`.
In order that the CSS cascade behaves in a predictable manner, it's recommended that the selectors follow the order `:visited`, `:focus`/`:hover`, `:active`. As order affects the specificity, this ensures the interaction states override the visited states. CSS specificity is really quite beautiful, although complex.
Props mikachan, sabernhardt, davidbaumwald, mukesh27, Mamaduka, desrosj.
Fixes#56928.
Built from https://develop.svn.wordpress.org/trunk@54774
git-svn-id: http://core.svn.wordpress.org/trunk@54326 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Ensure only full post objects are passed to `update_post_author_caches()` when called within `WP_Query::the_post()`. This prevents an error when starting the Loop for Queries initiated with a subset of fields or IDs only.
Props konyoldeath, dd32, lozula, TimothyBlynJacobs, spacedmonkey, mxbclang, peterwilsoncc.
Fixes#56948.
Built from https://develop.svn.wordpress.org/trunk@54771
git-svn-id: http://core.svn.wordpress.org/trunk@54323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Change `orderby` clause used within `WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles` to `date` to match the `WP_Query` documentation for the parameter.
Props miguelaxcar, johnbillion, JeffPaul, spacedmonkey, mxbclang, mukesh27.
Fixes#56900.
Built from https://develop.svn.wordpress.org/trunk@54770
git-svn-id: http://core.svn.wordpress.org/trunk@54322 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `wp_max_upload_size()` function can be expensive to call, especially for large sites or multisites. For the frontend usage of `get_default_block_editor_settings()` knowing the allowed upload size is typically unnecessary.
This changeset adds a condition so that `wp_max_upload_size()` is only called if the current user can actually `upload_files`. It keeps the data present when it is actually needed while avoiding the execution overhead when it is not needed.
Props janthiel, Clorith, flixos90, spacedmonkey.
Fixes#56815.
Built from https://develop.svn.wordpress.org/trunk@54769
git-svn-id: http://core.svn.wordpress.org/trunk@54321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Bypass caching within `WP_Query` when the `SELECT` clause has been modified via a filter. This prevents both cache key collisions and the returning of incomplete or unexpected results when the `SELECT` clause has been modified by an extender.
Props pypwalters, claytoncollie, johnwatkins0, TimothyBlynJacobs, costdev, spacedmonkey, peterwilsoncc.
Fixes#57012.
Built from https://develop.svn.wordpress.org/trunk@54768
git-svn-id: http://core.svn.wordpress.org/trunk@54320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In #55594 user meta caching was enabled by default when making a `WP_User_Query`. Previously, this was only enabled if a developer specifically queried for 'all_with_meta'
fields. User meta caching is implemented using a pluggable function, `cache_users`. If a plugin runs a `WP_User_Query` before pluggable functions have been defined, this
will now cause a fatal error.
In this commit, a `function_exists` check is introduced to avoid calling `cache_users` if it's not defined. Additionally, a `_doing_it_wrong` notice is issued if the
`WP_User_Query::query` method is called before the 'plugins_loaded' hook.
Props carazo, subrataemfluence, oakesjosh, spacedmonkey, obenland, SergeyBiryukov, peterwilsoncc.
Fixes#56952.
Built from https://develop.svn.wordpress.org/trunk@54766
git-svn-id: http://core.svn.wordpress.org/trunk@54318 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The previous iteration of the test passed when run in isolation but failed when running the whole test suite.
Restoring the `switch_to_blog()` call allows the test to pass again pending a deeper investigation.
Follow-up to [54760].
See #57023.
Built from https://develop.svn.wordpress.org/trunk@54762
git-svn-id: http://core.svn.wordpress.org/trunk@54314 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Reduce some of the clutter in `tests/multisite/site.php` and introduce `tests/multisite/updateBlogStatus.php`. Tests moved over are verbatim at this point.
Follow-up to [1078/tests], [29916], [30784], [30785], [33253].
See #56793.
Built from https://develop.svn.wordpress.org/trunk@54757
git-svn-id: http://core.svn.wordpress.org/trunk@54309 1a063a9b-81f0-0310-95a4-ce76da25c4cd
According to the docs in developer.wordpress.org/reference/classes/wp_term_query/query WP_Term_Query:->query( string|array $query ) returns WP_Term[]|int[]|string[]|string, and we were using an inexistent object property terms making it always empty and look like the taxonomy did not exist.
Props mamaduka, mikachan, ockham, franz00.
See #56902.
Built from https://develop.svn.wordpress.org/trunk@54751
git-svn-id: http://core.svn.wordpress.org/trunk@54303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Includes:
* Fixing a few typos.
* Using the correct format for multi-line comments.
* Removing some comments that duplicate the assertion messages without providing any additional context.
Follow-up to [54478].
See #56792.
Built from https://develop.svn.wordpress.org/trunk@54741
git-svn-id: http://core.svn.wordpress.org/trunk@54293 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When uploading artifacts during GitHub Action workflows, all files uploaded to an artifact name are zipped. When a ZIP file is uploaded, the result is a horrifying state of ZIP-ception.
This changes the workflow to upload all of the needed theme files to the artifact instead of a singular ZIP file created prior to uploading.
This also fixes a bug where ZIP files generated have the desired theme nested within `src/wp-content/themes` instead of just containing the theme files.
Props ndiego, wildworks, desrosj, bgardner, colorful-tones.
Fixes#56898.
Built from https://develop.svn.wordpress.org/trunk@54740
git-svn-id: http://core.svn.wordpress.org/trunk@54292 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset removes `role="img"` attribute from two decorative images: despite being hidden to assistive technologies using `aria-hidden="true"`, automated tools still understand them as images and expect alternative texts.
Props viralsampat, sabernhardt, audrasjb, ryokuhi, elifvish.
Fixes#56824.
Built from https://develop.svn.wordpress.org/trunk@54739
git-svn-id: http://core.svn.wordpress.org/trunk@54291 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When using `'%%%s%%'` pattern with `$wpdb->prepare()`, it works on 6.0.3 but does not on 6.1-RC. Why? The inserted value is wrapped in quotes on 6.1-RC5 whereas it is not on <= 6.0.3.
With 6.1 final release tomorrow, more time is needed to further investigate and test. Reverting this changeset to restore the previous behavior.
This commit also adds a dataset for testing the `'%%%s%%'` pattern.
Props SergeyBiryukov, hellofromTonya, bernhard-reiter, desrosj, davidbaumwald, jorbin.
Fixes#56933.
See #52506.
Built from https://develop.svn.wordpress.org/trunk@54733
git-svn-id: http://core.svn.wordpress.org/trunk@54285 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Link the image and text to the new 6.1 release video on youtube. The video is currently private, but will be made public during the release party.
Props admwgn, critterverse, joen, annezazu, jpantani, laurlittle, cbringmann, kellychoffman, pablohoney, EidolonNight.
See #56357.
Built from https://develop.svn.wordpress.org/trunk@54729
git-svn-id: http://core.svn.wordpress.org/trunk@54281 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This changeset replaces a link to the outdated W3C specs on Custom Elements with a link to the corresponding WhatWG specification.
Previously committed in [53205], this appears to be accidentally reverted in [53562].
Follow-up to [53204], [53205], [53562].
Props audrasjb.
See #56792.
Built from https://develop.svn.wordpress.org/trunk@54727
git-svn-id: http://core.svn.wordpress.org/trunk@54279 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In the tests for updating a theme via Ajax, `wp_installing( true )` is called to prevent `wp_update_themes()` from running.
This worked as expected in `test_update_theme()`, however, it was missed in `test_uppercase_theme_slug()`, which was accidentally relying on the `wp_installing()` status not being properly restored in the previous test.
Now that the `wp_installing()` status was corrected in [54723], the latter test started throwing an error on PHP 8.2:
{{{
1) Tests_Ajax_wpAjaxUpdateTheme::test_uppercase_theme_slug
http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated
/var/www/src/wp-includes/Requests/Transport/cURL.php:345
/var/www/src/wp-includes/Requests/Transport/cURL.php:135
/var/www/src/wp-includes/class-requests.php:381
/var/www/src/wp-includes/class-wp-http.php:395
/var/www/src/wp-includes/class-wp-http.php:615
/var/www/src/wp-includes/http.php:179
/var/www/src/wp-includes/update.php:719
/var/www/src/wp-admin/includes/ajax-actions.php:4292
/var/www/src/wp-includes/class-wp-hook.php:308
/var/www/src/wp-includes/class-wp-hook.php:332
/var/www/src/wp-includes/plugin.php:517
/var/www/tests/phpunit/includes/testcase-ajax.php:265
/var/www/tests/phpunit/tests/ajax/wpAjaxUpdateTheme.php:157
}}}
Replicating the `wp_installing()` status changes in this test too resolves the error.
Follow-up to [38168], [38710], [54722], [54723].
See #56793.
Built from https://develop.svn.wordpress.org/trunk@54725
git-svn-id: http://core.svn.wordpress.org/trunk@54277 1a063a9b-81f0-0310-95a4-ce76da25c4cd
A recent change to how WOFF files are processed in PHP 8.2 RC3 has caused a new test failure.
The tests was previously skipped on PHP 8.2, however, apparently after a `fileinfo` extension update, it started failing on PHP 8.1 too.
This commit adjusts the skipping condition to include PHP 8.1.
Follow-up to [54508], [54509].
See #56817.
Built from https://develop.svn.wordpress.org/trunk@54724
git-svn-id: http://core.svn.wordpress.org/trunk@54276 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In the tests for updating a plugin or theme via Ajax, `wp_installing( true )` was called to prevent `wp_update_plugins()` or `wp_update_themes()` from running.
Since the subsequent `wp_installing( false )` call was in the same `try { ... }` block, it could not be executed if an exception was thrown, affecting other tests.
In this case, after rearranging the Ajax tests in [54722], this started affecting the `get_site_option()` calls in the tests for `wp_ajax_wp_compression_test()`.
By moving both `wp_installing()` calls out of the `try`/`catch` block, we can ensure the status is correctly restored.
Follow-up to [734/tests], [37150], [38168], [38710], [54722].
See #56793.
Built from https://develop.svn.wordpress.org/trunk@54723
git-svn-id: http://core.svn.wordpress.org/trunk@54275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This was previously used to delete the users created during `wpSetUpBeforeClass()`, however that now happens automatically in `WP_UnitTestCase_Base::tear_down_after_class()` via `_delete_all_data()`.
Follow-up to [35311], [37404], [38398].
See #56793.
Built from https://develop.svn.wordpress.org/trunk@54720
git-svn-id: http://core.svn.wordpress.org/trunk@54272 1a063a9b-81f0-0310-95a4-ce76da25c4cd
As the tests belong to either the `ms-excluded` or the `ms-required` group, the skipping should not be necessary.
While these methods were initially intended to be used in conjunction with the respective group, the PHPUnit configuration files for single site and multisite exclude these groups as appropriate, so calling these methods explicitly is no longer required.
Follow-up to [40520], [40543], [40564], [43005], [46683], [53011].
See #56793.
Built from https://develop.svn.wordpress.org/trunk@54719
git-svn-id: http://core.svn.wordpress.org/trunk@54271 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This was previously removed in [51870] and appears to be accidentally readded in [53561].
As the test belongs to the `ms-excluded` group, the skipping is unnecessary and does not affect anything in practice.
Follow-up to [46693], [49835], [51870], [53561].
See #56793.
Built from https://develop.svn.wordpress.org/trunk@54718
git-svn-id: http://core.svn.wordpress.org/trunk@54270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This aims to bring some consistency to the location of category function tests, as well as to make the tests more discoverable and easier to expand.
Follow-up to [28438], [28566], [31006], [31025], [37464], [28438], [31299], [36988], [42364], [42367], [42368], [46413], [53684].
See #56793.
Built from https://develop.svn.wordpress.org/trunk@54717
git-svn-id: http://core.svn.wordpress.org/trunk@54269 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This aims to bring some consistency to the location of pluggable function tests.
Includes:
* Renaming the test class to better reflect the intention of the tests.
* Adding a `@coversNothing` tag to the class DocBlock.
Follow-up to [34126], [53478], [54702].
Props pbearne, SergeyBiryukov.
See #56793, #56782.
Built from https://develop.svn.wordpress.org/trunk@54716
git-svn-id: http://core.svn.wordpress.org/trunk@54268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Based on feedback from network storage configurations there was a noticed slowdown due to the usage of the `path_join()` function. This needs more time to find a workaround.
Follow-up to [53934].
Props mreishus, SergeyBiryukov, desrosj, mikeschroder.
Reverts [53934].
See #56924.
Built from https://develop.svn.wordpress.org/trunk@54712
git-svn-id: http://core.svn.wordpress.org/trunk@54264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This change removes caching of global styles for logged in users, allowing "wp_global_styles" custom post type to be imported completely, regardless of any previously cached data. This change now relies on the lower-level native `WP_Query` cache invalidation methods for the global styles post type.
Follow-up to [52275], [54186].
Props anariel-design, bernhard-reiter, andrewserong, spacedmonkey, andraganescu, peterwilsoncc, oandregal, hellofromTonya.
Fixes#56901.
Built from https://develop.svn.wordpress.org/trunk@54706
git-svn-id: http://core.svn.wordpress.org/trunk@54258 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This change ensures custom styles for all third-party blocks are rendered on the front end if assets are set to be loaded on a per-block basis. Additionally, this change includes new unit tests to help prevent a similar bug in the future.
Props scruffian, aristath, poena, wildworks, ajlende, andraganescu, ndiego, gigitux, cbravobernal, ramonopoly, andrewserong, oandregal, hellofromTonya, bernhard-reiter.
Fixes#56915.
Built from https://develop.svn.wordpress.org/trunk@54703
git-svn-id: http://core.svn.wordpress.org/trunk@54255 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This introduces a GitHub Action workflow that performs the following steps for default themes:
- Test installing npm dependencies and running the build script (for relevant themes).
- Create ZIP files for the .org Theme directory and uploads them as workflow artifacts.
The workflow will only run on limited occasions, one of those being when Twenty Nineteen, Twenty Twenty, or Twenty Twenty-One is edited. These are the themes with build scripts that need to be tested for issues.
It can also be manually run through the GitHub Actions UI for occasions when the ZIP files are needed for a release.
Props peterwilsoncc, desrosj
Fixes#56898.
Built from https://develop.svn.wordpress.org/trunk@54699
git-svn-id: http://core.svn.wordpress.org/trunk@54251 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This aims to clarify that "Site Address (URL)" is a required field that should not be left blank, whether or not the site home page is intended to be different from the WordPress installation directory.
Follow-up to [1203], [3058], [5093], [5141], [13750], [41986].
Props digical, sabernhardt.
Fixes#50629.
Built from https://develop.svn.wordpress.org/trunk@54689
git-svn-id: http://core.svn.wordpress.org/trunk@54241 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In [54358], styling for Button blocks that had been removed from classic themes was reintroduced. However, it was added with a global scope, whereas editor styles are usually added with a `.editor-styles-wrapper` selector, which makes them more specific.
This change modifies the way that classic theme styles are added so that they also get wrapped in an `.editor-styles-wrapper` selector to match specificity.
Furthermore, adjust specificity for some Button block related styling in the editor for the Twenty Twelve and Twenty Twenty themes.
Merges [https://github.com/WordPress/gutenberg/pull/44731 Gutenberg PR 44731] into trunk.
Follow-up to [54358].
Props scruffian, cbravobernal, sabernhardt, audrasjb.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54687
git-svn-id: http://core.svn.wordpress.org/trunk@54239 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Introduce `WP_Query::generate_cache_key()` for generating the cache key used by the main database query.
This removes the need for a filter to test that cache keys do not include the WPDB placeholder causing unreachable cache keys. The tests now call `WP_Query::generate_cache_key()` directly.
The filter `wp_query_cache_key` is removed as a hard deprecation. The filter was not included in a stable release.
Follow up to [54634].
Props spacedmonkey, jorbin, azaozz, hellofromtonya, mukesh27, peterwilsoncc, desrosj, audrasjb, adamsilverstein, flixos90, davidbaumwald, joedolson, sergeybiryukov.
Fixes#56802.
Built from https://develop.svn.wordpress.org/trunk@54685
git-svn-id: http://core.svn.wordpress.org/trunk@54237 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When a ruleset error is encountered during a PHPCodeSniffer scan, an XML report is not generated and `cs2pr` will exit with a `0`.
In this situation, a workflow run will be marked as passing (even though a failure has occurred) due to the presence of `continue-on-error`.
This adjusts the logic in the Coding Standards and PHP Compatibility workflows to remove the need for the `continue-on-error` option and ensures all failures are accurately reflected within the GitHub Actions UI.
Follow up to [54371].
Props jrf, TobiasBg.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@54678
git-svn-id: http://core.svn.wordpress.org/trunk@54230 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This resolves a bug in Featured Image blocks where `object-fit` was being removed during the `render_callback`.
Props raduiason, pbiron, kebbet, SergeyBiryukov, bernhard-reiter, ironprogrammer, xknown, audrasjb, ckanderson22, ivanjeronimo, seriouslysenpai.
Fixes#56855.
Built from https://develop.svn.wordpress.org/trunk@54675
git-svn-id: http://core.svn.wordpress.org/trunk@54227 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This removes the dynamic aspect of the `createWorkflowDispatch()` call that dispatches a Failed Workflow run when another workflow encounters an issue.
By hardcoding `trunk` as the `ref`, the version of the workflow used will always be the latest, most up to date. This ensures older branches receive the bug fixes and improvements made in `trunk` without having to backport them.
See #55652.
Built from https://develop.svn.wordpress.org/trunk@54674
git-svn-id: http://core.svn.wordpress.org/trunk@54226 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When using the `CUSTOM_TAGS` constant, these global variables should be set to arrays:
* `$allowedposttags`
* `$allowedtags`
* `$allowedentitynames`
* `$allowedxmlentitynames`
This commit aims to improve developer experience by displaying a more helpful message to explain a PHP fatal error further in the code if any of these globals are either not set or not an array.
Note Using `CUSTOM_TAGS` is not recommended and should be considered deprecated. The `wp_kses_allowed_html` filter is more powerful and supplies context.
Follow-up to [832], [834], [2896], [13358], [21796], [28845], [43016], [48072].
Props doctorlai, pento, KnowingArt_com, bosconiandynamics, TJNowell, ironprogrammer, audrasjb, mukesh27, SergeyBiryukov.
Fixes#47357.
Built from https://develop.svn.wordpress.org/trunk@54672
git-svn-id: http://core.svn.wordpress.org/trunk@54224 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In `register_block_type`, continue to allow passing arrays as the `editor_script`, `script`, `view_script`, `editor_style`, and `style` arguments. Note that those fields were soft-deprecated in favor of their `_handles` counterparts in [54155], which would allow specifying multiple items. At the same time, the deprecated fields were limited to `string` or `null`.
However, this broke existing code that passed an array as one of those arguments. For backwards compatibility, this change thus restores the previous behavior. It is implemented in `WP_Block_Type` as a pair of `__get()` and `__set()` methods that wrap around the corresponding `_handles` members, which are arrays of strings.
It also affects the REST API endpoint for block types. The latter’s schema has never allowed for anything other than `string` or `null` for any of those fields. For this reason, it now returns the first element of the array stored in the corresponding `_handles` member in `WP_Block_Type`.
Follow-up [54155].
Props nendeb55, costdev, gziolo, spacedmonkey, mukesh27, sergeybiryukov, audrasjb.
Fixes#56707.
Built from https://develop.svn.wordpress.org/trunk@54670
git-svn-id: http://core.svn.wordpress.org/trunk@54222 1a063a9b-81f0-0310-95a4-ce76da25c4cd
`WP_Textdomain_Registry` was introduced in [53874] to store text domains and their language directory paths, addressing issues with just-in-time loading of textdomains when using locale switching and when using`load_*_textdomain()` functions.
Said change has inadvertently caused a performance regression exactly when using`load_*_textdomain()`, which still often is the case, where the cached information was not further used or even overridden.
This change addresses that issue by storing the default languages paths in a separate way, while at the same time making `WP_Textdomain_Registry` easier to maintain and adding new tests to catch future regressions.
Props flixos90, spacedmonkey, ocean90, SergeyBiryukov, costdev.
Fixes#39210.
Built from https://develop.svn.wordpress.org/trunk@54669
git-svn-id: http://core.svn.wordpress.org/trunk@54221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When used inline, the SVG needs the `aria-hidden`, `focusable`, and `viewBox` properties for accessibility. Additionally, this optimizes the SVG by using `cirlce` elements in place of `path`, and removing `clipPath`. There is no visible change, but the file is now one-third the size.
Props sabernhardt.
See #56703, #56357.
Built from https://develop.svn.wordpress.org/trunk@54662
git-svn-id: http://core.svn.wordpress.org/trunk@54214 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This updates the third-party action used to post a welcome message to pull requests opened by first time contributors.
This release updates the action to use Node.js version 16 instead of 12, the latter of which support has been deprecated for in GitHub Action runners.
The action has also changed from `bukboo/welcome-action` to `wow-action/welcome`.
See #56793.
Built from https://develop.svn.wordpress.org/trunk@54651
git-svn-id: http://core.svn.wordpress.org/trunk@54203 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The `save-state` and `set-output` commands have been deprecated in GitHub Actions. This removes all occurrences of the command within workflow steps.
This will not remove all deprecated notices from workflow summaries (some third-party actions still contain instances of these commands and need to be fixed upstream), but it will fix the notices caused by custom workflow code.
See #56820.
Built from https://develop.svn.wordpress.org/trunk@54649
git-svn-id: http://core.svn.wordpress.org/trunk@54201 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit:
* Adds default minimum font size limits so that min font size, where provided, does not become smaller than `14px`/`0.875rem`/`0.875em`.
* For font sizes of `< 14px` that have no defined minimum sizes, uses the font size to set the floor of the `clamp()` value.
This bugfix prevents converting existing small font sizes to clamp values that will reduce their font size even further in narrow widths. It therefore improves backward compatibility and accessibility.
Original PR from Gutenberg repository:
* [https://github.com/WordPress/gutenberg/pull/44993#44993 Fluid typography: add font size constraints]
Follow-up to [54260], [54360], [54497], [54500].
Props ramonopoly, andrewserong, isabel_brison, Joen, bernhard-reiter.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54646
git-svn-id: http://core.svn.wordpress.org/trunk@54198 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The [https://make.wordpress.org/core/2021/02/19/feature-plugin-rollback-update-failure/ Rollback Update Failure feature project] creates a temporary backup of plugins and themes before updating. This aims to make the update process more reliable and ensure that if a plugin or theme update fails, the previous version can be safely restored.
If the [https://wordpress.org/plugins/rollback-update-failure/ Rollback Update Failure plugin] is installed, `WP_Upgrader::install_package()` will use the `move_dir()` function from there for better performance. Instead of copying a directory from one location to another, it uses the `rename()` PHP function to speed up the process, which is instrumental in creating a temporary backup without a delay. If the renaming failed, it falls back to `copy_dir()` WP function.
This conditional aims to facilitate broader testing of the feature. It is temporary, until the plugin is merged into core.
Follow-up to [53578], [54484].
Props afragen, pbiron, costdev, davidbaumwald, audrasjb, jrf, SergeyBiryukov.
See #56057.
Built from https://develop.svn.wordpress.org/trunk@54643
git-svn-id: http://core.svn.wordpress.org/trunk@54195 1a063a9b-81f0-0310-95a4-ce76da25c4cd
[54080] refactored the logic in `get_network_option()`, `update_network_option()` and `delete_network_option()` to use the metadata API. However, this change resulted in issues with large multisite installs that utilize memcached having network options > 1MB in size.
This change reverts [54080] and all related follow-up changes.
Reverts [54080], [54081], and [54082]. Partially reverts [54267] and [54402].
Props pavelschoffer, rebasaurus, johnbillion, spacedmonkey, desrosj, rinatkhaziev.
Fixes#56845.
See #37181.
Built from https://develop.svn.wordpress.org/trunk@54637
git-svn-id: http://core.svn.wordpress.org/trunk@54189 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The logic for sending the `X-Pingback` header for single posts that allow pings was recently moved from `WP::handle_404()` to a more appropriate place in `WP::send_headers()`.
To check whether pings are open for a particular post, that logic relies on the `$wp_query` global, which is declared in `WP::handle_404()`, but not in `WP::send_headers()`
This commit ensures that `$wp_query` is globalized in `WP::send_headers()` too, so that the check works as expected.
Follow-up to [54250].
Props strategio, sabernhardt, dlh, davidbaumwald, SergeyBiryukov.
Fixes#56840.
Built from https://develop.svn.wordpress.org/trunk@54636
git-svn-id: http://core.svn.wordpress.org/trunk@54188 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Add in missing links and fix incorrect copy. Remove the "header & footer patterns" section. Fix the icons in the feature grid. Add images using temporary links for now. Update the header artwork for About, Credits, Freedoms, and Privacy.
See #56357.
Reviewed by audrasjb.
Props courane01, bph, webcommsat, audrasjb, dansoschin, richtabor.
Built from https://develop.svn.wordpress.org/trunk@54635
git-svn-id: http://core.svn.wordpress.org/trunk@54187 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Remove escape placeholder from query cache key, as placeholders are a based on a unique id on every request. This means that it is impossible for a cache to be reused, making queries that use escape placeholders such as `LIKE` searches, unable to be cached.
Props dhl, spacedmonkey, peterwilsoncc, desrosj, chaion07, davidbaumwald, mukesh27.
Fixes#56802.
Built from https://develop.svn.wordpress.org/trunk@54634
git-svn-id: http://core.svn.wordpress.org/trunk@54186 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit adds a unit test to check that `WP_Theme_JSON_Resolver::get_theme_data()` returns a `WP_Theme_JSON` object, and that an `add_theme_support()` call overrides the settings from `theme.json`.
Follow-up to [54443], [54493].
Props cbravobernal.
Fixes#56835.
Built from https://develop.svn.wordpress.org/trunk@54630
git-svn-id: http://core.svn.wordpress.org/trunk@54182 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This applies to:
* `$block_name` in `strip_core_block_namespace()`
* `$allowed_html` in `filter_block_content()`
* `$pagination_type` in `get_comments_pagination_arrow()`
Follow-up to [46896], [48794], [53138], [54181].
Props rakibwordpress, ironprogrammer, sabernhardt, SergeyBiryukov.
Fixes#56596.
Built from https://develop.svn.wordpress.org/trunk@54520
git-svn-id: http://core.svn.wordpress.org/trunk@54075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
After running `phpunit --filter test_import_theme_starter_content`, the following files were generated and left in place in the version-controlled `DIR_TESTDATA` directory, resulting in a dirty working copy of the project:
{{{
tests/phpunit/data/images/canola-150x150.jpg
tests/phpunit/data/images/canola-300x225.jpg
}}}
In the test, `canola.jpg` is mocked as an **existing attachment**. When the test invokes `WP_Customize_Manager::import_theme_starter_content()`, existing attachments are passed directly to `wp_generate_attachment_metadata()`, which does not make a copy of the file, and `wp_create_image_subsizes()` creates the above referenced files in the original image's location.
By contrast, `waffles.jpg`, also used in the test, is **not** set as an existing attachment, and in `import_theme_starter_content()` is passed to `media_handle_sideload()`, which makes a **copy** of the file in the `wp-content/uploads/` directory, and then calls `wp_create_image_subsizes()` against the new file. The resulting sub-sizes are generated in that location, and are cleaned up during `tear_down()`.
The test's `tear_down()` uses `remove_added_uploads()`, which only clears items created in `wp-content/uploads/` (i.e. `waffles*.jpg`), but not the files in the `DIR_TESTDATA` directory (`canola-*.jpg`).
This commit addresses the issue by creating a copy of the file in uploads. This better matches the intention of the test, as existing attachments will most likely be located in uploads and not in an arbitrary path like the test data directory.
Follow-up to [39276], [39346], [39411], [40142], [54424], [54425].
Props ironprogrammer, audrasjb, boniu91, dariak, SergeyBiryukov.
Fixes#56807.
Built from https://develop.svn.wordpress.org/trunk@54519
git-svn-id: http://core.svn.wordpress.org/trunk@54074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The previous implementation of checking whether the `args` parameter is an array of arrays used `array_filter()`, which would always loop the full array, even though we are only interested in finding one (the first) non-array to display a `_doing_it_wrong()` message.
This commit aims to improve readability and performance of this check by using a `foreach` loop instead, leaving it as soon as the first non-array argument is found.
Follow-up to [54339].
Props TobiasBg, audrasjb, costdev, SergeyBiryukov.
Fixes#56804.
Built from https://develop.svn.wordpress.org/trunk@54518
git-svn-id: http://core.svn.wordpress.org/trunk@54073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
In the WordPress 6.1 cycle, WP_Theme_JSON_Resolver::get_merged_data method has become a hot path that is called many times. By improving small things that are repeated multiple times, we get more performance wins.
This commit reduces the number of calls of the low-level WP_Theme_JSON->merge method, with the corresponding performance improvements.
Props oandregal, aristath, mukeshpanchal27.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54517
git-svn-id: http://core.svn.wordpress.org/trunk@54072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
A recent change to how WOFF files are processed in PHP 8.2 RC3 has caused a new test failure.
This temporarily marks the `test_wp_check_filetype_and_ext_with_filtered_woff()` test skipped until a deeper analysis can be performed.
Props SergeyBiryukov, jrf, desrosj, oandregal.
See #56817.
Built from https://develop.svn.wordpress.org/trunk@54508
git-svn-id: http://core.svn.wordpress.org/trunk@54067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
The newly introduced filters are renamed to use the `wp_theme_json_data{$context}` structure:
* `theme_json_default` renamed to `wp_theme_json_data_default`
* `theme_json_theme` renamed to `wp_theme_json_data_theme`
* `theme_json_blocks` renamed to `wp_theme_json_data_blocks`
* `theme_json_user` renamed to `wp_theme_json_data_user`
The following new filter gets the `wp_` prefix added:
* `theme_json_get_style_nodes` renamed to `wp_theme_json_get_style_nodes`
Follow-up to [56467], [54183], [54118].
Props kebbet, desrosj, mukesh27, ocean90, sergeybiryukov, davidbaumwald, hellofromTonya.
Fixes#56796.
Built from https://develop.svn.wordpress.org/trunk@54501
git-svn-id: http://core.svn.wordpress.org/trunk@54060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This is the start of the WordPress 6.1 about page, introducing new content and a first pass of the new style.
Props adampickering, joen, iamarinoh, dansoschin, desrosj, ryelle, cbringmann, annezazu, priethor, laurlittle, eidolonnight, jeffpaul, sabernhardt, ndiego, richtabor, spacedmonkey, marybaum, abhanonstopnewsuk, courane01, tweetythierry, adamsilverstein, flixos90, ironprogrammer.
See #56357.
Built from https://develop.svn.wordpress.org/trunk@54499
git-svn-id: http://core.svn.wordpress.org/trunk@54058 1a063a9b-81f0-0310-95a4-ce76da25c4cd
A check is added to verify if the block's `'attrs'` key exists before accessing it. If no, it defaults to an empty array.
How was this found?
WP 6.1 removed the attributes from the `core/page-list` block. When this block is being processed by `WP_Block_Supports::apply_block_supports()`, the key `'attrs'` does not exist in `self::$block_to_render`.
This commit includes a tiny micro-optimization by moving this line of code after the existing guard clause. Why? If the guard clause is triggered, the method bails out early, meaning the attributes code is not used. By moving it after the guard clause, it saves a tiny bit of memory and processing if this happens.
Follow-up to [49310], [54399].
Props petitphp, spacedmonkey, hellofromTonya.
Fixes#56799.
Built from https://develop.svn.wordpress.org/trunk@54498
git-svn-id: http://core.svn.wordpress.org/trunk@54057 1a063a9b-81f0-0310-95a4-ce76da25c4cd