Commit Graph

20168 Commits

Author SHA1 Message Date
Jb Audras
6189d64f31 Themes: Ensure WP_Theme::get_files() doesn't return unexpected values.
This change filters out empty entries from `WP_Theme::get_files()` before returning the array of files. This avoid returning an entry with `false` value when the directory of the theme does not exist.

Props dd32, opurockey, Rahmohn, audrasjb.
Fixes #53599.


git-svn-id: https://develop.svn.wordpress.org/trunk@53253 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-25 09:45:00 +00:00
Jb Audras
94c0fb7628 Docs: Use third-person singular verbs for function descriptions in wp-includes/nav-menu.php, as per docs standards.
See #54729.


git-svn-id: https://develop.svn.wordpress.org/trunk@53252 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-25 09:30:34 +00:00
Jb Audras
074aaf152f Docs: Typo correction in wp-includes/ms-functions.php docblock.
See #54729.


git-svn-id: https://develop.svn.wordpress.org/trunk@53251 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-25 09:23:22 +00:00
Jb Audras
1d39994ba6 Docs: Use third-person singular verbs for function descriptions in wp-includes/ms-load.php, as per docs standards.
See #54729.


git-svn-id: https://develop.svn.wordpress.org/trunk@53250 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-25 09:20:55 +00:00
Jb Audras
071d971d16 Docs: Use third-person singular verbs for function descriptions in wp-includes/capabilities.php, as per docs standards.
Props azouamauriac.
See #54729.



git-svn-id: https://develop.svn.wordpress.org/trunk@53249 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-24 21:30:21 +00:00
Jb Audras
47aa11c5a6 Docs: Use third-person singular verbs for function descriptions in Multisite WordPress API, as per docs standards.
See #54729.


git-svn-id: https://develop.svn.wordpress.org/trunk@53248 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-24 21:26:51 +00:00
Jb Audras
f1235f2cba Twenty Fifteen: Use #page height instead of body height in sidebar scroll calculation.
This changeset replaces `bodyHeight = $body.height();` with `bodyHeight = $('#page).height();`. It fixes a JS issue in some specific context, when there is content generated right before the closing `body` tag. For example, this happens when the HTML content is added using the `wp_footer` filter.

Props stephenharris, sabernhardt, audrasjb.
Fixes #40492.


git-svn-id: https://develop.svn.wordpress.org/trunk@53247 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-24 21:01:09 +00:00
Sergey Biryukov
b1a1bdd88c Code Modernization: Rename parameters that use reserved keywords in swp-includes/class-wp-customize-setting.php.
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit renames the `$default` parameter to `$default_value` in `WP_Customize_Setting` class methods.

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].

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

git-svn-id: https://develop.svn.wordpress.org/trunk@53246 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-24 00:26:03 +00:00
Sergey Biryukov
2d852f93b1 Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wp-customize-nav-menus.php.
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit renames the `$type` and `$object` parameters to `$object_type` and `$object_name` in `WP_Customize_Nav_Menus::load_available_items_query()`.

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].

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

git-svn-id: https://develop.svn.wordpress.org/trunk@53245 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-23 20:57:06 +00:00
Sergey Biryukov
9a8d52395c Docs: Correct the expected parameter type for WP_Customize_Manager::remove_preview_signature().
Before the method was deprecated, the parameter contained the value passed through for the `wp_die_handler` filter, which expects a callable function. 

Follow-up to [20926], [32535], [34320], [38810], [53242], [53243].

See #54729.

git-svn-id: https://develop.svn.wordpress.org/trunk@53244 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-22 10:54:07 +00:00
Sergey Biryukov
07e5c662c3 Code Modernization: Rename parameters that use reserved keywords in wp_die_*_handler filters.
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 `$callback` in `wp_die_*_handler` filters, which aims to make it easier to use a non-reserved parameter name for anyone utilizing these filters.

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].

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

git-svn-id: https://develop.svn.wordpress.org/trunk@53243 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-22 10:41:59 +00:00
Sergey Biryukov
09406cb537 Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wp-customize-manager.php.
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit:
* Renames the `$default` parameter to `$default_value` in `WP_Customize_Manager::post_value()`.
* Renames the `$return` parameter to `$callback` in `WP_Customize_Manager::remove_preview_signature()`.

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].

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

git-svn-id: https://develop.svn.wordpress.org/trunk@53242 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-22 10:29:45 +00:00
Sergey Biryukov
509b159eec Code Modernization: Rename parameters that use reserved keywords in wp-includes/block-supports/border.php.
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit renames the `$default` parameter to `$default_value` in `wp_has_border_feature_support()`.

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].

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

git-svn-id: https://develop.svn.wordpress.org/trunk@53240 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-21 21:03:05 +00:00
Sergey Biryukov
14d9ca8da6 Code Modernization: Rename parameters that use reserved keywords in wp-includes/atomlib.php.
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit renames the `$string` parameter to `$content` in `AtomParser::xml_escape()`.

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].

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

git-svn-id: https://develop.svn.wordpress.org/trunk@53239 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-21 11:22:45 +00:00
Peter Wilson
f341d73ad9 Posts, Post Types: Fix option validation in stick_post().
Normalize an invalid `sticky_posts` option to an empty array within `stick_post()`. This fixes a bug in which an unexpected option value would prevent new posts from being made sticky.

Follow up to [50380].

Props azouamauriac, denishua, kajalgohel, sergeybiryukov, costdev.
Fixes #55176.



git-svn-id: https://develop.svn.wordpress.org/trunk@53238 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-21 06:02:21 +00:00
Sergey Biryukov
e780f28357 Code Modernization: Rename parameters that use reserved keywords in bundled themes.
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 `$class` parameter to `$css_class` in:
 * `twentysixteen_excerpt()`
 * `twentynineteen_post_classes()`
* Renames the `$echo` parameter to `$display` in:
 * `twentythirteen_entry_date()`
 * `twentytwenty_generate_css()`
 * `twentytwenty_site_logo()`
 * `twentytwenty_site_description()`
 * `twenty_twenty_one_generate_css()`

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].

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

git-svn-id: https://develop.svn.wordpress.org/trunk@53236 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-20 14:22:21 +00:00
Jb Audras
c63de7818e Docs: Docs: Use third-person singular verbs for function descriptions in wp-includes/blocks.php and wp-includes/script-loader.php, per the documentation standards.
See #54729.


git-svn-id: https://develop.svn.wordpress.org/trunk@53235 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-20 14:07:53 +00:00
Jb Audras
84f3b34e2d Editor: Move wp_enqueue_block_style() to wp-includes/script-loader.php, for better consistency.
As a result of [52741] and [52743], `wp_enqueue_block_support_styles()` was moved to `wp-includes/script-loader.php`. However, `wp_enqueue_block_style()` was still defined in `wp-includes/blocks.php`. This changeset also moves `wp_enqueue_block_support_styles()` to `wp-includes/script-loader.php` for better consistency.

Follow-up to [52741], [52743].

Props SergeyBiryukov, mukesh27, audrasjb.
Fixes #55182.
See #55148.


git-svn-id: https://develop.svn.wordpress.org/trunk@53234 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-20 13:51:21 +00:00
Jb Audras
8cb291cbd0 Feeds: Use latest comment date for the Last-Modified header of comments feed.
Previously, the `Last-Modified` header of comments feed was using the date/time of the last comment. This behavior was breaking caching and causing feed readers to believe there is no new content even when there might be new posts.

This commit changes this behavior to use the newest date from both `get_lastcommentmodified()` and `get_lastpostmodified()` functions instead of only using the result from `get_lastcommentmodified()`.

Props xiven, mauteri, costdev, audrasjb.
Fixes #47968.


git-svn-id: https://develop.svn.wordpress.org/trunk@53233 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-20 12:46:01 +00:00
Sergey Biryukov
8ad5aec839 Code Modernization: Rename parameters that use reserved keywords in wp-admin/install-helper.php.
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit renames the `$default` parameter to `$default_value` in `check_column()`.

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].

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

git-svn-id: https://develop.svn.wordpress.org/trunk@53232 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-20 11:17:05 +00:00
Sergey Biryukov
2fcc00815b Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/upgrade.php.
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit renames the `$public` parameter to `$is_public` in `wp_install()`.

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].

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

git-svn-id: https://develop.svn.wordpress.org/trunk@53230 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-20 10:44:46 +00:00
Jb Audras
6045bacda1 Docs: Misc fixes and improvements in the Administration Media API docblocks, as per documentation standards.
See #54729.


git-svn-id: https://develop.svn.wordpress.org/trunk@53229 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-20 08:28:00 +00:00
Jb Audras
e666adfaa4 Media: Remove attachment_fields_to_save filter and deprecate image_attachment_fields_to_save().
This filter prevented removing attachment titles. This changeset removes the filter and deprecates the related function since it is no longer used.

Props dromero20, desrosj, Junaidkbr, francina, antpb, audrasjb, aadilali, etaproducto, azouamauriac, Boniu91, SergeyBiryukov.
Fixes #39108.


git-svn-id: https://develop.svn.wordpress.org/trunk@53228 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-20 08:11:34 +00:00
Peter Wilson
059cab0e71 Autosave: Compare heartbeat intervals in same unit.
Move the conversion of `minimalInterval` to milliseconds to be grouped with the other time conversions from seconds to milliseconds.

This fixes a bug in which the minimal and main intervals were compared after the former had been converted to milliseconds but the latter had not. This could cause the heatbeat interval to blow out to unexpectedly high values if the minimal interval was set.

Props tabrisrp, sabernhardt, SergeyBiryukov, audrasjb.
Fixes #54825.



git-svn-id: https://develop.svn.wordpress.org/trunk@53226 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-20 05:53:25 +00:00
Peter Wilson
dec48ad77a Comments: Improve accuracy of get_comment_count() docblock.
Remove reference to uncached database query now `get_comment_count()` uses `WP_Comment_Query` which contains caching. Remove reference to `$wpdb` global, it is no longer used.

Follow up to [53036].

Fixes #19901.


git-svn-id: https://develop.svn.wordpress.org/trunk@53225 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-20 05:51:21 +00:00
Sergey Biryukov
419e8248d6 Post WordPress 6.0 Beta 2 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@53224 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-19 16:39:38 +00:00
Sergey Biryukov
e467197f4f WordPress 6.0 Beta 2.
git-svn-id: https://develop.svn.wordpress.org/trunk@53223 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-19 16:12:34 +00:00
Sergey Biryukov
027f723d80 Menus: Use correct parameter in _wp_nav_menu_meta_box_object().
Follow-up to [53220].

Props davidbaumwald.
See #55327.

git-svn-id: https://develop.svn.wordpress.org/trunk@53222 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-19 15:57:57 +00:00
David Baumwald
e31128ecb7 Twenty Twenty-One: Correct translator comment in twenty_twenty_one_continue_reading_text.
This commit updates the translator comment in `twenty_twenty_one_continue_reading_text` to indicate that the text is visually hidden.  This change also corrects the comment above the `the_content_more_link` filter to reference the content, not the excerpt.

Props sabernhardt, costdev.
Fixes #55564.

git-svn-id: https://develop.svn.wordpress.org/trunk@53221 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-19 15:21:43 +00:00
Sergey Biryukov
48e5ac7bd5 Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/template.php.
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit:
* Renames the `$echo` parameter to `$display` in:
 * `wp_popular_terms_checklist()`
 * `_post_states()`
 * `_media_states()`
* Renames the `$default` parameter to `$default_term` in `wp_popular_terms_checklist()`.
* Renames the `$default` parameter to `$default_template` in `page_template_dropdown()`.
* Renames the `$default` parameter to `$default_page` in `parent_dropdown()`.
* Renames the `$object` parameter to `$data_object` in:
 * `do_block_editor_incompatible_meta_box()`
 * `do_meta_boxes()`
 * `do_accordion_sections()`
* Amends the `$item_object` parameter in other functions for consistency:
 * `wp_nav_menu_item_post_type_meta_box()`
 * `wp_nav_menu_item_taxonomy_meta_box()`
 * `_wp_nav_menu_meta_box_object()`

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207], [53215], [53216].

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

git-svn-id: https://develop.svn.wordpress.org/trunk@53220 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-19 15:11:22 +00:00
Greg Ziółkowski
5d3a78bbd8 Editor: Update WordPress packages for 6.0 Beta 2
Included cherry-picked commits from the Gutenberg plugin that fix bugs discovered after WordPress 6.0 Beta 1.

Props zieladam, ndiego.
See #55567.



git-svn-id: https://develop.svn.wordpress.org/trunk@53219 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-19 15:08:48 +00:00
Greg Ziółkowski
32f1bdeec6 REST API: Add array argument to getItems for Pattern Directory endopoint
Since http://api.wordpress.org/patterns API supports array parameters, there is no need to implode slug values inside the _register_remote_theme_patterns function.
Both WP_REST_Pattern_Directory_Controller and _register_remote_theme_patternsmust be updated to support array request arguments.

Props antonvlasenko.
Fixes #55574.
Follow-up #55505, [53152].




git-svn-id: https://develop.svn.wordpress.org/trunk@53218 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-19 14:56:40 +00:00
Greg Ziółkowski
5ae266fdc4 REST API: Respect _fields query arg in preloaded requests
Ensures that preloaded request can include a `_fields` query param that asks that only selected response fields are returned.

Props jsnajdr, timothyblynjacobs. 
Fixes #55213.
See #55567.



git-svn-id: https://develop.svn.wordpress.org/trunk@53217 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-19 14:38:16 +00:00
Sergey Biryukov
abaee6aefb Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/taxonomy.php.
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit:
* Renames the `$parent` parameter to `$category_parent` in `category_exists()` and `wp_create_category()`. This matches the category object property of the same name.
* Amends similar parameters in `dropdown_categories()` and `wp_dropdown_cats()` 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].

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

git-svn-id: https://develop.svn.wordpress.org/trunk@53216 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-19 13:49:19 +00:00
Sergey Biryukov
8c1abdcf8a Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/plugin.php.
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit:
* Renames the `$function` parameter to `$callback` in:
 * `add_menu_page()`
 * `add_submenu_page()`
 * `add_management_page()`
 * `add_options_page()`
 * `add_theme_page()`
 * `add_plugins_page()`
 * `add_users_page()`
 * `add_dashboard_page()`
 * `add_posts_page()`
 * `add_media_page()`
 * `add_links_page()`
 * `add_pages_page()`
 * `add_comments_page()`
* Renames the `$echo` parameter to `$display` in `menu_page_url()`.
* Renames the `$parent` parameter to `$parent_page` in `get_admin_page_parent()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203], [53207].

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

git-svn-id: https://develop.svn.wordpress.org/trunk@53215 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-19 12:46:24 +00:00
Greg Ziółkowski
c755258903 Editor: Fix Comment Query block isn't lazy loading meta data
Related GitHub issue: https://github.com/WordPress/gutenberg/issues/40241.
Primes comment meta data cache within calls to WP_Comment_Query.

Props peterwilsoncc, cbravobernal.
See #55567.
Follow-up [53138].




git-svn-id: https://develop.svn.wordpress.org/trunk@53214 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-19 12:37:53 +00:00
Greg Ziółkowski
7e65fcbbef Editor: Include the PHP file for the Cover block
This file is copied by the build process but it also needs to be versioned so unit tests can run without issues.

Follow-up [53212].
See #55580.



git-svn-id: https://develop.svn.wordpress.org/trunk@53213 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-19 11:49:22 +00:00
Greg Ziółkowski
8fafc11932 Editor: Correctly register the dynamic Cover block
The new "Featured Image" enhancement is handled dynamically, so we need to update how the Cover block is handled in the build processa and registered in the code.

Props ironprogrammer, costdev, Mamaduka, chaion07.
Fixes #55580.



git-svn-id: https://develop.svn.wordpress.org/trunk@53212 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-19 11:35:50 +00:00
Greg Ziółkowski
87dc304715 Code Quality: Fix reported undefined $script_uri variable notice
The code editor reported this issue while mamduka was browsing the blocks.php file. PHP considers variables undefined until a value is assigned (or the global keyword is used).

Follow-up for [53091].
Props mamaduka, peterwilsoncc.
See 55567.



git-svn-id: https://develop.svn.wordpress.org/trunk@53211 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-19 09:56:02 +00:00
Greg Ziółkowski
e8df37e341 REST API: Add inserter field to the schema of Patterns endpoint
Backports changes from https://github.com/WordPress/gutenberg/pull/40416. Adds the missing `inserter` field to the Patterns item schema. This field was omitted from the response, and patterns that should be hidden in the inserter were visible.

Props mamaduka, ndiego.
See #55567.
Follow-up [53152].




git-svn-id: https://develop.svn.wordpress.org/trunk@53210 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-19 09:39:42 +00:00
Greg Ziółkowski
699853bbc4 REST API: Don't load remote patterns twice in the controller
This PR aims to fix an issue with fetching remote patterns multiple times inside the WP_REST_Block_Patterns_Controller::get_items method.

Follow-up [53152].

Props antonvlasenko.
See #55567.




git-svn-id: https://develop.svn.wordpress.org/trunk@53209 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-19 09:26:20 +00:00
Jorge Costa
2c2b5d0cfd Block editor: Prevent styles from being added in the site editor.
The site editor, unlike other editors, generates the styles coming from global styles (presets, styles) dynamically in the client. This is because the user can modify any value that we need to consolidate (merge core, theme, and user style preferences). We don't want to have the global styles twice, as it introduces subtle bugs.

Props oandregal, youknowriad.
See #55567.

git-svn-id: https://develop.svn.wordpress.org/trunk@53208 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-18 17:10:17 +00:00
Sergey Biryukov
a7b2e1b565 Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/nav-menu.php.
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit:
* Renames the `$echo` parameter to `$display` in `wp_nav_menu_disabled_check()`.
* Renames the `$object` parameter to `$item_object` in:
 * `wp_nav_menu_item_post_type_meta_box()`
 * `wp_nav_menu_item_taxonomy_meta_box()`
 * `_wp_nav_menu_meta_box_object()`

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198], [53203].

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

git-svn-id: https://develop.svn.wordpress.org/trunk@53207 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-18 15:20:16 +00:00
Jb Audras
658906b3ba Docs: Replace Codex links with the corresponding page on DevHub.
The Codex page for `WP_Object_Cache` already redirects to the corresponding DevHub page.

See #54729.


git-svn-id: https://develop.svn.wordpress.org/trunk@53206 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-18 15:06:24 +00:00
Jb Audras
9e0b155a73 Docs: Update a link to the Custom Elements spec in force_balance_tags() docblock.
This changeset replaces a link to the outdated W3C specs on Custom Elements with a link to the corresponding WhatWG specification.

See #54729.


git-svn-id: https://develop.svn.wordpress.org/trunk@53204 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-18 14:33:16 +00:00
Sergey Biryukov
a67c03172a Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/ms.php.
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit renames the `$echo` parameter to `$display_message` in `upload_is_user_over_quota()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014], [53029], [53039], [53116], [53117], [53137], [53174], [53184], [53185], [53192], [53193], [53198].

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

git-svn-id: https://develop.svn.wordpress.org/trunk@53203 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-18 10:31:40 +00:00
Jb Audras
24d9f5a568 Docs: Update MDN link in send_frame_options_header() docblock.
The X-Frame-Options MDN documentation has been moved to `/docs/Web/HTTP/Headers/X-Frame-Options`. This changeset updates the link accordingly.

See #54729.


git-svn-id: https://develop.svn.wordpress.org/trunk@53202 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-18 10:16:20 +00:00
Sergey Biryukov
7184c2affa Docs: Use third-person singular verbs for function descriptions in wp-admin/includes/meta-boxes.php, per the documentation standards.
See #54729.

git-svn-id: https://develop.svn.wordpress.org/trunk@53201 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-17 17:55:05 +00:00
Sergey Biryukov
ac2e1b125d Docs: Add missing descriptions for function parameters in wp-admin/includes/meta-boxes.php.
See #54729.

git-svn-id: https://develop.svn.wordpress.org/trunk@53200 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-17 17:45:05 +00:00
Sergey Biryukov
8c9af98160 Coding Standards: Simplify long conditions in xfn_check().
Add some comments for clarity.

Follow-up to [2051], [4990], [53198].

See #54728.

git-svn-id: https://develop.svn.wordpress.org/trunk@53199 602fd350-edb4-49c9-b593-d223f7449a82
2022-04-17 17:24:27 +00:00