Commit Graph

19310 Commits

Author SHA1 Message Date
Sergey Biryukov
69be4c73ff Docs: Add missing documentation for WP_*_Query::get_search_sql() method parameters.
Includes renaming the `$cols` parameter to `$columns` for consistency across the classes.

Follow-up to [42876], [53272-53276].

See #54729.
Built from https://develop.svn.wordpress.org/trunk@53280


git-svn-id: http://core.svn.wordpress.org/trunk@52869 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 14:04:10 +00:00
Sergey Biryukov
5ac4bf5ec6 Docs: Correct alignment for the customize_nav_menu_available_items filter DocBlock.
Follow-up to [53245].

See #54729.
Built from https://develop.svn.wordpress.org/trunk@53279


git-svn-id: http://core.svn.wordpress.org/trunk@52868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 13:44:15 +00:00
gziolo
b9f396743c Editor: Update WordPress packages for 6.0 Beta 3
Included cherry-picked commits from the Gutenberg plugin that fix bugs discovere after WordPress 6.0 Beta 2.

Props zieladam, ndiego.
See #55567.


Built from https://develop.svn.wordpress.org/trunk@53278


git-svn-id: http://core.svn.wordpress.org/trunk@52867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 13:42:07 +00:00
Sergey Biryukov
cc6dcc2623 Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wp-query.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 `$array` parameter to `$query_vars` in `WP_Query::fill_query_vars()`.
* Renames the `$default` parameter to `$default_value` in `WP_Query::get()`.

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

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53277


git-svn-id: http://core.svn.wordpress.org/trunk@52866 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 13:32:11 +00:00
Sergey Biryukov
901dae255d Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wp-user-query.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 `$search` in `WP_User_Query::get_search_sql()`.

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

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53276


git-svn-id: http://core.svn.wordpress.org/trunk@52865 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 11:47:26 +00:00
Sergey Biryukov
1c5a65884a Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wp-term-query.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 `$search` in `WP_Term_Query::get_search_sql()`.

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

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53275


git-svn-id: http://core.svn.wordpress.org/trunk@52864 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 11:46:18 +00:00
Sergey Biryukov
e333f174de Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wp-site-query.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 `$search` in `WP_Site_Query::get_search_sql()`.

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

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53274


git-svn-id: http://core.svn.wordpress.org/trunk@52863 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 11:44:15 +00:00
Sergey Biryukov
27eff4bd87 Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wp-network-query.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 `$search` in `WP_Network_Query::get_search_sql()`.

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

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53273


git-svn-id: http://core.svn.wordpress.org/trunk@52862 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 11:43:07 +00:00
Sergey Biryukov
84e3a59385 Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wp-comment-query.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 `$search` in `WP_Comment_Query::get_search_sql()`.

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

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53272


git-svn-id: http://core.svn.wordpress.org/trunk@52861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 11:41:10 +00:00
Sergey Biryukov
adec401ff7 Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wp-image-editor.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 `WP_Image_Editor::make_image()`.

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

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53271


git-svn-id: http://core.svn.wordpress.org/trunk@52860 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 11:31:07 +00:00
Sergey Biryukov
f5f05eb2cc Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wp-image-editor-gd.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 `WP_Image_Editor_GD::make_image()`.

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

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53270


git-svn-id: http://core.svn.wordpress.org/trunk@52859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 11:25:08 +00:00
Sergey Biryukov
bbf6ffb769 Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wp-embed.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 `$match` parameter to `$matches` in `WP_Embed::autoembed_callback()`.

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

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53269


git-svn-id: http://core.svn.wordpress.org/trunk@52858 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 10:00:09 +00:00
gziolo
1dabd8df68 Editor: Register 'lock' attribute for every block on the server
Backports changes from https://github.com/WordPress/gutenberg/pull/40468.

The lock attribute needs to be supported by every block, but currently, it is only done on the client site. As a result, it was causing block rendered API requests to fail when blocks are locked.

Props mamaduka, peterwilsoncc.
See #55567.



Built from https://develop.svn.wordpress.org/trunk@53268


git-svn-id: http://core.svn.wordpress.org/trunk@52857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 09:50:12 +00:00
audrasjb
22de3f7711 Widgets: Fix Classic Widgets screen toggle response on small screens.
This changeset updates the toogle logic to fix Widget's responsive behavior on Classic Widgets screen.

Props inc2734, kmix39, dlh, desrosj, costdev, Boniu91.
Fixes #48896.

Built from https://develop.svn.wordpress.org/trunk@53267


git-svn-id: http://core.svn.wordpress.org/trunk@52856 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 06:54:09 +00:00
audrasjb
813c4d604c Bootstrap/load: Move administration related hooks to admin-filters.php.
This change moves some administration related hooks from `default-filters.php` to `admin-filters.php`. It also updates the `default-filters.php` docblock to indicate that contextualized hooks should be located in the most appropriate place.

Props dlh, hellofromTonya, antonvlasenko, audrasjb, azaozz.
Fixes #54795.

Built from https://develop.svn.wordpress.org/trunk@53266


git-svn-id: http://core.svn.wordpress.org/trunk@52855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 06:32:08 +00:00
audrasjb
29cc1e94c0 Docs: Use third-person singular verbs for function descriptions in Core Comment API and Comment template functions.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@53265


git-svn-id: http://core.svn.wordpress.org/trunk@52854 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 06:20:08 +00:00
Peter Wilson
e9610a5d20 Administration: Trigger a notice for incorrect add_menu_page() parameter.
Trigger a notice (via `_doing_it_wrong()`) for developers incorrectly setting the position when calling `add_menu_page()`.

Modify a similar message in `add_submenu_page()` to combine near identical strings and match the error description to the conditions in which it is called.

Follow up to [52569], [53104].

Fixes #40927.

Built from https://develop.svn.wordpress.org/trunk@53264


git-svn-id: http://core.svn.wordpress.org/trunk@52853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-26 02:59:08 +00:00
davidbaumwald
df148d90fc Twenty Twenty-One: Make translator comments referencing the post title consistent.
Follow-up to [53221].

Props SergeyBiryukov.
Fixes #55564.
Built from https://develop.svn.wordpress.org/trunk@53263


git-svn-id: http://core.svn.wordpress.org/trunk@52852 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 23:11:10 +00:00
gziolo
77c9ef30d7 Build: Update the constant used to remove experimental Gutenberg code
We missed the change for blocks that got applied to packages. `process.env.GUTENBERG_PHASE` got renamed to `process.env.IS_GUTENBERG_PLUGIN`.

See #55567.
Follow-up for [53157].


Built from https://develop.svn.wordpress.org/trunk@53262


git-svn-id: http://core.svn.wordpress.org/trunk@52851 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 17:03:10 +00:00
gziolo
19d31e1b42 Tests: Update Gallery block unit tests to new gallery format
The Gallery block unit tests still use the old format, so this updates it to the new format that uses nested Image blocks.

Props glendaviesnz.
Fixes #55571.


Built from https://develop.svn.wordpress.org/trunk@53261


git-svn-id: http://core.svn.wordpress.org/trunk@52850 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 16:57:10 +00:00
gziolo
32bbe9b0b9 Editor: Fix styles for nested elements (link color)
This fixes an issue by which link color behaves differently in the editor and front end.

Related Gutenberg PR: https://github.com/WordPress/gutenberg/pull/37728.

Props oandregal.
See #55567.


Built from https://develop.svn.wordpress.org/trunk@53260


git-svn-id: http://core.svn.wordpress.org/trunk@52849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 16:37:08 +00:00
gziolo
287662fca1 Editor: Add default comment status to discussion settings
This is a backport that exposes the default_comments_status option in the Editor, under the discussion settings, which then is then used by the Post Comments and Post Comments Form blocks.

Related change in Gutenberg: https://github.com/WordPress/gutenberg/pull/40484.

Props luisherranz.
See #55567.


Built from https://develop.svn.wordpress.org/trunk@53259


git-svn-id: http://core.svn.wordpress.org/trunk@52848 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 16:16:10 +00:00
gziolo
f7dde1e53a Tests: Add missing unit tests to Comment Template block
Follow-up for [53138], [53172].
Props darerodz.
See #55567.


Built from https://develop.svn.wordpress.org/trunk@53258


git-svn-id: http://core.svn.wordpress.org/trunk@52847 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 16:12:09 +00:00
Sergey Biryukov
5097c83eac Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wp-customize-widgets.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_Widgets` 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], [53246].

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53257


git-svn-id: http://core.svn.wordpress.org/trunk@52846 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 13:29:09 +00:00
audrasjb
8f93e5f2dd Docs: Use third-person singular verbs for function descriptions in WP_User_Query Class, as per docs standards.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@53256


git-svn-id: http://core.svn.wordpress.org/trunk@52845 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 13:05:10 +00:00
audrasjb
120f9b9eae Users: Make sure WP_User_Query can be filtered using the fields parameter.
This change ensures the `fields` parameter is taken into account when running `WP_User_Query` by fixing the conditional statement used to process the `fields` param.

Props rilwis, peterwilsoncc, NomNom99, hellofromTonya, audrasjb, rilwis, Boniu91.
Fixes #53177.

Built from https://develop.svn.wordpress.org/trunk@53255


git-svn-id: http://core.svn.wordpress.org/trunk@52844 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 12:57:09 +00:00
audrasjb
a74d3ede67 Docs: Use third-person singular verbs for function descriptions in WP_Theme Class, as per docs standards.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@53254


git-svn-id: http://core.svn.wordpress.org/trunk@52843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 09:54:07 +00:00
audrasjb
50050b2f59 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.

Built from https://develop.svn.wordpress.org/trunk@53253


git-svn-id: http://core.svn.wordpress.org/trunk@52842 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 09:46:08 +00:00
audrasjb
2c0a330fba Docs: Use third-person singular verbs for function descriptions in wp-includes/nav-menu.php, as per docs standards.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@53252


git-svn-id: http://core.svn.wordpress.org/trunk@52841 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 09:32:09 +00:00
audrasjb
dc8a2658e4 Docs: Typo correction in wp-includes/ms-functions.php docblock.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@53251


git-svn-id: http://core.svn.wordpress.org/trunk@52840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 09:25:09 +00:00
audrasjb
baf41c1fb9 Docs: Use third-person singular verbs for function descriptions in wp-includes/ms-load.php, as per docs standards.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@53250


git-svn-id: http://core.svn.wordpress.org/trunk@52839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-25 09:22:15 +00:00
audrasjb
5d93f8d388 Docs: Use third-person singular verbs for function descriptions in wp-includes/capabilities.php, as per docs standards.
Props azouamauriac.
See #54729.


Built from https://develop.svn.wordpress.org/trunk@53249


git-svn-id: http://core.svn.wordpress.org/trunk@52838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-24 21:32:06 +00:00
audrasjb
365afa3b9c Docs: Use third-person singular verbs for function descriptions in Multisite WordPress API, as per docs standards.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@53248


git-svn-id: http://core.svn.wordpress.org/trunk@52837 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-24 21:28:07 +00:00
audrasjb
9564a68697 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.

Built from https://develop.svn.wordpress.org/trunk@53247


git-svn-id: http://core.svn.wordpress.org/trunk@52836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-24 21:03:10 +00:00
Sergey Biryukov
8ca3012db9 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.
Built from https://develop.svn.wordpress.org/trunk@53246


git-svn-id: http://core.svn.wordpress.org/trunk@52835 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-24 00:28:08 +00:00
Sergey Biryukov
ccde5b8bd3 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.
Built from https://develop.svn.wordpress.org/trunk@53245


git-svn-id: http://core.svn.wordpress.org/trunk@52834 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-23 20:59:10 +00:00
Sergey Biryukov
af5365ff02 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.
Built from https://develop.svn.wordpress.org/trunk@53244


git-svn-id: http://core.svn.wordpress.org/trunk@52833 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-22 10:56:13 +00:00
Sergey Biryukov
752429a58e 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.
Built from https://develop.svn.wordpress.org/trunk@53243


git-svn-id: http://core.svn.wordpress.org/trunk@52832 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-22 10:43:20 +00:00
Sergey Biryukov
2bc70fc658 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.
Built from https://develop.svn.wordpress.org/trunk@53242


git-svn-id: http://core.svn.wordpress.org/trunk@52831 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-22 10:31:15 +00:00
audrasjb
2b25ad7c7b Build/Test Tools: Typo correction in rss2 unit tests.
Follow-up to [53233].

Props SergeyBiryukov.
Fixes #47968.

Built from https://develop.svn.wordpress.org/trunk@53241


git-svn-id: http://core.svn.wordpress.org/trunk@52830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-21 23:13:12 +00:00
Sergey Biryukov
01a28c0031 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.
Built from https://develop.svn.wordpress.org/trunk@53240


git-svn-id: http://core.svn.wordpress.org/trunk@52829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-21 21:05:11 +00:00
Sergey Biryukov
88b6ade46a 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.
Built from https://develop.svn.wordpress.org/trunk@53239


git-svn-id: http://core.svn.wordpress.org/trunk@52828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-21 11:24:17 +00:00
Peter Wilson
7082f4dc84 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.


Built from https://develop.svn.wordpress.org/trunk@53238


git-svn-id: http://core.svn.wordpress.org/trunk@52827 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-21 06:04:15 +00:00
Peter Wilson
7821c369eb Tests, Build Tools: Improve version compatibility tests.
Improve tests for `is_wp_version_compatible()` and `is_php_version_compatible()`.

Follow up to [53227].

Props costdev, SergeyBiryukov.
Fixes #54257.


Built from https://develop.svn.wordpress.org/trunk@53237


git-svn-id: http://core.svn.wordpress.org/trunk@52826 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-21 01:02:14 +00:00
Sergey Biryukov
89f24e9c61 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.
Built from https://develop.svn.wordpress.org/trunk@53236


git-svn-id: http://core.svn.wordpress.org/trunk@52825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 14:24:12 +00:00
audrasjb
6ef5625ac2 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.

Built from https://develop.svn.wordpress.org/trunk@53235


git-svn-id: http://core.svn.wordpress.org/trunk@52824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 14:09:11 +00:00
audrasjb
4d3dbe477a 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.

Built from https://develop.svn.wordpress.org/trunk@53234


git-svn-id: http://core.svn.wordpress.org/trunk@52823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 13:53:16 +00:00
audrasjb
943e956379 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.

Built from https://develop.svn.wordpress.org/trunk@53233


git-svn-id: http://core.svn.wordpress.org/trunk@52822 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 12:47:11 +00:00
Sergey Biryukov
0cc2cb34cd 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.
Built from https://develop.svn.wordpress.org/trunk@53232


git-svn-id: http://core.svn.wordpress.org/trunk@52821 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 11:19:12 +00:00
Sergey Biryukov
5fad544f8d Tests: Update the test for wp_install() signature.
Follow-up to [53230].

See #55327.
Built from https://develop.svn.wordpress.org/trunk@53231


git-svn-id: http://core.svn.wordpress.org/trunk@52820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 11:06:07 +00:00
Sergey Biryukov
91ad9dbb07 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.
Built from https://develop.svn.wordpress.org/trunk@53230


git-svn-id: http://core.svn.wordpress.org/trunk@52819 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 10:46:09 +00:00
audrasjb
3d7603869b Docs: Misc fixes and improvements in the Administration Media API docblocks, as per documentation standards.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@53229


git-svn-id: http://core.svn.wordpress.org/trunk@52818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 08:29:08 +00:00
audrasjb
aab2815d58 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.

Built from https://develop.svn.wordpress.org/trunk@53228


git-svn-id: http://core.svn.wordpress.org/trunk@52817 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 08:13:10 +00:00
Peter Wilson
eeedcfac4b Build, Test Tools: Test PHP and WP compatibility functions.
Introduce tests for `is_php_version_compatible()` and `is_wp_version_compatible()`.

Props pbearne, hellofromTonya, mikeschroder, peterwilsoncc, toro_unit.
Fixes #54257.

Built from https://develop.svn.wordpress.org/trunk@53227


git-svn-id: http://core.svn.wordpress.org/trunk@52816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 06:01:09 +00:00
Peter Wilson
1b5dd9b426 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.


Built from https://develop.svn.wordpress.org/trunk@53226


git-svn-id: http://core.svn.wordpress.org/trunk@52815 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 05:55:06 +00:00
Peter Wilson
40942c2695 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.

Built from https://develop.svn.wordpress.org/trunk@53225


git-svn-id: http://core.svn.wordpress.org/trunk@52814 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-20 05:53:11 +00:00
Sergey Biryukov
8aef26cfe3 Post WordPress 6.0 Beta 2 version bump.
Built from https://develop.svn.wordpress.org/trunk@53224


git-svn-id: http://core.svn.wordpress.org/trunk@52813 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 16:41:08 +00:00
Sergey Biryukov
70fc105ce0 WordPress 6.0 Beta 2.
Built from https://develop.svn.wordpress.org/trunk@53223


git-svn-id: http://core.svn.wordpress.org/trunk@52812 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 16:14:10 +00:00
Sergey Biryukov
eeb9f68181 Menus: Use correct parameter in _wp_nav_menu_meta_box_object().
Follow-up to [53220].

Props davidbaumwald.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53222


git-svn-id: http://core.svn.wordpress.org/trunk@52811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 15:59:10 +00:00
davidbaumwald
5892153992 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.
Built from https://develop.svn.wordpress.org/trunk@53221


git-svn-id: http://core.svn.wordpress.org/trunk@52810 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 15:23:11 +00:00
Sergey Biryukov
9ce061ae8c 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.
Built from https://develop.svn.wordpress.org/trunk@53220


git-svn-id: http://core.svn.wordpress.org/trunk@52809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 15:13:08 +00:00
gziolo
6aead54d17 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.


Built from https://develop.svn.wordpress.org/trunk@53219


git-svn-id: http://core.svn.wordpress.org/trunk@52808 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 15:11:17 +00:00
gziolo
c795115b0a 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].



Built from https://develop.svn.wordpress.org/trunk@53218


git-svn-id: http://core.svn.wordpress.org/trunk@52807 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 14:58:09 +00:00
gziolo
d2e9cf1f81 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.


Built from https://develop.svn.wordpress.org/trunk@53217


git-svn-id: http://core.svn.wordpress.org/trunk@52806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 14:40:09 +00:00
Sergey Biryukov
05d12bfa4c 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.
Built from https://develop.svn.wordpress.org/trunk@53216


git-svn-id: http://core.svn.wordpress.org/trunk@52805 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 13:51:08 +00:00
Sergey Biryukov
90cbd98c6b 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.
Built from https://develop.svn.wordpress.org/trunk@53215


git-svn-id: http://core.svn.wordpress.org/trunk@52804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 12:48:08 +00:00
gziolo
ec0574144a 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].



Built from https://develop.svn.wordpress.org/trunk@53214


git-svn-id: http://core.svn.wordpress.org/trunk@52803 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 12:39:09 +00:00
gziolo
5cc972ba4a 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.


Built from https://develop.svn.wordpress.org/trunk@53213


git-svn-id: http://core.svn.wordpress.org/trunk@52802 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 11:51:07 +00:00
gziolo
87207e9ca5 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.


Built from https://develop.svn.wordpress.org/trunk@53212


git-svn-id: http://core.svn.wordpress.org/trunk@52801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 11:37:12 +00:00
gziolo
83aed3ea4f 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.


Built from https://develop.svn.wordpress.org/trunk@53211


git-svn-id: http://core.svn.wordpress.org/trunk@52800 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 09:58:07 +00:00
gziolo
fba03a16ca 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].



Built from https://develop.svn.wordpress.org/trunk@53210


git-svn-id: http://core.svn.wordpress.org/trunk@52799 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 09:41:09 +00:00
gziolo
09688edc45 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.



Built from https://develop.svn.wordpress.org/trunk@53209


git-svn-id: http://core.svn.wordpress.org/trunk@52798 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-19 09:28:12 +00:00
jorgefilipecosta
0559e94375 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.
Built from https://develop.svn.wordpress.org/trunk@53208


git-svn-id: http://core.svn.wordpress.org/trunk@52797 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-18 17:12:07 +00:00
Sergey Biryukov
c4c4edccc0 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.
Built from https://develop.svn.wordpress.org/trunk@53207


git-svn-id: http://core.svn.wordpress.org/trunk@52796 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-18 15:22:08 +00:00
audrasjb
57fba4946f 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.

Built from https://develop.svn.wordpress.org/trunk@53206


git-svn-id: http://core.svn.wordpress.org/trunk@52795 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-18 15:08:09 +00:00
audrasjb
3b2c1e5629 Docs: Update a link to the Custom Elements spec in unsupported_valid_tag_names() unit test docblock.
This changeset replaces a link to the outdated W3C specs on Custom Elements with a link to the corresponding WhatWG specification.

Follow-up to [53204].

See #54729.

Built from https://develop.svn.wordpress.org/trunk@53205


git-svn-id: http://core.svn.wordpress.org/trunk@52794 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-18 14:43:08 +00:00
audrasjb
eca9278a10 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.

Built from https://develop.svn.wordpress.org/trunk@53204


git-svn-id: http://core.svn.wordpress.org/trunk@52793 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-18 14:35:07 +00:00
Sergey Biryukov
f53b215bfe 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.
Built from https://develop.svn.wordpress.org/trunk@53203


git-svn-id: http://core.svn.wordpress.org/trunk@52792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-18 10:33:09 +00:00
audrasjb
b6c2df9325 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.

Built from https://develop.svn.wordpress.org/trunk@53202


git-svn-id: http://core.svn.wordpress.org/trunk@52791 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-18 10:18:10 +00:00
Sergey Biryukov
99de4aea45 Docs: Use third-person singular verbs for function descriptions in wp-admin/includes/meta-boxes.php, per the documentation standards.
See #54729.
Built from https://develop.svn.wordpress.org/trunk@53201


git-svn-id: http://core.svn.wordpress.org/trunk@52790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 17:57:09 +00:00
Sergey Biryukov
9043ef83ef Docs: Add missing descriptions for function parameters in wp-admin/includes/meta-boxes.php.
See #54729.
Built from https://develop.svn.wordpress.org/trunk@53200


git-svn-id: http://core.svn.wordpress.org/trunk@52789 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 17:47:13 +00:00
Sergey Biryukov
6c36a0867d Coding Standards: Simplify long conditions in xfn_check().
Add some comments for clarity.

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

See #54728.
Built from https://develop.svn.wordpress.org/trunk@53199


git-svn-id: http://core.svn.wordpress.org/trunk@52788 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 17:26:08 +00:00
Sergey Biryukov
447bd92f5d Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/meta-boxes.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 `$class` parameter to `$xfn_relationship` in `xfn_check()`.
* Renames the `$value` parameter to `$xfn_value` for clarity.
* Includes minor code layout changes for better readability.

Reference: [http://gmpg.org/xfn/join XFN: Getting Started].

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

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53198


git-svn-id: http://core.svn.wordpress.org/trunk@52787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 15:37:09 +00:00
Sergey Biryukov
e0d13f8b59 Coding Standards: Correct alignment in various files.
This fixes an `Array double arrow not aligned correctly` WPCS warning.

Follow-up to [53075], [53084], [53091], [53094], [53155], [53129].

See #54728.
Built from https://develop.svn.wordpress.org/trunk@53197


git-svn-id: http://core.svn.wordpress.org/trunk@52786 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 15:07:08 +00:00
Sergey Biryukov
8a6d7ea5ac Coding Standards: Correct the $items_count variable in add_menu_classes().
Follow-up to [53195].

See #54728.
Built from https://develop.svn.wordpress.org/trunk@53196


git-svn-id: http://core.svn.wordpress.org/trunk@52785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 14:44:07 +00:00
Sergey Biryukov
b32080c332 Coding Standards: Use more descriptive variable names in add_menu_classes().
Follow-up to [9578], [53193], [53194].

See #54728.
Built from https://develop.svn.wordpress.org/trunk@53195


git-svn-id: http://core.svn.wordpress.org/trunk@52784 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 14:41:08 +00:00
Sergey Biryukov
a30a1efac4 Docs: Add missing documentation for add_cssclass() and add_menu_classes().
Follow-up to [9578], [53193].

See #54729.
Built from https://develop.svn.wordpress.org/trunk@53194


git-svn-id: http://core.svn.wordpress.org/trunk@52783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 14:30:13 +00:00
Sergey Biryukov
f6b7a1fd7a Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/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 `$class` parameter to `$classes` in `add_cssclass()`.
* Renames the `$add` parameter to `$class_to_add` for clarity.
* Includes minor code layout changes for better readability. 

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

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53193


git-svn-id: http://core.svn.wordpress.org/trunk@52782 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 14:10:07 +00:00
Sergey Biryukov
88cce3c705 Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/media.php.
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit renames the `$return` parameter to `$return_type` in `media_sideload_image()`.

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

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53192


git-svn-id: http://core.svn.wordpress.org/trunk@52781 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-17 10:51:10 +00:00
audrasjb
9998c01dca Themes: Use consistent thumbnail sizes in Customizer preview screen.
This ensures displaying theme thumbnails in consistent sizes in Customizer theme preview.

Props poena, karpstrucking, costdev, audrasjb.
Fixes #54188.

Built from https://develop.svn.wordpress.org/trunk@53191


git-svn-id: http://core.svn.wordpress.org/trunk@52780 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-16 06:15:09 +00:00
Sergey Biryukov
36708d062c I18N: Move code out of a translatable string in WP_Theme::__construct().
Props kapilpaul, azouamauriac, SergeyBiryukov.
Fixes #55405.
Built from https://develop.svn.wordpress.org/trunk@53190


git-svn-id: http://core.svn.wordpress.org/trunk@52779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-16 00:30:11 +00:00
audrasjb
407e802048 Docs: Use third-person singular verbs for function descriptions in author-template.php, as per documentation standards.
See #54729.

Built from https://develop.svn.wordpress.org/trunk@53189


git-svn-id: http://core.svn.wordpress.org/trunk@52778 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-15 15:14:09 +00:00
audrasjb
6d0458e78c Docs: Fix a docblock typo in get_the_modified_author.
Follow-up to [53187].

See #55420.

Built from https://develop.svn.wordpress.org/trunk@53188


git-svn-id: http://core.svn.wordpress.org/trunk@52777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-15 13:55:10 +00:00
audrasjb
ed59d4f043 Users: Avoid warning on the_modified_author when get_userdata() returns false.
This change adds a check of the value returned by `get_userdata()` before using it in `get_the_modified_author()`. It avoids a warning when retrieving the last author who edited the current post.

Props juanlopez4691, mukesh27.
Fixes #55420.

Built from https://develop.svn.wordpress.org/trunk@53187


git-svn-id: http://core.svn.wordpress.org/trunk@52776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-15 13:47:12 +00:00
audrasjb
f087315090 Text Changes: Fix various inconsistent capitalization issues.
Props Presskopp, arpitgshah, mukesh27, desrosj, audrasjb, marybaum.
Fixes #53028.

Built from https://develop.svn.wordpress.org/trunk@53186


git-svn-id: http://core.svn.wordpress.org/trunk@52775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-15 11:58:10 +00:00
Sergey Biryukov
ad5deed830 Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/list-table.php.
While using reserved PHP keywords as parameter name labels is allowed, in the context of function calls using named parameters in PHP 8.0+, this will easily lead to confusion. To avoid that, it is recommended not to use reserved keywords as function parameter names.

This commit renames the `$class` parameter to `$class_name` in `_get_list_table()`.

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

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53185


git-svn-id: http://core.svn.wordpress.org/trunk@52774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-15 10:52:11 +00:00
Sergey Biryukov
e86b90cad6 Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/deprecated.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` and `$parent` parameters to `$default_category` and `$parent_category` in `dropdown_categories()`.
* Renames the `$default` parameter to `$default_link_category` in `dropdown_link_categories()`.
* Renames the `$parent` parameter to `$parent_cat` and some other parameters for consistency in `wp_dropdown_cats()`.
* Renames the `$function` to `$callback` in `add_object_page()` and `add_utility_page()`.

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

Props jrf, aristath, poena, justinahinon, SergeyBiryukov.
See #55327.
Built from https://develop.svn.wordpress.org/trunk@53184


git-svn-id: http://core.svn.wordpress.org/trunk@52773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-14 15:26:09 +00:00
Sergey Biryukov
9a9617ea72 Coding Standards: Rename the $object variable to $attachment in several files.
This brings some consistency with a similar fragment in `Custom_Image_Heade::step_2_manage_upload()`, `WP_Site_Icon::insert_attachment()`, `media_handle_upload()`, and clarifies the type of the data.

Follow-up to [52946], [53137].

See #55327, #54728.
Built from https://develop.svn.wordpress.org/trunk@53183


git-svn-id: http://core.svn.wordpress.org/trunk@52772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-14 15:15:12 +00:00
audrasjb
c57fd8ae09 Help/about: Improve text in help tabs of the Personal Data Exporter/Eraser.
This change clarifies the purpose of the personal data exporter/eraser tool in the related help tab.

Props dimadin, peterwilsoncc, audrasjb, marybaum, webcommsat, azaozz, paapst, desrosj.
Fixes #52970.

Built from https://develop.svn.wordpress.org/trunk@53182


git-svn-id: http://core.svn.wordpress.org/trunk@52771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-14 14:46:07 +00:00
audrasjb
80aea1734c Plugins: Avoid translating empty plugin headers.
This change aims to avoid unnecessarily translating empty strings from plugin headers, by removing empty fields from translation process in `_get_plugin_data_markup_translate()`.

Props Chouby, johnbillion, audrasjb.
Fixes #54586.

Built from https://develop.svn.wordpress.org/trunk@53181


git-svn-id: http://core.svn.wordpress.org/trunk@52770 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-04-14 13:26:12 +00:00