Commit Graph

34545 Commits

Author SHA1 Message Date
Andrew Ozz
9d580a0fcb Emoji: Always skip nodes with the wp-exclude-emoji CSS class.
Patches twemoji.js to add support for a `doNotParse()` callback. Uses that callback to always exclude emojis in HTML elements with the above class.

Props: dd32, peterwilsoncc, azaozz.
Fixes #52219.
Built from https://develop.svn.wordpress.org/trunk@55186


git-svn-id: http://core.svn.wordpress.org/trunk@54719 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-02 00:53:25 +00:00
Felix Arntz
9feba5fa8b Editor: Use a non-persistent object cache instead of transient in wp_get_global_stylesheet().
This changeset is part of a greater effort to enhance the caching strategy for theme.json based data. Similar to [55138], [55148], and [55155], the cache is currently ignored when `WP_DEBUG` is on to avoid interrupting the theme developer's workflow.

Props spacedmonkey, oandregal, flixos90, ajlende, hellofromtonya.
Fixes #57568.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54718 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-01 22:59:13 +00:00
hellofromTonya
1056e0175c KSES: Allow position-related CSS properties.
Adds support for the following CSS properties considered safe for inline CSS:
* `position`
* `top`
* `right`
* `bottom`
* `left`
* `z-index`

References:
* [https://github.com/WordPress/gutenberg/pull/46142 Gutenberg PR 46142].

Follow-up to [54117].

Props andrewserong, mukesh27.
Fixes #57504.
Built from https://develop.svn.wordpress.org/trunk@55184


git-svn-id: http://core.svn.wordpress.org/trunk@54717 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-01 22:52:14 +00:00
joedolson
379bec8ea6 Media: Ensure media IDs are type int in bulk editing.
Cast all array values to integers using `array_map` so functions like `wp_delete_attachment` receiving the expected variable type.
 
Props eherman24, joedolson.
Fixes #56170.
Built from https://develop.svn.wordpress.org/trunk@55183


git-svn-id: http://core.svn.wordpress.org/trunk@54716 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-01 22:17:15 +00:00
audrasjb
e8bd962c4e Embeds: Add oEmbed support for crowdsignal.net surveys.
Crowdsignal has a block-editor powered survey/project editor. Surveys created using this editor appear on `*.crowdsignal.net` when published. This changeset adds oEmbed support for these URLs to embed Crowdsignal surveys.

Props donncha, audrasjb, Mamaduka, ntsekouras.
Fixes #57543.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-01 21:45:16 +00:00
hellofromTonya
e8096f0883 Editor: Add 'wp-polyfill' to _wp_get_iframed_editor_assets() for inert attribute in Firefox.
Adds the polyfill script to the iframe to make the `inert` attribute work correctly in Firefox. This solves the problem that the site editor can operate on the block editor in Firefox even in browse mode.

Why?

The inert attribute is intended to render the element and its sub-tree elements `inert`, but Firefox doesn't support this attribute. For the `inert` attribute to work as intended in Firefox, even within an iframe, the script needs to be injected into the iframe as well as the global document.

References:
* [https://github.com/WordPress/gutenberg/pull/47398 Gutenberg PR 47398].

Follow-up to [53160].

Props wildworks, mamaduka, youknowriad.
Fixes #57552.
Built from https://develop.svn.wordpress.org/trunk@55181


git-svn-id: http://core.svn.wordpress.org/trunk@54714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-01 20:44:11 +00:00
joedolson
237cb1da8f Media: Remove meta data after restoring w/IMAGE_EDIT_OVERWRITE.
When IMAGE_EDIT_OVERWRITE is defined as true the meta field `_wp_attachment_backup_sizes` is deleted after an image is restored.
 
Props mitogh, jeawhanlee, robinwpdeveloper, iapial.
Fixes #55150.
Built from https://develop.svn.wordpress.org/trunk@55180


git-svn-id: http://core.svn.wordpress.org/trunk@54713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-01 20:31:14 +00:00
hellofromTonya
b0521eaa50 Editor: Separate content styles for iframe in __wp_get_iframed_editor_assets() and wp_default_styles().
This changeset:
* Removes the `'wp-block-editor'` and `'wp-block-library'` from the iframe's stylesheet collection (i.e. `_wp_get_iframed_editor_assets()`).
* Adds the new `'wp-block-editor-content'` for the separate stylesheet to the list of editor (`'wp-edit-blocks'`) dependencies.

Why?

These PHP changes are part of the initiative to:

* Separate the content styles contained in the block editor package into a separate stylesheet.
* Avoid loading all block editor styles into the iframe.

References:
* [https://github.com/WordPress/gutenberg/pull/44298 Gutenberg PR 44298].

Follow-up to [53160], [50761].

Props ellatrix, youknowriad.
Fixes #57550.
Built from https://develop.svn.wordpress.org/trunk@55179


git-svn-id: http://core.svn.wordpress.org/trunk@54712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-01 20:17:13 +00:00
joedolson
7334d79f5c Media: Fix upload not visible if added after deleting media.
Unset GET parameters in the media library so they don't suppress error notifications and messages. Fix an issue where uploading an image after being redirected from deleting media did not show the new upload in the gallery.
 
Props rnitinb, Mista-Flo, desrosj, zebaafiashama, joedolson, antpb.
Fixes #49178.
Built from https://develop.svn.wordpress.org/trunk@55178


git-svn-id: http://core.svn.wordpress.org/trunk@54711 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-01 19:47:12 +00:00
hellofromTonya
96f54a8132 REST API: Declare 'edit_css' capability in links within WP_REST_Global_Styles_Controller.
Updates the Global Styles endpoint to expose the `'edit_css'` capability via action links.

References:
* [https://github.com/WordPress/gutenberg/pull/46815 Gutenberg PR 46815] Part of an effort to hide custom CSS setting for users without `'edit_css'` capability.

Follow-up to [52342], [52051].

Props mamaduka, dsas, glendaviesnz, mmtr86, talldanwp, timothyblynjacobs.
Fixes #57526.
Built from https://develop.svn.wordpress.org/trunk@55177


git-svn-id: http://core.svn.wordpress.org/trunk@54710 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-01 18:38:14 +00:00
hellofromTonya
263ef5505d Themes: Add shadow presets support for theme.json.
Adds shadow presets support for `theme.json` within the `WP_Theme_JSON` by 

* Adding it to presets metadata and valid settings.
* Defining the default shadow presets in Core's `theme.json`.

Includes PHPUnit tests. 

References:
* [https://github.com/WordPress/gutenberg/pull/46813 Gutenberg PR 46813]
* [https://github.com/WordPress/gutenberg/pull/47272 Gutenberg PR 47272]

Follow-up to [54162], [52049], [50973].

Props madhudollu, mamaduka, oandregal, scruffian, hellofromTonya.
Fixes #57559.
Built from https://develop.svn.wordpress.org/trunk@55176


git-svn-id: http://core.svn.wordpress.org/trunk@54709 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-01 18:07:12 +00:00
hellofromTonya
048b304deb Editor: Introduce minimum height dimensions block support.
This changeset adds the new dimension feature's PHP code for supporting minimum height in the block editor inspector and in global styles. Minimum height is quite useful for defining the minimum vertical dimensions of a block, while allowing it to expand beyond that size. 

In this changeset:

* Adds support in `theme.json`.
* Adds support in the style engine.
* Adds support in `wp_apply_dimensions_support()`.
* Renames the setting from `'__experimentalDimensions'` to `dimensions` in `wp_register_dimensions_support()`.
* Adds PHPUnit tests.

Is renaming `'__experimentalDimensions'` a backwards-compatibility (BC) break?

Though the setting has been in the code since 5.9.0, it was never wired to anything, ie it did not expose any controls or styles. Notice in `wp_register_dimensions_support()` and `wp_apply_dimensions_support()` prior to this changeset, there are inline comments as placeholders for height and width support, but no code.

If a developer opted in to use it, it had no effect.

A search in wp.org's plugin and themes repo showed no instances of this experimental setting.

Given there was no functionality attached to it (until this changeset), no change in behavior or effect from removing it, and no usage found in the plugins and themes repository, it does appear to be a BC break.

References:
* [https://github.com/WordPress/gutenberg/pull/45300 Gutenberg PR 45300]
* [https://github.com/WordPress/gutenberg/pull/45334 Gutenberg PR 45334]

Follow-up to [53076], [52069].

Props andrewserong, aaronrobertshaw , costdev, hellofromTonya, isabel_brison, joen, paaljoachim, mukesh27, ntsekouras, oandregal, ramonopoly.
Fixes #57582.
Built from https://develop.svn.wordpress.org/trunk@55175


git-svn-id: http://core.svn.wordpress.org/trunk@54708 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-01 16:15:15 +00:00
Sergey Biryukov
1b359fb4b9 Docs: Document the inserter property in WP_Block_Patterns_Registry::register().
Follow-up to [53152], [55173].

See #56792.
Built from https://develop.svn.wordpress.org/trunk@55174


git-svn-id: http://core.svn.wordpress.org/trunk@54707 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-01 15:29:13 +00:00
Sergey Biryukov
d099f2f708 Docs: Improve documentation for block pattern properties.
Includes:
* Adding the `templateTypes` property to the `WP_Block_Patterns_Registry::register()` DocBlock.
* Adding `@since` notes for the `postTypes` and `templateTypes` properties to:
 * `_register_theme_block_patterns()`
 * `WP_Block_Patterns_Registry::register()`
* Bringing some consistency to the order of properties between:
 * `_register_theme_block_patterns()`
 * `WP_Block_Patterns_Registry::register()`
 * `WP_REST_Block_Patterns_Controller::prepare_item_for_response()`
 * `WP_REST_Block_Patterns_Controller::get_item_schema()`

Follow-up to [52943], [53152], [54263], [55168].

See #56792.
Built from https://develop.svn.wordpress.org/trunk@55173


git-svn-id: http://core.svn.wordpress.org/trunk@54706 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-01 15:02:14 +00:00
hellofromTonya
cafd7544c2 Editor: Add support for editing block style variations in global styles.
To allow editing of block style variations in global styles, this changeset adds the following for server side support:

* building of block style schema into `WP_Theme_JSON::sanitize()`.
* appending of style variation selectors to block metadata in `WP_Theme_JSON::get_blocks_metadata()`.
* building of selectors and variations for nodes in `WP_Theme_JSON::get_block_nodes()`.

Tests for happy and unhappy paths are included.

Reference:
* [https://github.com/WordPress/gutenberg/pull/46343 Gutenberg PR 46343]

Follow-up to [54118], [50973], [50959].

Props isabel_brison, 
Fixes #57583.
Built from https://develop.svn.wordpress.org/trunk@55172


git-svn-id: http://core.svn.wordpress.org/trunk@54705 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-01 13:43:18 +00:00
Felix Arntz
d8246e8f7a Media: Allow to omit decoding="async" on tags from wp_get_attachment_image().
When adding `decoding="async"` to images was introduced in [53480], it did not provide the ability to customize that behavior specifically for image tags returned from `wp_get_attachment_image()`.

With this changeset it is now possible to explicitly provide a `decoding` value of e.g. boolean `false` in the `$attr` parameter of the function, to ensure the attribute is omitted.

Props maximej, adamsilverstein, flixos90, costdev, peterwilsoncc, mukesh27.
Fixes #57086.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54704 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-31 19:41:14 +00:00
John Blackbourn
e6cc65d39e Cron API: Improve the docs for some cron event and cron schedule related functions.
See #56792

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


git-svn-id: http://core.svn.wordpress.org/trunk@54703 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-31 17:50:12 +00:00
spacedmonkey
449fdda55f Query: Use WP_Query in get_page_by_path.
Replace raw database queries in `get_page_by_path` with a call to `WP_Query` class. This has a number of benefits, including improved caching and priming of post caches. To maintain backwards compatibility, this function calls `WP_Query` to gets all matching posts of all post statuses.  

Props spacedmonkey, peterwilsoncc, costdev, 
Fixes #56689.
Built from https://develop.svn.wordpress.org/trunk@55169


git-svn-id: http://core.svn.wordpress.org/trunk@54702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-31 16:56:12 +00:00
jorgefilipecosta
49c1d2066c Add: Template types to the patterns API.
Backports https://github.com/WordPress/gutenberg/pull/45814 into the core.
This commit adds a new templateType property to the patterns registration API.
This property allows a pattern to specify which template it makes sense on, e.g.: 404, single-post, single-product, category.

Props youknowriad, ntsekouras, 
spacedmonkey.
Built from https://develop.svn.wordpress.org/trunk@55168


git-svn-id: http://core.svn.wordpress.org/trunk@54701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-31 16:49:16 +00:00
jorgefilipecosta
5a6c222bfa Update: Improve performance of gutenberg_render_layout_support_flag.
Backports https://github.com/WordPress/gutenberg/pull/46074 into the core.
render_layout_support_flag is run per block, and inside we called get_global_settings three times. get_global_settings calls get_merged_data, which is costly. render_layout_support_flag is a filter called during the block render. When the blocks start rendering, there is no expectation that the theme.json settings change during the block render, so the settings and their derived information should all be static information of this function.
This simple change removes 3*NUMBER_OF_BLOCKS calls of get_merged_data to just one call.

Props oandregal, aristath, felixarntz, tellthemachines, andrewserong, aaronrobertshaw, aaronrobertshaw.
Built from https://develop.svn.wordpress.org/trunk@55167


git-svn-id: http://core.svn.wordpress.org/trunk@54700 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-31 15:24:14 +00:00
Sergey Biryukov
3ec35fac02 Docs: Fix typo in the send_auth_cookies filter DocBlock.
Follow-up to [55164], [55165].

See #56971, #39367.
Built from https://develop.svn.wordpress.org/trunk@55166


git-svn-id: http://core.svn.wordpress.org/trunk@54699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-31 12:20:16 +00:00
Sergey Biryukov
a389692e5a Docs: Remove a duplicate line in the send_auth_cookies filter DocBlock.
Describe the default values for the `$send` and `$expire` parameters.

Follow-up to [55164].

See #56971, #39367.
Built from https://develop.svn.wordpress.org/trunk@55165


git-svn-id: http://core.svn.wordpress.org/trunk@54698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-31 12:18:22 +00:00
audrasjb
67abe8cfb3 Users: Add context to the send_auth_cookies filter.
This changeset adds `$user_id`, `$expire`, `$expiration` and `$token` parameters to provide context to `send_auth_cookies` hook, which allows the filter to skip sending auth cookies.

Props dd32, mukesh27, costdev, peterwilsoncc, audrasjb.
Fixes #56971.
See #39367.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54697 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-31 08:46:13 +00:00
Sergey Biryukov
15af7662df Code Modernization: Allow some parameters with reserved keywords in wp-includes/class-wp-text-diff-renderer-*.php.
This commit adds inline comments instructing PHPCS to ignore parameters with reserved keywords in the affected methods that should not be renamed:
* `$string` parameter in `WP_Text_Diff_Renderer_inline::_splitOnWords()`
* `$final` parameter in `WP_Text_Diff_Renderer_Table::_changed()` and `::interleave_changed_lines()`

This resolves a few WPCS warnings along the lines of:
{{{
It is recommended not to use reserved keyword "string" as function parameter name. Found: $string
It is recommended not to use reserved keyword "final" as function parameter name. Found: $final
}}}

The two `WP_Text_Diff_Renderer_*` classes in question extend the `Text_Diff_Renderer_inline` and `Text_Diff_Renderer` classes from the `Text_Diff` package and should have the same parameters as the parent class methods, per the Task 1 section of ticket #51553.

The `Text_Diff` library currently included in WordPress core is no longer kept in sync with the upstream project and can be considered “adopted”, so the `$string` and `$final` parameters in the  parent class methods can technically be renamed, e.g. to `$input_string` and `$modified`, respectively.

However, the “final” wording is also used to represent modified content in other parts the library, so it is more internally consistent to keep these parameters as is for now.

Follow-up to [7747], [38352], [55136].

See #56788.
Built from https://develop.svn.wordpress.org/trunk@55163


git-svn-id: http://core.svn.wordpress.org/trunk@54696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-30 15:24:13 +00:00
Sergey Biryukov
ff399d17fe Code Modernization: Rename parameters that use reserved keywords in wp-includes/formatting.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 `$classname` in `sanitize_html_class()`.

Follow-up to [54927].

See also: [search:?q=code+modernization+rename+parameters+that+use+reserved+keywords&changeset=on equivalent commits for other files].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-30 14:15:16 +00:00
Pascal Birchler
5edb22187d I18N: Introduce switch_to_user_locale().
This new function makes it easier to switch to a specific user’s locale by reducing duplicate code and storing the user’s ID as additional context for plugins to consume. Existing usage of `switch_to_locale()` in core has been replaced with `switch_to_user_locale()` where appropriate.

Also, this change ensures `WP_Locale_Switcher` properly filters `determine_locale` so that anyyone using the `determine_locale()` function will get the correct locale information when switching is in effect.

Props costdev.
Fixes #57123.
See #26511.
Built from https://develop.svn.wordpress.org/trunk@55161


git-svn-id: http://core.svn.wordpress.org/trunk@54694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-30 10:27:16 +00:00
Sergey Biryukov
319fadaa9c Build/Test Tools: Back up and restore the $wp_filters global when running tests.
Introduced along with the `did_filter()` function, the `$wp_filters` global stores the number of times each filter has been applied during the current request.

This commit adds `$wp_filters` to the list of globals that are saved in `WP_UnitTestCase_Base::_backup_hooks()` and restored in `::_restore_hooks()` so that hooks set by the current test do not accidentally affect future tests.

Additionally, this commit brings some consistency by backing up and restoring the hook-related globals in the same order they are defined in `wp-includes/plugin.php`.

Follow-up to [29251], [53803].

Props sanjucta, SergeyBiryukov.
Fixes #57236.
Built from https://develop.svn.wordpress.org/trunk@55160


git-svn-id: http://core.svn.wordpress.org/trunk@54693 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-29 16:26:15 +00:00
audrasjb
9c04271f60 Media: Deprecate unused method WP_Media_List_Table::column_desc().
This changeset formally deprecates the `column_desc()` method from `WP_Media_List_Table`, as it was never used anywhere in core.

Props iandunn, JeffMatson, antpb, costdev, audrasjb.
Fixes #39710.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-28 22:17:16 +00:00
Sergey Biryukov
c588aebc84 Database: Replace substr_compare() usage with substr() in wpdb::prepare().
This amends the previous commit to avoid a warning on PHP < 7.2.18 if haystack is an empty string:
{{{
Warning: substr_compare(): The start position cannot exceed initial string length
}}}

Follow-up to [55151], [55157].

See #52506.
Built from https://develop.svn.wordpress.org/trunk@55158


git-svn-id: http://core.svn.wordpress.org/trunk@54691 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-28 20:58:12 +00:00
Sergey Biryukov
d9de5c33a0 Database: Replace str_ends_with() usage in wpdb::prepare().
This avoids a fatal error if the file is included directly outside of WordPress core, e.g. by HyperDB.

While WordPress core does include a polyfill function, it is not directly loaded in the `wpdb` class.

This commit replaces the `str_ends_with()` calls with `substr_compare()` for now.

Follow-up to [55151].

Props Otto42.
See #52506.
Built from https://develop.svn.wordpress.org/trunk@55157


git-svn-id: http://core.svn.wordpress.org/trunk@54690 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-28 13:48:20 +00:00
joedolson
ac0cb7a37b Media: Add download link to media modal and attachment details.
Make it easier for users to download their uploaded media by providing a download link on the attachment details screen and in the media modal.

Props countrymusicchicago, joedolson, amin7
Fixes #41474.
Built from https://develop.svn.wordpress.org/trunk@55156


git-svn-id: http://core.svn.wordpress.org/trunk@54689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-27 23:07:13 +00:00
Felix Arntz
fef356b375 Editor: Use a non-persistent object cache in wp_get_global_settings().
This changeset is part of a greater effort to enhance the caching strategy for `theme.json` based data. Similar to [55138] and [55148], the cache is currently ignored when `WP_DEBUG` is on to avoid interrupting the theme developer's workflow.

This addition of a non-persistent cache results in a significant performance improvement for the overall load time of WordPress, with the Server-Timing load metric being ~8% faster and Time to First Byte being 25+% faster than before.

Props oandregal, spacedmonkey, hellofromtonya, flixos90, azaozz, aristath.
Fixes #57502.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54688 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-27 22:14:12 +00:00
Adam Silverstein
5df3679f34 Revisions: only create autosave when content changed.
In the autosave REST API endpoint, avoid excessive database writes when an autosave is sent with content that is unchanged from the saved post. 

Before this fix, clicking "preview" in the editor (which uses the autosave feature) multiple times would cause an identical autosave entry to be deleted and re-created repeatedly.

Props inwerpsel, aduth, mukesh27, ironprogrammer.
Fixes #49532.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-27 22:03:19 +00:00
davidbaumwald
0d27540b5e Tests: Resolve some line endings issues in blocks/renderCommentTemplate.php on Windows machines.
This change resolves a unit test failure in `Tests_Blocks_RenderReusableCommentTemplate::test_rendering_comment_template_nested()` on systems using `\r\n` line endings.

Props SergeyBiryukov.
See #56793.
Built from https://develop.svn.wordpress.org/trunk@55153


git-svn-id: http://core.svn.wordpress.org/trunk@54686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-27 20:51:12 +00:00
desrosj
a85f69da41 Build/Test Tools: Update third-party GitHub Actions.
This updates the following third-party GitHub Actions to their latest versions.

- `actions/cache`
- `actions/checkout`
- `actions/upload-artifact`
- `actions/setup-node`
- `actions/setup-php`
- `actions/github-script`

See #57572.
Built from https://develop.svn.wordpress.org/trunk@55152


git-svn-id: http://core.svn.wordpress.org/trunk@54685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-27 19:25:13 +00:00
davidbaumwald
d25ae5dd33 Database: Add %i placeholder support to $wpdb->prepare to escape table and column names, take 2.
[53575] during the 6.1 cycle was reverted in [54734] to address issues around multiple `%` placeholders not being properly quoted as reported in #56933.  Since then, this issue has been resolved and the underlying code improved significantly.  Additionally, the unit tests have been expanded and the inline docs have been improved as well.

This change reintroduces `%i` placeholder support in `$wpdb->prepare()` to give extenders the ability to safely escape table and column names in database queries.

Follow-up to [53575] and [54734].

Props craigfrancis, jrf, xknown, costdev, ironprogrammer, SergeyBiryukov.
Fixes #52506.
Built from https://develop.svn.wordpress.org/trunk@55151


git-svn-id: http://core.svn.wordpress.org/trunk@54684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-27 18:49:16 +00:00
desrosj
d4085bc90d Build/Test Tools: Update PostCSS to version 8.
This updates PostCSS related dependencies for the main Core build process to versions that use the latest major version of PostCSS, 8.x.

There were no changes to any versioned CSS files as a result of this update directly. However, two occurrences of `-o-tab-size` have been removed due to the version of `caniuse-lite` used being updated in the process.

See #57554, #57555.
Built from https://develop.svn.wordpress.org/trunk@55150


git-svn-id: http://core.svn.wordpress.org/trunk@54683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-27 15:56:28 +00:00
Sergey Biryukov
a61dc175a8 Themes: Add "Style Variations" to the list of WordPress theme features.
Follow-up to [meta12372].

Props poena, mukesh27, costdev.
Fixes #56869. See #meta6545.
Built from https://develop.svn.wordpress.org/trunk@55149


git-svn-id: http://core.svn.wordpress.org/trunk@54682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-27 15:54:19 +00:00
Felix Arntz
24bcc488b0 Editor: Use a non-persistent object cache instead of transient in wp_get_global_stylesheet().
This changeset is part of a greater effort to enhance the caching strategy for `theme.json` based data. Similar to [55138], the cache is currently ignored when `WP_DEBUG` is on to avoid interrupting the theme developer's workflow.

Props oandregal, spacedmonkey, hellofromtonya, flixos90, ironprogrammer, azaozz, aristath, costdev, mcsf.
Fixes #56910.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54681 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-26 23:03:14 +00:00
hellofromTonya
74241b9205 Editor: Add is block theme setting to get_block_editor_settings().
The block editor's iframe needs to know if the theme is a block theme. This changeset adds a setting to `get_block_editor_settings()`.

Reference:
* https://github.com/WordPress/gutenberg/pull/46212

Props ellatrix, alexstine, costdev, dgwyer, glendaviesnz, scruffian.
Fixes #57549.
Built from https://develop.svn.wordpress.org/trunk@55147


git-svn-id: http://core.svn.wordpress.org/trunk@54680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-26 20:01:12 +00:00
Felix Arntz
cbb418fbe2 Themes: Avoid unnecessary database queries from get_default_block_editor_settings() in WP_Theme_JSON_Resolver::get_theme_data().
The `get_default_block_editor_settings()` function included several pieces of data that are irrelevant for the purpose that `WP_Theme_JSON_Resolver` was calling it for, yet resulted in three database queries on page load that can be avoided.

This changeset introduces a new function `get_classic_theme_supports_block_editor_settings()` to takes responsibility of only the data needed in `WP_Theme_JSON_Resolver`, which now uses that function. This leads to a reduction of database queries and accordingly a performance improvement.

Props mamaduka, spacedmonkey, oandregal, flixos90, audrasjb, mukesh27.
Fixes #57547.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54679 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-26 18:39:13 +00:00
Sergey Biryukov
89706afd21 Coding Standards: Bring some consistency to the order of attributes in password fields.
Follow-up to [11359], [13592], [13696], [33023], [33246], [33353], [41556], [46256], [49248], [53111], [55094].

See #56791.
Built from https://develop.svn.wordpress.org/trunk@55145


git-svn-id: http://core.svn.wordpress.org/trunk@54678 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-26 18:12:11 +00:00
hellofromTonya
a0c53b91a3 Docs: Update $types param for wp_get_global_stylesheet().
In 6.1.0, the values the `$types` parameter accepts changed to include `'base-layout-styles'`.

This commit updates the DocBlock to reflect this change and provide clear information of what the function will load if no types are passed to it.

Reference:
* https://github.com/WordPress/gutenberg/pull/46817

Follow-up to [54162], [52054].

Props oandregal, jorgefilipecosta , ntsekouras.
Fixes #57563.
See #56792.
Built from https://develop.svn.wordpress.org/trunk@55144


git-svn-id: http://core.svn.wordpress.org/trunk@54677 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-26 17:23:15 +00:00
Felix Arntz
54b4f3aa8e Bootstrap/Load: Avoid initializing WP_Recovery_Mode when fatal error handler is disabled.
The WordPress recovery mode only works in combination with the fatal error handler that works as the entry mode for recovery mode. The fatal error handler can be disabled using the `WP_DISABLE_FATAL_ERROR_HANDLER` constant, but so far the logic in the `WP_Recovery_Mode` class was still being initialized even when that constant was set to `true`, which is unnecessary.

This changeset updates the WordPress bootstrap process to only initialize `WP_Recovery_Mode` when needed.

Props costdev.
Fixes #56848.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54676 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-26 00:07:14 +00:00
Felix Arntz
d0e699bb2c Editor: Fix undefined variable following [54805].
Props mamaduka, costdev, mukesh27.
See #56974, #57067.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54675 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-25 22:09:13 +00:00
hellofromTonya
1b6b3a0765 Editor: Remove WP_DEBUG defined check in wp_tinycolor_hue_to_rgb().
The constant `WP_DEBUG` is a default constant that is set within `wp_initial_constants()` when not defined. This means the constant will always be defined, thus making the `defined( 'WP_DEBUG' )` unnecessary.

Removing the `defined()` provides these benefits:
* Makes the code more readable.
* Tiny performance optimization.

References:
* https://github.com/WordPress/gutenberg/pull/45979

Follow-up to [52049].

Props ocean90, spacedmonkey, mamaduka.
See #57527. 
Built from https://develop.svn.wordpress.org/trunk@55141


git-svn-id: http://core.svn.wordpress.org/trunk@54674 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-25 21:56:15 +00:00
hellofromTonya
e9a172b0ef Editor: Use in/decrementors in wp_tinycolor_hue_to_rgb().
Replaces `+=` and `-=` with `++$t` and `--$t` (in/decrementors) within the `wp_tinycolor_hue_to_rgb()`. 

Why? For performance: in/decrementors are more performant than an assignment with a calculation.

References:
* https://www.php.net/manual/en/language.operators.increment.php
* https://github.com/WordPress/gutenberg/pull/44551

Follow-up to [50929].

Props jrf, czapla, antonvlasenko, aristath, mamaduka.
See #57527. 
Built from https://develop.svn.wordpress.org/trunk@55140


git-svn-id: http://core.svn.wordpress.org/trunk@54673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-25 21:42:15 +00:00
desrosj
adbfbb6bfb Build/Test Tools: Revert [55137].
This changeset resulted in some unexpected JavaScript validation failures.

See #57555.
Built from https://develop.svn.wordpress.org/trunk@55139


git-svn-id: http://core.svn.wordpress.org/trunk@54672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-25 20:22:12 +00:00
hellofromTonya
652f2244c6 Themes: Add static cache variable to wp_theme_has_theme_json().
For performance, a static variable is added to `wp_theme_has_theme_json()` to cache the boolean result of determining if a theme (or its parent) has a `theme.json` file. 

This cache avoids the overhead of calling `get_stylesheet_directory()` and `get_template_directory()` each time `wp_theme_has_theme_json()` is invoked.

The cache is lean, non-persistent, and encapsulated within the function (i.e. function scope and not available externally).

The cache is ignored when:
* `WP_DEBUG` is on to avoid interrupting theme developer's workflow and for extender automated test suites.
* `WP_RUN_CORE_TESTS` is on to ensure each Core test exercises the checking code.

Follow-up to [55092], [55086].

Props oandregal, azaozz, costdev, dmsnell, flixos90, hellofromTonya, Otto42, spacedmonkey.
Fixes #56975.
Built from https://develop.svn.wordpress.org/trunk@55138


git-svn-id: http://core.svn.wordpress.org/trunk@54671 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-25 19:38:14 +00:00
desrosj
9fe4e0b6f4 Build/Test Tools: Update caniuse-lite to the latest version.
This updates the `caniuse-lite` database from `1.0.30001407` to `1.0.30001448` and applies the resulting changes to generated WP Admin CSS.

This removes two occurrences of `-o-tab-size`, which was required for partial support of the `tab-size` property in Opera Mini. Usage has dropped below 1%, hence this vendor prefix being removed.

See #57555.
Built from https://develop.svn.wordpress.org/trunk@55137


git-svn-id: http://core.svn.wordpress.org/trunk@54670 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-25 19:15:15 +00:00
Sergey Biryukov
27529e9dee Coding Standards: Allow some parameters with reserved keywords in wp-includes/compat.php.
Parameter names for PHP polyfills in WordPress core need to 100% match the native PHP parameter names. Otherwise using named parameters with those functions could cause fatal errors for installations where the polyfills kick in.

This commit adds inline comments instructing PHPCS to ignore parameters with reserved keywords in the affected functions that should not be renamed:
* `$string` parameter in `mb_substr()` and `mb_strlen()`
* `$array` parameter in `array_key_first()` and `array_key_last()`

This resolves a few WPCS warnings along the lines of:
{{{
It is recommended not to use reserved keyword "string" as function parameter name. Found: $string
}}}

Follow-up to [7140], [10707], [17603], [17621], [32114], [52038], [53365].

Props jrf.
See #56788, #56791.
Built from https://develop.svn.wordpress.org/trunk@55136


git-svn-id: http://core.svn.wordpress.org/trunk@54669 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-25 01:40:12 +00:00
audrasjb
a0b0f4560b Menus: Add missing escaping function in Admin Menu walker.
Props aniketpatel, mukesh27, costdev.
Fixes #57541.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54668 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-24 21:32:14 +00:00
audrasjb
0cdd1f8069 Code Modernization: Fix a JS error in wpdialog.
This changeset replaces `this.element._trigger('focus');` with `this.element.trigger('focus');` in `wpdialog` to fix a JS error introduced in [55052].

Indeed, `this` inside the `open()` function of `wpdialog` refers to the jQuery UI widget, whereas `this.element` is the jQuery object of the DOM element. Thus, native jQuery methods need to be used, as `_trigger` is only defined on the jQuery UI widget.

Follow-up to [55052].

Props TobiasBg, audrasjb, shubham1gupta.
Fixes #56830.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54667 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-24 21:13:12 +00:00
hellofromTonya
fe2c8f9237 Editor: Adds 'settings.typography.fluid.minFontSize' support to wp_get_typography_font_size_value().
In `wp_get_typography_font_size_value()`, adds support for using a minimum font size for fluid typography when defined in a theme's `theme.json` file.

Reference:
* Part of [https://github.com/WordPress/gutenberg/pull/42489 Gutenberg PR 42489]

Follow-up to [54497], [54260].

Props andrewserong, ramonopoly, hellofromTonya, joen.
Fixes #57529.
Built from https://develop.svn.wordpress.org/trunk@55133


git-svn-id: http://core.svn.wordpress.org/trunk@54666 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-24 20:40:10 +00:00
hellofromTonya
16b9fdfc34 Editor: Adds pagination and ordering support to WP_REST_Pattern_Directory_Controller.
Adds pagination and ordering support to `WP_REST_Pattern_Directory_Controller` by allow listing `'per_page'`, `'page'`, `'offset'`, `'order'`, and `'orderby'` query parameters. This change enables pagination and ordering features in the pattern directory explorer by using the same sort as wordpress.org/patterns.

Reference:
* [https://github.com/WordPress/gutenberg/pull/45293 Gutenberg PR 45293]

Follow-up to [55098], [51206], [51021].

Props ntsekouras, ryelle, arrasel403, hellofromTonya, ironprogrammer, mukesh27, robinwpdeveloper.
Fixes #57501.
Built from https://develop.svn.wordpress.org/trunk@55132


git-svn-id: http://core.svn.wordpress.org/trunk@54665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-24 16:54:11 +00:00
Sergey Biryukov
28f3369220 Code Modernization: Rename parameters that use reserved keywords in phpunit/tests/kses.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 `$global` parameter to `$global_name` in `Tests_Kses::test_kses_globals_are_defined()`.

Follow-up to [52229], [54203], [55090].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-24 16:05:12 +00:00
Sergey Biryukov
c5913fc3de Code Modernization: Rename parameters that use reserved keywords in phpunit/tests/functions/wpRefererField.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 `Tests_Functions_wpRefererField::test_wp_referer_field_should_respect_display_arg()`.

Follow-up to [54420], [54929].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54663 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-24 15:55:10 +00:00
Sergey Biryukov
eda80ba004 Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wp-theme-json.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_Theme_JSON::get_metadata_boolean()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023], [55027], [55028], [55034], [55036], [55037], [55038], [55039], [55049], [55050], [55060], [55062], [55064], [55065], [55076], [55077], [55078], [55081], [55090], [55100], [55104], [55112], [55115], [55116], [55117], [55119], [55120], [55126], [55127].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54662 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-24 15:45:11 +00:00
Sergey Biryukov
378246f1dc Docs: Add missing @since tag for WP_Theme_JSON_Resolver::remove_json_comments().
Follow-up to [54162].

See #56792.
Built from https://develop.svn.wordpress.org/trunk@55128


git-svn-id: http://core.svn.wordpress.org/trunk@54661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-24 15:41:15 +00:00
Sergey Biryukov
73b9d96f77 Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wp-theme-json-resolver.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 `$input_array` in `WP_Theme_JSON_Resolver::remove_json_comments()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023], [55027], [55028], [55034], [55036], [55037], [55038], [55039], [55049], [55050], [55060], [55062], [55064], [55065], [55076], [55077], [55078], [55081], [55090], [55100], [55104], [55112], [55115], [55116], [55117], [55119], [55120], [55126].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-24 15:37:12 +00:00
Sergey Biryukov
74567338b8 Code Modernization: Rename parameters that use reserved keywords in wp-includes/blocks.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 `block_has_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], [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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023], [55027], [55028], [55034], [55036], [55037], [55038], [55039], [55049], [55050], [55060], [55062], [55064], [55065], [55076], [55077], [55078], [55081], [55090], [55100], [55104], [55112], [55115], [55116], [55117], [55119], [55120].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-24 14:42:17 +00:00
hellofromTonya
45ef4c0623 Editor: Migrate old to the new pattern categories.
Adds a new non-public `WP_REST_Block_Patterns_Controller::migrate_pattern_categories()` method to automatically migrate existing content's pattern categories to the new ones introduced in [55098].

Old to  New
`'buttons'` to `'call-to-action'`
`'columns'` to `'text'`
`'query'`   to `'posts'`

Reference:
* Part of [https://github.com/WordPress/gutenberg/pull/46144 Gutenberg PR 46144]

Follow-up to [55098], [53152].

Props ntsekouras, annezazu, jameskoster, joen, hellofromTonya, mcsf, paaljoachim, ryelle.
Fixes #57532.
Built from https://develop.svn.wordpress.org/trunk@55125


git-svn-id: http://core.svn.wordpress.org/trunk@54658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-24 14:36:12 +00:00
audrasjb
190350ecea Twenty Twenty-One: Refine primary-navigation.js behavior for anchor links.
This changeset fixes a bug where clicking on an anchor link in the content changes the state of the button that opens and closes the responsive menu. It adds a conditional to check if the clicked anchor link is inside the primary navigation menu (`#site-navigation`), in order to prevent content anchor links from changing the state of the button.

Known limitations: The state of the button is not reset when the browser is resized. If a menu anchor link is first clicked while on desktop width, and the browser width is reduced, the menu button will show the text "Close" even though the menu is not opened.

Props andreaboe, sabernhardt, poena, afercia, chaion07, cu121, mukesh27.
Fixes #53331.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-24 12:59:10 +00:00
audrasjb
037d3406ee Docs: Various improvements in ms-blogs.php function descriptions, as per docblocks standards.
See #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54656 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-24 12:57:15 +00:00
audrasjb
215de3c5f3 Twenty Twenty-Two: Remove color reference from pattern names.
This changeset removes color names from pattern names to make them less opinionated, and avoid mismatching when the user changes related colors. It does not update filenames for now, as they are not directly exposed to end users.

Props poena, mukesh27.
Fixes #56720.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54655 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-24 08:51:12 +00:00
audrasjb
0939d89ded Themes: Support additional link related pseudo classes in theme.json.
This changeset adds support for `:link` and `:any-link` in `theme.json`, using the `VALID_ELEMENT_PSEUDO_SELECTORS` array. `:link` can be used to style unvisited links and `:any-link` can be used to style any link containing an `href` attribute.

Props peterwilsoncc, whaze, audrasjb, costdev, mukesh27.
Fixes #57053.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54654 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-24 08:11:15 +00:00
Sergey Biryukov
c47eae0612 Code Modernization: Rename parameters that use reserved keywords in phpunit/tests/widgets/wpWidgetMedia.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 `$object` parameter to `$widget` in `Tests_Widgets_wpWidgetMedia::filter_widget_mocked_instance()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023], [55027], [55028], [55034], [55036], [55037], [55038], [55039], [55049], [55050], [55060], [55062], [55064], [55065], [55076], [55077], [55078], [55081], [55090], [55100], [55104], [55112], [55115], [55116], [55117], [55119].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54653 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-23 16:54:11 +00:00
Sergey Biryukov
0cc0ff91a6 Code Modernization: Rename parameters that use reserved keywords in phpunit/tests/shortcode.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 `$output` in:
 * `Tests_Shortcode::filter_pre_do_shortcode_tag_attr()`
 * `Tests_Shortcode::filter_do_shortcode_tag_replace()`
 * `Tests_Shortcode::filter_do_shortcode_tag_generate()`
 * `Tests_Shortcode::filter_do_shortcode_tag_attr()`
* Amends the `$return` parameter of the `pre_do_shortcode_tag` 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], [54947], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023], [55027], [55028], [55034], [55036], [55037], [55038], [55039], [55049], [55050], [55060], [55062], [55064], [55065], [55076], [55077], [55078], [55081], [55090], [55100], [55104], [55112], [55115], [55116], [55117].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-23 16:35:12 +00:00
Sergey Biryukov
e474ef7192 Tests: Use wp_recursive_ksort() in WP_Theme_JSON_Resolver tests.
This replaces a helper method in `Tests_Theme_wpThemeJsonResolver` with the `wp_recursive_ksort()` function that was introduced later for the same purpose.

Follow-up to [52049], [53129], [55117].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@55118


git-svn-id: http://core.svn.wordpress.org/trunk@54651 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-23 16:03:10 +00:00
Sergey Biryukov
227ba555ae Code Modernization: Rename parameters that use reserved keywords in wp-includes/functions.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 `$input_array` in `wp_recursive_ksort()`.
* Moves the function next to other array-related functions for consistency.

Follow-up to [53129], [54929].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54650 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-23 15:54:10 +00:00
Sergey Biryukov
a864df149a Code Modernization: Rename parameters that use reserved keywords in phpunit/tests/rest-api.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 `$date` in:
 * `Tests_REST_API::test_rest_parse_date()`
 * `Tests_REST_API::test_rest_parse_date_force_utc()`
* Amends the `$value` and `$valid` parameters to `$expected` 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], [54947], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023], [55027], [55028], [55034], [55036], [55037], [55038], [55039], [55049], [55050], [55060], [55062], [55064], [55065], [55076], [55077], [55078], [55081], [55090], [55100], [55104], [55112], [55115].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54649 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-23 12:12:11 +00:00
Sergey Biryukov
fba1aa6a4f Code Modernization: Rename parameters that use reserved keywords in phpunit/tests/post.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 `$override_slug` in `Tests_Post::filter_pre_wp_unique_post_slug()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023], [55027], [55028], [55034], [55036], [55037], [55038], [55039], [55049], [55050], [55060], [55062], [55064], [55065], [55076], [55077], [55078], [55081], [55090], [55100], [55104], [55112].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-23 11:09:12 +00:00
audrasjb
e4f070a161 Bundled Themes: Fix Separator block "Dots" style variation on various themes.
This changeset fixes an issue with the "Dots" style of the Separator block on multiple bundled themes. It adds `max-width: 100%` to this style variation on the following themes: Twenty Eleven, Twenty Thirteen, Twenty Fourteen, Twenty Fifteen, and Twenty Sixteen.

Props umesh84, sabernhardt, audrasjb, amin7, esratpopy, multidots1896.
Fixes #56114.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54647 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-22 20:07:12 +00:00
audrasjb
524bd7ba46 Posts, Post Types: Increase the input field's width in the Slug metabox.
This changeset adds a `large-text` attribute and removes the `size` attribute of the text input field located in the Slug metabox. It improves its usability, at least for as long as the Slug metabox is available in the Classic Editor.

Props ABTOP, nacin, helen, sabernhardt, abitofmind, tyxla, audrasjb.
Fixes #16346.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-22 11:11:12 +00:00
Sergey Biryukov
e550644ab0 Code Modernization: Rename parameters that use reserved keywords in phpunit/tests/pluggable/signatures.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 `$function_name` in `Tests_Pluggable_Signatures::test_pluggable_function_signatures_match()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023], [55027], [55028], [55034], [55036], [55037], [55038], [55039], [55049], [55050], [55060], [55062], [55064], [55065], [55076], [55077], [55078], [55081], [55090], [55100], [55104].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54645 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-22 00:17:12 +00:00
Sergey Biryukov
4568b1fb32 Docs: Further clarify the wp_ajax_save_attachment filter parameters description.
Follow-up to [55106].

See #23148.
Built from https://develop.svn.wordpress.org/trunk@55111


git-svn-id: http://core.svn.wordpress.org/trunk@54644 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-21 15:58:10 +00:00
audrasjb
89f144ea9e Upgrade/Install: Disable spellcheck for password field on Setup screen.
This changeset adds `spellcheck="false"` attribute to Database Password field on the Database Setup screen.

Follow-up to [55094], [55095], [55096].

See #56763.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54643 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-21 09:07:15 +00:00
audrasjb
c58a08d9df Menus: Hide the "Remove selected item" from Menus screen when no item is selected.
This changeset removes the "Remove selected item" from the classic Navigation Menus screen when no item is selected, and makes it non focusable from assistive technologies.

Plus, this changeset fixes a small unrelated coding standard issue in `nav-menus.css`.

Props kebbet, joedolson, audrasjb.
Fixes #56942.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54642 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-20 22:06:13 +00:00
audrasjb
73f6748ea4 Quick/Bulk Edit: Add an action hook on bulk_edit_posts().
This changeset introduces the `bulk_edit_posts` action hook, triggered after processing the post data for bulk edit and before it returns its results. For example, it allows developers to save additional data without having to perform any `.ajax()` call.

Props helgatheviking, helen, Mte90, afercia, mrasharirfan, desrosj, itowhid06, pento, mensmaximus, audrasjb, costdev.
Fixes #28112.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54641 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-20 21:43:11 +00:00
joedolson
c0b3839620 Plugins: Add visible focus on plugin modal close button.
Change the focus and hover state of the plugin modal close button to use `#f0f0f1` with visible outline to be visible against modal overlay.

Props dperonne, viralsampat, jeawhanlee, mukesh27, sabernhardt, joedolson.
Fixes #56604.
Built from https://develop.svn.wordpress.org/trunk@55107


git-svn-id: http://core.svn.wordpress.org/trunk@54640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-20 21:28:14 +00:00
audrasjb
fe3e932421 Media: Add an action hook on wp_ajax_save_attachment().
This changeset introduces the `wp_ajax_save_attachment` action hook, triggered after an attachment has been updated and before the JSON response is sent. For example, it allows developers to update any additional attachment fields that have been rendered by extending the `media.view.Attachment.Details` subview.

Props griffinjt, bradyvercher, pputzer, antpb, sc0ttkclark, audrasjb, costdev, hellofromTonya.
Fixes #23148.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54639 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-20 14:17:16 +00:00
Sergey Biryukov
28562c4306 Code Modernization: Use correct property in IXR_Message::tag_open().
The `IXR_Message` class declares a property `_currentTag`, which is never assigned or used. It does assign to `currentTag` instead, which outside of that one assignment is never used either.

Since there are various other underscore-prefixed properties declared on the class, including one named `_currentTagContents` which is used in several places, it appears that the declared property is correct and the assignment is a typo.

This commit resolves a notice on PHP 8.2:
{{{
Deprecated: Creation of dynamic property IXR_Message::$currentTag is deprecated
}}}

Follow-up to [1346].

Props bjorsch, kraftbj, jrf, mukesh27, SergeyBiryukov.
See #56790.
Built from https://develop.svn.wordpress.org/trunk@55105


git-svn-id: http://core.svn.wordpress.org/trunk@54638 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-20 01:36:10 +00:00
Sergey Biryukov
c5297203d6 Code Modernization: Rename parameters that use reserved keywords in phpunit/tests/rest-api/rest-*-controller.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 `$object` parameter to `$response_data` in:
 * `WP_Test_REST_Attachments_Controller::additional_field_get_callback()`
 * `WP_Test_REST_Autosaves_Controller::additional_field_get_callback()`
 * `WP_Test_REST_Categories_Controller::additional_field_get_callback()`
 * `WP_Test_REST_Comments_Controller::additional_field_get_callback()`
 * `WP_Test_REST_Post_Statuses_Controller::additional_field_get_callback()`
 * `WP_Test_REST_Post_Types_Controller::additional_field_get_callback()`
 * `WP_Test_REST_Posts_Controller::additional_field_get_callback()`
 * `WP_Test_REST_Revisions_Controller::additional_field_get_callback()`
 * `WP_Test_REST_Tags_Controller::additional_field_get_callback()`
 * `WP_Test_REST_Users_Controller::additional_field_get_callback()`
* Amends the `$data` and `$prepared` parameters for consistency in:
 * `WP_REST_Controller::add_additional_fields_to_object()`
 * `WP_REST_Controller::filter_response_by_context()`
 * `rest_filter_response_by_context()`

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023], [55027], [55028], [55034], [55036], [55037], [55038], [55039], [55049], [55050], [55060], [55062], [55064], [55065], [55076], [55077], [55078], [55081], [55090], [55100].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54637 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-20 00:21:15 +00:00
audrasjb
26d9268e3c Permalinks: Remove floating on Permalinks settings screen.
This changeset replaces floating elements with `flex` CSS positioning, while the markup stays the same to keep the elements' semantic value.

Follow-up to [53706].

Props sabernhardt, kebbet, audrasjb.
Fixes #56673.
See #55498.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-19 22:57:14 +00:00
Sergey Biryukov
a1b4d027f3 Tests: Correct additional_field_get_callback() parameters in some REST API tests.
The second parameter passed to `get_callback` in `WP_REST_Controller::add_additional_fields_to_object()` is the field name, not the request details.

Includes moving the `get_callback` and `update_callback` helper functions next to the tests they are used in.

Follow-up to [38832], [43768].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@55102


git-svn-id: http://core.svn.wordpress.org/trunk@54635 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-19 21:48:17 +00:00
audrasjb
ee8958557a Twenty Twenty-One: Fix obsolete navigation block styles for better Global Styles support.
This changeset removes some CSS custom properties that targets navigation menu items to avoid preventing the block from inheriting padding values set by the Global Styles system.

Props Joen, desrosj, poena, audrasjb, hellofromtonya, SergeyBiryukov.
Fixes #53220.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-19 17:41:16 +00:00
Sergey Biryukov
f48bb425ed Code Modernization: Rename parameters that use reserved keywords in phpunit/tests/option/themeMods.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 `Tests_Option_ThemeMods::test_theme_mod_default_value_with_percent_symbols()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023], [55027], [55028], [55034], [55036], [55037], [55038], [55039], [55049], [55050], [55060], [55062], [55064], [55065], [55076], [55077], [55078], [55081], [55090].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54633 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-19 17:09:13 +00:00
Pascal Birchler
58545bacce I18N: Allow installing new translations when changing the user locale on the profile page.
Up until now, new translations could only be installed via Settings -> General.
When editing the user profile, one could only select locales that were already installed.

This change allows also installing new translations if the editing user has the necessary capabilities.

Props barryceelen, johnbillion, ocean90, swissspidy.
Fixes #38664.
Built from https://develop.svn.wordpress.org/trunk@55099


git-svn-id: http://core.svn.wordpress.org/trunk@54632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-19 14:13:13 +00:00
youknowriad
ff7751868f Editor: Updated the bundled block pattern categories.
This adds descriptions to the existing pattern categories.
It also updates backports the new pattern categories: 
banner, call to action, posts, team, testimonials, services,
portfolio and contact.

Fixes #57479.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-19 12:21:19 +00:00
youknowriad
0831f905f0 Editor: Allow block pattern categories to have descriptions.
Updates the corresponding REST API endpoint and unit test.

Fixes #57478.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-19 12:13:14 +00:00
audrasjb
f92b90116a Application Passwords: Disable spellcheck for password field.
This changeset adds `spellcheck="false"` attribute to application password field.

Follow-up to [55094], [55095].

Props Spaceshipone.
Fixes #56763.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54629 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-19 11:48:12 +00:00
audrasjb
a97156c76d Twenty Twenty-One: Disable spellcheck for post password field.
This changeset adds `spellcheck="false"` attribute to various password fields.

Follow-up to [55094].

Props dziudek, audrasjb, gainesm, fosuahmed.
See #56763.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54628 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-19 09:12:12 +00:00
audrasjb
0f28fc7aed Login and Registration: Disable spellcheck for password fields.
This changeset adds `spellcheck="false"` attribute to various password fields.

The spellcheck global attribute defines whether the element may be checked for spelling errors. The `false` value indicates that the element should not be checked for spelling errors, which is relevant for a password field.

Furthermore, and as per MDN specs, using spellchecking can have consequences for users' security and privacy. The specification does not regulate how spellchecking is done and the content of the element may be sent to a third party for spellchecking results. Thus, it is recommended to set `spellcheck` attribute to `false` for elements that can contain sensitive information. Which is the case for password fields.

Props dziudek, audrasjb, gainesm, fosuahmed.
Fixes #56763.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54627 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-19 08:53:13 +00:00
Felix Arntz
1a21c14d85 Media: Allow for customization of lazy-loading featured images.
When lazy-loading images was introduced, in [52065] the check for `wp_lazy_loading_enabled()` was omitted by accident in the logic to set the attribute with its default value on `img` tags from `get_the_post_thumbnail()`. Without this check, it is impossible for third-party developers to modify the behavior for featured images.

This changeset fixes the problem by introducing the check.

Props flixos90, joemcgill, mukesh27.
Fixes #57490.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-19 07:34:14 +00:00
hellofromTonya
18b551b84d Themes: Revert caching from r55086.
Calls to `wp-admin/load-styles.php` do not include the loading of `wp_cache_*()` functions. With [55086], this caused a fatal error:

{{{
Fatal error: Uncaught Error: Call to undefined function wp_cache_get() in /wp-includes/global-styles-and-settings.php on line 285
}}}

In some production and local environments running `trunk`, the admin area looked broken as the styling was not loaded as there were no HTTP requests.

This commit reverts the caching from [55086] to restore sites running `trunk` until a solution is found.

Follow-up to [55086].

Props Otto42, dmsnell, costdev.
See #56975.
Built from https://develop.svn.wordpress.org/trunk@55092


git-svn-id: http://core.svn.wordpress.org/trunk@54625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-18 21:59:13 +00:00
joedolson
8c310381f2 Media: Prevent hidden overflow on uploaded image names.
Allow the image upload notification to expand height and display the full image name when uploaded. Primarily effects mobile devices, where the available space for image names is narrow.

Props sumitsingh.
Fixes #54812.
Built from https://develop.svn.wordpress.org/trunk@55091


git-svn-id: http://core.svn.wordpress.org/trunk@54624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-18 18:51:11 +00:00
Sergey Biryukov
1eb631da4d Code Modernization: Rename parameters that use reserved keywords in phpunit/tests/kses.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:
 * `Tests_Kses::test_wp_filter_post_kses_address()`
 * `Tests_Kses::test_wp_filter_post_kses_a()`
 * `Tests_Kses::test_wp_filter_post_kses_abbr()`
* Amends a few parameters and variables in other tests in the same file 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], [54947], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023], [55027], [55028], [55034], [55036], [55037], [55038], [55039], [55049], [55050], [55060], [55062], [55064], [55065], [55076], [55077], [55078], [55081].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-18 16:19:23 +00:00
audrasjb
db9b22b051 Twenty Twenty-One: Revert [55088].
[55088] introduced some issues with the "Test Default Themes & Create ZIPs" workflow on GitHub Actions. This changeset reverts it to leave time to figure out what failed and why.

See #53220.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-18 14:52:18 +00:00
audrasjb
b93aa43140 Twenty Twenty-One: Fix obsolete navigation block styles for better Global Styles support.
This changeset removes CSS custom properties that targets navigation menu items to avoid preventing the block from inheriting padding values set by the Global Styles system.

Props Joen, desrosj, poena.
Fixes #53220.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54621 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-18 13:33:12 +00:00
Sergey Biryukov
69f0cb5e3f Tests: Add unique messages to assertions for attachment filenames in wp_mail().
This makes the assertions more helpful, as per the [https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#using-assertions Writing PHP Tests] guidelines:
> All PHPUnit assertions, as well as all WordPress custom assertions, allow for a `$message` parameter to be passed. This message will be displayed when the assertion fails and can help immensely when debugging a test. This parameter should always be used if more than one assertion is used in a test method.

Follow-up to [55030], [55032].

Props mukesh27, costdev.
See #28407.
Built from https://develop.svn.wordpress.org/trunk@55087


git-svn-id: http://core.svn.wordpress.org/trunk@54620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-18 13:00:15 +00:00
hellofromTonya
8ddb28368a Themes: Introduce wp_theme_has_theme_json() for public consumption.
Adds `wp_theme_has_theme_json()` for public consumption, to replace the private internal Core-only `WP_Theme_JSON_Resolver::theme_has_support()` method. This new global function checks if a theme or its parent has a `theme.json` file.

For performance, results are cached as an integer `1` or `0` in the `'theme_json'` group with `'wp_theme_has_theme_json'` key. This is a non-persistent cache. Why? To make the derived data from `theme.json` is always fresh from the potential modifications done via hooks that can use dynamic data (modify the stylesheet depending on some option, settings depending on user permissions, etc.).

Also adds a new public function `wp_clean_theme_json_cache()` to clear the cache on `'switch_theme'` and `start_previewing_theme'`.

References:
* [https://github.com/WordPress/gutenberg/pull/45168 Gutenberg PR 45168] Add `wp_theme_has_theme_json` as a public API to know whether a theme has a `theme.json`.
* [https://github.com/WordPress/gutenberg/pull/45380 Gutenberg PR 45380] Deprecate `WP_Theme_JSON_Resolver:theme_has_support()`.
* [https://github.com/WordPress/gutenberg/pull/46150 Gutenberg PR 46150] Make `theme.json` object caches non-persistent.
* [https://github.com/WordPress/gutenberg/pull/45979 Gutenberg PR 45979] Don't check if constants set by `wp_initial_constants()` are defined.
* [https://github.com/WordPress/gutenberg/pull/45950 Gutenberg PR 45950] Cleaner logic in `wp_theme_has_theme_json`.

Follow-up to [54493], [53282], [52744], [52049], [50959].

Props oandregal, afragen, alexstine, aristath, azaozz, costdev, flixos90, hellofromTonya, mamaduka, mcsf, ocean90, spacedmonkey.
Fixes #56975.
Built from https://develop.svn.wordpress.org/trunk@55086


git-svn-id: http://core.svn.wordpress.org/trunk@54619 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-18 11:40:10 +00:00
spacedmonkey
645d6359b3 Posts, Post Types: Use persistent caching in get_adjacent_post function.
The function `get_adjacent_post` cached the results of database query in the cache group `counts`. This is a none persistent group and meant cache would not persist on the next request. Change cache to save to the `posts` cache group. Cache invalidation is done by using get last changed value of the `posts` and `terms` group as a salt for the cache key. 

Props spacedmonkey, peterwilsoncc, johnbillion, boonebgorges, mukesh27, dd32.
Fixes #41131.
Built from https://develop.svn.wordpress.org/trunk@55085


git-svn-id: http://core.svn.wordpress.org/trunk@54618 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-18 11:20:13 +00:00
youknowriad
3df45e0dc3 Editor: Add inert attribute polyfill.
The new Gutenberg packages are using the inert attribute
to disable some parts of the HTML tree in an accessible way.

Props ntsekouras.
Fixes #57492.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-18 11:16:33 +00:00
spacedmonkey
da05dbb69c Taxonomy: Remove placeholder from WP_Term_Query cache key.
Remove escape placeholder from query cache key, as placeholders are on a based on a unique id on every request. This meant that it is impossible for a cache to be reused, making queries that use escape placeholders such as searches, meta queries or using the `description__like` / `name__like` parameters were unable to be cached.  
 
Follow on from [54634]. 

Props spacedmonkey, peterwilsoncc.
Fixes #57298.
Built from https://develop.svn.wordpress.org/trunk@55083


git-svn-id: http://core.svn.wordpress.org/trunk@54616 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-18 09:58:16 +00:00
audrasjb
5bda5f22dc Administration: Use a consistent capitalization in Privacy Policy related strings.
This changeset fixes a few use case:
- When referring to the Privacy Policy page, "Privacy Policy" should use capitalization on "Privacy Policy", but "page" should remain lowercase;
- When referring to the fact that a website needs, let's say "a relevant privacy policy", "privacy policy" should stay lowercase.

This changeset also updates other small capitalization issues.

Props aravindajith, audrasjb, sarathar, nithi22, costdev.
Fixes #57226.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-17 21:34:12 +00:00
Sergey Biryukov
e4a77d8460 Code Modernization: Rename parameters that use reserved keywords in phpunit/tests/hooks/addFilter.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 `$value` in:
* `Tests_Hooks_AddFilter::_filter_remove_and_add1()`
* `Tests_Hooks_AddFilter::_filter_remove_and_add2()`
* `Tests_Hooks_AddFilter::_filter_remove_and_recurse_and_add2()`
* `Tests_Hooks_AddFilter::_filter_remove_and_add3()`
* `Tests_Hooks_AddFilter::_filter_remove_and_add4()`

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023], [55027], [55028], [55034], [55036], [55037], [55038], [55039], [55049], [55050], [55060], [55062], [55064], [55065], [55076], [55077], [55078].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54614 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-17 14:07:18 +00:00
audrasjb
06010c2795 Docs: Remove unused post_modified and post_modified_gmt params from wp_insert_post() docblock.
Props dshanske, mehulkaklotar.
Fixes #57473.
See #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-16 20:39:10 +00:00
Felix Arntz
98c4aaf832 Editor: Update packages to unblock lazy-loading issues.
Fixing the issue that featured images are always lazy-loaded in block themes required an upstream Gutenberg change https://github.com/WordPress/gutenberg/pull/45534. This changeset updates packages in order to unblock the remainder of the fix in `trunk`.

Props mamaduka.
See #56930.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-16 19:59:36 +00:00
Sergey Biryukov
ea16f92902 Code Modernization: Rename parameters that use reserved keywords in phpunit/tests/functions/wpListSort.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 `$list` parameter to `$input_list` in:
* `Tests_Functions_wpListSort::test_wp_list_sort()`
* `Tests_Functions_wpListSort::test_wp_list_sort_preserve_keys()`

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023], [55027], [55028], [55034], [55036], [55037], [55038], [55039], [55049], [55050], [55060], [55062], [55064], [55065], [55076], [55077].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54611 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-16 16:26:22 +00:00
Sergey Biryukov
7644a5d926 Code Modernization: Rename parameters that use reserved keywords in phpunit/tests/functions/wpListPluck.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 `$list` parameter to `$input_list` in `Tests_Functions_wpListPluck::test_wp_list_pluck()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023], [55027], [55028], [55034], [55036], [55037], [55038], [55039], [55049], [55050], [55060], [55062], [55064], [55065], [55076].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54610 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-16 16:21:19 +00:00
Sergey Biryukov
15d51d7de5 Code Modernization: Rename parameters that use reserved keywords in phpunit/tests/functions/wpListFilter.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 `$list` parameter to `$input_list` in `Tests_Functions_wpListFilter::test_wp_list_filter()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023], [55027], [55028], [55034], [55036], [55037], [55038], [55039], [55049], [55050], [55060], [55062], [55064], [55065].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54609 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-16 16:18:21 +00:00
audrasjb
6ed4fb675e Docs: Various docblock fixes in Multisite WordPress API related functions.
Follow-up to [55074].

See #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54608 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-15 17:52:11 +00:00
audrasjb
0f0372c99d Docs: Add a missing quote to wp_is_large_network() Docblock params.
Props lanacodes.
Fixes #57468.
See #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54607 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-15 17:18:11 +00:00
audrasjb
ce00f7f664 Docs: Typo correction in POP3 class send_cmd() inline docs.
Props nitman43, manojkpatil, kebbet.
Fixes #57449.
See #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54606 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-15 15:24:12 +00:00
audrasjb
0a16223d4c Docs: Use third-person singular verbs for Script Loader related function descriptions, as per docblocks standards.
See #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54605 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-15 14:57:13 +00:00
audrasjb
b211123173 Docs: Improve wp_style_add_data() function description.
This changeset removes an extra apostrophe in `wp_style_add_data()` DocBlock.

Props lanacodes, ashrafulsarkar, SergeyBiryukov.
Fixes #57466.
See #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-15 14:50:11 +00:00
Sergey Biryukov
4fb871ef19 Tests: Use more specific assertions in image saving tests.
When passed a `WP_Image_Editor` instance as the `$image` parameter, `wp_save_image_file()` returns an array on success, so we can specifically check for an array instead of any non-empty result.

Likewise, in PDF tests, when creating an attachment is expected to return an integer ID and not a `WP_Error` object, we can specifically check for that.

Follow-up to [1061/tests], [38949], [39617], [42792], [53529], [53530], [53531], [55019], [55066].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@55070


git-svn-id: http://core.svn.wordpress.org/trunk@54603 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-15 13:38:12 +00:00
John Blackbourn
badc8943d1 HTTP API: Correct the name of a filter referenced in the docs for wp_redirect() and wp_safe_redirect().
Props pbiron, audrasjb, SergeyBiryukov 

Fixes #57464

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


git-svn-id: http://core.svn.wordpress.org/trunk@54602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-15 01:01:15 +00:00
audrasjb
d5f95382f0 Embeds: Update Mixcloud oEmbed URL to the new domain.
Replaces `https://www.mixcloud.com/oembed` with `https://app.mixcloud.com/oembed`.
Mixcloud plan to redirect old URLs to the new endpoint.

Props matclayton, peterwilsoncc, audrasjb, ayeshrajans.
Fixes #57376.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-14 10:49:12 +00:00
audrasjb
367e6b4cdf Themes: Add opt-in Appearance Tools support for Classic Themes.
This changeset merges the following changes from Gutenberg repository: 

- Allow themes without `theme.json` to opt-in to appearance tools via `add_theme_support( 'appearance-tools' );`
- Update `wpThemeJsonResolver` unit tests accordingly

See the following pull request for more info: https://github.com/WordPress/gutenberg/pull/43337

Props ironprogrammer, audrasjb.
Fixes #57460.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-14 09:36:14 +00:00
Sergey Biryukov
05a019f95e Tests: Move the test for wp_save_image_file() with a GD resource to a more appropriate place.
When passed a GD resource as `$image`, `wp_save_image_file()` should throw a deprecated argument notice:
{{{
Function wp_save_image_file was called with an argument that is deprecated since version 3.5.0!
$image needs to be a WP_Image_Editor object.
}}}

The test verifies that the notice is thrown as expected.

Includes:
* Removing the `Tests_Functions_Deprecated` class. It appears to be initially intended for testing deprecated functions or arguments, but this was later superseded by the `@expectedDeprecated` annotation.
* Removing a redundant test for `wp_save_image_file()` **not** throwing a deprecation notice when passed a `WP_Image_Editor` instance. This is already covered by `test_wp_save_image_file()`, which would fail if there is an unexpected deprecation notice.

Follow-up to [1061/tests], [25408], [25409], [53529].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@55066


git-svn-id: http://core.svn.wordpress.org/trunk@54599 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-14 02:08:13 +00:00
Sergey Biryukov
629d6e9757 Code Modernization: Rename parameters that use reserved keywords in phpunit/tests/functions/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 `$function` parameter to `$function_name` in `Tests_Functions_Deprecated::deprecated_function()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023], [55027], [55028], [55034], [55036], [55037], [55038], [55039], [55049], [55050], [55060], [55062], [55064].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54598 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-13 22:13:17 +00:00
Sergey Biryukov
fac70351e9 Code Modernization: Rename parameters that use reserved keywords in phpunit/tests/formatting/sanitizeTrackbackUrls.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 `$break` parameter to `$separator` in `Tests_Formatting_SanitizeTrackbackUrls::test_sanitize_trackback_urls_with_multiple_urls()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023], [55027], [55028], [55034], [55036], [55037], [55038], [55039], [55049], [55050], [55060], [55062].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54597 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-13 14:38:11 +00:00
John Blackbourn
779ead447e HTTP API: Correct the documentation for the https_ssl_verify and https_local_ssl_verify filters.
The value for both these filters can also contain a string path to a CA file used to authenticate the identity of the remote server.

Props chesio, mcaskill

Fixes #54803

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


git-svn-id: http://core.svn.wordpress.org/trunk@54596 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-13 14:22:12 +00:00
Sergey Biryukov
57d74635e5 Code Modernization: Rename parameters that use reserved keywords in phpunit/tests/formatting/sanitizeTextField.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 `$str` in `Tests_Formatting_SanitizeTextField::test_sanitize_text_field()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023], [55027], [55028], [55034], [55036], [55037], [55038], [55039], [55049], [55050], [55060].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54595 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-13 13:59:16 +00:00
audrasjb
19e75805b0 Bundled Themes: Add Mastodon domains for menu item icons.
This changeset adds the top 10 Mastodon domains by popularity to Twenty Twenty and Twenty Twenty-One Social icon feature.

Note: other Mastodon domains can be added to the array of domain mapping using `twentytwenty_social_icons_map` and `twenty_twenty_one_social_icons_map` filters.

Props triumvirate, sabernhardt, audrasjb, peterwilsoncc, rryyaanndd, ianbelanger.
Fixes #57293, #49099.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54594 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-13 13:19:13 +00:00
Sergey Biryukov
4191d80f70 Code Modernization: Rename parameters that use reserved keywords in phpunit/tests/file.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 `$case` parameter to `$filename` in `Tests_File::test_wp_tempnam()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023], [55027], [55028], [55034], [55036], [55037], [55038], [55039], [55049], [55050].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-13 01:01:12 +00:00
Andrew Ozz
0380c40190 Menus: Compare $menu_item->ID and $menu_item->menu_item_parent as strings and avoid moidifying them. Plugins may change the ID to a string.
Props Chouby, peterwilsoncc, Chrystl, manooweb, azaozz.
Fixes #57169.
Built from https://develop.svn.wordpress.org/trunk@55059


git-svn-id: http://core.svn.wordpress.org/trunk@54592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-12 23:24:12 +00:00
audrasjb
e87b8157cb Build/Test Tools: Fix an incorrect inline comment in Tests_Ajax_wpAjaxReplytoComment.
This changeset replaces "Become an administrator" with "Become a subscriber" in an inline comment located in `Tests_Ajax_wpAjaxReplytoComment::test_as_subscriber`.

Props davidbinda.
Fixes #57452.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54591 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-12 23:08:16 +00:00
Sergey Biryukov
10ad5f0d4d Docs: Correct the type of the $user_id parameter in wp_set_password action.
Follow-up to [6600], [55056].

See #57436.
Built from https://develop.svn.wordpress.org/trunk@55057


git-svn-id: http://core.svn.wordpress.org/trunk@54590 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-12 13:14:15 +00:00
audrasjb
00ed89ffb1 Users: Add an action hook on wp_set_password().
This changeset introduces the `wp_set_password` action hook, triggered after a password is set for a given user. As several plugins are calling `wp_set_password()` directly, adding an action to the end of the function will help plugin authors to catch all instances of password setting.

Props tanner-m, audrasjb.
Fixes #57436.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54589 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-12 09:05:15 +00:00
Sergey Biryukov
2c0a6fefae Upgrade/Install: Revert a temporary conditional for testing the Rollbacks feature project.
The [https://make.wordpress.org/core/2021/02/19/feature-plugin-rollback-update-failure/ Rollback Update Failure feature project] has been split into two plugins for testing:
 * [https://github.com/afragen/faster-updates Faster Updates] speeds up plugin or theme updates by moving files rather than copying them, thus decreasing the memory usage and reducing the chance of timeouts or running out of disk space during updates.
 * [https://wordpress.org/plugins/rollback-update-failure/ Rollback Update Failure] 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.

The current priority of the feature project is to test the new `move_dir()` function, which offers better performance than `copy_dir()`. Instead of copying a directory in a recursive manner file by file from one location to another, `move_dir()` uses the `rename()` PHP function to speed up the process, which is instrumental in updating large plugins without a delay. If the renaming failed, it falls back to the `copy_dir()` WP function.

The `move_dir()` function is self-contained in the Faster Updates plugin and does not require any special hooks in core, so the conditional previously added to `WP_Upgrader::install_package()` to facilitate testing is no longer needed and can be removed.

Follow-up to [53578], [54484], [54643].

Props afragen, costdev, peterwilsoncc.
See #56057, #57375, #57386.
Built from https://develop.svn.wordpress.org/trunk@55055


git-svn-id: http://core.svn.wordpress.org/trunk@54588 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-12 00:19:12 +00:00
audrasjb
6e83ac5595 Date/Time: Prevent errors in current_time() when using timestamp and no value for gmt_offset.
This changeset moves typecasting to affect the `get_option` value, which ensures that when math is done it does not generate any error. In PHP 7.4 and earlier the previous implementation was dismissed as a warning, but in PHP 8+ it would have throw a fatal error.

Follow-up to [45856].

Props Nick_theGeek, SergeyBiryukov, johnbillion.
Fixes #57035.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54587 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-11 23:20:12 +00:00
Felix Arntz
de505f0eac Formatting: Improve performance of esc_url().
This changeset indirectly improves performance of the commonly used `esc_url()` function by optimizing the low-level function `wp_kses_bad_protocol()` for the by far most common scenarios, which are URLs using either the `http` or `https` protocol.

For this common scenario, the changeset now avoids the `do while` loop. While for a single call to the `esc_url()` function the performance wins are negligible, given that `esc_url()` is often called many times in one page load, they can add up, making this a worthwhile improvement.

Props mukesh27, schlessera, markjaquith, azaozz, spacedmonkey.
Fixes #22951.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54586 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-11 15:23:13 +00:00
audrasjb
bc8ed77b19 Code Modernization: Fix a jQuery Migrate deprecation in wpdialog.
This changeset replaces a `focus()` shorthand in WP Core's customized jQuery UI widget `wpdialog` to avoid a jQuery Migrate deprecation notice in the browser's console.

Props TobiasBg, elifvish.
Fixes #56830.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54585 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-11 14:07:11 +00:00
audrasjb
6e88e39baa Docs: Align spelling with American English.
This changeset updates the use of "-ise" suffix to American English "-ize" in various files.

Follow-up to [54663], [54664], [55043], [55044].

Props kebbet, mukesh27.
See #56811, #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-11 13:59:13 +00:00
Sergey Biryukov
af34b7c082 Code Modernization: Rename parameters that use reserved keywords in phpunit/tests/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:
* `Tests_WP_Customize_Setting::custom_type_getter()`
* `Tests_WP_Customize_Setting::custom_type_value_filter()`

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023], [55027], [55028], [55034], [55036], [55037], [55038], [55039], [55049].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54583 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-11 12:23:12 +00:00
Sergey Biryukov
48eee34128 Code Modernization: Rename parameters that use reserved keywords in phpunit/tests/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 `Test_WP_Customize_Nav_Menus::filter_items()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023], [55027], [55028], [55034], [55036], [55037], [55038], [55039].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54582 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-11 11:51:16 +00:00
audrasjb
c5409cd17b General: revert [55045].
This changeset reverts [55045] to maintain backward compatibility for developers using the function in their SCSS.

Follow-up to [55045].

Unprops audrasjb.
Props peterwilsoncc, kebbet.
See #56811.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54581 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-11 09:17:21 +00:00
hellofromTonya
07a0b36562 I18N: Initialize WP_Locale array properties.
Initializing the `WP_Locale` array properties to an empty array at the class definition point. Why?

* Ensure the properties initialize to an `array` data type at instantiation (rather than `null`).

This initialization is needed to ensure the properties are not `null` if another class inherits from `WP_Locale` but does not run `WP_Locale::init()` from the constructor. In this case, the initialization prevents

{{{
Warning: array_values() expects parameter 1 to be array, null given
}}}

when Core uses any of the properties.

* Good design practice.

The code and documentation are clearly expecting these properties to be an `array` data type. Setting each to a default `array()` state further helps to clearly communicate the code design.

Follow-up to [37889], [36292], [31078], [3676], [6589].

Props tyxla, SergeyBiryukov, azaozz, hellofromTonya, mukesh27.
See #57427.
Built from https://develop.svn.wordpress.org/trunk@55047


git-svn-id: http://core.svn.wordpress.org/trunk@54580 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-10 14:00:36 +00:00
Sergey Biryukov
924f204630 HTTP API: Use correct class reference for Requests' HTTP Proxy in WP_Http::request().
Renaming the class was missed in [54997] when updating changes in `WP_Http::request()` for the Requests 2.0.0 external library upgrade. The `HTTP` class no longer exists and caused a fatal error:
{{{
PHP Fatal error: Class 'WpOrg\Requests\Proxy\HTTP' not found in wp-includes/class-wp-http.php on line 382
}}}

This commit renames the class to `Http` and resolves the fatal error.

Follow-up to [52244], [52315], [52327], [52328], [54997], [55007].

Props danielbachhuber, jrf.
See #54504.
Built from https://develop.svn.wordpress.org/trunk@55046


git-svn-id: http://core.svn.wordpress.org/trunk@54579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-10 11:30:15 +00:00
audrasjb
668b8c55b3 General: Align spelling with American English.
This changeset renames `url-friendly-colour` to `url-friendly-color` in `_admin.scss`.

Follow-up to [54663], [54664], [55043], [55044].

Props kebbet.
See #56811.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54578 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-10 11:06:21 +00:00
audrasjb
b6760ea0ce Docs: Align spelling with American English.
This changeset updates the use of "-ise" suffix to American English "-ize" and replaces "behaviour" with "behavior" in various docblocks.

Follow-up to [54663], [54664], [55043].

Props kebbet.
See #56811, #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-10 09:30:13 +00:00
audrasjb
693b507de7 Docs: Align spelling with American English.
This changeset updates the use of "-ise" suffix to American English "-ize" in docblocks.

Follow-up to [54663], [54664].

Props ironprogrammer, costdev.
See #56811, #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54576 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-10 09:09:13 +00:00
audrasjb
2058cdd91f Help/About: Improve comments keyboard shortcuts HelpHub links.
This changeset adds an anchor in Comments keyboard shortcut documentation links to direct the user to a more specific section of the HelpHub documentation. It also removes `target="_blank" from a link, since preventing data loss when clicking any on User Edit and Comment Edit screens is already handled by another existing ticket (#40493).

Props NekoJonez, SergeyBiryukov, sabernhardt, dennisatyoast, robinwpdeveloper.
Fixes #56920.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54575 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-10 09:01:13 +00:00
audrasjb
9798608a6a Twenty Twenty-Three: Fix incorrect gradient values in Aubergine theme.
This changeset removes two unwanted semicolons from the gradients declaration in `aubergine.json`, fixing two gradients that were showing a checkerboard pattern instead of the gradient, and a console error for each of them.

Props wildworks, sabernhardt.
Fixes #57245.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54574 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-09 23:45:12 +00:00
audrasjb
e7765cb5e2 Pings/Trackbacks: Remove a mention of the "Page" post type from the Discussion meta box.
This changeset removes a mention of the "Page" post type from the Discussion meta box as this is a generic meta box, used for multiple post types. It makes it more consistent with the other option available in the meta box ("Allow comments") and also with the corresponding option in the block editor.

Follow-up to [12323].

Props jeremyfelt, sabernhardt, audrasjb, virgar.
Fixes #57429.
See #11346.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54573 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-09 21:32:16 +00:00
Sergey Biryukov
01f1448f73 Code Modernization: Rename parameters that use reserved keywords in phpunit/tests/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 `$class` parameter to `$setting_class` in:
 * `Tests_WP_Customize_Manager::return_dynamic_customize_setting_class()`
 * `Tests_WP_Customize_Manager::return_dynamic_customize_setting_args()`
* Amends the `$args` and `$id` parameters in both methods for consistency.
* Corrects the DocBlock for `::return_dynamic_customize_setting_args()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023], [55027], [55028], [55034], [55036], [55037], [55038].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-09 16:40:14 +00:00
Sergey Biryukov
8eed7d4dc5 Code Modernization: Rename parameters that use reserved keywords in phpunit/tests/cron.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 `$null` parameter to `$result` in `Tests_Cron::filter_pre_schedule_event_filter()`.
* Amends the `$pre` parameter of the `pre_schedule_event` 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], [54947], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023], [55027], [55028], [55034], [55036], [55037].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54571 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-09 00:42:15 +00:00
Sergey Biryukov
76e08ae1f2 Code Modernization: Rename parameters that use reserved keywords in phpunit/tests/compat/mbSubstr.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 `$input_string` in the unit tests for `mb_substr()` polyfill.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023], [55027], [55028], [55034], [55036].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54570 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-08 01:15:16 +00:00
Sergey Biryukov
3ded56f732 Code Modernization: Rename parameters that use reserved keywords in phpunit/tests/compat/mbStrlen.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 `$input_string` in the unit tests for `mb_strlen()` polyfill.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023], [55027], [55028], [55034].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54569 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-07 00:38:14 +00:00
spacedmonkey
30c49f8df6 Query: Stop priming posts twice in WP_Query.
Part revert of [54352]. In cases where queries are not split, then it results in priming posts that are already loaded resulting in a superfluous database query. 

Props spacedmonkey, flixos90, peterwilsoncc.
Fixes #57373.
Built from https://develop.svn.wordpress.org/trunk@55035


git-svn-id: http://core.svn.wordpress.org/trunk@54568 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-06 10:35:15 +00:00
Sergey Biryukov
df12521451 Code Modernization: Rename parameters that use reserved keywords in phpunit/tests/block-supports/elements.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 `$block_content` in `Tests_Block_Supports_Elements::make_unique_id_one()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023], [55027], [55028].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-06 00:37:14 +00:00
Sergey Biryukov
e5b8662000 Coding Standards: Correct alignment in wp-includes/option.php.
This fixes an `Equals sign not aligned with surrounding statements` WPCS warning, so that the output of `composer format` is clean.

Follow-up to [54948].

See #56791.
Built from https://develop.svn.wordpress.org/trunk@55033


git-svn-id: http://core.svn.wordpress.org/trunk@54566 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-05 15:27:16 +00:00
Sergey Biryukov
aa9b706870 Coding Standards: Fix WPCS issues in phpunit/tests/pluggable/wpMail.php.
This addresses a few errors along the lines of:

* Opening parenthesis of a multi-line function call must be the last content on the line
* Only one argument is allowed per line in a multi-line function call
* Each array item in a multi-line array declaration must end in a comma
* Closing parenthesis of a multi-line function call must be on a line by itself

Follow-up to [55030].

See #28407.
Built from https://develop.svn.wordpress.org/trunk@55032


git-svn-id: http://core.svn.wordpress.org/trunk@54565 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-05 11:19:12 +00:00
Sergey Biryukov
2c91dfbc25 Tests: Use correct variable in _fake_download_url_non_200_response_code().
Follow-up to [55029].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@55031


git-svn-id: http://core.svn.wordpress.org/trunk@54564 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-05 10:50:28 +00:00
johnjamesjacoby
0f0646eda0 Mail: allow custom attachment filenames in wp_mail().
Previous to this change, attachment filenames in outgoing emails could only ever be derived from their paths (passed in as a numerically indexed array of `$attachments`).

This changeset adds support for passing an associative `$attachments` array, where the key strings will be used as filenames instead.

Includes 2 new unit tests to ensure both array formats continue to work as intended.

Props johnjamesjacoby, ritteshpatel, swissspidy, syntaxart.
Fixes #28407.
Built from https://develop.svn.wordpress.org/trunk@55030


git-svn-id: http://core.svn.wordpress.org/trunk@54563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-05 10:49:16 +00:00
Sergey Biryukov
995964e3f6 Tests: Bring some consistency to mocking HTTP requests in unit tests.
Includes:
* Renaming the `$preempt` parameter to `$response` in the `pre_http_request` filter to better match the context used in callbacks (returning the original value if the conditions are not met rather than preempting the request).
* Synchronizing parameter names and types in various `pre_http_request` callbacks in unit tests.

Follow-up to [34509], [37907], [40628], [40629], [45667], [46175], [48242], [48462], [49904], [51021], [51973], [52146], [52382], [54043], [54968].

See #56793, #56792.
Built from https://develop.svn.wordpress.org/trunk@55029


git-svn-id: http://core.svn.wordpress.org/trunk@54562 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-05 10:23:14 +00:00
Sergey Biryukov
dca7b5204b Code Modernization: Rename parameters that use reserved keywords in phpunit/includes/utils.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 `$callable` parameter to `$callback` in `get_echo()`.
* Renames the `$array` parameter to `$expected_data` in `gen_tests_array()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023], [55027].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54561 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-04 14:18:18 +00:00
Sergey Biryukov
3efd18435b Code Modernization: Rename parameters that use reserved keywords in phpunit/includes/spy-rest-server.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 `$namespace` parameter to `$route_namespace` in `Spy_REST_Server::register_route()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021], [55023].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-03 12:47:15 +00:00
audrasjb
1e82763d99 Networks and Sites: Mark required fields as such in New User Form.
This changeset adds `required="required"` attributes to required form fields and uses `wp_required_field_message()` and `wp_required_field_indicator()` functions to improve the generated markup, and for better consistency with other required fields.

Props jackreichert, flixos90, afercia, sabernhardt.
Fixes #38460.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-02 22:50:15 +00:00
Sergey Biryukov
ed86f1f0c2 Tests: Update the terminology used for filter names in tests_add_filter().
This commit renames the `$tag` and `$function_to_add` parameters to match the `add_filter()` function signature.

Includes:
* Renaming the `$tag` parameter to `$hook_name`.
* Renaming the `$function_to_add` parameter to `$callback`.
* Synchronizing documentation for:
 * `tests_add_filter()` and `add_filter()`
 * `_test_filter_build_unique_id()` and `_wp_filter_build_unique_id()`

Follow-up to [760/tests], [38582], [43555], [46801], [50807], [52300], [53804], [53805], [55023].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@55025


git-svn-id: http://core.svn.wordpress.org/trunk@54558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-02 00:30:16 +00:00
Sergey Biryukov
c145a2f96d Happy New Year! 🎄
Update copyright year to 2023 in `license.txt` and bundled themes.

Follow-up to [18201], [23306], [28064], [36855], [36856], [39659], [40241], [42424], [46719], [46720], [47025], [47026], [49915], [52427].
Built from https://develop.svn.wordpress.org/trunk@55024


git-svn-id: http://core.svn.wordpress.org/trunk@54557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-01-01 00:06:18 +00:00
Sergey Biryukov
0908abdfc6 Code Modernization: Rename parameters that use reserved keywords in phpunit/includes/functions.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 `_test_filter_build_unique_id()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020], [55021].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-31 01:17:15 +00:00
Sergey Biryukov
e27a087d9e Coding Standards: Add visibility to Tests_Dependencies::test_enqueue_before_register().
Adds a `public` visibility to a test where it was not explicitly specified. 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], [52338], [54889].

Props jrf.
See #56791.
Built from https://develop.svn.wordpress.org/trunk@55022


git-svn-id: http://core.svn.wordpress.org/trunk@54555 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-30 03:31:13 +00:00
Sergey Biryukov
835378abe1 Code Modernization: Rename parameters that use reserved keywords in phpunit/includes/class-wp-unittest-factory-for-attachment.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 `$parent_post_id` in `WP_UnitTest_Factory_For_Attachment::create_upload_object()`.
* Amends the `$parent_post` parameter in `wp_insert_attachment()` and `WP_REST_Revisions_Controller::get_parent()` 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], [54947], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017], [55020].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-30 02:38:17 +00:00
Sergey Biryukov
36883a9cc2 Code Modernization: Rename parameters that use reserved keywords in phpunit/includes/class-wp-unittest-factory-for-thing.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_UnitTest_Factory_For_Thing::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], [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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016], [55017].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54553 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-29 15:33:18 +00:00
Sergey Biryukov
8096f784c5 Tests: Bring some consistency to creating and updating objects in factory classes.
In various unit test factory classes, some of the `create_object()` and `update_object()` methods returned a `WP_Error` object on failure, while a few others were documented to do so, but did not in practice, instead returning the value `0` or `false`, or not accounting for a failure at all.

This commit aims to handle this in a consistent way by updating the methods to always return the object ID on success and a `WP_Error` object on failure.

Includes:
* Updating and correcting the relevant documentation parts.
* Adding missing documentation and `@since` tags in some classes.
* Renaming some variables to clarify that it is the object ID which is passed around, not the object itself.

Follow-up to [760/tests], [838/tests], [922/tests], [948/tests], [985/tests], [27178], [32659], [34855], [37563], [40968], [44497], [46262].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@55019


git-svn-id: http://core.svn.wordpress.org/trunk@54552 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-28 14:09:19 +00:00
Sergey Biryukov
1e3c221043 Docs: Remove the legacy example of passing a taxonomy to get_terms().
As of WordPress 4.5, taxonomies should be passed to `get_terms()` via the `taxonomy` argument in the `$args` array:
{{{
$terms = get_terms( array(
    'taxonomy'   => 'post_tag',
    'hide_empty' => false,
) );
}}}

The legacy way of passing a taxonomy via the function's first parameter was still mentioned in the documentation, causing some confusion.

This commit updates the function documentation to better highlight the currently recommended approach.

Follow-up to [36614].

Props ramon-fincken, sabernhardt, SergeyBiryukov.
Fixes #57380.
Built from https://develop.svn.wordpress.org/trunk@55018


git-svn-id: http://core.svn.wordpress.org/trunk@54551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-27 12:23:15 +00:00
Sergey Biryukov
3657c9240d Code Modernization: Rename parameters that use reserved keywords in phpunit/includes/class-wp-test-stream.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 `$var` parameter to `$value` in `WP_Test_Stream::stream_metadata()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015], [55016].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54550 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-26 11:28:15 +00:00
Sergey Biryukov
f621e98430 Code Modernization: Rename parameters that use reserved keywords in phpunit/includes/abstract-testcase.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 `$function_name` in:
 * `WP_UnitTestCase_Base::deprecated_function_run()`
 * `WP_UnitTestCase_Base::doing_it_wrong_run()`
* Renames the `$object` parameter to `$actual` in:
 * `WP_UnitTestCase_Base::assertEqualFields()`
 * `WP_UnitTestCase_Base::assertNonEmptyMultidimensionalArray()`

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014], [55015].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54549 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-25 13:12:16 +00:00
Sergey Biryukov
35e349ee16 Code Modernization: Rename parameters that use reserved keywords in wp-includes/user.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 `$global` parameter to `$is_global` in:
* `update_user_option()`
* `delete_user_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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013], [55014].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54548 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-24 14:33:14 +00:00
Sergey Biryukov
f1df157fa7 Code Modernization: Rename parameters that use reserved keywords in wp-includes/theme.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 `get_theme_mod()`.
* Renames the `$include` parameter to `$file` in `require_if_theme_supports()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011], [55013].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54547 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-23 11:38:15 +00:00
Sergey Biryukov
bf344bb3bf Code Modernization: Rename parameters that use reserved keywords in wp-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 `$require_once` parameter to `$load_once` in:
* `locate_template()`
* `load_template()`

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000], [55011].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-22 11:08:19 +00:00
Peter Wilson
f25373720c External Libraries: Update jQuery to 3.6.3.
Update the jQuery library from 3.6.1 to 3.6.3.

* [https://blog.jquery.com/2022/12/13/jquery-3-6-2-released/ 3.6.2 release announcement]
* [https://blog.jquery.com/2022/12/20/jquery-3-6-3-released-a-quick-selector-fix/ 3.6.3 release announcement]
* [https://github.com/jquery/jquery/compare/3.6.1...3.6.3 Full changelog]

Props TobiasBg, naeemhaque, mukesh27, mgol.
Fixes #57324.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-22 03:25:30 +00:00
Sergey Biryukov
c178ececac Code Modernization: Rename parameters that use reserved keywords in wp-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 `$object` parameter to `$object_type` in `get_object_taxonomies()`.
* Renames the `$parent` parameter to `$parent_term` in:
 * `term_exists()`
 * `wp_check_term_hierarchy_for_loops()`

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996], [55000].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54544 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-21 14:36:18 +00:00
Pascal Birchler
b57ef14af1 I18N: Change how WP_Textdomain_Registry caches translation information.
`WP_Textdomain_Registry` was introduced in [53874] and later adjusted in [54682] to store text domains and their language directory paths, addressing issues with just-in-time loading of textdomains when using locale switching and `load_*_textdomain()` functions.

This change improves how the class stores information about all existing MO files on the site, addressing an issue where translations are not loaded after calling `switch_to_locale()`.

Props johnbillion, ocean90, SergeyBiryukov.
Fixes #57116.
Built from https://develop.svn.wordpress.org/trunk@55010


git-svn-id: http://core.svn.wordpress.org/trunk@54543 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-20 15:12:11 +00:00
Sergey Biryukov
9dfc9375da Themes: Alphabetize the properties list in WP_Theme_JSON::VALID_STYLES for consistency.
Follow-up to [53129], [54253], [55008].

See #57354.
Built from https://develop.svn.wordpress.org/trunk@55009


git-svn-id: http://core.svn.wordpress.org/trunk@54542 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-20 13:57:15 +00:00
hellofromTonya
3ddfa88245 Themes: Adds outline CSS properties support in theme.json.
Adds the ability to define outline CSS properties for elements and blocks within `theme.json` to render `outline-color`, `outline-offset`, `outline-style`, and `outline-width` styles.

Originally developed and tested in [https://github.com/WordPress/gutenberg/pull/43526 Gutenberg PR 43526].

Props onemaggie, hellofromTonya, audrasjb, ironprogrammer.
Fixes #57354.
Built from https://develop.svn.wordpress.org/trunk@55008


git-svn-id: http://core.svn.wordpress.org/trunk@54541 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-19 20:55:13 +00:00
hellofromTonya
eff9f72714 HTTP API: Adds BC-layer /library/Requests.php file.
When the Requests 2.0.0 [7ef0774f0b/src/Autoload.php (L141-L143) autoloader detects the older (deprecated) `Requests` class], it attempts to load [https://github.com/WordPress/Requests/blob/v2.0.0/library/Requests.php its `/library/Requests.php` file]. Prior to this commit, this file did not exist in Core. Thus, a fatal error happened.

Why not change Requests Autoloader?
Requests is an external dependency that Core consumes. It is also used by other projects outside of Core. Thus, Core needs a fix to guard itself to prevent a fatal error.

The fix:
* Adds the missing `wp-includes/Requests/library/Requests.php` file, which then loads the `wp-includes/class-requests.php` (which will throw a deprecation notice to alert developers to upgrade).
* Adds a test.

Follow-up to [54997].

Props bjorsch, costdev, jrf, mukesh27, peterwilsoncc, ironprogrammer, hellofromTonya.
Fixes #57341.
Built from https://develop.svn.wordpress.org/trunk@55007


git-svn-id: http://core.svn.wordpress.org/trunk@54540 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-19 15:12:11 +00:00
Sergey Biryukov
a65e37770d Tests: Correct a flaky wp_nonce_field() test.
The test for `wp_nonce_field()` with a custom action name verifies that the nonce value matches the one returned by `wp_create_nonce()` with the same action name.

The created nonce, in turn, depends on `wp_nonce_tick()`, which returns a different result in the first and the second half of the nonce's lifespan, one day by default:
* 00:00:01 to 12:00:00 — First tick
* 12:00:01 to 00:00:00 — Second tick

In practice, due to a delay between initializing data providers and running the actual tests, it is possible for the nonce tick to change in the process, for example if the test suite run starts at 11:59:30, and the affected test runs at 12:00:30, causing a test failure.

This commit reduces the chance of a race condition by moving the `wp_create_nonce()` call from the data provider into the test itself.

Includes wrapping long lines with the expected results for better readability.

Follow-up to [54420].

Props NekoJonez, SergeyBiryukov.
See #56793.
Built from https://develop.svn.wordpress.org/trunk@55006


git-svn-id: http://core.svn.wordpress.org/trunk@54539 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-19 14:45:18 +00:00
Peter Wilson
0f323130f7 Menus: Account for legacy calls to nav_menu_css_class filter.
Modify `wp_nav_menu_remove_menu_item_has_children_class()` to account for changes to the `nav_menu_css_class` filter since it's introduction.

The `$args` and `$depth` parameters were added after the filter's introduction so this protects against fatal errors in custom walkers applying the filter in a legacy format.

Without the `$args` or `$depth` parameters, `wp_nav_menu_remove_menu_item_has_children_class()` no longer attempts to remove the `menu-item-has-children` from the lowest level menu items as these are required to determine the current branch the walker is walking.

Follow up to [54999].

Props dd32, azaozz, peterwilsoncc.
See #56926, #28620.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54538 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-19 00:01:14 +00:00
Sergey Biryukov
53eab18979 Twenty Seventeen: Document the $twentyseventeencounter global.
Follow-up to [38833], [38986], [55003].

See #57069, #56792.
Built from https://develop.svn.wordpress.org/trunk@55004


git-svn-id: http://core.svn.wordpress.org/trunk@54537 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-18 13:02:14 +00:00
audrasjb
f2553c0823 Docs: Improve various globals documentation, as per docblock standards.
Props upadalavipul, audrasjb.

See #57069, #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54536 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-18 08:47:13 +00:00
audrasjb
9c1d82dd17 Docs: Update docs for image_sideload_extensions filter to include webp in the list of allowed extensions.
Follow-up to [50810].

Props dimadin.
Fixes #57346.
See #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-17 23:07:16 +00:00
Sergey Biryukov
92673e251e Site Health: Remove the WordPress 5.2 reference from the email sent on fatal errors.
The version reference was initially added to reduce confusion and make it clear that this is new WordPress functionality, with the website itself sending an automated notification of a fatal error, most likely in a plugin or theme.

Almost four years and several major releases later, it no longer adds any helpful information and can be removed.

Follow-up to [44973], [45181], [45268].

Props NekoJonez, jb510, peterwilsoncc, kebbet, mukesh27, mrwweb, johnbillion, SergeyBiryukov.
Fixes #57327. See #54961.
Built from https://develop.svn.wordpress.org/trunk@55001


git-svn-id: http://core.svn.wordpress.org/trunk@54534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-17 15:31:17 +00:00
Sergey Biryukov
b1f7eb6e1e Code Modernization: Rename parameters that use reserved keywords in wp-includes/sitemaps/class-wp-sitemaps.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_Sitemaps::add_robots()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972], [54996].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-16 10:43:16 +00:00
Peter Wilson
4d4ddb80dc Menus: Prevent infinite loop in menus.
This modifies how the `menu-item-has-children` class is removed from bottom level menu items. Instead of removing the class within `wp_nav_menu()` a filter is applied to the `nav_menu_css_class` hook to remove the class as required.

Introduces `wp_nav_menu_remove_menu_item_has_children_class()` for removing the class.

Reverts source code changes in [54478,54801], the tests are retained.

Props davidbinda, SergeyBiryukov, mhkuu, JeffPaul, jmdodd, priethor, desrosj, hellofromTonya, azaozz, peterwilsoncc.
Fixes #56926.
See #28620.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-16 02:40:15 +00:00
spacedmonkey
72948dee1e Themes: Improve performance of _add_block_template_part_area_info and _add_block_template_info functions.
Improve performance of `_add_block_template_part_area_info` and `_add_block_template_info` function by passing the `with_supports` parameter to the `WP_Theme_JSON_Resolver::get_theme_data` method. This results in hitting an existing cache and in many less calls to get_option. 

Props spacedmonkey, flixos90, SergeyBiryukov, peterwilsoncc, desrosj.
Fixes #57077.
Built from https://develop.svn.wordpress.org/trunk@54998


git-svn-id: http://core.svn.wordpress.org/trunk@54531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-15 22:55:16 +00:00
hellofromTonya
645e753a51 External Libraries: Update Requests library to version 2.0.0.
This is a major release and contains breaking changes.

Most important changes to be aware of for this release:
* All code is now namespaced. Though there is a full backward compatibility layer available and the old class names are still supported, using them will generate a deprecation notice (which can be silenced by plugins if they'd need to support multiple WP versions). See the [https://requests.ryanmccue.info/docs/upgrading.html upgrade guide] for more details.
* A lot of classes have been marked `final`. This should generally not affect userland code as care has been taken to not apply the `final` keyword to classes which are known to be extended in userland code.
* Extensive input validation has been added to Requests. When Requests is used as documented though, this will be unnoticable.
* A new `WpOrg\Requests\Requests::has_capabilities()` method has been introduced which can be used to address #37708.
* A new `WpOrg\Requests\Response::decode_body()` method has been introduced which may be usable to simplify some of the WP native wrapper code.
* Remaining PHP 8.0 compatibility fixed (support for named parameters).
* PHP 8.1 compatibility.

Release notes: https://github.com/WordPress/Requests/releases/tag/v2.0.0

For a full list of changes in this update, see the Requests GitHub:
https://github.com/WordPress/Requests/compare/v1.8.1...v2.0.0

This commit also resolves 2 blocking issues which previously caused the revert of [52244]:

* New Requests files are loaded into `wp-includes/Requests/src/`, matching the location of the library. In doing so, filesystems that are case-insensitive are not impacted (see #54582).
* Preload: During a Core update, the old Requests files are preloaded into memory before the update deletes the files. Preloading avoids fatal errors noted in #54562. 

Follow-up to [50842], [51078], [52244], [52315], [52327], [52328].

Props jrf, schlessera, datagutten, wojsmol, dustinrue, soulseekah, szepeviktor. costdev, sergeybiryukov, peterwilsoncc, ironprogrammer, antonvlasenko, hellofromTonya, swissspidy, dd32, azaozz, TobiasBg, audrasjb.
Fixes #54504.
See #54582, #54562.
Built from https://develop.svn.wordpress.org/trunk@54997


git-svn-id: http://core.svn.wordpress.org/trunk@54530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-15 21:32:17 +00:00
Sergey Biryukov
1587b0d725 Code Modernization: Rename parameters that use reserved keywords in wp-includes/rewrite.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_feed()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971], [54972].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54529 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-15 11:03:11 +00:00
Peter Wilson
d2c067a216 Build/Test tools: Remove 3.7-4.0 branches from scheduled test runs.
We're gonna teach 'em how to say goodbye (teach 'em how to say goodbye)
Teach 'em how
To say goodbye
To say goodbye (say goodbye)
Say goodbye (say goodbye)
One last time

Fixes #57228.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-15 05:04:14 +00:00
Andrew Ozz
599201eca7 Menus: Reset menu_item_parent to 0 when the parent is set to the item itself.
Props: peterwilsoncc, SergeyBiryukov, azaozz.
Fixes #57169.
Built from https://develop.svn.wordpress.org/trunk@54973


git-svn-id: http://core.svn.wordpress.org/trunk@54525 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-14 22:54:14 +00:00
Sergey Biryukov
95c797463d Code Modernization: Rename parameters that use reserved keywords in wp-includes/rest-api/endpoints/class-wp-rest-widgets-controller.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 `$form_data` in a closure in `WP_REST_Widgets_Controller::get_item_schema()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970], [54971].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54524 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-14 14:31:11 +00:00
Sergey Biryukov
b3a7c69ac5 Code Modernization: Rename parameters that use reserved keywords in wp-includes/rest-api/endpoints/class-wp-rest-widget-types-controller.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 `$form_data` in a closure in `WP_REST_Widget_Types_Controller::register_routes()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969], [54970].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54523 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-14 14:28:12 +00:00
Sergey Biryukov
1d9e308c67 Code Modernization: Rename parameters that use reserved keywords in wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.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 `$parent` to `$parent_post` in `WP_REST_Revisions_Controller::get_parent()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965], [54969].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-14 13:52:14 +00:00
Sergey Biryukov
e623438f68 Code Modernization: Rename parameters that use reserved keywords in wp-includes/rest-api/endpoints/class-wp-rest-controller.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 `$object` to `$data_object` in `WP_REST_Controller::update_additional_fields_for_object()`.
* Includes a minor code layout fix for better readability.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964], [54965].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54521 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-14 13:41:13 +00:00
Peter Wilson
fdb5ee0291 Built/Test tools, HTTP API: Refactor test for multiple location headers.
Remove wordpress.org as an external dependency testing `WP_HTTP::handle_redirects()`.

This refactors and reenables an existing test to call the `WP_HTTP::handle_redirects()` method directly with a mocked array of HTTP headers containing multiple location headers.

The test is moved from the external-http group to the http test group as it no longer makes an HTTP request.

Follow up to [54955].

Props SergeyBiryukov, dd32, peterwilsoncc.
Fixes #57306.
See #56793.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54520 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-14 01:28:12 +00:00
desrosj
8399a3a160 Build/Test Tools: Run Xdebug tests on PHP 8.2.
Xdebug 3.2.0 (which adds support for PHP 8.2) has been released and is now included in the PHP 8.2 Docker container.

The tests in the `xdebug` group can now be run against all PHP versions currently supported by WordPress.

See https://github.com/WordPress/wpdev-docker-images/pull/92.

See #56009.
Built from https://develop.svn.wordpress.org/trunk@54967


git-svn-id: http://core.svn.wordpress.org/trunk@54519 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-14 00:24:18 +00:00
Sergey Biryukov
0230731505 Code Modernization: Rename parameters that use reserved keywords in wp-includes/rest-api/class-wp-rest-server.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 `$namespace` parameter to `$route_namespace` in:
* `WP_REST_Server::register_route()`
* `WP_REST_Server::get_routes()`

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962], [54964].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54517 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-13 18:34:12 +00:00
Sergey Biryukov
e52cbfe467 Code Modernization: Rename parameters that use reserved keywords in wp-includes/rest-api.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 `$namespace` parameter to `$route_namespace` in `register_rest_route()`.
* Renames the `$function` parameter to `$function_name` in:
 * `rest_handle_deprecated_function()`
 * `rest_handle_deprecated_argument()`
 * `rest_handle_doing_it_wrong()`
* Renames the `$array` parameter to `$input_array` in `rest_validate_array_contains_unique_items()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961], [54962].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-13 18:28:11 +00:00
John Blackbourn
0d5910247a Options, Meta APIs: Correct the documented return type for get_settings_errors().
This function returns an array of settings errors arrays.

Props mcaskill, costdev

Fixes #57323

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


git-svn-id: http://core.svn.wordpress.org/trunk@54515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-13 16:39:11 +00:00
Sergey Biryukov
58cde838c1 Code Modernization: Rename parameters that use reserved keywords in wp-includes/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 `$var` and `$default` parameters to `$query_var` and `$default_value` in `get_query_var()`.
* Renames the `$var` parameter to `$query_var` in `set_query_var()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960], [54961].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54514 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-13 12:26:15 +00:00
Sergey Biryukov
4ffd8b005e Code Modernization: Rename parameters that use reserved keywords in wp-includes/post.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 `$object` parameter to `$data_object` in `_get_custom_object_labels()`.
* Renames the `$parent` parameter to `$parent_post` in `wp_insert_attachment()`.

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], [54948], [54950], [54951], [54952], [54956], [54959], [54960].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-13 00:03:15 +00:00
Sergey Biryukov
41924d88a3 Code Modernization: Rename parameters that use reserved keywords in wp-includes/pomo/streams.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 `$input_string` in:
 * `POMO_Reader::substr()`
 * `POMO_Reader::strlen()`
 * `POMO_Reader::str_split()`

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], [54948], [54950], [54951], [54952], [54956], [54959].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-12 20:21:12 +00:00
Sergey Biryukov
68f2c6cd13 Code Modernization: Rename parameters that use reserved keywords in wp-includes/pomo/po.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 `$input_string` in:
 * `PO::poify()`
 * `PO::unpoify()`
 * `PO::prepend_each_line()`

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], [54948], [54950], [54951], [54952], [54956].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54511 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-12 19:39:13 +00:00
Sergey Biryukov
cf9793f0df Docs: Mark some optional parameters as such in wp-includes/comment-template.php.
This affects:
* `get_comment_class()`
* `comment_class()`
* `get_comment_excerpt()`
* `comment_excerpt()`
* `get_comment_link()`
* `get_comment_text()`
* `comment_text()`
* `comments_open()`
* `pings_open()`
* `get_comment_reply_link()`
* `comment_reply_link()`
* `post_reply_link()`
* `comment_form()`

Follow-up to [25567], [27156], [33961].

See #56792.
Built from https://develop.svn.wordpress.org/trunk@54958


git-svn-id: http://core.svn.wordpress.org/trunk@54510 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-12 11:51:11 +00:00
Sergey Biryukov
3d29300173 Docs: Improve DocBlock formatting for get_post_class().
Follow-up to [9273], [27429], [31271], [37544].

See #56792.
Built from https://develop.svn.wordpress.org/trunk@54957


git-svn-id: http://core.svn.wordpress.org/trunk@54509 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-12 11:17:17 +00:00
Sergey Biryukov
92c86d749b Code Modernization: Rename parameters that use reserved keywords in wp-includes/post-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 `the_title()`.
* Renames the `$class` parameter to `$css_class` in:
 * `post_class()`
 * `get_post_class()`
 * `body_class()`
 * `get_body_class()`

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], [54948], [54950], [54951], [54952].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54508 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-11 13:42:15 +00:00
Sergey Biryukov
4c2241830e Tests: Temporarily disable a WP_Http test for multiple Location headers.
The test verifies that `WP_Http::handle_redirects()` uses the last specified URL as the redirect location if multiple `Location` headers are specified in the response.

It appears that the redirection script on api.wordpress.org no longer sends the expected two `Location` headers, causing the test to fail.

While the exact cause is being investigated and confirmed, this commit disables the affected test for now, so that other commits and PRs are not blocked by these failures.

Follow-up to [342/tests], [874/tests], [1329/tests], [24846].

Props costdev, SergeyBiryukov.
See #57306.
Built from https://develop.svn.wordpress.org/trunk@54955


git-svn-id: http://core.svn.wordpress.org/trunk@54507 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-10 13:33:15 +00:00
Sergey Biryukov
2043081e9e Docs: Add missing type for $_wp_theme_features in WP_Debug_Data::debug_data().
Includes moving the global declaration to the top of the method for consistency.

Follow-up to [44986], [54953].

See #57069, #56792.
Built from https://develop.svn.wordpress.org/trunk@54954


git-svn-id: http://core.svn.wordpress.org/trunk@54506 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-09 12:25:14 +00:00
audrasjb
01102b3d6e Docs: Improve various globals documentation, as per documentation standards.
Props upadalavipul.
See #57069, #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54505 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-09 11:54:13 +00:00
Sergey Biryukov
0d03ee0b7a Code Modernization: Rename parameters that use reserved keywords in wp-includes/pluggable.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 `$die` parameter to `$stop` in `check_ajax_referer()`.
* Renames the `$default` parameter to `$fallback_url` in `wp_validate_redirect()`.
* Renames the `$default` parameter to `$default_value` in `get_avatar()`.

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], [54948], [54950], [54951].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54504 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-09 00:24:17 +00:00
Sergey Biryukov
9e50590938 Code Modernization: Rename parameters that use reserved keywords in wp-includes/php-compat/readonly.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 `$readonly` and `$echo` parameters to `$readonly_value` and `$display` in `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], [54932], [54933], [54938], [54943], [54944], [54945], [54946], [54947], [54948], [54950].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54503 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-08 19:31:17 +00:00
Sergey Biryukov
8c03cb5df8 Code Modernization: Rename parameters that use reserved keywords in wp-includes/class-wpdb.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 `$data` in:
 * `wpdb::_weak_escape()`
 * `wpdb::_real_escape()`
 * `wpdb::escape_by_ref()`
* Renames the `$string` parameter to `$input_string` in `wpdb::check_ascii()`.

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], [54948].

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


git-svn-id: http://core.svn.wordpress.org/trunk@54502 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-08 17:28:15 +00:00
Sergey Biryukov
afab4aa575 Tests: Use more descriptive name for a wp_new_comment() test.
Includes:
* Correcting the order of expected and actual values.
* Adding a missing `@covers` tag for another test next to it.

Follow-up to [32299], [53863], [54489].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@54949


git-svn-id: http://core.svn.wordpress.org/trunk@54501 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-08 15:09:16 +00:00
Sergey Biryukov
131c378f6a Code Modernization: Rename parameters that use reserved keywords in wp-includes/option.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:
* `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
2022-12-07 21:32:15 +00:00
Sergey Biryukov
53e90faeeb Code Modernization: Rename parameters that use reserved keywords in wp-includes/ms-site.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_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
2022-12-07 21:19:19 +00:00
Sergey Biryukov
8972539bc5 Code Modernization: Rename parameters that use reserved keywords in wp-includes/ms-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 `$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
2022-12-07 14:32:15 +00:00
Sergey Biryukov
018d10cafe Code Modernization: Rename parameters that use reserved keywords in wp-includes/ms-blogs.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 `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
2022-12-06 22:16:13 +00:00
Sergey Biryukov
2aac26becd Code Modernization: Rename parameters that use reserved keywords in wp-includes/load.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 `$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
2022-12-06 21:33:17 +00:00
Sergey Biryukov
f296748b5b Code Modernization: Rename parameters that use reserved keywords in wp-includes/link-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 `$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
2022-12-06 21:18:15 +00:00
spacedmonkey
3bcfbde4b4 Tests: Change the wp_cache_get_multiple function to get cache keys in a single request.
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
2022-12-06 20:01:11 +00:00
spacedmonkey
a5ed225499 Media: Use featured image if available for attachment as preview instead of icon.
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
2022-12-06 19:24:19 +00:00
spacedmonkey
aec68c417e Users: Clear the user_meta cache when clean_user_cache function is called.
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
2022-12-06 13:54:15 +00:00
spacedmonkey
03fc3cde8e Revisions: Use update_post_author_caches in wp_prepare_revisions_for_js function.
The `update_post_author_caches` function was added in [53482]. Replace call to `cache_users` function with `update_post_author_caches`, for consistency and code quality.  

Props benjgrolleau, spacedmonkey.
Fixes #56978.
Built from https://develop.svn.wordpress.org/trunk@54939


git-svn-id: http://core.svn.wordpress.org/trunk@54491 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-06 13:42:13 +00:00
Sergey Biryukov
a6da3647c8 Code Modernization: Rename parameters that use reserved keywords in wp-includes/l10n.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 `$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
2022-12-06 13:03:18 +00:00
Sergey Biryukov
e6f755adec External Libraries: Upgrade PHPMailer to version 6.7.
This is a bug fix release which also contains some PHP 8.1 related improvements.

References:
* [https://github.com/PHPMailer/PHPMailer/releases/tag/v6.7 PHPMailer 6.7 release notes]
* [https://github.com/PHPMailer/PHPMailer/compare/v6.6.5...v6.7 Full list of changes in PHPMailer 6.7]

Follow-up to [50628], [50799], [51169], [51634], [51635], [52252], [52749], [52811], [53500], [53535], [53917], [54427].

Props jrf, Synchro.
Fixes #57281.
Built from https://develop.svn.wordpress.org/trunk@54937


git-svn-id: http://core.svn.wordpress.org/trunk@54489 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-06 12:19:15 +00:00
Andrew Ozz
867203db05 Quick edit: Fix cases where the author field is empty when the user no longer has edit capabilities.
Props: OllieJones, sabernhardt, iamjaydip, costdev.
Fixes: #56819.
Built from https://develop.svn.wordpress.org/trunk@54936


git-svn-id: http://core.svn.wordpress.org/trunk@54488 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-06 02:30:15 +00:00
audrasjb
0164f0a85f Customize: Fix a wrong condition on WP_Customize_Manager::has_published_pages().
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
2022-12-05 21:31:11 +00:00
audrasjb
b218a71d1c Security: Remove useless span tags from SECURITY.md.
Props TobiasBg, peterwilsoncc.
Fixes #57243.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54486 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-05 21:25:16 +00:00
Sergey Biryukov
613091bce5 Code Modernization: Rename parameters that use reserved keywords in wp-includes/kses.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:
 * `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
2022-12-05 13:57:16 +00:00
Sergey Biryukov
19382aa5e4 Code Modernization: Rename parameters that use reserved keywords in wp-includes/general-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_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
2022-12-04 13:22:12 +00:00
Sergey Biryukov
25c78a1b2a Code Modernization: Rename parameters that use reserved keywords in wp-includes/functions.wp-styles.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 `$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
2022-12-04 12:48:11 +00:00
Sergey Biryukov
2e6eb58946 Code Modernization: Rename parameters that use reserved keywords in wp-includes/functions.wp-scripts.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 `$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
2022-12-04 12:46:16 +00:00
Sergey Biryukov
a460de4e58 Code Modernization: Rename parameters that use reserved keywords in wp-includes/functions.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_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
2022-12-03 15:07:14 +00:00
Andrew Ozz
ef3a00a869 Media: Fix the version string of imgAreaSelect to indicate when the second set of modifications were made.
Props SergeyBiryukov, ironprogrammer.
Fixes #54308.
Built from https://develop.svn.wordpress.org/trunk@54928


git-svn-id: http://core.svn.wordpress.org/trunk@54480 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-02 20:21:11 +00:00
Sergey Biryukov
868f939367 Code Modernization: Rename parameters that use reserved keywords in wp-includes/formatting.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 `$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
2022-12-02 18:53:19 +00:00
audrasjb
73bd837100 Options, Meta APIs: Improve error messages in Options Management Administration Screen.
Props NekoJonez, costdev.
Fixes #57230.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54478 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-01 22:20:12 +00:00
audrasjb
1e63fe0f2c Twenty Twenty: Remove unwanted title attributes.
This changeset removes `title` attributes from various links, as they add redundant information.

Follow-up to [53844].

Props sabernhardt, costdev, mukesh27.
See #57199, #24766, #24203.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54477 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-01 22:08:12 +00:00
audrasjb
74a83fd163 Twenty Twelve: Remove unwanted title attributes.
This changeset removes `title` attributes from various links, as they add redundant information.

Follow-up to [53844].

Props sabernhardt, costdev, mukesh27.
See #57199, #24766, #24203.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54476 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-01 22:06:13 +00:00
audrasjb
1073998752 Twenty Thirteen: Remove unwanted title attributes.
This changeset removes `title` attributes from various links, as they add redundant information.

Follow-up to [53844].

Props sabernhardt, costdev, mukesh27.
See #57199, #24766, #24203.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54475 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-01 21:56:11 +00:00
audrasjb
4b17b129dd Twenty Ten: Remove unwanted title attributes.
This changeset removes `title` attributes from various links, as they add redundant information.

Follow-up to [53844].

Props sabernhardt, costdev, mukesh27.
See #57199, #24766, #24203.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54474 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-01 21:53:13 +00:00
desrosj
c3bd352f28 Build/Test Tools: Improve caching for PHPCS.
This improves the speed of the PHPCS scans between workflow runs in GitHub Action by creating a scan cache file for each unique set of arguments passed to `phpcs`.

Props jrf.
Fixes #57148. See #53841.
Built from https://develop.svn.wordpress.org/trunk@54921


git-svn-id: http://core.svn.wordpress.org/trunk@54473 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-01 20:13:15 +00:00
Sergey Biryukov
5f30490527 Coding Standards: Remove a one-time $loading variable in get_avatar().
This aims to bring consistency between two similar code fragments.

Follow-up to [47554], [53480], [54895].

See #56791.
Built from https://develop.svn.wordpress.org/trunk@54920


git-svn-id: http://core.svn.wordpress.org/trunk@54472 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-01 15:43:20 +00:00
Peter Wilson
767bdad516 Security: Improve accessibility of security policy.
Replace emoji indicators of support with "yes" and "no". This prevents "White Heavy Check Mark" indicating supported versions for screen-reader users.

Props audrasjb.
Fixes #57222.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54471 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-30 22:54:12 +00:00
Peter Wilson
c0a3701246 Security: Update supported WordPress versions in security policy.
Removes WordPress versions 3.7.x-4.0.x from the list of supported versions in the security policy.

Props audrasjb, peterwilsoncc.
Fixes #57217.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-30 22:33:14 +00:00
Sergey Biryukov
961a67cb88 Coding Standards: Fix a non-snake_case function name in WP_Block tests.
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
2022-11-30 18:32:13 +00:00
Sergey Biryukov
a5c25ded41 Coding Standards: Remove redundant semicolon after get_template_hierarchy().
Follow-up to [54269].

Props jrf.
See #56791.
Built from https://develop.svn.wordpress.org/trunk@54916


git-svn-id: http://core.svn.wordpress.org/trunk@54468 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-30 17:36:13 +00:00
Sergey Biryukov
08fbc025c7 Coding Standards: Fix indentation of multi-line chained method call in test_json_error_with_status().
Follow-up to [34928], [42228].

Props jrf.
See #56791.
Built from https://develop.svn.wordpress.org/trunk@54915


git-svn-id: http://core.svn.wordpress.org/trunk@54467 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-30 16:35:12 +00:00
Bernhard Reiter
476c21de10 Build/Test Tools: Stylistic changes to Gutenberg e2e test.
Make some stylistic changes (multiline comment formatting, test description) that had been suggested during code review and that didn't make it into the previous commit.

Props costdev.
Follows [54913].
See #57197.
Built from https://develop.svn.wordpress.org/trunk@54914


git-svn-id: http://core.svn.wordpress.org/trunk@54466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-30 14:07:14 +00:00
Bernhard Reiter
98399a3f9b Build/Test Tools: Add basic e2e coverage for Gutenberg.
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
2022-11-30 13:17:14 +00:00
audrasjb
4b5996cd13 Plugins: Correctly display spaces in installed plugins search results.
This changeset improves searched terms URL decoding in installed plugins search results.

Follow-up to [53844].

Props 254volkan, dilipbheda, audrasjb, adhun, syamraj24.
Fixes #57174.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54456 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-29 23:46:11 +00:00
Andrew Ozz
c31c7aa653 Media: Fix the initialization of imgAreaSelect when cropping a header image or a site icon or logo.
Props alshakero, arthur791004, nmutua, desrosj, audrasjb, ironprogrammer, obenland, costdev, ajmaurya.
Fixes #54308, #55377.
Built from https://develop.svn.wordpress.org/trunk@54903


git-svn-id: http://core.svn.wordpress.org/trunk@54455 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-29 22:14:12 +00:00
Sergey Biryukov
6436dd1fd4 Twenty Seventeen: Fix comment indentation in twentyseventeen_setup().
Follow-up to [38833], [42343]

Props jrf.
See #56791.
Built from https://develop.svn.wordpress.org/trunk@54902


git-svn-id: http://core.svn.wordpress.org/trunk@54454 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-29 22:12:12 +00:00
audrasjb
96134499ff Coding Standards: Use consistent markup for line break tags on update-core.php.
This changeset replaces <br/> with <br /> on various places, as per WordPress Coding Standards.
See https://developer.wordpress.org/coding-standards/wordpress-coding-standards/html/#self-closing-elements

Follow-up to [54062].

Props rajanpanchal2028, alberuni-azad, sabernhardt.
Fixes #57226.
See #56791.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54449 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-29 21:30:11 +00:00
Sergey Biryukov
653c410859 Coding Standards: Fix spacing for incrementors and decrementors in various files.
Note: This will be enforced by WPCS 3.0.0.

Props jrf.
See #56791.
Built from https://develop.svn.wordpress.org/trunk@54896


git-svn-id: http://core.svn.wordpress.org/trunk@54448 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-29 21:13:16 +00:00
Sergey Biryukov
1750d30863 Coding Standards: Always use strict type check for in_array().
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
2022-11-29 21:00:14 +00:00
Dominik Schilling
15d01c9235 Query: Account for primed post caches without primed post meta/term caches.
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
2022-11-29 20:29:11 +00:00
Sergey Biryukov
3ba44120d0 Coding Standards: Always use parentheses when instantiating an object.
Note: This will be enforced by WPCS 3.0.0.

Props jrf.
See #56791.
Built from https://develop.svn.wordpress.org/trunk@54891


git-svn-id: http://core.svn.wordpress.org/trunk@54443 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-29 15:51:14 +00:00
Sergey Biryukov
ab923804f4 Coding Standards: Add visibility to properties in tests/phpunit/tests/.
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
2022-11-29 12:42:12 +00:00
Sergey Biryukov
6c1f6ba92e Coding Standards: Add visibility to methods in tests/phpunit/tests/.
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
2022-11-29 12:34:20 +00:00
Sergey Biryukov
b105e59c23 Comments: Make moderated or disallowed key check case-insensitive for non-Latin words.
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
2022-11-28 19:44:17 +00:00
Bernhard Reiter
3884bd3c6e Twenty Twenty-Three: In page template, make post titles links.
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
2022-11-28 15:13:18 +00:00
Sergey Biryukov
5d08331c21 Twenty Twenty-One: Add a comment for the closing h2 tag in author info template.
This brings consistency with the `.comments-title` heading in the `comments.php` template.

Follow-up to [49216], [50234].

Props haritpanchal, sabernhardt, mukesh27.
Fixes #56476.
Built from https://develop.svn.wordpress.org/trunk@54886


git-svn-id: http://core.svn.wordpress.org/trunk@54438 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-27 10:34:13 +00:00
audrasjb
8c1d559c27 Twenty Nineteen: Remove useless title attributes.
This changeset removes `title` attributes from links, as they are adding redundant information.

Props sabernhardt.
See #57199, #24766, #24203.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54437 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-26 22:43:12 +00:00
audrasjb
ca5bf74221 Twenty Eleven: Remove useless title attributes.
This changeset removes `title` attributes from various links, as they are adding redundant information.

Props sabernhardt.
See #57199, #24766, #24203.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54436 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-26 22:39:10 +00:00
audrasjb
9666402c47 Docs: Add missing parameter descriptions in wp-admin/includes/template.php.
Props mahekkalola, costdev, audrasjb, riccardodicurti.
Fixes #57208.
See #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54435 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-26 22:18:10 +00:00
audrasjb
30e6820f0e Twenty Ten: Fixes brace indentation in loop-attachment template.
Props mukesh27.
See #57210, #56791.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54434 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-26 22:03:11 +00:00
audrasjb
a73fc6c084 Coding Standards: Various brace indentation corrections.
Props mukesh27.
Fixes #57210.
See #56791.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-26 21:01:17 +00:00
Sergey Biryukov
00c3bea83b Coding Standards: Correct the deprecation version for _filter_query_attachment_filenames().
Follow-up to [54524].

Props jrf.
See #56791.
Built from https://develop.svn.wordpress.org/trunk@54878


git-svn-id: http://core.svn.wordpress.org/trunk@54430 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-26 16:12:11 +00:00
audrasjb
114fc4cf69 Docs: Improve various globals documentation, as per documentation standards.
Props upadalavipul.
See #57069, #56792.


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


git-svn-id: http://core.svn.wordpress.org/trunk@54429 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-26 09:39:13 +00:00
audrasjb
b4888708bb Coding Standards: Fix brace indentation in wp-align/includes/noop.php.
Props alberuni-azad.
Fixes #57209.
See #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54428 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-26 09:12:17 +00:00
Sergey Biryukov
6025b41a5c Docs: Correct the type for _WP_Dependency::$src property.
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
2022-11-25 15:12:16 +00:00
audrasjb
e2ed8d0650 Docs: Various docblock fixes in Block Supports related functions.
See #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54426 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-24 22:52:11 +00:00
audrasjb
532cd00f46 Docs: Use third-person singular verbs for Block Supports related function descriptions, as per docblocks standards.
See #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-24 22:36:11 +00:00
audrasjb
64a713db2b Coding Standards: Remove extra slashes when concatenating ABSPATH with a path.
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
2022-11-24 22:11:14 +00:00
audrasjb
5fd77cda7f Plugins: Improve "No plugin found" message alignement in Plugins screen.
This changeset centers the "No plugin found" message in plugin search results.

Follow-up to [54149].

Props sruthi90, aparnajl, krupalpanchal, audrasjb, anantajitjg.
Fixes #57194.
See #55721, #55272.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54423 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-24 15:38:15 +00:00
Sergey Biryukov
34b6ab69b8 Coding Standards: Use HOUR_IN_SECONDS where appropriate.
This aims to clarify the time units for some time offset values.

Follow-up to [21996], [23823], [40108], [41626].

See #56791.
Built from https://develop.svn.wordpress.org/trunk@54870


git-svn-id: http://core.svn.wordpress.org/trunk@54422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-24 14:18:15 +00:00
audrasjb
c1dd534ec8 Twenty Nineteen: Remove the incorrect "flexible-header" tag.
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
2022-11-23 22:23:09 +00:00
audrasjb
753fff78e3 Docs: Improve various globals documentation, as per documentation standards.
Props upadalavipul.
See #57069, #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54420 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-23 21:36:12 +00:00
audrasjb
349e9ac8d4 Docs: Improve various globals documentation, as per documentation standards.
Props upadalavipul, mukesh27, krupalpanchal, jigar-bhanushali.
See #57069, #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-23 21:30:13 +00:00
Sergey Biryukov
665719b9de Docs: Revise comments using “we” in WordPress root directory files.
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
2022-11-23 15:43:13 +00:00
Sergey Biryukov
abe134c209 Tests: Correct references to set_up() and tear_down() in various DocBlocks.
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
2022-11-22 21:27:16 +00:00
Sergey Biryukov
17588baef8 Tests: Clean up test file in wpmu_delete_blog() tests.
This makes sure there are no leftover files after the tests from the `multisite` directory are run separately.

Follow-up to [30404].

See #56793.
Built from https://develop.svn.wordpress.org/trunk@54864


git-svn-id: http://core.svn.wordpress.org/trunk@54416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-22 20:19:11 +00:00
Sergey Biryukov
e489c69dcc Tests: Add unit tests for attachment’s file size being included in metadata.
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
2022-11-22 19:45:11 +00:00
Sergey Biryukov
1a3a3ee250 Tests: Add a public visibility to wp_filesize() tests.
Follow-up to [52010], [52837], [52932], [54861].

See #57171.
Built from https://develop.svn.wordpress.org/trunk@54862


git-svn-id: http://core.svn.wordpress.org/trunk@54414 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-22 15:11:14 +00:00
Sergey Biryukov
e2ba63091d Tests: Move wp_filesize() tests to their own file.
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
2022-11-22 15:04:14 +00:00
Sergey Biryukov
c7457d772e Site Editor: Show correct theme per template or template part.
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
2022-11-21 16:50:17 +00:00
Sergey Biryukov
f3b087164d Docs: Fix typo and improve DocBlock formatting in wp-admin/install-helper.php.
Follow-up to [236], [265], [8645], [30542].

See #56792.
Built from https://develop.svn.wordpress.org/trunk@54859


git-svn-id: http://core.svn.wordpress.org/trunk@54411 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-20 14:10:15 +00:00
Sergey Biryukov
f299e3c83a Coding Standards: Fix WPCS issues in wp-admin/install-helper.php.
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
2022-11-19 15:42:16 +00:00
Sergey Biryukov
513a8dc17f Users: Add missing escaping on the Add New User screen.
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
2022-11-18 15:21:15 +00:00
desrosj
95828a9077 Build/Test Tools: Improve how Composer dependencies are installed.
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
2022-11-18 14:52:14 +00:00
Sergey Biryukov
25ea9680ae Docs: Update various DocBlocks and inline comments per the documentation standards.
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
2022-11-17 18:15:19 +00:00
Sergey Biryukov
260276583c Docs: Update wp_count_posts and wp_count_attachments filter descriptions.
This aims to match the wording generally used for other filters as per the documentation standards.

Follow-up to [25554], [25578], [25579], [53456].

See #56792.
Built from https://develop.svn.wordpress.org/trunk@54854


git-svn-id: http://core.svn.wordpress.org/trunk@54406 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-17 17:07:15 +00:00
Sergey Biryukov
cede832fb1 Docs: Fix typo in the WP_Theme_JSON::PRESETS_METADATA constant description.
Follow-up to [53129].

Props kebbet, mukesh27.
See #56792.
Built from https://develop.svn.wordpress.org/trunk@54853


git-svn-id: http://core.svn.wordpress.org/trunk@54405 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-17 16:58:20 +00:00
desrosj
44bd7a8471 Build/Test Tools: Add additional details why MacOS jobs are separate.
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
2022-11-16 20:57:13 +00:00
desrosj
a64c2964f1 Build/Test Tools: Various minor GitHub Action improvements.
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
2022-11-16 19:34:14 +00:00
jorgefilipecosta
5a0499a3df Add: Documentation for postTypes pattern property.
This commit documents the postTypes property part of the block pattern registration added in WordPress/gutenberg#41791, and meanwhile backported into core.

Props mcsf, ntsekouras.
Built from https://develop.svn.wordpress.org/trunk@54850


git-svn-id: http://core.svn.wordpress.org/trunk@54402 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-16 16:36:14 +00:00
desrosj
9940af48e3 Upgrade/Install: Remove bundled theme files from $_old_files.
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
2022-11-16 15:43:10 +00:00
Sergey Biryukov
5e58ab8b2a Docs: Split the "main part" comment in wp-login.php into two lines.
This aims to better match the multi-line comment format of the documentation standards.

Follow-up to [6643], [52945], [53313].

Props sabernhardt, NekoJonez.
Fixes #56843.
Built from https://develop.svn.wordpress.org/trunk@54848


git-svn-id: http://core.svn.wordpress.org/trunk@54400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-16 13:51:13 +00:00
Sergey Biryukov
42c1f97aaa Docs: Minor DocBlock edits for get_adjacent_post() and related functions.
This aims to better match the line wrapping recommendations of the documentation standards.

Follow-up to [16951], [28111], [32606], [37254].

See #56792.
Built from https://develop.svn.wordpress.org/trunk@54842


git-svn-id: http://core.svn.wordpress.org/trunk@54394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-15 00:34:12 +00:00
Sergey Biryukov
8a3426bf8b Docs: Correct type for the $post parameter of the {$adjacent}_post_link filter.
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
2022-11-15 00:19:13 +00:00
audrasjb
9b53ca0fd2 Text Changes: Improve the wording of the email sent to confirm site deletion.
Props NekoJonez, SergeyBiryukov, mukesh27, audrasjb.
See #56921.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54392 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-14 21:57:10 +00:00
audrasjb
7d6e977293 Help/About: Fix inconsistency in auto-updates help tabs.
This changeset ensures the wording of auto-updates related help tabs is consistent with other help tabs.

Props NekoJonez, SergeyBiryukov, mukesh27, audrasjb.
Fixes #56921.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-14 21:53:11 +00:00
audrasjb
5f2083cb7b Twenty Seventeen: Improve letter-spacing reset for non-latin alphabets.
This changeset resets `letter-spacing` for Persian and Urdu, and changes the related CSS selector to include any Persian locale.

Props amirrezatm, itpathsolutions, sabernhardt, mukesh27.
Fixes #56994.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54390 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-14 21:32:17 +00:00
desrosj
5fc5af9722 Upgrade/Install: Delete the comments-query-loop folder in wp-includes/blocks.
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
2022-11-14 18:24:12 +00:00
audrasjb
cf77d178a0 Docs: Typo correction in get_registered_nav_menus() docblock.
Props nithins53.
Fixes #57101.
See #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-14 14:24:12 +00:00
Sergey Biryukov
948a260e80 Administration: Add missing escaping for a few strings used as HTML attributes.
Follow-up to [47209], [50997], [51006].

Props kowsar89, riccardodicurti, audrasjb, krupalpanchal, SergeyBiryukov.
Fixes #57093.
Built from https://develop.svn.wordpress.org/trunk@54834


git-svn-id: http://core.svn.wordpress.org/trunk@54386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-14 11:50:15 +00:00
audrasjb
4e4016f61f Docs: Various docblock fixes in Multisite administration functions.
See #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54385 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-13 23:19:12 +00:00
audrasjb
ca35d65075 Networks and Sites: Replace "N/A" with "Not applicable" in choose_primary_blog()
This changeset replaces "N/A" with "Not applicable" in the `choose_primary_blog()` function. It also makes the text string translatable.

Props kowsar89, SergeyBiryukov, audrasjb, mukesh27.
Fixes #57040.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-13 22:31:14 +00:00
Sergey Biryukov
7836738bd9 Docs: Document the usage of globals in some functions.
This affects:
* `the_block_editor_meta_boxes()`
* `wp_generate_block_templates_export_file()`
* `WP_oEmbed_Controller::get_proxy_item()`

Follow-up to [44131], [48135], [51151], [53129].

Props krunal265.
Fixes #57082.
Built from https://develop.svn.wordpress.org/trunk@54831


git-svn-id: http://core.svn.wordpress.org/trunk@54383 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-13 13:51:20 +00:00
Sergey Biryukov
243fdb8da2 Tests: Resolve WP_Query test failures on MariaDB due to indeterminate sort order.
[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
2022-11-12 14:51:15 +00:00
desrosj
a2a3187437 Coding Standards: Apply spacing changes after composer format.
Follow up to [54817].
See #57057.
Built from https://develop.svn.wordpress.org/trunk@54824


git-svn-id: http://core.svn.wordpress.org/trunk@54376 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-11 17:51:12 +00:00
desrosj
face84c028 Editor: Improve how min/max font sizes are calculated for fluid typography.
- 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
2022-11-11 17:48:12 +00:00
desrosj
39f1141e78 Editor: Correctly style separator blocks when only a background-color is defined.
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
2022-11-11 17:11:10 +00:00
desrosj
3b86eee81b Themes: Revert one instance of wp_get_theme() from [54817].
Since this specific call to `wp_get_theme()` is found within `wp-includes/blocks`, this change will need to be made upstream in the Gutenberg repository.

See #57057.
Built from https://develop.svn.wordpress.org/trunk@54819


git-svn-id: http://core.svn.wordpress.org/trunk@54371 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-11 16:34:12 +00:00
spacedmonkey
8ea348f6db Themes: Reduce usage of wp_get_theme function.
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
2022-11-11 16:26:12 +00:00
desrosj
4e492ffe61 Filesystem: Return FTP/FTP Sockets exists() methods to a previous state.
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
2022-11-11 15:55:13 +00:00
Sergey Biryukov
43addd9e1e Formatting: Check that both normalizer_* functions exist in remove_accents().
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
2022-11-11 15:28:12 +00:00
desrosj
b497a707b7 Editor: Update block editor packages to the latest patch releases.
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
2022-11-11 12:46:55 +00:00
Sergey Biryukov
eb68614e2e Coding Standards: Declare $wp_taxonomies global at the top of unregister_taxonomy().
This brings some consistency with how the global is declared in other taxonomy functions.

Follow-up to [36243], [38747], [54794].

See #57058.
Built from https://develop.svn.wordpress.org/trunk@54810


git-svn-id: http://core.svn.wordpress.org/trunk@54362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-11 12:39:13 +00:00
Felix Arntz
702344e383 Editor: Improve performance of WP_Theme_JSON class by reducing usage of expensive array functions.
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
2022-11-11 01:50:11 +00:00
Peter Wilson
912ac10f4b I18N: Initialize textdomain registry in wp_load_translations_early().
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
2022-11-11 01:27:10 +00:00
Peter Wilson
3151be6da7 Media: Prevent decoding attribute corrupting JSON data.
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
2022-11-11 01:01:12 +00:00
Peter Wilson
9a2189e880 Menus: Apply menu-item-has-children class in sub-menus.
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
2022-11-11 00:06:14 +00:00
Felix Arntz
2a57dd7f86 Editor: Avoid running certain logic around theme.json parsing unnecessarily for classic themes.
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
2022-11-10 22:16:15 +00:00
Dominik Schilling
c9a4d274fc I18N: Always pass $locale to load_textdomain().
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
2022-11-10 19:40:11 +00:00
audrasjb
c64cc7959e Docs: Improve globals documentation in unregister_taxonomy() and wp_term_is_shared().
Props upadalavipul, mukesh27.
Fixes #57058. 
See #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-10 17:16:12 +00:00
Sergey Biryukov
81da0c1e18 Tests: Correct the test for get_blogaddress_by_id() with a non-existing ID.
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
2022-11-10 13:07:12 +00:00
hellofromTonya
7341083c81 Update/Install: Deactivate Gutenberg plugin version older than 14.1.
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
2022-11-10 12:22:18 +00:00
audrasjb
748a5d9919 Text Changes: Update @since mentions for [54786] changes.
This updates the `@since` mention of `get_theme_feature_list()` as this changeset is going to be backported to 6.1.1.

Follow-up to [54786].

See #57026.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54340 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-10 12:10:11 +00:00
audrasjb
ef48ee8739 Text Changes: Remove capitalization on "site editing".
Follow-up to [54786].

Props ocean90.
See #57026.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54339 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-10 11:33:14 +00:00
audrasjb
b63b1a86ee Text Changes: Replace "Full site editing" with "Site Editor".
This changeset replaces the various occurrences of "Full site editing" with "Site Editor" as it is the new official name of the feature.

For more background about this change, see https://make.wordpress.org/updates/2022/11/04/site-editor-a-more-user-friendly-name/.

Props audrasjb, peterwilsoncc, poena.
Fixes #57026.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54338 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-10 09:40:16 +00:00
Peter Wilson
486bec9939 Canonical: Protect against error for term not exists queries.
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
2022-11-10 03:01:14 +00:00
Peter Wilson
0f7fcc2863 Posts, Post Types: Revert get_page_by_title()'s use of WP_Query.
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
2022-11-10 00:46:16 +00:00
Sergey Biryukov
735313df84 Coding Standards: Use consistent spelling for "cacheable" in WP_Query::get_posts().
Follow-up to [53941], [54768].

See #57012.
Built from https://develop.svn.wordpress.org/trunk@54777


git-svn-id: http://core.svn.wordpress.org/trunk@54329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-09 10:27:12 +00:00
audrasjb
2fc04a0316 Docs: Fix block_editor_rest_api_preload() parameter type.
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
2022-11-09 09:51:14 +00:00
audrasjb
8cea4f733a Docs: Replace HTTP links with HTTPS in class-pop3.php docblocks and JS vendor readme file.
Props rajeshraval786, hiren1094.
See #57017, #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54327 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-09 09:19:14 +00:00
Peter Wilson
63f944e831 Themes: Re-order valid link pseudo classes.
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
2022-11-09 04:08:16 +00:00
Peter Wilson
113838ed78 Query: Prevent ID only queries erroring when starting the loop.
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
2022-11-09 00:59:12 +00:00
Peter Wilson
330c35b258 Themes: Improve WP_Query call getting global styles.
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
2022-11-09 00:40:12 +00:00
Felix Arntz
5f61131cc6 Editor: Improve frontend performance for get_default_block_editor_settings().
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
2022-11-09 00:30:10 +00:00
Peter Wilson
4c90be7e91 Query: Bypass caching for filtered SELECTs.
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
2022-11-09 00:28:16 +00:00
TimothyBlynJacobs
72cc029989 Query: Don't attempt caching if running a WP_User_Query before plugins_loaded.
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
2022-11-08 17:31:13 +00:00
Sergey Biryukov
03f4c7972f Docs: Document the usage of $wpdb global in WP_Date_Query methods.
Follow-up to [25139], [29933], [38280], [38768].

Props upadalavipul.
Fixes #57033.
Built from https://develop.svn.wordpress.org/trunk@54765


git-svn-id: http://core.svn.wordpress.org/trunk@54317 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-08 13:29:16 +00:00
Sergey Biryukov
f011bf7f5b Tests: Restore blog switching in update_posts_count() test.
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
2022-11-07 20:55:10 +00:00
audrasjb
daccffbd4a Editor: Improve Archive template description.
This changeset improves the description of the Archive template in the Site Editor to make it more accurate.

Follow-up to [52331].

Props Chaton666, webaxones, mukesh27, audrasjb, SergeyBiryukov.
Fixes #57001.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54313 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-07 20:23:11 +00:00
Sergey Biryukov
3481f64d6c Tests: Combine duplicate update_posts_count() tests.
This combines the newer test for `update_posts_count()` located in its own file with the pre-existing one from `tests/multisite/site.php`, which was essentially testing the same thing in a similar way.

Includes:
* Renaming the test class per the [https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization naming conventions].
* Adjusting comments per the documentation standards.
* Updating `@covers` tags for accuracy.
* Removing unnecessary blog switching.
* Using `assertSame()` to check the value type.

Follow-up to [28835], [29667], [52207].

See #57023, #56793.
Built from https://develop.svn.wordpress.org/trunk@54760


git-svn-id: http://core.svn.wordpress.org/trunk@54312 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-07 17:47:11 +00:00
audrasjb
b21f66ae06 Docs: Replace HTTP links with HTTPS in class-json.php docblocks.
Props haritpanchal.
Fixes #57017.
See #56792.

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


git-svn-id: http://core.svn.wordpress.org/trunk@54311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-07 13:35:12 +00:00