Commit Graph

20870 Commits

Author SHA1 Message Date
audrasjb
6a97b83d01 Docs: Typo correction in wp_fuzzy_number_match DocBlock.
Props costdev, kebbet.
Fixes #55493.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-31 08:17:06 +00:00
Peter Wilson
18ace8bef4 KSES: Document HTML allow list is in lowercase.
Expand documentation of the `wp_kses_allowed_html` hook to indicate that developers must add permitted HTML tags and attributes in lowercase for KSES to recognise they are permitted.

Props r-a-y, SergeyBiryukov, peterwilsoncc.
Fixes #55407.
See #53399.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-31 03:54:02 +00:00
Peter Wilson
147a936f33 Build/Test Tools: Add unit tests for feed_links_extra().
Props costdev, hellofromTonya.
Fixes #54713.
See #54725.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-31 00:57:04 +00:00
Sergey Biryukov
f99c38efd5 Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-wp-importer.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_Importer::min_whitespace()`.

Follow-up to [52946], [52996], [52997], [52998], [53003], [53014].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52618 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-30 10:45:06 +00:00
Felix Arntz
e2b654efe6 Media: Introduce wp_content_img_tag filter.
This filter allows modifying individual `img` tags within a blob of content that are by default processed by the `wp_filter_content_tags()` function. The addition of this filter facilitates plugins that tweak images to accomplish this goal without re-implementing duplicate content image parser logic, which furthermore can have a negative performance impact due to additional regular expressions.

In addition to the filterable `img` tag, the filter receives the context (typically the function or filter in which the content is parsed) and the attachment ID. The latter may be 0, in case the image is not an attachment (for example when it is an external image URL).

Props adamsilverstein, flixos90, pbearne, peterwilsoncc.
Fixes #55347.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 23:58:18 +00:00
joedolson
34e9346967 Media: Preserve attachment properties on cropping custom logo.
Migrate the alternative text, title, description, and caption of an image over to the cropped copy of the image after cropping. Ensure that characteristics added to an image prior to cropping are not lost.

Props flixos90, Clorith, afercia, antonvlasenko, ironprogrammer, hellofromTonya.
Fixes #37750.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52616 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 21:48:14 +00:00
audrasjb
2f0cb02d07 Customizer: Accessibility fixes following [53024].
This changeset fixes a few issues spotted after [53024].

- Remove target blank on HelpHub link
- Remove duplicate information in `aria-label`
- Small i18n fixes

Follow-up to [53024].

Props joedolson, audrasjb, pbiron.
Fixes #54939.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52614 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 19:57:16 +00:00
audrasjb
fff6998023 Customizer: When a block theme is active, add an information about Site Editor in the Customizer.
This change adds an information notice to the customizer when a block theme is active and the customizer is also available (for example when a plugin activates it), to encourage people to use the Site Editor for the best full site customization experience.

Props ironprogrammer, antonvlasenko, Clorith, audrasjb, psmits1567, tobifjellner, costdev, webcommsat.
Fixes #54939.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 19:10:14 +00:00
joedolson
6732d37abf Quick/Bulk Edit: Position action buttons in close proximity.
Move the Submit and Cancel buttons in quick edit forms to be next to each other and change the order of the buttons. Improve accessibility for low vision and cognitive impairments for quick editing. 

Props afercia, marybaum.
Fixes #55364.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 19:08:19 +00:00
audrasjb
31c9e9452a Administration: Do not specify menu order for the Widgets menu when the active theme is a block theme.
When using a block theme that declares Widgets support, it's better to not specify a menu order for the Widgets menu to avoid conflicts between menu items order.

Props Rufus87, ironprogrammer, audrasjb, hellofromTonya, davidbaumwald.
Fixes #54916.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52609 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 15:59:22 +00:00
Sergey Biryukov
8dc9fafcb6 Users: Move get_user_count() and related functions to wp-includes/user.php.
The new location is next to the pre-existing `count_users()` function, along with other user-specific functions, and should be a more appropriate place in terms of consistency.

This affects:
* `get_user_count()`
* `wp_maybe_update_user_counts()`
* `wp_update_user_counts()`
* `wp_schedule_update_user_counts()`
* `wp_is_large_user_count()`

Follow-up to [53011], [53016].

See #38741.
Built from https://develop.svn.wordpress.org/trunk@53018


git-svn-id: http://core.svn.wordpress.org/trunk@52607 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 13:53:14 +00:00
Sergey Biryukov
cd8db5e05f I18N: Move code out of a translatable string in get_user_count() and related functions.
Follow-up to [53011].

See #38741.
Built from https://develop.svn.wordpress.org/trunk@53016


git-svn-id: http://core.svn.wordpress.org/trunk@52605 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 13:38:09 +00:00
audrasjb
25fafd4c44 Editor: Change location of block support styles in wp_head.
Backports changes from https://github.com/WordPress/gutenberg/pull/39164.

Props ndiego, alexstine, cbravobernal, mamaduka.
See #55474.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 13:28:08 +00:00
Sergey Biryukov
1aaf68db85 Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-wp-filesystem-base.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 `$verbose` in `WP_Filesystem_Base::find_base_dir()` and `::get_base_dir()`, and updates the documentation accordingly. This matches the class property of the same name.

Follow-up to [52946], [52996], [52997], [52998], [53003].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52603 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 13:21:08 +00:00
audrasjb
3306061aa3 Editor: Use wp_unique_id() instead of uniqid() to generate CSS class names.
Backports changes from https://github.com/WordPress/gutenberg/pull/38891.
See https://github.com/WordPress/gutenberg/issues/38889.

Props westonruter, mamaduka.
See #55474.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 13:06:07 +00:00
spacedmonkey
e2e15f1876 Users: Introduce the concept of a large site to single site installations.
Currently in WordPress multisite there is a concept of large networks. The function `wp_is_large_network` is used to determine if a network has a large number of sites or users. If a network is marked as large, then 
expensive queries to calculate user counts are not run on page load but deferred to scheduled events. However there are a number of places in a single site installation where this functionality would also be useful, as 
expensive calls to count users and roles can make screens in the admin extremely slow.

In this change, the `get_user_count` function and related functionality around it is ported to be available in a single site context. This means that expensive calls to the `count_users` function are replaced with 
calls to `get_user_count`. This change also includes a new function called `wp_is_large_user_count` and a filter of the same name, to mark if a site is large.

Props johnbillion, Spacedmonkey, Mista-Flo, lumpysimon, tharsheblows, obenland, miss_jwo, jrchamp, flixos90, macbookandrew, pento, desrosj, johnjamesjacoby, jb510, davidbaumwald, costdev. 
Fixes #38741.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 12:42:13 +00:00
spacedmonkey
c220f23155 Menus: Convert wp_get_nav_menu_items function to use a taxonomy query.
Change the `wp_get_nav_menu_items` function to replace the call to `get_objects_in_term` with a simple taxonomy query. This change improves performance as it results in one fewer query to retrieve menu items from the 
database. 

Props Spacedmonkey, peterwilsoncc.
Fixes #55372.




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


git-svn-id: http://core.svn.wordpress.org/trunk@52599 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 11:07:11 +00:00
Helen Hou-Sandí
1de43a471c Build/Test Tools: First pass at a .git-blame-ignore-revs file.
This suppresses certain commits from Git blame views, notably in the GitHub UI as well as the command line. These commits are purely stylistic and excluding them from these views helps to reduce the noise when doing code archaeology.

Still to come: More coding standards commits as they are reviewed.

Props helen, costdev, peterwilsoncc.
See #55422

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


git-svn-id: http://core.svn.wordpress.org/trunk@52596 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-29 03:22:09 +00:00
audrasjb
1c07680a7a Plugins: Avoid stomping of some variables in wp-settings.php.
This changeset decreases the chance of accidentally overwriting some variables located in `wp-settings.php`, as the chance of overriding a variable called `$_wp_plugin_file` would be lower than for `$plugin`, `$mu_plugin` or `$network_plugin`.

Props stevegrunwell, joyously, peterwilsoncc, ocean90, SergeyBiryukov, jrf, azouamauriac.
Fixes #55432.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-28 13:59:02 +00:00
Sergey Biryukov
8761c4cefd Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-wp-debug-data.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 `$mysql_var` in `WP_Debug_Data::get_mysql_var()`.

Additionally, `$type` is renamed to `$data_type` in `WP_Debug_Data::format()` for clarity.

Follow-up to [51522], [52946], [52996], [52997], [52998].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-28 13:24:01 +00:00
audrasjb
c3a76d012d Docs: Use third-person singular verbs for function descriptions in wp-admin/includes/theme.php and wp-admin/includes/theme-install.php, per the documentation standards.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52591 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-28 13:17:05 +00:00
audrasjb
e92dc36129 Options, Meta APIs: Rephrase the description of the "Avatars" section.
This changeset clarifies the description of the "Avatars" section in Discussion Settings screen.

Props johnjamesjacoby, helen, netweb, GaryJ, sabernhardt, costdev, audrasjb, webcommsat, peterwilsoncc.
Fixes #32998.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52590 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-28 10:56:04 +00:00
John Blackbourn
0a1310b60d Docs: Correct the documented return types for date and time related functions and filters.
See #54729

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


git-svn-id: http://core.svn.wordpress.org/trunk@52589 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-28 10:25:01 +00:00
audrasjb
1abfa45554 Docs: Use third-person singular verbs for function descriptions in wp-includes/template.php, per the documentation standards.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52588 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-28 09:45:06 +00:00
Sergey Biryukov
407a9bebe4 Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-theme-upgrader.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` variable in `Theme_Upgrader` class methods to `$response` and updates the documentation accordingly.

Follow-up to [47409], [52946], [52996], [52997].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52587 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-27 14:55:02 +00:00
Sergey Biryukov
0cde19b503 Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-plugin-upgrader.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` variable in `Plugin_Upgrader` class methods to `$response` and updates the documentation accordingly.

Follow-up to [47409], [52946], [52996].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52586 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-27 14:45:04 +00:00
Sergey Biryukov
6ada28a47b Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-ftp.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 of `ftp_base::glob_pattern_match()` to `$subject`.

Follow-up to [52946].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52585 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-26 15:28:08 +00:00
audrasjb
f0d2ba5be0 Editor: Optimize preload paths for post and site editors.
This patch optimizes preload paths in post and site editors so that they match the real requests:

- Remove the `/` preload as the payload is very big and the response is not needed on any critical path.
- Modify the preloaded path for `/wp/v2/taxonomies` so that it corresponds to what `loadTaxonomyEntities` requests. After Gutenberg PR 37685 was merged to core, these preloads need to be modified to use `context=view` instead of `context=edit`.
- Modify the `/wp/v2/users/me path` so that it matches the real request (no query params).
- Add a preload of `/wp/v2/settings` because it is requested on critical path (editor boot). Site editor already preloads this, the changeset is only adding it to the post editor.

This is related to Gutenberg PR 39256 which introduces compatibility code to modify the preload paths with a filter, when the Gutenberg plugin is active.

See https://github.com/WordPress/gutenberg/pull/39256.

Props jsnajdr, noisysocks.
Fixes #55337.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-25 21:50:03 +00:00
audrasjb
e2bf0e9edf Docs: Use third-person singular verbs for function descriptions in wp-includes/rewrite.php, per the documentation standards.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52583 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-25 21:34:01 +00:00
audrasjb
876dde2def Twenty Nineteen: Override flex order in comment form.
This change updates Twenty Nineteen bundled theme to fix the DOM order in the comment form, and to add a new `.comment-form-wrapper` class to change `flex` display to `block` for this specific area.

Props garrett-eclipse, audrasjb, sabernhardt.
Fixes #46600.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52582 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-25 21:20:04 +00:00
Sergey Biryukov
746f1146c9 Docs: Use third-person singular verbs for function descriptions in wp-includes/taxonomy.php, per the documentation standards.
See #54729.
Built from https://develop.svn.wordpress.org/trunk@52992


git-svn-id: http://core.svn.wordpress.org/trunk@52581 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-25 16:53:01 +00:00
Sergey Biryukov
05dfeab45e Docs: Adjust the term_exists_default_query_args filter docs per the documentation standards.
Follow-up to [52987].

See #55439.
Built from https://develop.svn.wordpress.org/trunk@52991


git-svn-id: http://core.svn.wordpress.org/trunk@52580 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-25 16:48:01 +00:00
spacedmonkey
ff1e74602d Query: Ensure that sticky post query returns all sticky posts.
Ensure that the `posts_per_page` parameter submit to sticky post query matches the number of sticky posts requested. 

Follow-up to [52982]

Props Spacedmonkey, peterwilsoncc.
See #36907.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-25 09:56:05 +00:00
davidbaumwald
31dede34c1 External Libraries: Update Jcrop to version 0.9.15.
For a full list of changes, see https://github.com/tapmodo/Jcrop/compare/v0.9.12...v0.9.15.

This change also adds a comment in `script-loader.php` indicating that this library is no longer used by core.

Follow-up to [10846], [10863], [11015], [21633], [25549].

Props hareesh-pillai, karpstrucking, SergeyBiryukov.
Fixes #54035.
Built from https://develop.svn.wordpress.org/trunk@52989


git-svn-id: http://core.svn.wordpress.org/trunk@52578 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-24 20:07:05 +00:00
Sergey Biryukov
89439a7f83 Upgrade/Install: Update sodium_compat to v1.17.1.
The latest version of sodium_compat includes further improvements for PHP 8.1 compatibility.

Release notes:
https://github.com/paragonie/sodium_compat/releases/tag/v1.17.1

A full list of changes in this update can be found on GitHub:
https://github.com/paragonie/sodium_compat/compare/v1.17.0...v1.17.1

Follow-up to [49741], [51002], [51591].

Props jrf, paragoninitiativeenterprises.
Fixes #55453.
Built from https://develop.svn.wordpress.org/trunk@52988


git-svn-id: http://core.svn.wordpress.org/trunk@52577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-24 15:20:08 +00:00
spacedmonkey
e0570e5753 Taxonomy: Introduce term_exists_default_query_args filter.
In [52921] `term_exists` was converted to use `get_terms`. This change adds a filter called `term_exists_default_query_args` 
to the `term_exists` function to allow developers to modify the arguments passed to `get_terms` before the query is run.

Props Chouby, Spacedmonkey, peterwilsoncc.
Fixes #55439.



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


git-svn-id: http://core.svn.wordpress.org/trunk@52576 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-24 10:26:06 +00:00
davidbaumwald
fabc5db7fe Upgrade/Install: Fix the docs for the default value of $clear_working in WP_Upgrader::run.
The current docblock for `WP_Upgrader::run` indicates the default value for the `clear_working` key of the `$options` argument is `false`.  However, in the code directly below, the default is shown to be `true.  This change updates the docblock to correct the default.

This commit also reorders the `$defaults` to match the order they appear in the docblock.

Props paulkevan.
Fixes #55450.
Built from https://develop.svn.wordpress.org/trunk@52986


git-svn-id: http://core.svn.wordpress.org/trunk@52575 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-23 18:04:05 +00:00
Sergey Biryukov
4499c7a17f Tests: Use a more descriptive name for the sticky posts test that verifies the parameters from the main query.
Reorder the parameters of the `get_posts()` call for consistency with similar calls elsewhere.

Follow-up to [52982].

See #36907.
Built from https://develop.svn.wordpress.org/trunk@52985


git-svn-id: http://core.svn.wordpress.org/trunk@52574 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-23 16:28:06 +00:00
Sergey Biryukov
b3f614f962 Docs: Adjust documentation in get_post_galleries() tests per the documentation standards.
Follow-up to [52190], [52797].

Props azouamauriac, SergeyBiryukov.
See #54725, #54729.
Built from https://develop.svn.wordpress.org/trunk@52984


git-svn-id: http://core.svn.wordpress.org/trunk@52573 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-23 15:03:05 +00:00
Sergey Biryukov
efcc58a31e Tests: Remove some unused variables in phpunit/tests/filters.php.
Follow-up to [29422], [31014].

Props azouamauriac.
See #54725.
Built from https://develop.svn.wordpress.org/trunk@52983


git-svn-id: http://core.svn.wordpress.org/trunk@52572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-23 14:50:07 +00:00
spacedmonkey
e8bf92cf76 Query: Improved sticky post query
Ensure that the parameters `update_post_meta_cache`, `update_post_term_cache`, `cache_results`, `suppress_filters` and 
`lazy_load_term_meta` that are passed to WP_Query, are also passed down to the secondary query used to get sticky 
posts. 

Props Spacedmonkey, peterwilsoncc, rehanali, uday17035. 
Fixes #36907.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52571 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-23 10:39:06 +00:00
audrasjb
dcd54244a6 Administration: Remove a duplicate sentence after [52980].
Follow-up to [52980], [52979], [52978].

Props SergeyBiryukov.
Fixes #38913.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52570 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-22 21:11:01 +00:00
audrasjb
108af2ee64 Administration: Rephrase some sentences after [52978].
Follow-up to [52978], [52979].

Props SergeyBiryukov.
Fixes #38913.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52569 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-22 21:07:01 +00:00
audrasjb
6f39380c34 Administration: Replace contracted verb forms for better consistency.
This changeset replaces contracted verb forms like `doesn't`, `can't`, or `isn't` with non-contracted forms like `does not`, `cannot`, or `is not`, for better consistency across the WordPress administration. It also updates some corresponding unit tests strings.

Follow-up to [52978].

See #38913.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52568 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-22 19:59:04 +00:00
audrasjb
223cda987f Administration: Replace contracted verb forms for better consistency.
This changeset replaces contracted verb forms like `doesn't`, `can't`, or `isn't` with non-contracted forms like `does not`, `cannot`, or `is not`, for better consistency across the WordPress administration. It also updates some corresponding unit tests strings.

Props Presskopp, socalchristina, aandrewdixon, francina, SergeyBiryukov, JeffPaul, audrasjb, hellofromTonya.
Fixes #38913.
See #39176.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-22 16:25:03 +00:00
Sergey Biryukov
6f5f187574 Coding Standards: Use multi-line strings for the $this->request property in wp-includes/class-wp-*-query.php.
This further improves the readability by replacing `implode()` calls with string interpolation.

Follow-up to [52973].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52566 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-22 14:56:05 +00:00
spacedmonkey
51d4723691 Build/Test Tools: Make comment cache group persistent in object-cache.php.
After the comment cache group was made persistent in [37613], also make 
persistent in object-cache.php used for PHPUnit tests. 

See #54725 


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


git-svn-id: http://core.svn.wordpress.org/trunk@52565 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-22 11:36:01 +00:00
spacedmonkey
7613aaf9b1 Menus: Improve cache priming in the wp_get_nav_menu_items function.
In `wp_get_nav_menu_items` multiple function calls to `get_terms` and `get_posts` were being used to load post/term objects into 
memory. This change replaces calls to `get_terms` and `get_posts` with calls to `_prime_post_caches` and 
`_prime_term_caches`. These functions are designed to prime object caches and do not have the overhead of a query object. This 
change also replaces multiple queries with a single query, saving many SQL queries per page load. 

Props Spacedmonkey, peterwilsoncc. 
Fixes #55428.
 --This line, and those below, 
will be ignored--

M    src/wp-includes/nav-menu.php

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


git-svn-id: http://core.svn.wordpress.org/trunk@52564 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-22 09:58:07 +00:00
Sergey Biryukov
41de51364a Coding Standards: Remove a one-time $pieces variable in wp-includes/class-wp-*-query.php.
Use the existing `$clauses` variable instead for consistency.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-21 12:22:01 +00:00
Sergey Biryukov
38dbd506e7 Coding Standards: Wrap the $this->request property in wp-includes/class-wp-*-query.php.
This aims to improve readability by fitting the values on a single screen to avoid horizontal scrolling. 

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


git-svn-id: http://core.svn.wordpress.org/trunk@52562 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-21 12:05:04 +00:00
Sergey Biryukov
83c4cdf92b Coding Standards: Simplify some long conditions in wp-includes/class-wp-term-query.php.
This aims to improve readability and make the logic easier to parse at a glance.

Follow-up to [40293], [52970].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52561 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-21 11:56:04 +00:00
audrasjb
7fda1f8e69 Menus: Improve padding on bulk action labels for small screens.
Props sumitsingh, sabernhardt, ryokuhi, priyank9033, audrasjb, pbiron.
Fixes #54855.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-21 10:32:03 +00:00
Peter Wilson
284308048e Taxonomy: Increase cache hits in WP_Term_Query.
Increase the number of cache hits in `WP_Term_Query` by normalizing data included in the cache key.

Arguments that do not affect the SQL query, eg `update_term_meta_cache`, are removed from cache key generation. Arguments that are accepted in multiple formats, eg a string and an array, are normalized for both the cache key and the SQL query.

Props spacedmonkey.
Fixes #55352.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-21 03:55:03 +00:00
Sergey Biryukov
dcf9c33bc6 KSES: Add support for <ruby> and related elements.
`<ruby>` element and its friends are used to attach annotation text onto a piece of text. This is especially commonly used in Japanese content, but it can also been seen in content of other languages like Chinese.

The set of elements to enable such functionality consists of `<ruby>`, `<rt>`, and `<rp>` in the [https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-ruby-element HTML Standard], while some browsers (like Firefox) additionally support `<rb>` and `<rtc>` for more advanced formatting, which are not yet included in the official HTML spec, but can be found in a [https://www.w3.org/TR/html-ruby-extensions/ W3C extension].

Props upsuper, mukesh27, SergeyBiryukov.
Fixes #54698.
Built from https://develop.svn.wordpress.org/trunk@52969


git-svn-id: http://core.svn.wordpress.org/trunk@52558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-21 00:30:04 +00:00
Peter Wilson
d89f6097c4 KSES: Allow lang, xml:lang, dir attributes globally.
Globally permit the `lang`, `xml:lang`, and `dir` attributes on all elements rather than a subset in accordance with the HTML specification.

Props upsuper, SergeyBiryukov, mukesh27, audrasjb.
Fixes #54699.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-21 00:13:05 +00:00
Sergey Biryukov
799d6d616c Coding Standards: Escape the comment post URL in _wp_dashboard_recent_comments_row().
Follow-up to [6705].

Props kebbet.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52967


git-svn-id: http://core.svn.wordpress.org/trunk@52556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 17:39:01 +00:00
Sergey Biryukov
0fc4e7d73a Coding Standards: Use strict comparison in wp-includes/class-wp-http-curl.php.
Follow-up to [17692], [25303], [29968].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52555 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 16:24:03 +00:00
Sergey Biryukov
b30c9f51c0 Coding Standards: Rename the $theBody variable to $body in WP_Http_Curl::request().
This fixes a `Variable "$theBody" is not in valid snake_case format` WPCS warning.

Follow-up to [8516], [51825], [51929], [51931], [51940], [52025], [52960], [52961], [52962], [52963], [52964].

Props azouamauriac.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52965


git-svn-id: http://core.svn.wordpress.org/trunk@52554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 16:12:06 +00:00
Sergey Biryukov
010c5d4f89 Coding Standards: Rename the $strResponse variable to $response in WP_Http_Streams::request().
This fixes a `Variable "$strResponse" is not in valid snake_case format` WPCS warning.

For consistency, this commit also renames the `WP_Http::processResponse()` argument to `$response`.

Follow-up to [8516], [51825], [51929], [51940], [52025], [52960], [52961], [52962], [52963].

Props azouamauriac.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52964


git-svn-id: http://core.svn.wordpress.org/trunk@52553 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 16:02:04 +00:00
Sergey Biryukov
0c8714dcda Coding Standards: Rename the $headerValue variable to $header_value in WP_Http_Streams::request().
This fixes a `Variable "$headerValue" is not in valid snake_case format` WPCS warning.

Follow-up to [8516], [51825], [51929], [51940], [52960], [52961], [52962].

Props azouamauriac.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52963


git-svn-id: http://core.svn.wordpress.org/trunk@52552 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 15:52:06 +00:00
Sergey Biryukov
6c3ea94f97 Coding Standards: Rename the $strHeaders variable to $headers in WP_Http_Streams::request().
This fixes a `Variable "$strHeaders" is not in valid snake_case format` WPCS warning.

Follow-up to [8516], [51825], [51929], [51940], [52960], [52961].

Props azouamauriac.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52962


git-svn-id: http://core.svn.wordpress.org/trunk@52551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 15:50:06 +00:00
Sergey Biryukov
236e1d4ee3 Coding Standards: Rename the $requestPath variable to $request_path in WP_Http_Streams::request().
This fixes a `Variable "$requestPath" is not in valid snake_case format` WPCS warning.

Follow-up to [8516], [51825], [51929], [51940], [52960].

Props azouamauriac.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52961


git-svn-id: http://core.svn.wordpress.org/trunk@52550 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 15:43:04 +00:00
Sergey Biryukov
47d2a73beb Coding Standards: Rename the $bodyStarted variable to $body_started in WP_Http_Streams::request().
This fixes a `Variable "$bodyStarted" is not in valid snake_case format` WPCS warning.

Follow-up to [17555], [51825], [51929], [51940].

Props azouamauriac.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52960


git-svn-id: http://core.svn.wordpress.org/trunk@52549 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 15:37:06 +00:00
Sergey Biryukov
60ca4af9e1 Docs: Correct variable references in get_category_feed_link() and get_term_feed_link() @return tags.
The `$cat_id` and `$term_id` variables were replaced by `$cat` and `$term`, respectively.

Follow-up to [52180].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52548 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 15:05:05 +00:00
Sergey Biryukov
845f4f00fd Coding Standards: Rename the $cat_ID argument to $cat_id in get_the_category_by_ID().
This fixes a `Variable "$cat_ID" is not in valid snake_case format` WPCS warning.

Props azouamauriac.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52958


git-svn-id: http://core.svn.wordpress.org/trunk@52547 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-20 14:57:07 +00:00
Sergey Biryukov
8cdec43675 Coding Standards: Use esc_url() instead of esc_attr() for some URLs.
Follow-up to [2063], [2182], [4656], [6952], [9098], [11109], [11204], [17887], [22505], 

Props kebbet.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52957


git-svn-id: http://core.svn.wordpress.org/trunk@52546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-19 20:31:12 +00:00
John Blackbourn
280aabee27 I18N: Avoid translating wp_locale strings several times.
This avoids 26 unnecessary duplicate translations.

Props Chouby

Fixes #54564

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


git-svn-id: http://core.svn.wordpress.org/trunk@52545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 21:18:03 +00:00
John Blackbourn
7f9c9dc731 Formatting: Add support for formatting sizes as PB, EB, ZB, and YB.
Props henry.wright, Presskopp

Fixes #40875

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


git-svn-id: http://core.svn.wordpress.org/trunk@52544 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 20:48:02 +00:00
davidbaumwald
35c5e74706 Users: Check maximum length of user_nicename after filters are applied.
Similar to other checks on `user_login` and `user_url`, this change moves the maximum length check on `user_nicename` after the `pre_user_nicename` filter has been applied, to account for any changes to the value prior to saving.

Props SergeyBiryukov, ravipatel, muhammadfaizanhaidar, mukesh27, csesumonpro, azouamauriac.
Fixes #54987.
Built from https://develop.svn.wordpress.org/trunk@52954


git-svn-id: http://core.svn.wordpress.org/trunk@52543 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 20:44:01 +00:00
davidbaumwald
ee85a17cf2 Taxonomy: Consider HTML5 input types when resetting form values after adding a new tag.
When adding a new tag, the form is reset by clearing values for `input[type=text]` and `textarea`s.  However, the reset doesn't account for any HTML5 input types, like `number` or `url`, that may be added by plugins or themes.

This change updates the form resetting jQuery to clear any values from `input` types that are not hidden and neither a `checkbox` nor `radio` type.

Props stevegrunwell.
Fixes #48030.
Built from https://develop.svn.wordpress.org/trunk@52953


git-svn-id: http://core.svn.wordpress.org/trunk@52542 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 20:12:06 +00:00
John Blackbourn
6571e44299 Plugins: Convert apply_filters() into a proper variadic function.
This makes its signature more correct by implementing the spread operator, and adjusts the internal logic correspondingly without affecting performance.

Props jrf, SergeyBiryukov, davidbaumwald, mauriac, johnbillion

Fixes #53218

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


git-svn-id: http://core.svn.wordpress.org/trunk@52541 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 18:23:04 +00:00
davidbaumwald
92a1067f1d Comments: Disable "close on escape" for inline replies when using an IME.
When using an Input Method Editor(IME), pressing escape to perform actions in the IME is common.  However, if this was done while replying to a comment, the "close on escape" feature was also triggered which cleared the current textarea and closed it.

This change checks if an IME is in use by binding the `compositionstart` event to the reply text box and setting a flag if it's triggered.  The "close on escape" feature will now only be triggered if this new flag is not set after typing a reply.

Props BettyJJ, sabernhardt, alexstine, konradyoast, audrasjb, rafiahmedd, afercia.
Fixes #54548.
Built from https://develop.svn.wordpress.org/trunk@52951


git-svn-id: http://core.svn.wordpress.org/trunk@52540 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 18:14:02 +00:00
davidbaumwald
df3dae33cc Administration: Add a media_date_column_time filter to the media list table date column.
Similar to the existing `post_date_column_time` filter in the posts list table, this change adds a new hook to filter the "Date" column output in the media list view.

Props ivanlutrov, lopo, audrasjb.
Fixes #42942.
Built from https://develop.svn.wordpress.org/trunk@52950


git-svn-id: http://core.svn.wordpress.org/trunk@52539 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 16:39:02 +00:00
Sergey Biryukov
fc469e56ca Themes: Use esc_url() for theme screenshots on the Themes screen.
This brings consistency with how screenshots are escaped elsewhere.

Follow-up to [52020], [52947].

See #53370.
Built from https://develop.svn.wordpress.org/trunk@52949


git-svn-id: http://core.svn.wordpress.org/trunk@52538 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 13:44:03 +00:00
audrasjb
775ae0b5f6 Themes: Add version to theme screenshot URL in WP_Themes_List_Table.
Follow-up to [52947].

See #53370.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52537 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-18 12:44:04 +00:00
audrasjb
a32545f854 Themes: Add version to theme screenshot URL for better browser cache handling.
This change appends the theme version number to the URL of screenshots that appear in various place of the WordPress Admin. As a result, browsers will be able to refresh the screenshot as needed when the theme is updated.

Props codente, desrosj, audrasjb, SergeyBiryukov.
Fixes #53370.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52536 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-17 22:21:07 +00:00
Sergey Biryukov
d6589948ca Code Modernization: Rename parameters that use reserved keywords in wp-admin/includes/class-custom-image-header.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` variable in `Custom_Image_Header` class methods to `$attachment` for clarity and consistency, as the variable type is actually an array, and updates the documentation accordingly.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-17 20:19:10 +00:00
Peter Wilson
5c2f80f60f Registration/Login: Coding standards fixes for wp-login.php.
Props alkesh7, Presskopp, audrasjb.
Fixes #54746.
See #54728.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-17 04:57:03 +00:00
Peter Wilson
e24bf8c2c9 Themes: Use pointer when hovering on theme details button.
Use the pointer cursor when hovering over the theme details button for consistency with the theme card. Clicking in either area performs the same action.

Props multidots1896, rehanali, ravipatel, sabernhardt, ryokuhi.
Fixes #54971.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-17 04:34:01 +00:00
Peter Wilson
88e428a2e1 Editor/Docs: Add blockTypes argument to WP_Block_Patterns_Registry::register() docblock.
Add the optional `blockTypes` argument in the patten properties for `WP_Block_Patterns_Registry::register()`.

Props vlad.olaru.
Fixes #55303.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-17 04:13:07 +00:00
noisysocks
d2c2dc1c10 Add WP_Block_Editor_Context::$name
Adds a new `WP_Block_Editor_Context::$name` and field. This allows plugin
developers to tell which block editor is being loaded when using filters such as
`allowed_block_types_all` and `block_editor_rest_api_preload_paths`.

Fixes #55301.
Props talldanwp, gziolo, andraganescu.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-17 03:37:05 +00:00
Sergey Biryukov
7e6d939911 Docs: Add a @since note about Twenty Twenty-Two for WP_Theme::$default_themes.
Follow-up to [51328], [52093].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-16 19:32:03 +00:00
Sergey Biryukov
0538720bba Themes: Allow block themes to be activated without index.php.
This removes the requirement for block themes to have an unused `index.php` template just for activation, as they use a `templates/index.html` file instead.

The updated requirements are as follows:

* Standalone themes need to have a `templates/index.html` or `index.php` template file.
* Child themes need to have a `Template` header in the `style.css` stylesheet.

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

Props poena, sabbirshouvo, scruffian, manfcarlo, overclokk, andraganescu, SergeyBiryukov.
Fixes #54272.
Built from https://develop.svn.wordpress.org/trunk@52940


git-svn-id: http://core.svn.wordpress.org/trunk@52529 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-16 18:30:03 +00:00
gziolo
54bdc31c99 Editor: Fix broken asset URLs when using WP outside of the regular directory
Both CSS and JS URLs were totally broken for some of the newer blocks (e.g. the navigation block in the 2022 theme) when WP core is outside of the current directory using a different prefix.

Props pgpagely, Mamaduka.
Fixes #55311.



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


git-svn-id: http://core.svn.wordpress.org/trunk@52528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-16 10:22:03 +00:00
Peter Wilson
65d06b7cdc Tests: Include special characters in term names for wp_set_term_objects().
Test `wp_set_term_objects()` using terms with special characters in the name, for example ampersand, bullet and other symbols and punctuation.

Props kapacity, costdev.
Fixes #53152.
See #54725.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52527 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-16 03:06:06 +00:00
Dominik Schilling
14f7f05190 I18N, Script Loader: Don't register empty locale data objects.
For `wp.i18n` the library [https://github.com/messageformat/Jed Jed] was initially used which was throwing an error if a domain was not registered but used in a translate function. Later, the library was replaced by [https://github.com/aduth/tannin Tannin] which no longer requires the domain to be registered and thus we can avoid printing an empty-ish translations script that doesn't add any translations.

Props jsnajdr.
Fixes #55250.
Built from https://develop.svn.wordpress.org/trunk@52937


git-svn-id: http://core.svn.wordpress.org/trunk@52526 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-15 16:00:02 +00:00
Sergey Biryukov
0e95737d10 Plugins: Move the introduction text from install_dashboard() to display_plugins_table().
This brings some consistency to how the introduction is displayed for the Beta Testing, Featured, and Recommended tabs of the Add Plugins screen.

This commit also reorders the `switch` cases for the text in the same order as they are displayed.

Follow-up to [9141], [30889], [36297].

Props sabbir1991, kapilpaul.
Fixes #55389.
Built from https://develop.svn.wordpress.org/trunk@52936


git-svn-id: http://core.svn.wordpress.org/trunk@52525 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-15 15:58:02 +00:00
audrasjb
1cd42e3cbe Docs: Misc. fixes in wp-includes/post-template.php and wp-includes/post-thumbnail-template.php.
Props azouamauriac, audrasjb.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52524 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-15 15:22:05 +00:00
Sergey Biryukov
3d5b1eac13 Docs: Further clarify the description for install_dashboard().
Follow-up to [52931].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52523 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-14 18:14:00 +00:00
Sergey Biryukov
0d747500ba I18N: Move wp_get_list_item_separator() to a more appropriate place.
Follow-up to [52929].

See #39733.
Built from https://develop.svn.wordpress.org/trunk@52933


git-svn-id: http://core.svn.wordpress.org/trunk@52522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-14 18:01:02 +00:00
hellofromTonya
316aa2544f Media: Relocate wp_filesize() function for use in frontend and backend.
A new function `wp_filesize()` was added with [52837]. The function lived in the `wp-admin/includes/file.php` file. However, this admin specific function is not loaded into memory when hitting `media/edit` endpoint. The result was a `500` Internal Server Error. Why? The function is invoked with that endpoint, but the function does not exist in memory.

This commit relocates the new function to the `wp-includes/functions.php` file. In doing so, the function is available for both the frontend and backend.

Follow-up to [52837].

Props talldanwp, spacedmonkey, costdev, antonvlasenko.
Fixes #55367.
Built from https://develop.svn.wordpress.org/trunk@52932


git-svn-id: http://core.svn.wordpress.org/trunk@52521 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-14 16:32:06 +00:00
audrasjb
d1fe2eec5c Docs: Miscellaneous fixes in wp-admin/includes/plugin-install.php and wp-admin/includes/plugin.php.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52520 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-13 21:56:01 +00:00
audrasjb
837cb1e93b Docs: Use third-person singular verbs for function descriptions in wp-includes/class-wp-locale.php.
Follow-up to [52929].

See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52519 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-13 21:06:01 +00:00
audrasjb
30a77d5fa4 i18n: Define List item separator as a WP_Locale property.
The list item separator is a locale property, and it doesn't make much sense to translate it separately in multiple projects. This changeset implements the following modifications:

- Define list item separator as a new WP_Locale property
- Add `wp_get_list_item_separator()` as a wrapper for `WP_Locale::get_list_item_separator`
- Replace `$wp_locale->get_list_item_separator()` calls with `wp_get_list_item_separator()`
- Added a compatibility layer for bundled themes

Props SergeyBiryukov, swissspidy, rsiddharth, johnbillion, audrasjb.
Fixes #39733.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-13 20:03:01 +00:00
audrasjb
3046b5b3e1 Twenty Thirteen: Add gradient background options using the theme color scheme.
This change implements gradient background options that fit the color scheme used in Twenty Thirteen.

Props ianbelanger, tomjdevisser, audrasjb.
Fixes #49762.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52517 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-13 09:50:06 +00:00
audrasjb
b9033d9203 Twenty Nineteen: Display Image block at the same size whether the image is linked or not.
This change makes sure the `max-width` value is assigned for linked images.

Props JarretC, sabernhardt.
Fixes #48697.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-12 22:53:04 +00:00
audrasjb
b972ba13bd Twenty Sixteen: Remove .entry-content selector from button styles.
This change applies the default button styles to all button blocks in Twenty Sixteen, instead of only targeting those in `entry-content`. This means that any buttons added outside of `.entry-content`, such as in a widget area, will be styled the same as any other button blocks. This change also makes the theme custom colors work outside of `.entry-content`.

Follow-up to [44306].

Props mikachan, costdev, audrasjb.
Fixes #55167.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-12 21:55:08 +00:00
audrasjb
2594c68d9f Twenty Nineteen: avoid columns set to full width to extend beyond editor bounds.
This changeset applies `max-width` and `margin` CSS rules when `block-editor-writing-flow` and `editor-styles-wrapper` classes are on the same element.

Props charleyparkerdesign, sabernhardt, smit08, sclayf1.
Fixes #54169.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52514 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-12 19:13:05 +00:00
davidbaumwald
3172eac11b Formatting: Use safecss_filter_attr in wp_get_layout_style().
Previously, `safecss_filter_attr` did not allow for `calc` and `var` in parsed CSS.  Because of this, `wp_strip_all_tags` was used in `wp_get_layout_style` to allow for the use of these CSS functions to account for responsive widths.  [50923] added support for both of these CSS functions in KSES, so `safecss_filter_attr` can now be used in `wp_get_layout_style` as originally intended.

Follow-up to [52069].

Props grapplerulrich.
Fixes #55356.
Built from https://develop.svn.wordpress.org/trunk@52924


git-svn-id: http://core.svn.wordpress.org/trunk@52513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-12 00:29:04 +00:00
davidbaumwald
29574d03bd Site Editor: Rename the default attachment template from "Media" to "Attachment".
Follow-up to [52062].

Props scruffian, costdev.
Fixes #55373.
Built from https://develop.svn.wordpress.org/trunk@52923


git-svn-id: http://core.svn.wordpress.org/trunk@52512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-11 23:30:07 +00:00
Sergey Biryukov
08b97d13b8 Site Editor: Fix typo in the description of the tag template.
Follow-up to [52331].

Props scruffian.
Fixes #55374.
Built from https://develop.svn.wordpress.org/trunk@52922


git-svn-id: http://core.svn.wordpress.org/trunk@52511 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-11 15:24:02 +00:00
spacedmonkey
4c23c2f079 Taxonomy: Use get_terms instead of a database lookup in term_exists().
Replace raw SQL queries to the terms table, with a call to the `get_terms` function. Using `get_terms` means that `term_exists` is now cached. For developers using `term_exists` where cache invalidation is disabled, such as importing, a workaround was added to ensure that queries are uncached. 

Props Spacedmonkey, boonebgorges, flixos90, peterwilsoncc. 
Fixes #36949. 

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


git-svn-id: http://core.svn.wordpress.org/trunk@52510 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-11 11:07:05 +00:00
jorgefilipecosta
28b6093061 Block Editor: Improve Global Styles filtering order.
From the conceptual point it makes sense to execute global styles filters before post filters. So the post filters are always the last.

Props xknown, sergey, audrasjb, vortfu, oandregal, get_dave.
Built from https://develop.svn.wordpress.org/trunk@52895


git-svn-id: http://core.svn.wordpress.org/trunk@52484 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 23:27:04 +00:00
davidbaumwald
8cda35ebd3 Privacy: Fix "Retry" action after a personal data export failure.
When exporting personal data for a user request, if the export fails for any reason, a "Retry" link is displayed inline.  However, up to this point, clicking this link performed no action.  This change adds the `export-personal-data-handle` CSS class to the link to make sure it's picked up by the same delegated listener as the initial action.  Clicking this link will now retry the export.

Props hellofromTonya, nomnom99, rafiahmedd, SergeyBiryukov, hasanuzzamanshamim.
Fixes #53032.
Built from https://develop.svn.wordpress.org/trunk@52846


git-svn-id: http://core.svn.wordpress.org/trunk@52435 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 19:22:01 +00:00
audrasjb
95d72f2207 jquery-query
Built from https://develop.svn.wordpress.org/trunk@52844


git-svn-id: http://core.svn.wordpress.org/trunk@52433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 18:54:02 +00:00
davidbaumwald
8fdb20e0f8 Media: Note ClipboardJS as a global in /js/_enqueues/admin/media.js.
Follow-up to [52842].

See #54426.
Built from https://develop.svn.wordpress.org/trunk@52843


git-svn-id: http://core.svn.wordpress.org/trunk@52432 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 18:43:02 +00:00
davidbaumwald
658f4e9367 Media: Add a "Copy URL to clipboard" function to the list table view.
Previously, a button was added to the modal view for a single media item in the "grid" view to copy the file URL to the user's clipboard.  This change adds a similar function to the "list" view for each media item.

Follow-up to [48232].

Props pbiron, ravipatel, alexstine, afercia.
Fixes #54426.
Built from https://develop.svn.wordpress.org/trunk@52842


git-svn-id: http://core.svn.wordpress.org/trunk@52431 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 18:24:03 +00:00
Sergey Biryukov
c771c6a79d Quick/Bulk Edit: Check the show_in_quick_edit taxonomy property when populating the data for the posts list table.
Previously, setting the `show_in_quick_edit` property to `false` removed the taxonomy from the inline edit form, but the terms were still being populated in the data for each table row via the `get_inline_data()` function, which only checked the `$taxonomy->show_ui` property.

This commit:
* Improves performance by ensuring that taxonomy terms are not unnecessarily populated for each table row when `show_in_quick_edit` is `false`.
* Properly populates the taxonomy terms when `show_in_quick_edit` is `true` and `show_ui` is `false`.

Follow-up to [31307].

Props jazbek, figureone, sabernhardt, ovidiul, webcommsat, SergeyBiryukov.
Fixes #42916, #49701.
Built from https://develop.svn.wordpress.org/trunk@52841


git-svn-id: http://core.svn.wordpress.org/trunk@52430 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 18:22:01 +00:00
davidbaumwald
12134c3435 Coding Standards: Fix minor alignment issue in wp_ajax_install_theme().
Follow-up to [52819].

See #54728.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52429 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 17:32:03 +00:00
hellofromTonya
2c9525edc3 Build/Test Tools: Add trash and restore of a single post e2e tests.
Adds an end-to-end (e2e) test case for:
* Emptying a post from the trash.
* Restoring a post from the trash.

Props pavanpatil1, pooja1210, justinahinon, kevin940726.
Fixes #54843.
Built from https://develop.svn.wordpress.org/trunk@52839


git-svn-id: http://core.svn.wordpress.org/trunk@52428 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 16:28:03 +00:00
hellofromTonya
d1565514e4 HTTP API: Fix typo in and improve readability of wp_parse_url() docblock.
Removes the "starting" word from "starting containing" as this is a typo. Includes minor formatting adjustments to improve readability.

Follow-up to [38726].

Props mehedi890, SergeyBiryukov, mukesh27.
Fixes #55355.
Built from https://develop.svn.wordpress.org/trunk@52838


git-svn-id: http://core.svn.wordpress.org/trunk@52427 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 16:02:01 +00:00
spacedmonkey
bbf017e550 Media: Store attachment’s file size in metadata.
Store the file size of all newly uploaded attachments, as part of the metadata stored in post meta. Storing file size means, developers will not have to resort to doing `filesize` function calls, that can be time consuming on assets on offloaded to services like Amazon’s S3. 

This change also introduces a new helper function called, `wp_filesize`. This is a wrapper around the `filesize` php function, that adds some helpful filters and ensures the return value is an integer.

Props Cybr, Spacedmonkey, SergeyBiryukov, johnwatkins0, swissspidy, desrosj, joemcgill, azaozz, antpb, adamsilverstein, uday17035. 
Fixes #49412. 


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


git-svn-id: http://core.svn.wordpress.org/trunk@52426 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 13:10:02 +00:00
spacedmonkey
8771a658ad Taxonomy: Only store term_ids and object_ids in WP_Term_Query query caches.
The query cache currently implemented in `WP_Term_Query` caches the final output of the query, depending on what fields are requested. This is wasteful, as if a user requests `fields` => `all`, then an unlimited array of `WP_Term` objects could be stored in the object cache. Instead of storing the whole WP_Term object, this change only the term_id is stored. To get an array the full WP_Term objects, the `_prime_term_caches` function is called with an array of ids. In instances where a persistent object cache is not in use, then this will result in another SQL query to be run. After `_prime_term_caches` is called if this term is requested again in the same page load, then it will already be loaded into memory.  If a user runs `WP_Term_Query` with the fields param set to `all_with_object_id`, an array of objects containing both the term_id and object_ids are stored in cache. 

This change also improves the logic to load term meta caches. This change ensures that term meta is always primed for all terms loaded in the term query. 

Props Spacedmonkey, boonebgorges, jbpaul17, peterwilsoncc, flixos90, pbearne.
Fixes #37189.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 10:58:09 +00:00
Peter Wilson
fa364267d4 Twenty Twenty-One: Reverse logic for prefers-reduced-motion media query.
Reverse the logic of the `prefers-reduced-motion` to enable transitions based on `no-preference` rather than disable them based on the `reduce` preference. This removes the need to disable transitions with the `! important` tag and unintended interactions with plugins as a result.

Props gregoiresailland, sabernhardt, ryokuhi.
Fixes #54174.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52424 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 05:21:03 +00:00
Peter Wilson
8752a2392a Sitemaps: Pass term object to wp_sitemaps_taxonomies_entry filter.
Add a forth parameter to the `wp_sitemaps_taxonomies_entry` filter to pass the entire `WP_Term` object. 

Correct the documentation for the second parameter of the `wp_sitemaps_taxonomies_entry` filter to indicate it is a term ID rather than term object.

Props RavanH, swissspidy, audrasjb.
Fixes #55239.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52423 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-10 04:01:05 +00:00
Sergey Biryukov
a1d974a2e1 Canonical: Check if the URL scheme exists in strip_fragment_from_url().
This avoids an "Undefined index" PHP notice when a schemeless URI is passed.

Props dd32, SergeyBiryukov.
Fixes #55333.
Built from https://develop.svn.wordpress.org/trunk@52833


git-svn-id: http://core.svn.wordpress.org/trunk@52422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-09 15:08:06 +00:00
Peter Wilson
a793be201b Media: Revert query string support for wp_check_filetype().
Revert [52829] due to fatal errors in some Multisite configurations.

Props dd32, SergeyBiryukov, audrasjb.
See #30377.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-09 00:48:05 +00:00
Sergey Biryukov
ac9f203a88 REST API: Correct the wording for show_in_nav_menus property description in post type visibility settings.
Follow-up to [51959].

Props pedromendonca.
Fixes #55340.
Built from https://develop.svn.wordpress.org/trunk@52831


git-svn-id: http://core.svn.wordpress.org/trunk@52420 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-08 14:51:07 +00:00
Peter Wilson
1b72380e10 Taxonomy: Improve code quality within _prime_term_caches().
Remove the second parameter on the call to `update_term_cache()` from within the function `_prime_term_caches()`. The since deprecated parameter of the former was at one point a string, never a boolean.

Props david.binda, SergeyBiryukov, azouamauriac.
Fixes #55162.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-08 04:25:06 +00:00
audrasjb
28f7345fce Media: Allow wp_check_filetype() to support query strings in URLs.
This changeset adjusts the regex in `wp_check_filetype()` to support query strings in URLs.

Follow-up to [30640], [32172].

Props voldemortensen, johnbillion, layotte, dd32, atomicjack, supercleanse, spencercameron, ianmjones, audrasjb.
Fixes #30377.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52418 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-07 22:52:05 +00:00
Sergey Biryukov
2399966d8c Themes: Correct the logic for displaying a _doing_it_wrong() notice for add_theme_support( 'html5' ).
* Calling `add_theme_support( 'html5' )` without passing an array of supported types should throw a `_doing_it_wrong()` notice: "You need to pass an array of types".
* If the second parameter is not specified, it should fall back to an array of `comment-list`, `comment-form`, and `search-form` for backward compatibility.
* If the second parameter is not an array, the function should return `false`.

The latter two points are covered by existing unit tests. The first one is now addressed by `@expectedIncorrectUsage`.

Follow-up to [25193], [25235], [25785].

Props audrasjb, peterwilsoncc, SergeyBiryukov.
Fixes #51657.
Built from https://develop.svn.wordpress.org/trunk@52828


git-svn-id: http://core.svn.wordpress.org/trunk@52417 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-07 14:44:01 +00:00
audrasjb
f33f3979ca Docs: Use third-person singular verbs for function descriptions in wp-includes/class-wp-user.php.
Props azouamauriac.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-07 13:07:03 +00:00
audrasjb
e6e88f4a2b Docs: Correct the indentation in delete_term_relationships filter.
See #54673.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52415 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-07 12:57:05 +00:00
Peter Wilson
f3d929163f General: Improve MS Edge user-agent sniff.
Update the `$is_edge` global to be `true` if the browser's user-agent contains `Edg` rather than `Edge`. Microsoft have dropped an E from the UA string.

Refer to [https://docs.microsoft.com/en-us/microsoft-edge/web-platform/user-agent-guidance#identifiers-for-microsoft-edge-on-various-platforms Microsoft's documentation on detecting edge].

Props costdev, abdullahramzan, mukesh27, Boniu91.
Fixes #55297.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52414 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-07 02:38:01 +00:00
Sergey Biryukov
c274ea83f3 Tests: Restore the original user role in the (add|remove)_user_role hooks test.
This makes sure the test does not unintentionally affect other tests.

Follow-up to [52823].

Fixes #54164.
Built from https://develop.svn.wordpress.org/trunk@52824


git-svn-id: http://core.svn.wordpress.org/trunk@52413 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-06 23:04:01 +00:00
Sergey Biryukov
78911c2f60 Users: Bring some consistency to user role hooks.
This standardizes the actions that one needs to hook to for tracking user role changes:

* `add_user_role` is only fired when the user has actually gained a new role.
* `remove_user_role` is only fired when the role was actually removed.

Both actions are now fired in `WP_User::set_role()` as appropriate.

Props dd32, SergeyBiryukov.
Fixes #54164.
Built from https://develop.svn.wordpress.org/trunk@52823


git-svn-id: http://core.svn.wordpress.org/trunk@52412 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-06 16:11:04 +00:00
Sergey Biryukov
4ae0744585 Query: Make sure WP_Query::get_queried_object() works for author_name before ::get_posts() is run.
Previously, the queried object with author data was not available before the posts loop when `author_name` is used in the query instead of `author`. With block themes, this use case appears to be more common to display the author name in the header.

This commit adjusts the logic in `WP_Query::get_queried_object()` to fall back to the `author_name` field if `author` is not present, similar to how taxonomy slugs are handled.

Follow-up to [1728], [3290], [10992].

Props dd32, swissspidy, SergeyBiryukov.
Fixes #55100.
Built from https://develop.svn.wordpress.org/trunk@52822


git-svn-id: http://core.svn.wordpress.org/trunk@52411 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-05 15:35:04 +00:00
Sergey Biryukov
c17ccc5490 Docs: Add inline comments for non-visible characters in sanitize_title_with_dashes().
This aims to clarify the list of characters that are stripped from URLs or converted to a hyphen.

Follow-up to [51984].

See #47912, #54729.
Built from https://develop.svn.wordpress.org/trunk@52821


git-svn-id: http://core.svn.wordpress.org/trunk@52410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-04 14:11:02 +00:00
audrasjb
318205d459 Coding Standards: Improve formatting in /wp-admin/user-edit.php.
This change improves the formatting of `/wp-admin/user-edit.php` to avoid PHPCS failures when adding new code, which previously required new code to be indented multiple times, breaking alignment of the HTML parts. This change avoids disabling/enabling PHPCS for failing sniffs.

Props costdev, johnregan3, peterwilsoncc.
Fixes #54673.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52409 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-04 11:29:04 +00:00
Peter Wilson
8db01b9c6b Themes: Hide block themes' live preview link following installation.
Prevent the Customizer/Live Preview button from showing for installed block themes when on the theme installation page.

Props antonvlasenko, costdev, ironprogrammer.
Fixes #54878.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52408 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-04 02:39:03 +00:00
davidbaumwald
66ed09edeb Comments: Guard against potential PHP notices in get_comment_author and get_comment_ID.
In both `get_comment_author` and `get_comment_ID`, it's possible that these functions are called without a comment context.  Specifically, `get_comment_author` can be called without passing the `$comment_ID` parameter, and `get_comment_ID` relies on the `comment` global if there's no `$comment` parameter supplied.  This leads to a PHP notice of "Trying to get property of a non-object."

This change adds a check to both functions to ensure the `$comment->comment_ID` property is not empty before actually using its value.

Follow-up to [52223].

Props dd32.
Fixes #54379.
Built from https://develop.svn.wordpress.org/trunk@52818


git-svn-id: http://core.svn.wordpress.org/trunk@52407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-03 20:33:59 +00:00
Sergey Biryukov
d71c435a82 Docs: Update the DocBlock for the wpmu_new_blog action to suggest wp_initialize_site as an alternative.
Follow-up to [43654], [52816].

See #49612.
Built from https://develop.svn.wordpress.org/trunk@52817


git-svn-id: http://core.svn.wordpress.org/trunk@52406 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-03 16:13:03 +00:00
Sergey Biryukov
b009374817 Networks and Sites: Suggest wp_initialize_site as an alternative for the deprecated wpmu_new_blog action.
The previously suggested alternative, `wp_insert_site`, does not get passed enough arguments and runs before the new site initialization routine is actually executed.

Follow-up to [43654].

Props asaquzzaman, henry.wright, MadtownLems.
Fixes #49612.
Built from https://develop.svn.wordpress.org/trunk@52816


git-svn-id: http://core.svn.wordpress.org/trunk@52405 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-03 15:58:03 +00:00
Sergey Biryukov
cc5bacb4e4 Docs: Add a @since note for WP::parse_request() about the new return value.
Includes minor code layout fixes for consistency. Additionally, this moves a more general unit test above the more specific one.

Follow-up to [52814].

See #10886.
Built from https://develop.svn.wordpress.org/trunk@52815


git-svn-id: http://core.svn.wordpress.org/trunk@52404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-02 15:40:01 +00:00
spacedmonkey
01040717aa Bootstrap/Load: Stop unnecessary queries when using the do_parse_request filter.
Developers of plugins and themes can use the `do_parse_request` filter to hot-wire requests and hook in early to render custom pages. However, even through these request may not need post queries and 404 lookups to be run, they run anyway. This can results in unnecessary SQL queries running on these requests. By adding a return value to the `parse_request` method of the `WP` class, these queries can now be skipped. 

Props junsuijin, ryan, westi, sivel, dd32, wonderboymusic, arnee, tyxla, DrewAPicture, lukecavanagh, SergeyBiryukov, davidbaumwald, Spacedmonkey, pbearne.
Fixes #10886.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-02 15:12:02 +00:00
Sergey Biryukov
f891f6f0c6 Administration: Require a valid action parameter to be set for admin-ajax.php requests.
This avoids `Array to string conversion` PHP notices when an array is passed as the `action` parameter.

Additionally, send an appropriate HTTP response status code when an invalid action is passed to `admin-post.php`.

Follow-up to [13175], [19738], [41120], [41926].

Props dd32.
Fixes #55212.
Built from https://develop.svn.wordpress.org/trunk@52813


git-svn-id: http://core.svn.wordpress.org/trunk@52402 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-02 15:00:11 +00:00
Sergey Biryukov
257b634b92 Themes: Make sure the current_theme_supports-{$feature} filter is consistently applied.
Previously, the filter was not applied if there are no arguments passed to `current_theme_supports()`.

Follow-up to [12350], [19682].

Props helgatheviking, azouamauriac, pavanpatil1, SergeyBiryukov.
Fixes #55219.
Built from https://develop.svn.wordpress.org/trunk@52812


git-svn-id: http://core.svn.wordpress.org/trunk@52401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-03-01 16:07:05 +00:00
Sergey Biryukov
4789371cfe External Libraries: Upgrade PHPMailer to version 6.6.0.
This is a minor feature release.

> Prior to this version, any OAuth provider needed to extend the provided `OAuth` base class, and this made it difficult to use with libraries other than ones based on the default [https://github.com/thephpleague/oauth2-client league] client packages. The OAuth property now accepts anything that implements the `OAuthProviderInterface`, making it much easier to use things like [https://github.com/googleapis/google-api-php-client Google's own OAuth classes]. Existing implementations that extend the provided `OAuth` base class will still work, as that base class now implements this interface too.
>
> When TLS errors occurred in PHPMailer, the error messages were often missing important info that might help diagnose/solve the problem. These error messages should now be more informative. A minor change is that a TLS error on SMTP connect will now throw an exception if exceptions are enabled.

Release notes:
https://github.com/PHPMailer/PHPMailer/releases/tag/v6.6.0

For a full list of changes in this update, see the PHPMailer GitHub:
https://github.com/PHPMailer/PHPMailer/compare/v6.5.4...v6.6.0

Follow-up to [50628], [50799], [51169], [51634], [51635], [52252], [52749].

Props jrf, Synchro, miken32.
Fixes #55277.
Built from https://develop.svn.wordpress.org/trunk@52811


git-svn-id: http://core.svn.wordpress.org/trunk@52400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-28 21:38:09 +00:00
Sergey Biryukov
e32e1750fd Docs: Use third-person singular verbs for function descriptions in wp-includes/formatting.php, per the documentation standards.
See #54729.
Built from https://develop.svn.wordpress.org/trunk@52810


git-svn-id: http://core.svn.wordpress.org/trunk@52399 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-28 16:03:00 +00:00
Sergey Biryukov
d0fb86dafb I18N: Add a $locale parameter for remove_accents().
This highlights the fact that `remove_accents()` is locale-aware and makes it easier to utilize the function with different locales without having to use `switch_to_locale()` or the `locale` filter.

Additionally, this commit relaxes the check for character replacements in German locales to include formal and informal variants of any `de_*` locale, even if WordPress does not have a native translation for some of them yet.

Props malthert, johnbillion, knutsp, ocean90, SergeyBiryukov.
Fixes #54415.
Built from https://develop.svn.wordpress.org/trunk@52809


git-svn-id: http://core.svn.wordpress.org/trunk@52398 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-28 15:42:05 +00:00
audrasjb
7e2b01d127 Administration: Consistency fixes on keyboard shortcuts instructions.
This changeset capitalizes the letter of keyboard shortcuts and replaces `CTRL` with `Ctrl`, for better consistency.

Props Presskopp, sabernhardt, joyously, SergeyBiryukov, audrasjb.
Fixes #40582.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-27 22:49:01 +00:00
Sergey Biryukov
01d22d18e6 Filesystem API: Include the ssh-ed25519 public key signature algorithm as an alternative to ssh-rsa.
The `ssh-rsa` signature algorithm is disabled by default as of OpenSSH 8.8, which breaks SSH2 uploads in WordPress on modern systems. `ssh-ed25519` is one of the suggested alternatives, supported since OpenSSH 6.5.

References:
* [https://www.openssh.com/txt/release-8.2 OpenSSH 8.2 release notes]
* [https://www.openssh.com/txt/release-8.7 OpenSSH 8.7 release notes]
* [https://www.openssh.com/txt/release-8.8 OpenSSH 8.8 release notes]

Follow-up to [8865].

Props richybkreckel, dd32.
Fixes #52409.
Built from https://develop.svn.wordpress.org/trunk@52807


git-svn-id: http://core.svn.wordpress.org/trunk@52396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-27 15:02:04 +00:00
joedolson
1da8de78da Media: Use consistent mirroring check in media views.
Change the mirroring property verification method to be consistent with other usages across models and attachments, since we don't care whether it's assigned directly on inherited.

Props MMDeveloper, SergeyBiryukov.
Fixes #53856.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52395 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-27 00:56:00 +00:00
Sergey Biryukov
d143c7c47e Query: Correct the "matched rule" condition in WP::parse_request().
The `WP::$matched_rule` property is always set now, so we should check that it's not empty instead.

Follow-up to [52804].

See #55222.
Built from https://develop.svn.wordpress.org/trunk@52805


git-svn-id: http://core.svn.wordpress.org/trunk@52394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-26 14:34:01 +00:00
Sergey Biryukov
a47961e80e Query: Preinitialize the WP class properties to their default values.
This avoids an `array_keys() expects parameter 1 to be array, null given` PHP warning for the `query_vars` property in `WP::build_query_string()` when disabling request parsing via the `do_parse_request` filter.

Props dd32, SergeyBiryukov.
Fixes #55222.
Built from https://develop.svn.wordpress.org/trunk@52804


git-svn-id: http://core.svn.wordpress.org/trunk@52393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-26 14:28:01 +00:00
audrasjb
e89229886b Themes: Remove the Live Preview link when installing a block theme from a zip archive.
This changeset removes the Live Preview link for block-based themes when installing for a zip archive, since the customizer is disabled by default for block themes.

Follow-up to [52353].

Props alanjacobmathew, hellofromTonya, antonvlasenko, ironprogrammer.
Fixes #54578.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-26 08:16:02 +00:00
audrasjb
f1d4f7f0f7 Administration: Further enhancements on small text fields after [52649].
This changeset replaces `#mailserver_port` to a more generic selector, fixes a coding standard issue, and adds a bigger margin to the field.

Follow-up to [52649].

Props SergeyBiryukov, kebbet, pyrobd.
Fixes #50177.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52390 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-25 15:49:02 +00:00
Sergey Biryukov
7c2fcae011 Tests: Rename the $success variable to $result in the wp_mail() test for an empty home URL.
The previously name could be a bit confusing if the function is expected to fail.

Follow-up to [52799].

See #54730.
Built from https://develop.svn.wordpress.org/trunk@52800


git-svn-id: http://core.svn.wordpress.org/trunk@52389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-25 14:09:59 +00:00
Sergey Biryukov
c2d8b48d97 Code Modernization: Check the return type of wp_parse_url() in wp_mail().
As per the PHP manual:
> If the `component` parameter is omitted, an associative array is returned.
> If the `component` parameter is specified, `parse_url()` returns a string (or an int, in the case of `PHP_URL_PORT`) instead of an array. If the requested component doesn't exist within the given URL, `null` will be returned.

Reference: [https://www.php.net/manual/en/function.parse-url.php#refsect1-function.parse-url-returnvalues PHP Manual: parse_url(): Return Values]

In PHP 8.1, if the home URL does not have a "host" component, it would lead to a `substr(): Passing null to parameter #1 ($string) of type string is deprecated` notice.

Changing the logic around and adding validation for the return type value of `wp_parse_url()` prevents that.

Follow-up to [48601], [51606], [51622], [51626], [51629], [51630].

Props dennisatyoast, jrf.
See #54730.
Built from https://develop.svn.wordpress.org/trunk@52799


git-svn-id: http://core.svn.wordpress.org/trunk@52388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-25 13:48:00 +00:00
Sergey Biryukov
7d6885bc51 Tests: Add a @ticket reference for the current_theme_supports-{$feature} filter test.
Follow-up to [19682], [495/tests].

Props azouamauriac.
See #54725.
Built from https://develop.svn.wordpress.org/trunk@52798


git-svn-id: http://core.svn.wordpress.org/trunk@52387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-25 13:09:00 +00:00
audrasjb
b26449d863 Media: Make get_post_galleries() only return galleries.
This change makes sure only gallery content is returned by `get_post_galleries()`. It fixes an issue where non gallery block content was also returned by the function.

Props BinaryMoon, costdev, glendaviesnz.
Fixes #55203.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-25 12:44:04 +00:00
spacedmonkey
2ae4784ca0 REST API: Pass WP_REST_Request object to the rest_index filter.
Props johnregan3, TimothyBlynJacobs, Spacedmonkey, hasanuzzamanshamim.
Fixes #48638. 

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


git-svn-id: http://core.svn.wordpress.org/trunk@52385 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-24 22:36:01 +00:00
audrasjb
631f08096b Docs: Correct return type for get_post_custom().
Props chouby, audrasjb.
Fixes #55249.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-24 21:26:02 +00:00
Sergey Biryukov
446c2afdc3 Docs: Add missing descriptions for some parameters of WP_Walker::paged_walk().
Props bhrugesh12.
Fixes #55225.
Built from https://develop.svn.wordpress.org/trunk@52794


git-svn-id: http://core.svn.wordpress.org/trunk@52383 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-24 13:33:01 +00:00
audrasjb
401e5d7175 Docs: Correct return type for get_block_metadata_i18n_schema().
Props jeremyfelt.
Fixes #55243.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52382 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-24 08:27:09 +00:00
joedolson
654d1477a9 Media: Stop arrow keys switching media if URL focused.
Keyboard handlers were prevented from navigating attachments in input fields, but the key handler excluded readonly fields, like the media URL field. This could prevent exploring the URL using the keyboard.

Props jrivett, joemcgill, afercia.
Fixes #43202.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52381 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-24 04:35:04 +00:00
audrasjb
4237c0a88b Themes: Avoid undefined variable warning on get_svg_filters().
This change fixes an undefined variable warning thrown when `duotone` color setting was set to null` in Block Themes `theme.json` file.

Follow-up to [52768].

Props aliakseyenkaihar, audrasjb, rafiahmedd.
Fixes #55241.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52380 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-23 23:17:01 +00:00
audrasjb
76e93c5d5f Plugins: Add focus style to plugin icon link in plugin cards.
This change adds a blue focus outline to the icon on plugin cards, for consistency with the text part of the link.

Props hitendra-chopda, SergeyBiryukov, afercia, themattroyal, imokol, sabernhardt, audrasjb.
Fixes #45209.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52379 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-23 21:20:06 +00:00
hellofromTonya
1f56c94459 Formatting: Make terms in wpautop() and shortcode_unautop() more welcoming and inclusive.
The developer facing humor in these functions were from a different era of WordPress. Tolerance for in-jokes and other developer facing humor has decreased over the years. Terms like "pee" and "tinkle" may make some folks chuckle while for others it makes them uncomfortable.

Terminology of the past is being (or has been) re-evaluated to transform words into a language that are inclusive and welcome for all. This commit is part of that effort as it replaces.

Follow-up [13], [9255].

Props ricomoorman, tzipporahwitty, ironprogrammer, peterwilsoncc, jeremyfelt, Viper007Bond, rmccue, SergeyBiryukov, hellofromTonya.
Fixes #25615.
Built from https://develop.svn.wordpress.org/trunk@52789


git-svn-id: http://core.svn.wordpress.org/trunk@52378 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-23 20:03:09 +00:00
audrasjb
2ac7dcd043 Help/About: Revert [52783].
Point releases about page changelog should not be committed to trunk. This changeset reverts [52783].

Unprops audrasjb.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52373 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-22 11:01:11 +00:00
audrasjb
9ce0a583a1 Help/About: Update the About page for WordPress 5.9.1.
Props hellofromTonya, audrasjb.
Fixes #55173.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52372 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-22 10:33:08 +00:00
audrasjb
53590e7cdc Twenty Twenty-Two: Bump theme version to 1.1.
This change bumps the version of the Twenty Twenty-Two bundled theme in preparation for release with WordPress 5.9.1.

Props peterwilsoncc, petaryoast, audrasjb, SergeyBiryukov, rafiahmedd.
Fixes #55056.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52370 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-21 20:55:02 +00:00
Sergey Biryukov
93e373b7be Docs: Use third-person singular verbs in some test descriptions in phpunit/tests/functions/.
Follow-up to [42971], [45371], [46159], [46175], [47779], [50962], [50964], [51910], [52778].

Props azouamauriac, SergeyBiryukov.
See #54725.
Built from https://develop.svn.wordpress.org/trunk@52780


git-svn-id: http://core.svn.wordpress.org/trunk@52369 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-21 14:52:06 +00:00
Sergey Biryukov
5040303d1a Docs: Fix typo in TracTickets::isTracTicketClosed() description.
Follow-up to [761/tests], [762/tests], [891/tests].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52368 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-20 10:14:04 +00:00
Sergey Biryukov
9253edeff3 Tests: Convert _wp_to_kebab_case() tests to use a data provider.
Follow-up to [51198], [51225].

See #54725.
Built from https://develop.svn.wordpress.org/trunk@52778


git-svn-id: http://core.svn.wordpress.org/trunk@52367 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-19 13:45:00 +00:00
Sergey Biryukov
38770aaf48 Docs: Correct parameter types for data_wp_validate_boolean().
Follow-up to [46159], [46224], [52775], [52776].

See #54725, #54729.
Built from https://develop.svn.wordpress.org/trunk@52777


git-svn-id: http://core.svn.wordpress.org/trunk@52366 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-19 13:26:58 +00:00
Sergey Biryukov
e7eda56175 Docs: Improve some DocBlocks in wp_validate_boolean() tests for consistency.
Follow-up to [46159], [46224], [52775].

See #54725, #54729.
Built from https://develop.svn.wordpress.org/trunk@52776


git-svn-id: http://core.svn.wordpress.org/trunk@52365 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-19 13:02:00 +00:00
Sergey Biryukov
72373078d1 Tests: Correct the order of expected and actual values in wp_validate_boolean() tests.
This corrects the order of the parameters when used in assertions so if/when they fail the failure message is correct.

Additionally, this commit moves the test function before the data provider, for consistency with other tests.

Follow-up to [46159], [46224].

See #54725.
Built from https://develop.svn.wordpress.org/trunk@52775


git-svn-id: http://core.svn.wordpress.org/trunk@52364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-19 12:42:01 +00:00
Sergey Biryukov
b7af78c1ce Tests: Correct the order of expected and actual values in wp_array_slice_assoc() tests.
This corrects the order of the parameters when used in assertions so if/when they fail the failure message is correct.

Follow-up to [45371].

See #54725.
Built from https://develop.svn.wordpress.org/trunk@52774


git-svn-id: http://core.svn.wordpress.org/trunk@52363 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-19 12:39:59 +00:00
Sergey Biryukov
bb395f9450 Tests: Correct the order of expected and actual values in get_status_header_desc() tests.
This corrects the order of the parameters when used in assertions so if/when they fail the failure message is correct.

Follow-up to [46107].

See #54725.
Built from https://develop.svn.wordpress.org/trunk@52773


git-svn-id: http://core.svn.wordpress.org/trunk@52362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-19 12:38:05 +00:00
spacedmonkey
7a48bab20c Cache API: Add wp_cache_flush_runtime function
Add a new function called `wp_cache_flush_runtime` to existing caching functions found in WordPress. This function allows users to flush the runtime (in-memory) cache, without flushing the entire persistent cache. 

Props: Spacedmonkey, tillkruess, flixos90, adamsilverstein, SergeyBiryukov, barryhughes. 
Fixes: #55080.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-18 12:06:03 +00:00
hellofromTonya
76207c890b Editor: Automatically apply global styles duotone filters to render in post editor.
Global styles duotone filters were not rendering in the post editor. This fixes that by adding `wp_global_styles_render_svg_filters` to the `in_admin_header` so it renders in the body before the editor.

Follow-up [52757].

Props ajlende, abhanonstopnewsuk.
Fixes #55190.
Built from https://develop.svn.wordpress.org/trunk@52768


git-svn-id: http://core.svn.wordpress.org/trunk@52357 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 20:45:00 +00:00
audrasjb
d8b1150a4a Editor: Update block editor packages for WordPress 5.9.1.
The following packages were updated:

- @wordpress/block-directory@3.0.27
- @wordpress/block-editor@8.0.17
- @wordpress/block-library@6.0.26
- @wordpress/components@19.2.3
- @wordpress/core-data@4.0.10
- @wordpress/customize-widgets@2.0.27
- @wordpress/e2e-tests@2.5.18
- @wordpress/edit-post@5.0.27
- @wordpress/edit-site@3.0.27
- @wordpress/edit-widgets@3.1.22
- @wordpress/editor@12.0.21
- @wordpress/format-library@3.0.23
- @wordpress/interface@4.1.18
- @wordpress/list-reusable-blocks@3.0.20
- @wordpress/nux@5.0.20
- @wordpress/reusable-blocks@3.0.23
- @wordpress/server-side-render@3.0.20
- @wordpress/widgets@2.0.23

Props Mamaduka.
See #55179.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52354 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 19:18:25 +00:00
hellofromTonya
2b94ffdbc9 Editor: Adds an additional check to guard against incompete presets.
Adds an additional guard to ensure the value of `$preset_metadata['value_key']` actually exists as a key in the `$preset` array. Fixes `Warning: Undefined array key` error. 

Intentionally adds the check into the existing `isset()` as it's native to PHP, more efficient, and a good pattern.

Follow-up [52049].

Props jeherve, swissspidy, sergeybiryukov, jrf.
Fixes #55161.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52352 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 18:47:02 +00:00
Sergey Biryukov
8f904628e9 Tests: Correct the @ticket reference in a download_url() test with the Content-Disposition header.
Move the data provider next to the test, for consistency.

Follow-up to [51939], [52734].

Props azouamauriac.
See #55109.
Built from https://develop.svn.wordpress.org/trunk@52760


git-svn-id: http://core.svn.wordpress.org/trunk@52349 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 17:40:02 +00:00
audrasjb
26667ab0e1 Editor: Backport Duotone fixes for 5.9.1.
This changeset is a backport for the following Gutenberg PRs:

- Fix duotone theme cache gutenberg#36236
- Fix duotone render in non-fse themes gutenberg#37954
- Duotone: Allow users to specify custom filters gutenberg#38442

Props oandregal, scruffian, Mamaduka.
See #55179.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 16:18:03 +00:00
hellofromTonya
9ac43b6ade Editor: Grant only admins access to the "Navigation Menus" UI for block and non-block themes.
Restricts and grants access to only admin roles for the Navigation Menu UI screen, i.e. either directly through the URL wp-admin/edit.php?post_type=wp_navigation or via the Navigation block's "Manage menu" option (in the block's toolbar).

It resolves 2 issues:

- For non-block themes, fixes the issue where admins could not access the UI.
- For block themes, restricts access to only admin roles, i.e. non-admins no longer have access to the UI.

Non-admins will receive the "Sorry, you are not allowed to edit posts in this post type" error message.

Follow-up [52069], [52145], [52330], [52400].

Props ironprogrammer, costdev, noisysocks, talldanwp, hellofromTonya, manfcarlo, pyrobd.
Fixes #54889.
Built from https://develop.svn.wordpress.org/trunk@52755


git-svn-id: http://core.svn.wordpress.org/trunk@52344 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 15:11:01 +00:00
Dominik Schilling
f42e80b077 Script Loader: Prevent normalizing data URIs in _wp_normalize_relative_css_links().
This prevents making data URIs as in `mask-image:url('data:image/svg+xml;utf8,<svg...` relative to the WordPress installation.

Props staatic.
See #54243.
Fixes #55177.
Built from https://develop.svn.wordpress.org/trunk@52754


git-svn-id: http://core.svn.wordpress.org/trunk@52343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 14:47:04 +00:00
jorgefilipecosta
007dec9ec6 Global Styles: Load the global styles before the theme styles in the editor.
This commit makes the site editor follow what we do in the front-end, where theme styles are loaded after global styles by default.

Props oandregal, ntsekouras.
Fixes #55188.
Built from https://develop.svn.wordpress.org/trunk@52752


git-svn-id: http://core.svn.wordpress.org/trunk@52341 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 14:14:01 +00:00
jorgefilipecosta
95bbd4c7d1 Global Styles: Fix PHP warning in WP_REST_Global_Styles_Controller if no styles exist.
There is a PHP warning in WP_REST_Global_Styles_Controller because we are assuming that every theme.json has styles property, which is not always the case.

Props ntsekouras.
Fixes #54900.
Built from https://develop.svn.wordpress.org/trunk@52750


git-svn-id: http://core.svn.wordpress.org/trunk@52339 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 13:47:59 +00:00
Sergey Biryukov
c70e24e0ab External Libraries: Upgrade PHPMailer to version 6.5.4.
The latest release includes some minor PHP cross-version improvements and a safeguard against hosters disabling security functions. Note to hosting providers: don't disable `escapeshellarg()` and `escapeshellcmd()`; it's not safe!

Release notes:
https://github.com/PHPMailer/PHPMailer/releases/tag/v6.5.4

For a full list of changes in this update, see the PHPMailer GitHub:
https://github.com/PHPMailer/PHPMailer/compare/v6.5.3...v6.5.4

Follow-up to [50628], [50799], [51169], [51634], [51635], [52252].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52338 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 13:23:04 +00:00
audrasjb
ab2c6d696b Themes: Allow extending WP_Theme_JSON and WP_Theme_JSON_Resolver classes.
This change updates methods visibility from `private` to `protected` and adds late static binding.

Original PRs from Gutenberg repository:
- https://github.com/WordPress/gutenberg/pull/38625
- https://github.com/WordPress/gutenberg/pull/38671

Props oandregal, Mamaduka, kapilpaul.
Fixes #55178.
See #55179.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52333 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-17 09:04:05 +00:00
jorgefilipecosta
cb3e78b0c3 Script Loader: Improvements to the load block support styles mechanism.
This commit applies feedback given to commit 52741. It changes the new function name, the file where it is located, and improves its documentation and marks.

Follow-up to [52741].
Props hellofromtonya, swissspidy, oandregal.
See #55148.
Built from https://develop.svn.wordpress.org/trunk@52743


git-svn-id: http://core.svn.wordpress.org/trunk@52332 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-16 22:20:01 +00:00
Sergey Biryukov
a5d6245d60 External Libraries: Update random_compat to version 2.0.21.
The latest release includes improved compatibility with PHP 8.1, as well as some bug fixes for Windows platforms.

Release notes:
https://github.com/paragonie/random_compat/releases/tag/v2.0.21

For a full list of changes in this update, see the random_compat GitHub:
https://github.com/paragonie/random_compat/compare/v2.0.11...v2.0.21

Follow-up to [42130].

Props jrf, paragoninitiativeenterprises.
Fixes #55181.
Built from https://develop.svn.wordpress.org/trunk@52742


git-svn-id: http://core.svn.wordpress.org/trunk@52331 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-16 21:19:04 +00:00
jorgefilipecosta
a73446f6ed Script Loader: Load block support styles in the head for block themes.
The dynamic block styles for layout and elements should be loaded in the head for block themes. While that should also be the case for classic themes, the current mechanism we use (render_block) does not allow us to do that, hence, this PR doesn't change anything for them and will be loaded the body.

Props oandregal, youknowriad, wpsoul.
Fixes #55148.
Built from https://develop.svn.wordpress.org/trunk@52741


git-svn-id: http://core.svn.wordpress.org/trunk@52330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-16 17:28:01 +00:00
Sergey Biryukov
a04ccd9c90 Twenty Seventeen: Remove bottom border (box-shadow) from linked images.
Props mikachan, sabernhardt, nidhidhandhukiya, mukesh27, scruffian.
Fixes #55141.
Built from https://develop.svn.wordpress.org/trunk@52740


git-svn-id: http://core.svn.wordpress.org/trunk@52329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-16 13:46:00 +00:00
audrasjb
8f5f8b19c5 Script Loader: Load block themes styles in the head section.
Previously, some logic was added to load the global stylesheet in the bottom of `<body>` for classic themes that opted-in into loading individual block styles instead of a single stylesheet for them all. At the time, block themes always loaded the global stylesheet in the `<head>`. When block themes landed in core during WordPress 5.9 this logic wasn’t updated to consider them, hence the global stylesheet loaded in the `<body>` for them. This changeset fixes this.

Props oandregal, aristath.
Fixes #55148.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52327 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-16 10:36:02 +00:00
audrasjb
ca76abd7e8 Networks and Sites: Remove unnecessary commented code from remove_user_from_blog().
This change removes a call to `wp_revoke_user()` from `remove_user_from_blog()`: this line has been commented out since forever.

Props Faison.
Fixes #55170.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52326 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-15 21:21:00 +00:00
audrasjb
fd752670a2 Administration: Fix a CSS issue on the Welcome Panel when the "Dashboard" heading is missing.
This change adds a CSS exception for when the "Dashboard" heading is missing or located below the Welcome Panel.

Props critterverse, sabernhardt, rolfsiebers, audrasjb.
Fixes #54977.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52324 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-15 18:12:00 +00:00
Clorith
c3ff2a1cc6 Filesystem API: Use a temp folder for Content-Disposition files.
#38231 added support for files fetched remotely to have their filename defined by the host using the `Content-Disposition` header. This would then take priority over the existing temporary file name created with `wp_tempnam()` earlier in the process.

The change unintentionally omitted the temporary directory path used during uploads, since the `wp_tempnam()` function would have added it previously, so that files with this header ended up being stored in the WordPress root folder, or wp-admin folder, when triggered by WP_Cron or user interactions respectively.

This change makes sure the file path includes the temporary directory location when the header is used.

Follow-up to [51939].

Props antonynz, azouamauriac.
Fixes #55109.
Built from https://develop.svn.wordpress.org/trunk@52734


git-svn-id: http://core.svn.wordpress.org/trunk@52323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-15 17:49:00 +00:00
Dominik Schilling
79971103c5 Editor: Prevent front-end assets of a block from being enqueued in the block editor.
Since WordPress 5.9 you can set a view script for a block which is supposed to be only loaded on the front end. Unfortunately it's currently also loaded in the editor which can cause unexpected behaviour and also performance issues depending on the size of the scripts.
This is caused by the preloading of REST API routes via `block_editor_rest_api_preload()` which doesn't happen in an encapsulated process and so does pollute any global state like the one for scripts and styles.
Similar to the global `$post`, core now backups the globals `$wp_scripts` and `$wp_styles` and restores the backup after the preloading.

Props gziolo, ocean90.
Fixes #55151.
Built from https://develop.svn.wordpress.org/trunk@52733


git-svn-id: http://core.svn.wordpress.org/trunk@52322 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-15 17:30:02 +00:00
Sergey Biryukov
fc26a05498 Coding Standards: Rename some variables in iis7_add_rewrite_rule() for consistency.
Follow-up to [52721].

Props azouamauriac.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52732


git-svn-id: http://core.svn.wordpress.org/trunk@52321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-15 13:49:04 +00:00
audrasjb
8475350f0e Widgets: Missing markup from Widgets Group block.
This change fixes an issue in the Widgets editor: widgets group was missing a `.wp-widget-group__inner-blocks` container.

Props noisysocks, ironprogrammer.
Fixes #55072.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52319 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-15 09:58:04 +00:00
audrasjb
f4a871189a Twenty Twenty-One: Allow editor styles to control block margins.
This change removes some overrides that prevented site editor updates in 5.9 from controlling vertical margins via `var(--global--spacing-vertical)`.

Props stacimc, Boniu91, aristath, ironprogrammer, nidhidhandhukiya.
Fixes #54250.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-14 21:55:08 +00:00
Sergey Biryukov
21a51e9993 Media: Display an error message in grid view if the attachment could not be deleted.
Previously, the attachment was silently removed from the grid but reappeared after a page reload.

Follow-up to [22869].

Props kapilpaul, costdev, mukesh27, azouamauriac, SergeyBiryukov.
Fixes #55158.
Built from https://develop.svn.wordpress.org/trunk@52725


git-svn-id: http://core.svn.wordpress.org/trunk@52314 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-14 14:21:05 +00:00
audrasjb
3c27e50dd6 Twenty Fifteen: Add gradient background options using the theme color scheme.
This change implements gradient background options that fit the color scheme used in Twenty Fifteen.

Props ianbelanger, itsamoreh, pls78, audrasjb.
Fixes #49760.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52313 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-13 21:47:01 +00:00
Sergey Biryukov
556d42ac71 Coding Standards: Fix WPCS issues in wp-admin/includes/misc.php.
* Use strict comparison in various conditions.
* Fix a `Variable "$system_webServer_node" is not in valid snake_case format` WPCS warning.

Includes minor code layout fixes for better readability.

Follow-up to [10607], [11350], [22253], [26137].

Props azouamauriac, SergeyBiryukov.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52721


git-svn-id: http://core.svn.wordpress.org/trunk@52310 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-13 17:09:05 +00:00
Sergey Biryukov
77b1aa0cf3 Docs: Fix typo in a comment in wp_get_image_mime().
Follow-up to [39831].

Props dilipbheda.
Fixes #55154.
Built from https://develop.svn.wordpress.org/trunk@52719


git-svn-id: http://core.svn.wordpress.org/trunk@52308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-12 14:45:00 +00:00
Sergey Biryukov
1e1fb78c07 Code Modernization: Use file_get_contents() in wp_get_webp_info().
`file_get_contents()` is faster than `fread()`, because the PHP core can decide how to best read the remaining file; it could decide to issue just one `read()` call or `mmap()` the file first.

Per the PHP manual, `file_get_contents()` or `stream_get_contents()` is the preferred way to read the contents of a file into a string. It will use memory mapping techniques if supported by the OS to enhance performance.

Reference: [https://www.php.net/manual/en/function.file-get-contents.php PHP Manual: file_get_contents()].

Follow-up to [50810], [52696], [52698], [52701].

Props maxkellermann.
See #55069.
Built from https://develop.svn.wordpress.org/trunk@52718


git-svn-id: http://core.svn.wordpress.org/trunk@52307 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-12 13:13:59 +00:00
Sergey Biryukov
c128cd263a Coding Standards: Remove unnecessary try/catch block in wp_get_webp_info().
This appears to be redundant, as none of the functions used inside the block throw an exception.

Follow-up to [50810].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52306 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-12 13:08:01 +00:00
Sergey Biryukov
11691e8207 Docs: Improve @return tags for wp_cache_*_multiple() functions:
* `wp_cache_add_multiple()`
* `wp_cache_set_multiple()`
* `wp_cache_get_multiple()`
* `wp_cache_delete_multiple()`

This aims to provide more details about the returned value types.

Follow-up to [52700], [52702], [52703].

See #54729, #54574.
Built from https://develop.svn.wordpress.org/trunk@52708


git-svn-id: http://core.svn.wordpress.org/trunk@52297 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 19:21:01 +00:00
spacedmonkey
a4026420cc Cache: Use wp_cache_*_multiple() in core functions.
Implement the `wp_cache_add_multiple`, `wp_cache_set_multiple` and `wp_cache_delete_multiple` in a number of core functions after they were introduced in [52700]

Props: spacedmonkey, adamsilverstein, flixos90, mitogh.
Fixes: #55029.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52296 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 18:51:59 +00:00
Sergey Biryukov
6f3fcdcb4b Cache API: Reorder object cache functions and methods for consistency.
The original order was alphabetical, which became less obvious as newer functions got added, resulting in a somewhat random order.

This commits aims to organize the functions and related `WP_Object_Cache` methods in a more predictable order:

* `wp_cache_init()`
* `wp_cache_add()`
* `wp_cache_add_multiple()`
* `wp_cache_replace()`
* `wp_cache_set()`
* `wp_cache_set_multiple()`
* `wp_cache_get()`
* `wp_cache_get_multiple()`
* `wp_cache_delete()`
* `wp_cache_delete_multiple()`
* `wp_cache_incr()`
* `wp_cache_decr()`
* `wp_cache_flush()`
* `wp_cache_close()`
* `wp_cache_add_global_groups()`
* `wp_cache_add_non_persistent_groups()`
* `wp_cache_switch_to_blog()`
* `wp_cache_reset()`

Follow-up to [3011], [6543], [7986], [13066], [18580], [21403], [47938], [52700], [52703-52705].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52295 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 18:49:03 +00:00
Sergey Biryukov
d3f69d117c Docs: Correct the suggested alternative for the deprecated wp_cache_reset() function.
While this was previously added and reverted more than once as part of various documentation cleanup efforts, `wp_cache_switch_to_blog()` appears to be the correct alternative for `wp_cache_reset()`, per the latter's DocBlock.

This commit also corrects the `@deprecated` tag for `WP_Object_Cache::reset()` to link to the `::switch_to_blog()` method of the class, instead of the function of the same name.

Follow-up to [13066], [21403], [22111], [33678], [34225], [34226], [40929].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52294 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 18:33:00 +00:00
Sergey Biryukov
42e1bea8f1 Docs: Correct @since tag for wp_cache_reset().
The function was added in WordPress 3.0, not 2.6.

Follow-up to [13066].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52293 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 18:05:03 +00:00
Sergey Biryukov
7f36a90e0e Docs: Update DocBlocks for some object cache functions per the documentation standards.
Follow-up to [47060], [47938], [47944], [52700].

See #54729, #54574.
Built from https://develop.svn.wordpress.org/trunk@52703


git-svn-id: http://core.svn.wordpress.org/trunk@52292 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 17:44:01 +00:00
Sergey Biryukov
2ca9b92cef Tests: Remove some extra wp_cache_set() calls from wp_cache_set_multiple() test.
These appear to be a copy/paste from the `wp_cache_get_multiple()` test and are not required here.

Follow-up to [47938], [52700].

See #54574.
Built from https://develop.svn.wordpress.org/trunk@52702


git-svn-id: http://core.svn.wordpress.org/trunk@52291 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 17:41:01 +00:00
Sergey Biryukov
734960733e Code Modernization: Use file_get_contents() in wp_get_image_mime().
`file_get_contents()` is faster than `fread()`, because the PHP core can decide how to best read the remaining file; it could decide to issue just one `read()` call or `mmap()` the file first.

Per the PHP manual, `file_get_contents()` or `stream_get_contents()` is the preferred way to read the contents of a file into a string. It will use memory mapping techniques if supported by the OS to enhance performance.

Reference: [https://www.php.net/manual/en/function.file-get-contents.php PHP Manual: file_get_contents()].

Follow-up to [50810], [52696], [52698].

Props maxkellermann.
See #55069.
Built from https://develop.svn.wordpress.org/trunk@52701


git-svn-id: http://core.svn.wordpress.org/trunk@52290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 15:50:05 +00:00
spacedmonkey
a3f3c5c959 Cache: Add wp_cache_*_multiple functions.
Add new caching functions named `wp_cache_add_multiple`, `wp_cache_set_multiple` and `wp_cache_delete_multiple`. All of these functions allow for an array of data to be passed, so that multiple cache objects can be created / edited / deleted in a single function call. This follows on from [47938] where the `wp_cache_get_multiple` function was introduced and allowed for multiple cache objects to be received in one call. 

Props: spacedmonkey, tillkruess, adamsilverstein, flixos90, mitogh, pbearne. 
Fixes: #54574.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52289 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 12:51:59 +00:00
gziolo
a877a9806b I18n: Standardize the script paths for blocks
When providing file paths to scripts (editorScript, script or viewScript), when there is a trailing ./ included then there was a different md5 generated for the file that didn't match the one used with the file generated in the translations folder.

Props Rahe.
See #54797.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52288 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-11 12:14:04 +00:00
Sergey Biryukov
8a62f7dc05 Code Modernization: Use file_get_contents() in get_file_data().
`file_get_contents()` is faster than `fread()`, because the PHP core can decide how to best read the remaining file; it could decide to issue just one `read()` call or `mmap()` the file first.

Per the PHP manual, `file_get_contents()` or `stream_get_contents()` is the preferred way to read the contents of a file into a string. It will use memory mapping techniques if supported by the OS to enhance performance.

Reference: [https://www.php.net/manual/en/function.file-get-contents.php PHP Manual: file_get_contents()].

Follow-up to [12044], [49073], [52696].

Props maxkellermann.
See #55069.
Built from https://develop.svn.wordpress.org/trunk@52698


git-svn-id: http://core.svn.wordpress.org/trunk@52287 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-10 15:03:04 +00:00
audrasjb
fbb9d52774 Query: Check if the theme supports block-templates before calling locate_block_template() in get_query_template().
This change improves performance for classic themes by removing an unnecessary query and fixes an issue where a classic theme would show "Empty template: Index" on the frontend when an empty `(block-)templates/index.html` file exists.

Props johnbillion, ianatkins, Mamaduka, costdev, manfcarlo, dolphingg, audrasjb, madeinua, kapilpaul, rafiahmedd, SergeyBiryukov.
Fixes #54844.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52286 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-09 13:22:03 +00:00
Sergey Biryukov
4f856dfae0 Code Modernization: Use stream_get_contents() in POMO_FileReader::read_all().
`stream_get_contents()` is faster than `fread()`, because the PHP core can decide how to best read the remaining file; it could decide to issue just one `read()` call or `mmap()` the file first.

Per the PHP manual, `file_get_contents()` or `stream_get_contents()` is the preferred way to read the contents of a file into a string. It will use memory mapping techniques if supported by the OS to enhance performance.

Reference: [https://www.php.net/manual/en/function.file-get-contents.php PHP Manual: file_get_contents()].

Follow-up to [12174].

Props maxkellermann.
See #55069.
Built from https://develop.svn.wordpress.org/trunk@52696


git-svn-id: http://core.svn.wordpress.org/trunk@52285 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-09 12:33:05 +00:00
audrasjb
f76b77b7c3 Script Loader: Prevent normalizing HTML IDs in _wp_normalize_relative_css_links().
This change fixes an issue where `_wp_normalize_relative_css_links()` was not only matching urls, but also HTML IDs.

Follow-up to [52036].

Props mahype, costdev, audrasjb, SergeyBiryukov.
Fixes #54922.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52284 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-08 23:41:00 +00:00
Peter Wilson
2fa1d729ba Options: Disable transients while installing.
Prevent the transient setters and getters from attempting to use the database table before they exist during the installation process. 

During installation transients now use the `wp_cache_*()` functions on all sites, including those without a persistent cache, to prevent database errors. The use of the caching functions stores the data in memory for the duration of the request to account for transient data that is used multiple times during installation.

Props dd32, audrasjb, tnolte, antonvlasenko, noisysocks, peterwilsoncc.
Fixes #54849.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52283 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-08 23:30:03 +00:00
audrasjb
22c9355e2d Docs: Fix an error in wp_kses_attr() docblock.
Props kebbet.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52282 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-08 16:25:01 +00:00
audrasjb
2b8f6781bb Docs: Typo correction in class-wp-theme-json docblocks.
Props kebbet.
See #54729.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52281 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-08 16:11:03 +00:00
Sergey Biryukov
7d9b54b131 Posts, Post Types: Pass the $update parameter to wp_insert_post_data and wp_insert_attachment_data filters.
This makes it easier to determine in a callback function whether this is an existing post being updated or not.

Follow-up to [8635], [8702], [27130], [27138], [28106], [28788], [47633].

Props nhadsall, mukesh27.
Fixes #46228.
Built from https://develop.svn.wordpress.org/trunk@52691


git-svn-id: http://core.svn.wordpress.org/trunk@52280 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-08 12:24:02 +00:00
audrasjb
bab3bdf2df Twenty Twelve: Typo correction a bundled pattern.
This change fixes a typo in the "Left-aligned Large Quote" block pattern.

Props tobifjellner, rafiahmedd, mukesh27.
Fixes #55099.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52279 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-07 18:29:04 +00:00
Sergey Biryukov
602b46626c Coding Standards: Rename the $profileuser variable to $profile_user in wp-admin/user-edit.php.
This brings the naming more in line with other variables like `$current_user`.

Follow-up to [2872].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52278 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-07 15:26:01 +00:00
Sergey Biryukov
1b22e56ad0 Coding Standards: Use strict comparison in wp-admin/user-edit.php.
Follow-up to [2872], [13941], [12722], [14043], [14802], [23364], [42688].

Props azouamauriac.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52687


git-svn-id: http://core.svn.wordpress.org/trunk@52276 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-07 14:47:02 +00:00
audrasjb
ca5f3d0af6 Twenty Twenty-Two: Restore custom padding for group blocks with a background color.
This change partially reverts [52679] which accidentally removed custom padding for group blocks with a background color.

Follow-up to [52679].

Props kjellr.
Fixes #55103.
See #54944.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-07 14:38:59 +00:00
Sergey Biryukov
a584be05eb Coding Standards: Rename $r variable to $args for clarity in walk_page_tree().
Follow-up to [9830], [32617], [45667], [52684].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52274 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-07 14:21:01 +00:00
Sergey Biryukov
a39f5f9d4f Coding Standards: Rename $r variable to $args for clarity in walk_nav_menu_tree().
Follow-up to [14248], [32612], [45667].

Props uzumymw.
See #54728.
Built from https://develop.svn.wordpress.org/trunk@52684


git-svn-id: http://core.svn.wordpress.org/trunk@52273 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-07 14:01:05 +00:00
Sergey Biryukov
3015d1ca44 Tests: Rename the test file and class for wp_get_global_stylesheet() tests.
This matches the name of the function being tested.

Follow-up to [52675-52677].

See #54782.
Built from https://develop.svn.wordpress.org/trunk@52682


git-svn-id: http://core.svn.wordpress.org/trunk@52271 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-05 13:21:01 +00:00
audrasjb
54514a5451 Twenty Twenty-Two: Fix headings consistency in Pricing table pattern.
This change fixes a consistency issue where "Pigeon" was a h3, while "Sparrow" and "Falcon" were h2. Let's treat these birds equally 🐦

Props kjellr, jffng.
Fixes #54929.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-05 08:00:05 +00:00
audrasjb
68f58d46a5 Docs: Typo corrections in various API docblocks.
Props hasanuzzamanshamim.
Fixes #55073.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52269 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-04 16:28:00 +00:00
audrasjb
70fe8c8cea Twenty Twenty-Two: Remove negative side margins on group blocks with a background.
This change fixes an issue where applying a background color to a group block aligned it to the left in the editor.

Props eddystile, audrasjb, webmandesign, sabernhardt, petaryoast.
Fixes #54944.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-04 15:16:01 +00:00
Sergey Biryukov
1b81823244 Tests: Use more appropriate assertions in wp_get_global_stylesheet() tests.
This replaces instances of `assertTrue( str_contains( ... ) )` with `assertStringContainsString()` to use native PHPUnit functionality.

Follow-up to [52675], [52676].

See #54782.
Built from https://develop.svn.wordpress.org/trunk@52677


git-svn-id: http://core.svn.wordpress.org/trunk@52266 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-04 14:35:00 +00:00
Sergey Biryukov
4cbad9a9aa Coding Standards: Use strict type check for in_array() in wp_get_global_stylesheet().
Use multi-line comment syntax for some comments, per the documentation standards.

Follow-up to [52675].

See #54782.
Built from https://develop.svn.wordpress.org/trunk@52676


git-svn-id: http://core.svn.wordpress.org/trunk@52265 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-04 14:18:59 +00:00
jorgefilipecosta
e8e20a2823 Fix: Classic themes using default presets are not working.
This commit makes the presets provided by the theme via add_theme_support always create CSS Custom Properties, whether or not the theme has a theme.json file. This way, if the overwrites a core preset, the core CSS variables are also overwritten and use the theme value.

Props oandregal, hellofromTonya, desrosj, costdev, pbearne, johnstonphilip, webmandesign.
Fixes #54782.
Built from https://develop.svn.wordpress.org/trunk@52675


git-svn-id: http://core.svn.wordpress.org/trunk@52264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-04 13:52:00 +00:00
audrasjb
e175e8aa0a Toolbar: Don't hide admin bar text labels from screen readers on small screens.
This change replaces `display: none` with `screen-reader-text` styles so the text labels are available for screen readers on small screens.

Props legendusmaximus, sabernhardt, konradyoast.
Fixes #54895.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52263 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-04 12:56:00 +00:00
Clorith
2d20fd7cc1 External libraries: Update version string for hoverIntent.
Updating the version string will help invalidate caches, ensuring the new version of the library is loaded where applicable.

Follow-up to [52429].

Props david.binda.
Fixes #54904.
Built from https://develop.svn.wordpress.org/trunk@52673


git-svn-id: http://core.svn.wordpress.org/trunk@52262 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-04 10:52:08 +00:00
joedolson
aa3db62410 Comments: Only render term update notices on term screens.
Prevent blank notices from appearing when adding custom fields or terms in the post editor.

Props gadhiyaravi, Boniu91, ravipatel, sabernhardt.
Fixes #54955. See #42937.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-04 01:22:02 +00:00
joedolson
f5d588bf26 Comments: Verify 'mirroring' property exists in media views.
Checks that the media collection has a mirroring property before accessing the property in media views.

Props MMDeveloper, mukesh27.
Fixes #53856.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52260 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-04 01:00:04 +00:00
Sergey Biryukov
84f61343d4 Docs: Fix typo in the is_post_status_viewable() function description.
Follow-up to [50130].

Props rafiahmedd.
Fixes #55068.
Built from https://develop.svn.wordpress.org/trunk@52670


git-svn-id: http://core.svn.wordpress.org/trunk@52259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-03 21:25:02 +00:00
spacedmonkey
db603605ac Taxonomy: Remove cache expiry limitation in WP_Term_Query.
Remove the one day expiry limitation from query caches found in the `WP_Term_Qurery` class. Removing this limitation means that the caches will remain in object caching, as long as possible. Ensure that all term / taxonomy cache clear functions invalidate query caches, by deleting the last_changed value in the terms cache group. 

Props spacedmonkey, adamsilverstein, boonebgorges, tillkruess, dlh, flixos90.
Fixes #54511.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52258 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-03 17:43:06 +00:00
audrasjb
ca9b189085 Editor: Remove standard post type UI for templates and template parts.
In [52158] the standard post type UI was added back for templates and template parts, because these features had been temporarily removed from the site editor in the rush to get 5.9 ready for December. Since 5.9 these features were properly added back to the site editor, the `show_ui` values for these post types should be returned back to `false`.

Follow-up to [52158].

Props manfcarlo, audrasjb.
Fixes #54908.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52257 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-03 09:03:04 +00:00
audrasjb
63888dec3e Twenty Twenty-Two: Make 404 pattern search label and button translatable.
This changes makes the Twenty Twenty-Two "hidden-404" pattern fully prepared for translation.

Props kjellr, walbo.
Fixes #54928.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52253 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-02 23:43:02 +00:00
Peter Wilson
69e9e78cf4 Upgrade: Add follow up ticket ID to upgrade_590() comment.
Follow up to [52656].

Props audrasjb.
See #54906.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52251 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-02 23:22:06 +00:00
Sergey Biryukov
051bd96994 Twenty Twenty: Add Noto Serif as a fallback font before Garamond.
This aims to provide better experience on Chromebooks. Noto Serif is also the fallback font for Android devices.

Follow-up to [46271].

Props sabernhardt, nmschaller.
Fixes #50723.
Built from https://develop.svn.wordpress.org/trunk@52661


git-svn-id: http://core.svn.wordpress.org/trunk@52250 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-02 15:13:04 +00:00
davidbaumwald
a5c45366cb Options, Meta APIs: Correct some inline docs for update_post_meta and delete_post_meta.
In `update_post_meta` and `delete_post_meta`, code was added to fetch the parent post if these functions were called for a revision post ID.  In [9252], the code was apparently copied from `add_post_meta`, and the inline comment describing the new block of code was not updated to mention either "updated" or "deleted" respectively.  This change corrects the comment in both functions to reflect the current action instead of "added".

Props thelovekesh, rehanali.
Fixes #54835.
Built from https://develop.svn.wordpress.org/trunk@52660


git-svn-id: http://core.svn.wordpress.org/trunk@52249 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-01 17:12:03 +00:00
Sergey Biryukov
fefd1930c5 General: Remove inaccurate reference to the link_updated field from the wp_insert_link() DocBlock.
The `link_updated` field is unused as of WordPress 3.0 and was never updated via `wp_insert_link()`, only via the `wp-admin/update-links.php` file removed in [13744].

Follow-up to [13744], [49487].

Props dshanske, dharm1025, SergeyBiryukov.
Fixes #54880.
Built from https://develop.svn.wordpress.org/trunk@52659


git-svn-id: http://core.svn.wordpress.org/trunk@52248 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-01 12:30:02 +00:00
audrasjb
4894efc122 Twenty Twenty-One: Replace GitHub with .org link in Theme URI.
Theme URI is the URL of a public web page where users can find more information about the theme. For bundled themes, it should be a link to the theme’s page on the Theme Repository.

Props kafleg.
Fixes #55018.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52247 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-01 10:31:04 +00:00
Clorith
d09e18c5cf External libraries: Update jQuery Color to 2.2.0
The NPM package for jQuery Color was updated in [50543], but a bundled version still existed within core.
This removes that bundled version, in favor of expanding the Grunt build steps to include the package from NPM instead.

Fixes #55016. See #51405.
Built from https://develop.svn.wordpress.org/trunk@52657


git-svn-id: http://core.svn.wordpress.org/trunk@52246 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-01 01:22:04 +00:00
Peter Wilson
1ee362004f Upgrade: Prevent warnings upgrading cron array.
An unvisited site may have an undefined cron array, resulting in `_get_cron_array()` returning the value `false`. Previously this would trigger warning in `upgrade_590()` as the function assumed `_get_cron_array()` would alway return an array.

No database version change is required as the upgrade routine was successful on sites with a cron array during 5.9.0. On sites without a cron array, the error has already been thrown if they are running db version 51917. This fix is only required for new sites or those upgrading that have skipped 5.9.0.

Follow up to [51917].

Props chrisvanpatten, kapilpaul, SergeyBiryukov.
Fixes #54906.
See #53940.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-02-01 00:14:06 +00:00
Sergey Biryukov
8de9cdf559 Docs: Add a comment to clarify the username_exists() check in wpmu_validate_blog_signup().
Creating a new site that matches an existing user's login name is not allowed, unless it's the user's own username.

Follow-up to [https://mu.trac.wordpress.org/changeset/550 mu:550], [https://mu.trac.wordpress.org/changeset/1364 mu:1364].

Props henry.wright, joyously, swissspidy, SergeyBiryukov.
Fixes #54326.
Built from https://develop.svn.wordpress.org/trunk@52655


git-svn-id: http://core.svn.wordpress.org/trunk@52244 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-31 13:07:03 +00:00
John Blackbourn
eb338bd22d Build/Test Tools: Switch to some more appropriate assertions.
See #54725

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


git-svn-id: http://core.svn.wordpress.org/trunk@52243 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-30 19:42:00 +00:00
John Blackbourn
aed11c4067 Role/Capability: Correct the documented accepted types for the capability argument of WP_User_Query.
See #16841, #54729

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


git-svn-id: http://core.svn.wordpress.org/trunk@52242 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-30 19:34:00 +00:00
John Blackbourn
ecc08a41f6 Docs: Increase the specificity of types in various inline documentation.
See #54729

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


git-svn-id: http://core.svn.wordpress.org/trunk@52241 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-30 19:25:03 +00:00
Sergey Biryukov
effadc5da9 Twenty Twenty-Two: Optimize the assets/images/ducks.jpg image.
The new file should have a much better balance of quality and file size.

Follow-up to [52081], [52107].

Props kafleg, kjellr, jffng, kapilpaul.
Fixes #54911.
Built from https://develop.svn.wordpress.org/trunk@52651


git-svn-id: http://core.svn.wordpress.org/trunk@52240 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-30 11:56:03 +00:00
Sergey Biryukov
b3aae615bb Users: Return a WP_Error from wp_insert_user() if the user_url field is too long.
The `user_url` database field only allows up to 100 characters, and if the value is longer than that, the function should return a proper error message instead of silently failing.

This complements similar checks for `user_login` and `user_nicename` fields.

Follow-up to [45], [1575], [32299], [34218], [34626].

Props mkox, sabernhardt, tszming, SergeyBiryukov.
Fixes #44107.
Built from https://develop.svn.wordpress.org/trunk@52650


git-svn-id: http://core.svn.wordpress.org/trunk@52239 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-29 14:25:03 +00:00
audrasjb
c0cbf007f0 Administration: Add a top margin to Mail Server Port field on small screens.
This change fixes an overlapping issue on small screens in the Writing Settings screen.

Props pravinparmar2404, afercia, utz119, thimalw, sabernhardt, audrasjb.
Fixes #50177.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52238 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-28 21:50:04 +00:00
Clorith
7ea33988e9 External libraries: Update jQuery UI to 1.13.1
Some regressions happened alongside the release of jQuery UI 1.13.0, this brings the fixes from 1.13.1 downstream to WordPress, notably relating to Widget, Autocomplete, Sortable, and Tooltip modules.

See the changelog between version 1.13.0 and 1.13.1 at https://github.com/jquery/jquery-ui/compare/1.13.0...1.13.1

Props blogaid, linux4me2, mgol.
Fixes #54902.
Built from https://develop.svn.wordpress.org/trunk@52648


git-svn-id: http://core.svn.wordpress.org/trunk@52237 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-28 16:44:05 +00:00
Sergey Biryukov
445d687680 Themes: Correct the width of theme preview on Add Themes screen.
This ensures that the preview ratio remains accurate for the user's screen size when the sidebar is open.

Follow-up to [19995], [20110], [20133], [20138], [28033].

Props shreyasikhar26, costdev, sumitsingh, SergeyBiryukov.
Fixes #54764.
Built from https://develop.svn.wordpress.org/trunk@52647


git-svn-id: http://core.svn.wordpress.org/trunk@52236 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-28 12:10:04 +00:00
audrasjb
1d561e1fa6 Media: Remove target blank attribute from media uploader edit links.
This change removes a dispensable target blank attribute from Edit links displayed in the asynchronous file uploader.

Follow-up to [22755].

Props kebbet, SergeyBiryukov.
Fixes #54945.
See #23432.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52235 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-27 22:17:00 +00:00
audrasjb
b3d3adaa2b Docs: Fix incorrect type in translations_api and translations_api_result docblocks.
Before this changeset, `translation_api` and `translation_api_result` filters were incorrectly marked as taking object as their first argument. The correct type is an array as `json_decode()` is asked to return an associative array.

Props volodymyrkolesnykov.
Fixes #54959.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52234 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-27 21:15:03 +00:00
Sergey Biryukov
66dc00211b Upgrade/Install: Make sure the "Show hidden updates" button is visible and works as expected.
The [https://api.jquery.com/toggle-event/ .toggle( handler, handler )] method signature was deprecated in jQuery 1.8 and removed in jQuery 1.9. 

This commit updates the click handler function to work with jQuery 1.9+.

Follow-up to [9441], [9543], [42785], [48323].

Props malinevskiy, SergeyBiryukov.
Fixes #54886.
Built from https://develop.svn.wordpress.org/trunk@52644


git-svn-id: http://core.svn.wordpress.org/trunk@52233 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-26 13:11:29 +00:00
Sergey Biryukov
2eaeae58ff Docs: Update spelling for inline comments in a few files.
Per the [https://make.wordpress.org/core/handbook/best-practices/spelling/ spelling] and [https://make.wordpress.org/docs/style-guide/language-grammar/word-choice/ word choice] documentation guidelines, American (US) spelling should be preferred.

Props mohadeseghasemi, subrataemfluence, rehanali, SergeyBiryukov.
Fixes #46837.
Built from https://develop.svn.wordpress.org/trunk@52640


git-svn-id: http://core.svn.wordpress.org/trunk@52229 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-25 13:55:05 +00:00
Sergey Biryukov
6329aacac8 Docs: Correct @global tag in wp_kses_xml_named_entities().
This updates the variable name in the DocBlock to the correct one.

Follow-up to [48072], [52229].

Props david.binda.
Fixes #54899.
Built from https://develop.svn.wordpress.org/trunk@52639


git-svn-id: http://core.svn.wordpress.org/trunk@52228 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-25 11:16:05 +00:00
davidbaumwald
fe7d62fe13 Upgrade/Install: Update $_old_files for 5.9.
Props SergeyBiryukov, davidbaumwald.
Fixes #54894.
Built from https://develop.svn.wordpress.org/trunk@52637


git-svn-id: http://core.svn.wordpress.org/trunk@52225 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-24 18:24:02 +00:00
desrosj
2900d9eccf Editor: Bump editor packages to include the latest fixes.
This merges the latest package updates for the block editor to include the fix for https://github.com/WordPress/gutenberg/pull/38175.

Props hellofromTonya, mamaduka, joen, talldanwp, cbravobernal, poena.
Fixes #54487.
Built from https://develop.svn.wordpress.org/trunk@52633


git-svn-id: http://core.svn.wordpress.org/trunk@52221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-24 15:57:28 +00:00
audrasjb
0e9a48e0cb Docs: Docblock corrections for get_block_file_template().
Follow-up to [52324].

Props johnbillion, SergeyBiryukov, costdev.
Fixes #54879.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52219 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-24 15:28:02 +00:00
Dominik Schilling
70a7faa9dc Plugins/Themes: Allow to install/activate plugins/themes which require the WordPress version currently in development.
Twenty Twenty-Two requires WordPress 5.9 but currently can't be (re)activated in the 5.9 branch because `version_compare( '5.9-RC3-52627', '5.9', '>=' )` as used by `is_wp_version_compatible()` returns `false`. To appreciate the testing of upcoming versions any `-alpha`, `-RC`, `-beta` suffixes are now stripped off from the WordPress version before checking for compatibility.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52216 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-24 10:41:01 +00:00
Peter Wilson
0c51a7f11b Help/About: Update Freedoms page for 5.9.
Fixes #54270.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52214 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-24 09:41:03 +00:00
noisysocks
939758a2b5 Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- Block Editor: Mark last change as persistent on save
- Site Editor: Restore ?styles=open functionality
- Site Editor: Fix resizable box scrollbars in blocks
- Add classic menus to menu switcher

See #54487.
Props talldanwp.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52212 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-24 07:46:21 +00:00
noisysocks
01cb359adc Customizer: Remove Widgets panel when a theme does not support widgets
By setting 'theme_supports' on the panel, we ensure that the Widgets panel is
removed if a theme does not have support for 'widgets'.

This makes the behaviour of the Widgets and Menus panels consistent.

Follows [52621].
See #54888.
Props hellofromTonya, costdev, peterwilsoncc.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52210 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-24 05:37:01 +00:00
noisysocks
4aaa1803ec Customizer: Remove Menus panel when a theme does not support menus
By overriding check_capabilities(), we can ensure that the Menus panel
is removed if a theme does not have support for 'menus' nor 'widgets'.

This ensures that the Menus panel does not appear when using a block
theme, which is confusing to users.

See #54888.
Props hellofromTonya, costdev, peterwilsoncc.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52209 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-24 05:34:04 +00:00
Sergey Biryukov
997f8b9921 Coding Standards: Use a more appropriate variable name in link_advanced_meta_box().
Follow-up to [45667].

Props mkox, SergeyBiryukov.
Fixes #54856.
Built from https://develop.svn.wordpress.org/trunk@52620


git-svn-id: http://core.svn.wordpress.org/trunk@52208 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-23 09:03:05 +00:00
desrosj
d332f43f60 Bundled Themes: Bump the versions for bundled themes for release.
This bumps the versions of the default bundled themes in preparation for release with WordPress 5.9.

The new versions are:
- Twenty Ten: 3.6
- Twenty Eleven: 4.0
- Twenty Twelve: 3.6
- Twenty Thirteen: 3.5
- Twenty Fourteen: 3.3
- Twenty Fifteen: 3.1
- Twenty Sixteen: 2.6
- Twenty Seventeen: 2.9
- Twenty Nineteen: 2.2
- Twenty Twenty: 1.9
- Twenty Twenty-One: 1.5

Props audrasjb.
Fixes #54783.
Built from https://develop.svn.wordpress.org/trunk@52618


git-svn-id: http://core.svn.wordpress.org/trunk@52206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-22 14:07:05 +00:00
desrosj
d6c4545f83 Bundled Themes: Reverts [52549].
[52549] updated some default presets in use by default themes to the new format. However, this change would cause elements to lose their styling when active on an older version of WordPress.

See #54782.
Built from https://develop.svn.wordpress.org/trunk@52615


git-svn-id: http://core.svn.wordpress.org/trunk@52203 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-21 19:52:02 +00:00
desrosj
fb4199b676 Twenty Twenty-Two: Re-add the link to the theme’s HelpHub changelog.
See #54318.
Built from https://develop.svn.wordpress.org/trunk@52613


git-svn-id: http://core.svn.wordpress.org/trunk@52201 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-21 19:42:01 +00:00
jffng
1229d642a2 Twenty Twenty-Two: update the required version.
This commit updates the required WordPress version of the 2022 default theme to 5.9 in advance of its release on January 25.

Props hellofromtonya, kjellr, desrosj.
See #54318.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52200 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-21 19:05:07 +00:00
Sergey Biryukov
7f5d7f1b56 Date/Time: Add a unit test for the return type of current_datetime().
Follow-up to [45883].

Props pbearne.
Fixes #53484.
Built from https://develop.svn.wordpress.org/trunk@52611


git-svn-id: http://core.svn.wordpress.org/trunk@52199 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-21 06:00:00 +00:00
audrasjb
99bac7e17c Docs: Replace "Current theme" with "Active theme" in various DocBlocks.
This change replaces "Current theme" with "Active theme" in various DocBlocks for better consistency with user-facing strings.

Follow-up to [52580].

Props Presskopp, audrasjb, costdev.
Fixes #54831.
See #54770.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52198 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-20 23:53:05 +00:00
Sergey Biryukov
e07b5af042 General: Clarify the deprecation messages in the _deprecated_*() functions family.
This makes the strings easier to translate and provides more details about what exactly is deprecated: a PHP function, a file name, or a WordPress hook.

The changes apply to:
* `_deprecated_function()`
* `_deprecated_constructor()`
* `_deprecated_file()`
* `_deprecated_argument()`
* `_deprecated_hook()`
* `_doing_it_wrong()`

Follow-up to [6514], [7884], [12536], [12584], [16939], [16942], [16945], [24439], [24723], [32989], [37861], [39315].

Props mukesh27, audrasjb, SergeyBiryukov.
Fixes #54658.
Built from https://develop.svn.wordpress.org/trunk@52609


git-svn-id: http://core.svn.wordpress.org/trunk@52197 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-20 13:13:01 +00:00
audrasjb
d4306e8d8a Administration: Properly handle HTML entities in the News & Events dashboard widget.
This change adds support for various HTML entities in the News & Events dashboard widget.

Props nickciske, kpegoraro, iandunn, shedonist, sayedulsayem, sabernhardt, audrasjb, SergeyBiryukov, ocean90.
Fixes #41208.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52196 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-20 09:19:07 +00:00
Sergey Biryukov
f8c10a28f5 Users: Revert the variable change in [52606] that caused the tests to fail.
Follow-up to [52604-52606].

Props audrasjb.
See #54690.
Built from https://develop.svn.wordpress.org/trunk@52607


git-svn-id: http://core.svn.wordpress.org/trunk@52195 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-19 13:39:01 +00:00
Sergey Biryukov
3bc7449859 Docs: Further update the send_retrieve_password_email filter documentation for consistency.
Follow-up to [52604], [52605].

See #54690.
Built from https://develop.svn.wordpress.org/trunk@52606


git-svn-id: http://core.svn.wordpress.org/trunk@52194 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-19 13:18:00 +00:00
audrasjb
0dcc9fd03a Docs: Docblocks consistency fixes after [52604].
Follow-up to [52604].

Fixes #54690.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52193 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-19 12:42:01 +00:00
audrasjb
e87e3dcf58 Users: Add new hooks to filter retrieve password emails.
This change introduces two new hooks to help developers to filter retrieve password emails:

- `send_retrieve_password_email` can be used to filter whether to send the retrieve password email;
- `retrieve_password_notification_email` can be used to filter the contents of the reset password notification email sent to the user.

This changesets also adds unit tests for these new filters.

Props connapptivity, costdev, audrasjb, johnbillion.
Fixes #54690.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52192 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-19 12:17:01 +00:00
Sergey Biryukov
48aa21e9d9 I18N: Improve the context for color-related strings in WP_Theme::translate_header().
* Use the `color scheme` context for the "Light" string, for more accuracy.
* Add the same context to the "Dark" string too, for consistency.

Follow-up to [37946], [52588].

Fixes #54804.
Built from https://develop.svn.wordpress.org/trunk@52603


git-svn-id: http://core.svn.wordpress.org/trunk@52191 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-19 10:35:03 +00:00
Peter Wilson
f7151a6f3a Script loader: Prevent DB errors during Multisite install.
Prevent the script loader from attempting to create nonces during the installation process for Multisite configurations.

Prior to this fix, multiple "Table does not exist" errors were thrown during installation if `MULTISITE` was defined in the `wp-config.php` file but the salt constants were not defined. Without the salts defined in PHP, WP was attempting to use the database fallbacks prior to table creation.

Props schlessera, johnbillion, hellofromTonya, audrasjb, costdev.
Fixes #54800.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52190 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-18 23:47:01 +00:00
hellofromTonya
1543616cff Editor: @wordpress package updates.
Update packages to include these bug fixes from Gutenberg:

* Navigation Block: update micromodal to `0.4.10` to fix menu close button on mobile

Props ryelle, poena, get_dave, talldanwp, aristath, kjellr, audrasjb, desrosj.
See #54487.
Built from https://develop.svn.wordpress.org/trunk@52598


git-svn-id: http://core.svn.wordpress.org/trunk@52186 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-18 21:34:18 +00:00
Sergey Biryukov
ef5a994a3c Docs: Fix typos in some DocBlocks.
Props kebbet.
See #54729.
Built from https://develop.svn.wordpress.org/trunk@52597


git-svn-id: http://core.svn.wordpress.org/trunk@52185 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-18 20:29:06 +00:00
noisysocks
cd191ca6fe Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- Stop keypresses being caught by other elements when they happen in a CustomSelectControl
- Remove color, spacing, and layout options for Template Part block
- Try: parse shortcode blocks outside the content
- Fix aria-modal attribution with multiple navs on page
- Gallery block: Remove warning notice about mobile version required
- Fix Home template description typo 
- Fix enqueueing additional styles for blocks only when rendered
- fix typo (hanle -> handle)
- SelectControl: mark the children prop as optional
- Remove warning for enqueued styles in Editor
- Add context to font style and font weight related translation strings
- Temporarily remove text decoration from Nav block
- Fix empty secondary sidebar overlapping widget editor content on mobile viewports
- Fix hiding the bottom of tablet/mobile preview in Site Editor

See #54487.
Props isabel_brison.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52183 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-18 03:39:26 +00:00
hellofromTonya
e158979d3d Editor: Explicitly load remote block patterns in the block and site editor screens.
Remote block patterns from wp.org were to be loaded through a callback hooked into the `current_screen` filter. Within 2 callbacks, i.e. `_load_remote_featured_patterns()` and `_load_remote_block_patterns()`, a guard clause bailed out early if the `$current_screen->is_block_editor` is `false`.

However, the `current_screen` filter is unreliable to detect the block editor. Why? In the block and Site Editor screens, `$current_scren->is_block_editor` is not set until after the filter is executed. Whoopsie.

This commit no longer uses the `current_screen` filter. Instead, it explicitly loads the remote block patterns by invoking both private functions (now not callbacks) directly in the screen files for the block and site editor screens.

With this change, passing `WP_Screen` object into these functions is no longer needed. As the `_load_remote_block_patterns()` function was introduced in 5.8.0, its function parameter is now deprecated and the guard clause retained for backwards compatibility.

Follow-up to [51021], [52377].

Props poena, noisysocks, peterwilsoncc, hellofromTonya, audrasjb.
Fixes #54806.
Built from https://develop.svn.wordpress.org/trunk@52593


git-svn-id: http://core.svn.wordpress.org/trunk@52181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-17 22:42:03 +00:00
hellofromTonya
c20c8a99bd Administration: Revert [51946].
Reverting changeset due to reported issue of menu being hidden after clicking on certain mobile devices.

Props dhusakovic, audrasjb, SergeyBiryukov, costdev, joedolson.
See #54837, #53587.
Built from https://develop.svn.wordpress.org/trunk@52591


git-svn-id: http://core.svn.wordpress.org/trunk@52179 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-17 19:55:04 +00:00
jffng
56b4c0e838 Twenty Twenty-Two: Sync updates from GitHub from RC3.
This commit syncs minor changes for the default theme from its active development repository to core. 

This is a follow up to [52081], [52107], [52164], [52222], [52283], [52335], [52375], [52392], [52430], and [52555]. It includes fixes to the group, cover, and template part block padding and removes unnecessary group block wrappers from many patterns.

To view the full set of changes, visit 69d5c512c6...91f8748566.

Props kjellr, richtabor, audrasjb.
See #54318.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52177 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-17 15:43:59 +00:00
audrasjb
442b46dc2f i18n: Contextualize "light" color translation strings.
This change helps translators to distinguish between color and font-family contexts.

Props ironprogrammer, audrasjb, tobifjellner, Presskopp, SergeyBiryukov, hellofromTonya.
Fixes #54804.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52176 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-17 15:38:01 +00:00
Sergey Biryukov
ab263f93e5 Upgrade/Install: Check if the disk_free_space() function exists before calling it.
In PHP 8+, `@` no longer suppresses fatal errors:
> The `@` operator will no longer silence fatal errors (`E_ERROR`, `E_CORE_ERROR`, `E_COMPILE_ERROR`, `E_USER_ERROR`, `E_RECOVERABLE_ERROR`, `E_PARSE`).

Reference: [https://www.php.net/manual/en/migration80.incompatible.php PHP 8: Backward Incompatible Changes].

`disk_free_space()` may be disabled by hosts, which will throw a fatal error on a call to undefined function.

This change prevents the fatal error, and falls back to `false` when `disk_free_space()` is unavailable.

Follow-up to [25540], [25774], [25776], [25831], [25869].

Props costdev, jrf, swb1192, SergeyBiryukov.
Fixes #54826. See #54730.
Built from https://develop.svn.wordpress.org/trunk@52585


git-svn-id: http://core.svn.wordpress.org/trunk@52175 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-17 11:41:03 +00:00
Sergey Biryukov
c6829b3afc Coding Standards: Rename the $val variable to $site for clarity in WP_MS_Users_List_Table::column_blogs().
Follow-up to [12603], [13918], [16607], [32757], [52583].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52174 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-16 08:40:00 +00:00
Sergey Biryukov
81a1fc33cb Coding Standards: Use strict comparison in wp-admin/includes/class-wp-ms-users-list-table.php.
Follow-up to [16607], [32630], [32757], [47219].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52173 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-16 08:16:04 +00:00
audrasjb
8669c16e04 Docs: Miscellaneous docblock corrections in REST API and Sitemaps API.
Props kebbet.
See #54729.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-15 21:22:02 +00:00
Sergey Biryukov
0bc24dd81f Coding Standards: Use strict comparison in wp-admin/includes/class-wp-users-list-table.php.
This mirrors a similar check a few lines below and includes minor code layout fixes for better readability.

Follow-up to [9955], [13931], [14176], [15315], [45407], [50129].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52171 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-15 20:49:06 +00:00
audrasjb
e05557e222 Administration: Replace "Current theme" with "Active theme" in user facing strings.
This change replaces "Current theme" with "Active theme" in user-facing strings. It brings better consistency across the Administration.

Props Presskopp, audrasjb, costdev.
Fixes #54770.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52170 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-15 08:44:03 +00:00
audrasjb
ab28757878 Docs: Typo correction in WP_REST_Response class docblocks.
Follow-up to [34928].

Props kebbet.
Fixes #54823.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52168 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-14 21:15:04 +00:00
Sergey Biryukov
59287c1157 Tests: Avoid duplicate queries in some WP_Query tests.
When passing args to the `WP_Query::__construct()` method, it internally executes the `WP_Query::get_posts()` method and stores the result in the `WP_Query::posts` property.

When calling `WP_Query::get_posts()` again, the same SQL query gets executed, and the result is again stored in the `WP_Query::posts` property.

Thus, the correct usage is to read the posts already stored in the `WP_Query::posts` property.

Follow-up to [1062/tests], [1065/tests], [1066/tests], [1070/tests], [29805], [31286], [49900], [51144].

Props david.binda.
Fixes #54822.
Built from https://develop.svn.wordpress.org/trunk@52577


git-svn-id: http://core.svn.wordpress.org/trunk@52167 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-14 17:52:01 +00:00
audrasjb
d73a6bcc64 Upgrade/Install: Typo correction in a Core_Upgrader class inline comment.
Follow-up to [45046].

Props kebbet.
Fixes #54821.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52166 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-14 15:14:00 +00:00
audrasjb
ed1421fa32 XML-RPC: Fix typos in some XMLRPC related docblocks.
Props kebbet, shreyasikhar26.
Fixes #54820.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52165 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-14 14:45:05 +00:00
audrasjb
0439ef8279 Media: Add a missing / in post thumbnail lazy loading regex.
This change avoids a warning thrown by a missing slash in a post thumbnail lazyload related regular expression.

Follow-up to [52065].

Props SierraTR, audrasjb, costdev.
Fixes #54815.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52164 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-14 11:02:06 +00:00
audrasjb
b4de570d35 Media: Typo correction in wp_image_maybe_exif_rotate docblock.
Follow-up to [46202].

Props mitogh.
Fixes #54816.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52163 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-13 19:14:05 +00:00
Sergey Biryukov
e840d56df5 Docs: Correct description for two HTTP API functions:
* `wp_remote_retrieve_response_code()`
* `wp_remote_retrieve_response_message()`

If incorrect parameter value is given, these functions return an empty string, not an empty array.

Follow-up to [8516].

Props chesio, johnbillion.
Fixes #54796.
Built from https://develop.svn.wordpress.org/trunk@52572


git-svn-id: http://core.svn.wordpress.org/trunk@52162 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-13 01:04:01 +00:00
audrasjb
b14d7a8149 Administration: Fix an erroneous translators comment after changeset [52569].
This change also fixes the indentation of the translators comment.

Fixes #54798.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52161 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-12 23:45:01 +00:00
audrasjb
b00a83b996 Tests: Trac ticket number correction after changeset [52569].
Follow-up to [52569].

See #54798.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52160 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-12 23:30:59 +00:00
audrasjb
725e1d02af Administration: Ensure an integer is used for menu priority in add_menu_page().
This change adds a verification of the `$position` parameter in `add_menu_page()` to ensure an integer is used. If not, the function informs developers of the wrong parameter type via a `_doing_it_wrong` message. This brings consistency with a similar check used in `add_submenu_page()`.

This change also typecasts any floating number to string to ensure that in case a float value was passed, at least it doesn't override existing menus.

Follow-up to [46570].

Props kirtan95.
Fixes #54798. See #48249.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52159 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-12 23:25:08 +00:00
Sergey Biryukov
23be3c2b55 Coding Standards: Remove an extra variable in get_author_posts_url().
This fixes a `Variable "$auth_ID" is not in valid snake_case format` WPCS warning by using the existing `$author_id` variable, and brings consistency with a similar fragment in `get_author_feed_link()`.

Follow-up to [979], [5087], [6364], [6365].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52158 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-12 11:17:08 +00:00
ryelle
c3c39a22b9 Help/About: Update the About section for 5.9.
Use the correct Field Guide link. Update the SVGs used on Freedoms and Privacy. Add more spacing between sections on the About page, fixed spacing between rows on Freedoms page.

Props critterverse, audrasjb, versusbassz.
See #54270.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52153 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-11 18:36:00 +00:00
ryelle
908a08696b Administration: Update design of the Dashboard welcome panel.
Tone down the brightness of the dashboard panel by using a white background behind the main text, and use the highlight color from each color scheme for the main background. This also introduces a `$scheme-name` SCSS variable to allow overrides for specific color schemes.

Props critterverse, sabernhardt, joedolson, audrasjb.
See #54489.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52152 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-11 18:27:03 +00:00
davidbaumwald
f950eec323 Script Loader: Fix a variable typo in wp_enqueue_block_style.
In `wp_enqueue_block_style` when `rtl` versions of CSS files are detected, `wp_style_add_data` is called to add the metadata to the registered sheet.  However, the stylesheet `handle` argument is misspelled as `hanle`.  This change corrects the argument name.

Props omaeyusuke.
Fixes #54786.
Built from https://develop.svn.wordpress.org/trunk@52558


git-svn-id: http://core.svn.wordpress.org/trunk@52148 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-11 17:16:00 +00:00
hellofromTonya
2a686addf0 Editor: Fix enqueueing additional styles in wp_enqueue_block_style() to print only when blocks render.
In a block theme, additional block styles registered using the `wp_enqueue_block_style` function should only get printed when the block exists on a page. However, they currently always get rendered.

This commit is a backport from Gutenberg that fixes the issue by printing the styles when a block renders.

Follow-up to [52069].

Props poena, aristath, Mamaduka.
Fixes #54787.
Built from https://develop.svn.wordpress.org/trunk@52556


git-svn-id: http://core.svn.wordpress.org/trunk@52146 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-11 16:00:01 +00:00
jffng
fcdf1ce242 Twenty Twenty-Two: Sync updates from GitHub for RC 2.
This commit syncs changes for the default theme from its active development repository to core.

This is a follow up to [52081], [52107], [52164], [52222], [52283], [52335], [52375], [52392], and [52430]. It includes fixes to the theme's spacing and adds a search template.

To view the full set of changes, visit 8564fd281f...f0346e1ad2.

Props richtabor, kjellr, danieldudzic, scruffian.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52145 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-11 15:58:02 +00:00
hellofromTonya
3abe551097 Site Editor: Fix typo in home template translatable description.
The home template's description should be: "Displays as the site's home page, or as the Posts page when a static home page isn't set." This commit fixes the typo changing "it" to "isn't".

Follow-up to [52331].

Props kharisblank, talldanwp.
Fixes #54787.
Built from https://develop.svn.wordpress.org/trunk@52554


git-svn-id: http://core.svn.wordpress.org/trunk@52144 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-11 15:18:03 +00:00
Sergey Biryukov
56d10309d0 Database: Add missing AS after INNER JOIN in some queries.
While `AS` is an optional keyword in SQL, it is commonly considered best practice to include it for better readability and compatibility. This also makes the queries more consistent with other queries using aliases in core.

Follow-up to [6359], [30238].

Props costdev, domainsupport.
Fixes #54769.
Built from https://develop.svn.wordpress.org/trunk@52553


git-svn-id: http://core.svn.wordpress.org/trunk@52143 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-11 04:12:05 +00:00
noisysocks
114bff87cf Update packages to include these bug fixes from Gutenberg:
- [Block Library - Query Pagination Next]: Hide block if custom query has no results
- [WP 5.9] Fix: HTML tags like inline images in nav links break submenu layout
- Check for nextpage to display page links for paginated posts
- Navigation: Set the default for --navigation-layout-align to "flex-start" when using vertical orientation
- [Block Library - Query Loop]: Use gap for the grid view
- Update page list flex variables to match navigation.
- Site logo: Fix range control on landscape logo
- Restore canvas padding for classic themes
- RichText: Fix dead key input on Windows
- Fix: Impossible to clear colors if color palettes are removed.
- Gallery block: pass any custom attributes through the gallery v2 migration script
- Reduce specificity of legacy font sizes defined by core
- Update: Improve escaping on the search block

See #54487.
Props isabel_brison.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52141 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-11 03:13:33 +00:00
jorgefilipecosta
83dc7c318b Fix: Update some default presets in use by default themes to the new format.
Themes that use the same preset slugs as WordPress uses need to be updated.
From the devnote https://make.wordpress.org/core/2022/01/08/updates-for-settings-styles-and-theme-json/
The CSS for some of the presets defined by WordPress (font sizes, colors, and gradients) was loaded twice for most themes in WordPress 5.8: in the block-library stylesheet plus in the global stylesheet. Additionally, there were slight differences in the CSS in both places.
In WordPress 5.9 those were consolidated into a single place, the global stylesheet whose name is global-styles-inline-css that is now loaded for all themes in the front-end.
For themes to override the default values they can use the theme.json and provide the same slug. Themes that do not use a theme.json can still override the default values by enqueuing some CSS that sets the corresponding CSS Custom Property. This commit does the second for the twenty twenty theme.

Props oandregal.
Fixes #54782.
Built from https://develop.svn.wordpress.org/trunk@52549


git-svn-id: http://core.svn.wordpress.org/trunk@52139 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-10 18:29:02 +00:00
jorgefilipecosta
6d30d2a5d6 Fix: WordPress default presets aren't loaded for all themes.
The default preset styles of WordPress (font sizes, colors, gradients) are now provided via the global stylesheet to avoid duplication of styles. This stylesheet can be found in the front-end with the name global-styles-inline-css.
The default presets are important to support old content that may use them and also patterns, that can use cross-theme styles.

Props oandregal.
Fixes #54781.
Built from https://develop.svn.wordpress.org/trunk@52547


git-svn-id: http://core.svn.wordpress.org/trunk@52137 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-10 17:29:03 +00:00
davidbaumwald
2d8ba6acd9 Build/Test Tools: Re-enable E2E tests for the 5.8 branch.
After the 5.9 branch was created, [52449] updated the workflow for testing old branches to include 5.9.  However, the E2E tests `-branch` condition was updated to 5.9 instead of adding an additional branch condition for 5.9.  This commit re-enables the E2E tests for 5.8.

Props desrosj, hellofromTonya.
Fixes #54749.
Built from https://develop.svn.wordpress.org/trunk@52546


git-svn-id: http://core.svn.wordpress.org/trunk@52136 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-10 16:45:04 +00:00
audrasjb
8cd983dee4 Help/About: Correction in "Managing Themes" HelpHub Docs link.
This change updates the HelpHub Documentation link to "Managing Themes" to make it more consistent with other Help tabs.

Props SergeyBiryukov, jdy68.
Fixes #54707.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-10 08:50:01 +00:00
Sergey Biryukov
b2ac6dcca8 Coding Standards: Correct alignment in get_block_editor_settings().
This fixes an `Array double arrow not aligned correctly` WPCS warning.

Follow-up to [52054].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52134 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-10 01:56:02 +00:00
audrasjb
461cd1373e Help/About: Change the HTML title of Themes Screen and add related HelpHub Docs link.
This change replaces the title of the Appearance Themes Screen to make it consistent with the main heading of the screen and with other Admin screens. It also adds a link to the related HelpHub Documentation in the Help tab of the screen.

Props jdy68.
Fixes #54707.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52133 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-09 23:14:04 +00:00
Sergey Biryukov
6dde735e3e Coding Standards: Use strict comparison in wp-admin/themes.php.
Follow-up to [15646], [30697].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52130 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-08 01:22:02 +00:00
davidbaumwald
aeb5d2ef17 Upgrade/Install: Fix parameter count in error call when an automatic core upgrade fails.
During automatic core upgrades, if installation results in a `WP_Error`, the `error` method is called on the skin with the details.  However, in this case, two parameters are passed to `$skin->error`, but only one is accepted.  This change passes only the running `WP_Error` instance as the sole parameter to `$skin->error`.

Also, this change adds an additional error to `$upgrade_result` before finally being passed to `$skin->error`, indicating that the installation failed.  This adds additional context to the failure.

Props desrosj, sainthkh, devutpol, SergeyBiryukov.
Fixes #53284.
Built from https://develop.svn.wordpress.org/trunk@52539


git-svn-id: http://core.svn.wordpress.org/trunk@52129 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-07 17:55:01 +00:00
Sergey Biryukov
10e842a662 Coding Standards: Use strict comparison in wp-admin/revision.php.
Follow-up to [7913], [12751].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52128 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-07 16:47:00 +00:00
audrasjb
286e4fa9b0 Taxonomy: Typo correction in context used for the navigation link block title.
This change fixes a wrong translation context on the navigation link block title.

Follow-up to [50527].

Props Chouby.
Fixes #54566.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52127 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-07 11:21:04 +00:00
audrasjb
68136b50c4 Tests: Update qUnit test fixtures after [52535].
See #54745.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52126 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-06 23:28:22 +00:00
audrasjb
f88037f0f4 REST API: Typo correction in a link description object.
This change fixes a wrong punctuation in a link description object of the menu items controller endpoint.

Props la-geek, audrasjb, tobifjellner, hellofromtonya.
Fixes #54745.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52125 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-06 23:27:14 +00:00
Sergey Biryukov
e38bb277ea Coding Standards: Use strict comparison in wp-admin/plugin-install.php.
Follow-up to [11366].

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


git-svn-id: http://core.svn.wordpress.org/trunk@52124 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-06 23:26:06 +00:00
desrosj
77a972838c Formatting: Correctly encode ASCII characters in post slugs.
Props zieladam, whyisjake, xknown, peterwilsoncc, desrosj, iandunn.
Built from https://develop.svn.wordpress.org/trunk@52457


git-svn-id: http://core.svn.wordpress.org/trunk@52049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-06 17:10:00 +00:00
desrosj
638ef7815e Upgrade/Install: Avoid using unserialize() unnecessarily.
Props vortfu, xknown, dd32.
Built from https://develop.svn.wordpress.org/trunk@52456


git-svn-id: http://core.svn.wordpress.org/trunk@52048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-06 17:07:03 +00:00
desrosj
c9c4dabcc1 Query: Improve sanitization within WP_Meta_Query.
Props vortfu, xknown, dd32.
Built from https://develop.svn.wordpress.org/trunk@52455


git-svn-id: http://core.svn.wordpress.org/trunk@52047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-06 17:05:02 +00:00
desrosj
271b1f60cd Query: Improve sanitization within WP_Tax_Query.
Props dd32, xknown, peterwilsoncc, ehtis.
Built from https://develop.svn.wordpress.org/trunk@52454


git-svn-id: http://core.svn.wordpress.org/trunk@52046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-06 17:03:05 +00:00
audrasjb
a02b7770f4 Help/About: Change the Learn WP link in the about page.
The workshops page doesn't specifically show 5.9 content at this stage (and likely won't until much later), so it needs to be changed to learn.wordpress.org homepage.

Props hlashbrooke, audrasjb, davidbaumwald.
Fixes #54755.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-06 09:18:06 +00:00
audrasjb
2699b3032a Help/About: Correction on the documentation link about adding new themes.
In the Themes Screen Help Tab, the "Documentation on Adding New Themes" link previously targeted the "Using Themes" HelpHub post whereas it had to target the "Install Themes" section of "Appearance Themes Screen" HelpHub post, which is more relevant.

Props jdy68.
Fixes #54709.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-05 22:14:59 +00:00
Sergey Biryukov
c9cf90786c Upgrade/Install: Make first comment URLs translatable.
This allows translators to localize the `https://wordpress.org/` and `https://gravatar.com/` URLs in the first comment on a new installation.

Follow-up to [2409], [37888], [37921].

Props kebbet, desrosj.
Fixes #54535.
Built from https://develop.svn.wordpress.org/trunk@52451


git-svn-id: http://core.svn.wordpress.org/trunk@52043 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-05 21:07:00 +00:00
davidbaumwald
55aaefe766 Login and Registration: Remove aria-expanded from "Generate Password" button.
During password resets, the 'Generate Password" button has a `aria-expanded="true"` attribute, but the button itself does not expand or collapse anything.  This change adds a `skip-aria-expanded` class to the button which is referenced in JavaScript to skip updating the `aria-expanded` attribute on the button itself when clicked.  

This change also resets the `aria-expanded` attribute to `false` for the parent form after it's submitted.

Props alexstine, johnjamesjacoby, sabernhardt.
Fixes #54538.
Built from https://develop.svn.wordpress.org/trunk@52450


git-svn-id: http://core.svn.wordpress.org/trunk@52042 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-05 17:37:03 +00:00
hellofromTonya
9f9440a039 Build/Test Tools: Add the 5.9 branch to the workflow for testing branches.
Built from https://develop.svn.wordpress.org/trunk@52449


git-svn-id: http://core.svn.wordpress.org/trunk@52041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 21:31:01 +00:00
Sergey Biryukov
5fc6f2a488 Trunk is now 6.0-alpha.
Built from https://develop.svn.wordpress.org/trunk@52448


git-svn-id: http://core.svn.wordpress.org/trunk@52040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 20:54:00 +00:00
Sergey Biryukov
e61c53f2e1 Post WordPress 5.9 RC1 version bump.
Built from https://develop.svn.wordpress.org/trunk@52446


git-svn-id: http://core.svn.wordpress.org/trunk@52038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 20:41:02 +00:00
Sergey Biryukov
d7f62c5732 WordPress 5.9 RC1.
Built from https://develop.svn.wordpress.org/trunk@52445


git-svn-id: http://core.svn.wordpress.org/trunk@52037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 20:15:08 +00:00
hellofromTonya
790d5ac07a Help/About: Use "refactoring" noun form in WordPress 5.9 About Page.
Follow-up to [52438].

Props tobifjellner, costdev, marybaum.
See #54270.
Built from https://develop.svn.wordpress.org/trunk@52444


git-svn-id: http://core.svn.wordpress.org/trunk@52036 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 19:50:01 +00:00
ryelle
cfd9559523 Administration: Add missing texture image for Welcome panel & About page.
See #54489, #54270.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52035 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 19:18:01 +00:00
ryelle
6868a257c1 Administration: Refresh the Dashboard Welcome panel.
With its last major update in 3.5, the welcome panel was feeling stale. This bright new design showcases links to recent features, including patterns, the site editor, and styles, depending on whether you have a block theme active.

Props jameskoster, desrosj, noisysocks, critterverse, karmatosed, hellofromtonya, smit08, melchoyce, poena, audrasjb, webcommsat, marybaum.
See #54489.


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


git-svn-id: http://core.svn.wordpress.org/trunk@52034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 19:13:02 +00:00
davidbaumwald
5d9af9adac HTTP API: Improve docs for wp_remote_retrieve_header function return value.
This change updates the `@return` docs for `wp_remote_retrieve_header` to specify that an array can also be returned if the requested header key has multiple values.

Props robtarr, johnjamesjacoby, felipeelia, hellofromTonya, costdev.
Fixes #51736.
Built from https://develop.svn.wordpress.org/trunk@52441


git-svn-id: http://core.svn.wordpress.org/trunk@52033 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 18:54:00 +00:00
hellofromTonya
79a705c8d8 Coding Standard: Remove empty space at end of inline comment in _add_default_theme_supports().
Follow-up to [52439].

See #54731.
Built from https://develop.svn.wordpress.org/trunk@52440


git-svn-id: http://core.svn.wordpress.org/trunk@52032 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 18:49:00 +00:00
hellofromTonya
e414b65dfe Themes: Make block themes support HTML5 by default.
For block themes, [52369] added HTML5 support for `'comment-list'`, `'comment-form'`, `'style'`, and `'script'`. However, when sites upgrade to 5.9 with non-block content such as a gallery and caption, the markup was not HTML5. 

This commit adds full HTML5 theme feature support for block themes. Non-block content such as a `[gallery]` and `[caption]` shortcodes will natively be in HMTL5 markup without block themes needing to specifically add `add_theme_support( 'html5, .. )` to the theme. 

Follow-up to [24417], [27302], [34261], [52369], [52383], [52386].

Props @joyously, costdev, hellofromTonya, audrasjb, Mamaduka, ocean90.
Fixes #54731. See #54597.
Built from https://develop.svn.wordpress.org/trunk@52439


git-svn-id: http://core.svn.wordpress.org/trunk@52031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 18:40:00 +00:00
ryelle
ee6093c4eb Help/About: WordPress 5.9 About Page.
Introducing the new About page for 5.9.

Props dansoschin, critterverse, webcommsat, marybaum, nalininonstopnewsuk, sabernhardt, costdev, chanthaboune, cbringmann, mkaz, davidbaumwald, ryelle, melchoyce, annezazu, paaljoachim, audrasjb, hellofromtonya, walbo, tobifjellner, mitogh


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


git-svn-id: http://core.svn.wordpress.org/trunk@52030 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 18:35:03 +00:00
audrasjb
90100ff883 Embeds: Fix oEmbed host script enqueueing on block-based themes.
This change fixes oEmbed host script enqueueing on front-end when using block themes.

It deprecates `wp_oembed_add_host_js` in favor of `wp_maybe_enqueue_oembed_host_js`. The action is still triggered in `default-filters.php` to ensure backward compatibility for websites that are removing the action. There is now a `has_action()` check in `wp_maybe_enqueue_oembed_host_js()` to see if `wp_oembed_add_host_js()` has not been unhooked from running at the `wp_head` action.

Follow-up to [52132], [52151], [52153], [52325].

Props swissspidy, westonruter, flixos90, kafleg.
Fixes #44632.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 15:23:59 +00:00
audrasjb
b042b70e68 REST API: Add unit tests for the 404 template slug handler.
Props ockham, SergeyBiryukov, hellofromTonya, rachelbaker.
Fixes #54680.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 14:25:02 +00:00
audrasjb
937398741b Login and registration: Rename login_language_switcher_args to login_language_dropdown_args.
This change adds better consistency with the other `*_dropdown_args` filters, like `taxonomy_parent_dropdown_args` or `widget_archives_dropdown_args`. It is also more consistent with the new `login_display_language_dropdown` filter.

Props SergeyBiryukov, faisal03.
Fixes #54696.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52027 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 08:30:04 +00:00
noisysocks
28a12c8bce Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- Site Logo: Add option to set site icon from Site Logo block
- Navigation: Enable even more compact setup state.
- Remove template parts from post content inserter an __unstable filter
- Template Editor Mode: Hide editor mode switcher
- Avoid using CSS variables for block gap styles
- Try to fix auto resizing in template part focus mode
- Lower the specificity of font size CSS Custom Properties in the editor
- Site icon: Fix site icon styling to display non-square site icons within a square button
- [Site Editor]: Register block editor shortcuts
- Update regex to handle 404 template slug
- Site Editor: Remove dead code
- [Block Editor]: Restrict delete multi selected blocks shortcut
- Fix: Gradients are not being applied by class
- Update: Make the global styles subtitles font smaller
- Post Content/Title: Reflect changes when previewing post
- ServerSideRender: Fix loading state
- [Block Library]: Fix editable post blocks in Query Loop with zero queryId
- Post Excerpt: Fix previews
- WP59: Contextualize "Export" string to differentiate it from other occurrences in WP Core
- Tools Panel: Fix race conditions caused by conditionally displayed ToolsPanelItems
- ToolsPanel: Allow items to register when panelId is null
- Font Size Picker: Allow non-integers as simple CSS values and in hints
- [Components - FontSizePicker]: Use incremental sequence of numbers as labels for the available font-sizes at the segmented control (conditionally)

See #54487.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 05:39:28 +00:00
audrasjb
15b614acc3 Revisions: Improve _set_preview for case when autosave is missing.
This change fixes an issue where autosaves are deleted when a new autosave is sent with the same data. In the block editor, this causes the preview data to be missing on post previews. The end result of this is that if one set a preview image using a block theme on a published post and preview it, the featured image is not displayed correctly. Skipping deleting the previous autosave fixes the issue.

Props adamsilverstein, walbo, audrasjb, Mamaduka, hellofromTonya.
Fixes #54708.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-04 00:20:01 +00:00
audrasjb
4f16b910f3 Login and registration: Rename two filters related to language dropdown for better consistency.
This change renames two filters introduced in WP 5.9 development cycle. It replaces `display_login_language_dropdown` with `login_display_language_dropdown` and `wp_login_language_switcher_args` with `login_language_switcher_args`, for better consistency with the other existing `login_*` filters.

Props kebbet, mukesh27, audrasjb, Clorith, hellofromTonya.
Fixes #54696.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52024 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-03 22:14:00 +00:00
Sergey Biryukov
65ebdf45d8 Coding Standards: Use strict comparison in wp-admin/options.php.
Follow-up to [21852], [47874], [51075].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@52431


git-svn-id: http://core.svn.wordpress.org/trunk@52023 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-03 21:28:01 +00:00
audrasjb
ed53ea3ace Twenty Twenty-Two: Sync updates from GitHub for RC 1.
This commit syncs changes for the default theme from its active development repository to core.

This is a follow up to [52081], [52107], [52164], [52222], [52283], [52335], [52375], and [52392].

To view the full set of changes, visit 2ce387178f...8564fd281f.

This changeset also deletes three unused files. These were removed from the dev repo, but never removed from core.

Props richtabor, kjellr.
See #54318.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52022 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-03 20:26:04 +00:00
hellofromTonya
cfcff52de3 External Libraries: Update jQuery hoverIntent to version 1.10.2.
This updates the `jquery-hoverintent` dependency from 1.10.1 to 1.10.2, which fixes the deprecation of `jQuery.isFunction`.

For a full list of changes, see https://github.com/briancherne/jquery-hoverIntent/compare/v1.10.1...v1.10.2.

Follow-up to [50521].

Props titsmaker.
Fixes #54722. See #51812.
Built from https://develop.svn.wordpress.org/trunk@52429


git-svn-id: http://core.svn.wordpress.org/trunk@52021 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-03 15:03:18 +00:00
Sergey Biryukov
54b155f4a5 Coding Standards: Use strict comparison in wp-admin/options-reading.php.
Follow-up to [16816].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@52428


git-svn-id: http://core.svn.wordpress.org/trunk@52020 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-02 16:47:05 +00:00
Sergey Biryukov
5abfff6c70 Happy New Year! 🎄
Update copyright year to 2022 in `license.txt` and bundled themes.
Built from https://develop.svn.wordpress.org/trunk@52427


git-svn-id: http://core.svn.wordpress.org/trunk@52019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-01-01 00:15:02 +00:00
audrasjb
c8050da1d3 Users: Use the "Posts" post type general name to contextualize the string used in Users posts count column label.
Since some locales may differentiate "Posts" generic post type name (works for both posts, pages, and custom post types) and "Posts" when speaking about blogposts, this change aims to contextualize the use of the "Posts" string in the "Users" admin screen. This change reuses the string used for the "Posts" post type registration, to avoid introducing any new string to translate.

Props audrasjb, jdy68, SergeyBiryukov.
Fixes #54712.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52018 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-31 15:30:01 +00:00
Sergey Biryukov
3ec2d2fcfa Build/Test Tools: Update PHPCompatibilityWP to version 2.1.3.
The latest release takes the new polyfills added in WordPress 5.9 into account.

This commit also removes redundant inline ignore comments for WP-polyfilled functionality. The PHPCompatibilityWP ruleset explicitly excludes those polyfills, so they don't need to be annotated as ignored.

Release notes:
https://github.com/PHPCompatibility/PHPCompatibilityWP/releases/tag/2.1.3

For a full list of changes in this update, see the PHPCompatibilityWP GitHub:
https://github.com/PHPCompatibility/PHPCompatibilityWP/compare/2.1.2...2.1.3

Follow-up to [46290], [51543].

Props jrf.
Fixes #54711.
Built from https://develop.svn.wordpress.org/trunk@52425


git-svn-id: http://core.svn.wordpress.org/trunk@52017 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-31 13:55:03 +00:00
Sergey Biryukov
2e8ac63be2 Tests: Add a unit test for the recommended MariaDB version in readme.html.
Per the [https://mariadb.org/about/#maintenance-policy MariaDB maintenance policy], MariaDB releases are supported for 5 years from the first stable (GA) release.

The test ensures that the recommended MariaDB version in `readme.html` is not older than 5 years.

Follow-up to [31291], [35759], [52319], [52358], [52418], [meta11407], [52420], [52421].

Fixes #41490.
Built from https://develop.svn.wordpress.org/trunk@52424


git-svn-id: http://core.svn.wordpress.org/trunk@52016 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-30 16:29:02 +00:00
John Blackbourn
1a137ef17a Docs: Further corrections and improvements to the inline documentation for wpdb.
See #53399, #54610

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


git-svn-id: http://core.svn.wordpress.org/trunk@52015 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-29 23:14:01 +00:00
John Blackbourn
678f2ceb0d Docs: Miscellaneous inline documentation improvements.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@52014 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-29 17:28:00 +00:00
Sergey Biryukov
9fb855eb48 Tests: Correct the check for the recommended MySQL version in readme.html.
This updates the regular expression in the test to retrieve the date of the first, instead of the last, GA release for the recommended MySQL branch, in order to properly track the EOL date.

Additionally, as the currently recommended MySQL 5.7 branch moved from active support to extended support on 2020-10-21, and WordPress core is not fully compatible with MySQL 8.0 at this time, this commit increases the “supported” period from 5 to 8 years to include extended support.

Follow-up to [31291], [35759], [meta11407], [52420].

See #41490.
Built from https://develop.svn.wordpress.org/trunk@52421


git-svn-id: http://core.svn.wordpress.org/trunk@52013 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-29 16:36:05 +00:00
Sergey Biryukov
aef38ab0e6 General: Bump the recommended MySQL and MariaDB versions in readme.html.
* MySQL 5.6 has reached EOL (“End of Life”) in February 2021. The recommended minimum is bumped to 5.7 for now.
* MariaDB 10.1 has reached EOL in October 2020. The recommended minimum is bumped to 10.2 for now.

Follow-up to [31291], [35759], [52319], [52358], [meta11407].

Props JavierCasares, SergeyBiryukov.
See #41490, #meta5999.
Built from https://develop.svn.wordpress.org/trunk@52420


git-svn-id: http://core.svn.wordpress.org/trunk@52012 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-28 17:38:04 +00:00
Sergey Biryukov
05a3e19924 Plugins: Escape the WordPress.org plugin page URL in the Plugin Installation modal.
Follow-up to [8540], [38953].

Props chintan1896, Presskopp, dimadin, henry.wright, aezazshekh, SergeyBiryukov.
Fixes #54362.
Built from https://develop.svn.wordpress.org/trunk@52419


git-svn-id: http://core.svn.wordpress.org/trunk@52011 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-27 16:06:02 +00:00
Sergey Biryukov
2caff694aa Tests: Separate the tests for recommended PHP and MySQL versions in readme.html
This aims to simplify the individual tests and reduce duplication using a helper function.

Follow-up to [52260], [52319], [52358].

See #41490.
Built from https://develop.svn.wordpress.org/trunk@52418


git-svn-id: http://core.svn.wordpress.org/trunk@52010 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-26 23:42:05 +00:00
audrasjb
3366e3859f Login and Registration: Use secondary button style for the Language switcher.
This change avoids having two primary buttons in the login screen.

Props rainbowgeek, audrasjb.
Fixes #54692.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52009 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-25 11:36:59 +00:00
audrasjb
d738794637 Docs: Typo correction in validate_file() comments.
See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52008 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-25 11:17:04 +00:00
Sergey Biryukov
ef7cf47ec4 Administration: Make sure the $customize_url variable is always defined in the admin menu.
This avoids an `Undefined variable` PHP warning when displaying other admin menu items.

Follow-up to [52069], [52134], [52158], [52178], [52414].

Props afragen.
Fixes #54682.
Built from https://develop.svn.wordpress.org/trunk@52415


git-svn-id: http://core.svn.wordpress.org/trunk@52007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-25 03:32:03 +00:00
Sergey Biryukov
7996e87f38 Toolbar: Show the Customize link on front end when using a block theme if any plugins use the Customizer.
In WordPress 5.9, when a block theme is being used, the `Appearance → Customize` admin menu item is not present unless a plugin uses the Customizer.

The Customize admin bar node should be shown on the front end if any plugins are using the Customizer, even if the current theme is a block theme.

This commit mirrors a similar check in the admin menu to determine if the Customize link should be displayed.

Follow-up to [52069], [52134], [52158], [52178].

Props pbiron, audrasjb, sabernhardt, costdev.
Fixes #54683.
Built from https://develop.svn.wordpress.org/trunk@52414


git-svn-id: http://core.svn.wordpress.org/trunk@52006 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-25 03:17:04 +00:00
Sergey Biryukov
aea5f0cbde External Libraries: Update the SimplePie library to version 1.5.8.
This minor update corrects the `SIMPLEPIE_VERSION` constant and updates the changelog after the previous release.

Release notes: https://github.com/simplepie/simplepie/releases/tag/1.5.8

For a full list of changes in this update, see the SimplePie GitHub:
https://github.com/simplepie/simplepie/compare/1.5.7...1.5.8

Follow-up to [47733], [49176], [52393].

Props faisal03, jrf, audrasjb, SergeyBiryukov.
Fixes #54659.
Built from https://develop.svn.wordpress.org/trunk@52413


git-svn-id: http://core.svn.wordpress.org/trunk@52005 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-24 18:06:06 +00:00
Sergey Biryukov
67b9822eda Build/Test Tools: Allow the PHPCS plugin in Composer configuration.
The `dealerdirect/phpcodesniffer-composer-installer` Composer plugin is used to register external PHPCS standards with PHPCS.

As of Composer 2.2, Composer plugins need to be explicitly allowed to run. This commit adds the necessary configuration for that to prevent Composer asking every single time `composer install` or `composer update` is run.

Reference: [https://blog.packagist.com/composer-2-2/#more-secure-plugin-execution Composer 2.2: More secure plugin execution].

Props jrf, johnbillion.
Fixes #54686.
Built from https://develop.svn.wordpress.org/trunk@52412


git-svn-id: http://core.svn.wordpress.org/trunk@52004 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-23 20:12:03 +00:00
Sergey Biryukov
ee282eba1b Build/Test Tools: Restore the https URL for browserify-aes.
Follow-up to [52000], [52156], [52402].

See #54487.
Built from https://develop.svn.wordpress.org/trunk@52411


git-svn-id: http://core.svn.wordpress.org/trunk@52003 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-23 17:03:04 +00:00
audrasjb
b788e6255a Docs: Typo correction in wp_get_layout_style() introduced in 5.9.
Follow-up to [52069].

See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@52002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-22 23:20:04 +00:00
Sergey Biryukov
4a22a4cec3 Editor: Add missing default template areas to the post/page editor settings.
This ensures that default template area settings are displayed when editing a template in the post/page editor, which previously got lost during backporting for 5.9.

Follow-up to [52232].

Props Mamaduka, costdev, gziolo.
Fixes #54679.
Built from https://develop.svn.wordpress.org/trunk@52409


git-svn-id: http://core.svn.wordpress.org/trunk@52001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-22 13:00:03 +00:00
Sergey Biryukov
9cb7908de2 Post WordPress 5.9 Beta 4 version bump.
Built from https://develop.svn.wordpress.org/trunk@52408


git-svn-id: http://core.svn.wordpress.org/trunk@52000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 21:14:59 +00:00
Sergey Biryukov
e88674b232 WordPress 5.9 Beta 4.
Built from https://develop.svn.wordpress.org/trunk@52407


git-svn-id: http://core.svn.wordpress.org/trunk@51999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 20:32:59 +00:00
hellofromTonya
673ab8a677 Administration: Add "File" to Theme/Plugin Editor menu names and relocate "Plugin File Editor" to Tools for block themes.
[52232] relocated the Theme Editor menu item from Appearance to Tools for block themes. This commit relocates the Plugin  Editor menu item from Plugins to Tools for block themes for a consistent workflow.

Both the Theme Editor and Plugin Editor menu items are renamed to "Theme File Editor" and "Plugin File Editor" respectively. Why? To better identify their purpose, i.e. to directly edit the code in the theme or plugin files. The rename is not limited to only block themes. 

Follow-up to [52232].

Props poena, annezazu, audrasjb, clorith, courane01, costdev, dryanpress, desrosj, hellofromTonya, ipstenu, jameskoster, joen, johnbillion, joyously, manfcarlo, marybaum, pbiron, SergeyBiryukov, walbo, youknowriad.
Fixes #54382.
Built from https://develop.svn.wordpress.org/trunk@52406


git-svn-id: http://core.svn.wordpress.org/trunk@51998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 20:06:02 +00:00
audrasjb
5e08149bf4 Coding Standards: Remove unwanted whitespaces after [52404].
Follow-up to [52404].

See #54675.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51997 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 19:00:00 +00:00
audrasjb
d0b3567730 Login and registration: Add a filter to allow to disable the Login screen language dropdown.
This change introduces the `display_login_language_dropdown` filter which allows to disable the Login screen language dropdown. 

Follow-up to [52058].

Props rickcurran, audrasjb, ocean90, hellofromtonya, costdev, johnbillion.
Fixes #54675.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51996 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 18:52:03 +00:00
Sergey Biryukov
e6b9b96130 Docs: Improve the @since 5.9.0 note for WP_Theme_JSON::PRESETS_METADATA.
Follow-up to [52320], [52401].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@52403


git-svn-id: http://core.svn.wordpress.org/trunk@51995 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 10:20:04 +00:00
isabel_brison
4939393799 Update @wordpress packages for Beta 4
Update packages with these bug fixes from Gutenberg:

Navigation: Remove hardcoded typography units
Handle parsed request
Navigation: Refactor modal padding to be simpler and more flexible
Show notice on save in site editor
Add aria-pressed true/false to Toggle navigation button based on state
Components FontSizePicker: Use incremental sequence of numbers
Custom keys from theme.json: fix kebabCase conversion
Template Part: Fix 'isMissing' condition check
Multi-Entity Saving: Decode HTML entities in item titles
Font sizes: update default values
Query Loop: Add useBlockPreview, fix Query Loop wide alignment
Only add dialog role to navigation when modal is open
Fix navigation appender
Show a UI warning when user does not have permission to update/edit a Navigation block
Block editor: Fix Enter handling for nested blocks
Update: Use subtitle styles for the palette names
Allow publishing a post while not saving changes to non-post entities
Update: Block top level useSetting paths
Fix Site Logo block alignment issues
Editor: when Toggle navigation receives state false, focus
ToolsPanel: Allow items to register when panelId is null
Block Support Panels - Make block support tools panels compatible
Gallery: Fix block registration hook priority
Navigation: Fix page list issues in overlay
Ensure the overlay menu works when inserting navigation block pattern
Restrict Navigation permissions and show UI warning if cannot create
Add block gap support for group blocks
Try cascading nav styles through classnames
Fix: Impossible to edit theme and default colors
Fix: Color editor discards colors with default name
Site Editor: Fix template author avatar check
Template Editing Mode: Fix options dropdown
Avoid undo issues when reset parent blocks for controlled blocks
Add comment-form and comment-list to html5 theme support and fix comment layout

Props hellofromtonya.
See #54487.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51994 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 07:02:34 +00:00
hellofromTonya
af941fc10c Editor: Add support for nameless font sizes in WP_Theme_JSON.
With nameless font sizes support, themes use the defaults by not declaring the `"name"` setting for their `fontSizes` in `theme.json`.

Backport from Gutenberg https://github.com/WordPress/gutenberg/pull/37410.

Follow-up to [50973], [52049], [52275], [52320].

Props ntsekouras, costdev, hellofromTonya.
Fixes #54640. See #54487.
Built from https://develop.svn.wordpress.org/trunk@52401


git-svn-id: http://core.svn.wordpress.org/trunk@51993 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 06:02:06 +00:00
hellofromTonya
770e631dfc Editor: Add 'edit_theme_options' capabilities to wp_navigation post type.
Adds `'edit_theme_options'` capabilities top restrict Navigation permission.

Partial backport from Gutenberg https://github.com/WordPress/gutenberg/pull/37454.

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

Props spacedmonkey, get_dave, hellofromTonya.
See #54487.
Built from https://develop.svn.wordpress.org/trunk@52400


git-svn-id: http://core.svn.wordpress.org/trunk@51992 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 04:26:00 +00:00
hellofromTonya
84229df562 REST API: Support . in theme directory names in WP_REST_Global_Styles_Controller, WP_REST_Templates_Controller, and WP_REST_Themes_Controller.
Regex changes from [52376] are reverted to restore the original regex patterns. Why? [52376] used an include characters pattern, which was too limiting. It did not account for localized characters, such as `é`, or other valid directory name characters.

The original theme directory regex pattern, i.e. `[^.\/]+(?:\/[^.\/]+)?` excluded the period `.` character. Removing the `.` character resolves the reported issue by allowing matching for `themes/theme-dirname-1.0/` or `themes/<subdirname>/theme-dirname-1.0/`.

As the pattern used an exclude approach, all characters are valid for matching except for `/`. However, not all characters are cross-platform valid for directory names. For example, the characters `/:<>*?"|` are not valid on Windows OS. The pattern now excludes those characters.

The theme's directory (or subdirectory) name pattern matching is now used in `WP_REST_Global_Styles_Controller`, `WP_REST_Templates_Controller`, and `WP_REST_Themes_Controller`.

Follow-up to [51003], [52051], [52275], [52376].

Props costdev, hellofromTonya, spacedmonkey, TimothyBlynJacobs, bijayyadav, kafleg.
Fixes #54596.
Built from https://develop.svn.wordpress.org/trunk@52399


git-svn-id: http://core.svn.wordpress.org/trunk@51991 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 04:14:00 +00:00
hellofromTonya
28b0710360 Application Passwords: Show HTTPS required message without filtering when not enabled or not in local environment.
When `add_filter( 'wp_is_application_passwords_available', '__return_false' )` exists, HTTPS requirement message is shown even if HTTPS is enabled on the site. This happens because `wp_is_application_passwords_available_for_user()` first invokes `wp_is_application_passwords_available()` which is filterable. The situation could happen if the `'wp_is_application_passwords_available_for_user'` filter returns `false`.

To fix this, the check for HTTPS (or if in a 'local' environment) is moved to a new function called `wp_is_application_passwords_supported()`. Then the return from this function is used as an OR condition for the Application Passwords section and for displaying the HTTPS required message.

Tests are included for both `wp_is_application_passwords_supported()` and `wp_is_application_passwords_available()`.

Follow-up to [51980], [51988].

Props davidbinda, SergeyBiryukov, ocean90, felipeelia, costdev, hellofromTonya.
Fixes #53658.
Built from https://develop.svn.wordpress.org/trunk@52398


git-svn-id: http://core.svn.wordpress.org/trunk@51990 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 02:45:03 +00:00
hellofromTonya
f067011b59 Editor: Explicitly declare $post_types and $area properties in WP_Block_Template class.
The `$post_types` and `$area` properties are assigned in the `_build_block_template_result_from_file()` and `_build_block_template_result_from_post()` functions. However, neither property was explicitly declared in the `WP_Block_Template` class.

This commit explicitly declares both properties in the class. Why? (1) To make the code more readable and maintainable; (2) to avoid a `Deprecated: Creation of dynamic property WP_Block_Template::$post_types is deprecated` deprecation when PHP 8.2 is released.

Ref:
* PHP 8.2 Deprecate dynamic properties https://wiki.php.net/rfc/deprecate_dynamic_properties

Follow-up to [52062].

Props jrf.
Fixes #54670.
Built from https://develop.svn.wordpress.org/trunk@52397


git-svn-id: http://core.svn.wordpress.org/trunk@51989 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 00:28:00 +00:00
hellofromTonya
bf60226e36 General: Fix 'rel' argument in Tests_Functions_wpListBookmarks test datasets.
`wp_list_bookmarks()` arguments include `'link_rel'`, but not `'rel'`. This commit fixes this argument in the test datasets. It also adds an expected `'rel=""'` result check, i.e. instead of only checking for `'noopener'`.

Follow-up to [52395].

Props davidbinda.
Fixes #53839.
Built from https://develop.svn.wordpress.org/trunk@52396


git-svn-id: http://core.svn.wordpress.org/trunk@51988 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-21 00:12:03 +00:00
hellofromTonya
a3dedd1d4d Script Loader: Skip getting 'can_compress_scripts' option in script_concat_settings() during install.
When installing a multisite, there is a potential access to a non-existent database table that needs to be skipped to avoid warnings/errors. This fix checks is WordPress is not installing before getting the `'can_compress_scripts'` option.

Props schlessera.
Fixes #54634.
Built from https://develop.svn.wordpress.org/trunk@52395


git-svn-id: http://core.svn.wordpress.org/trunk@51987 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-20 23:53:01 +00:00
audrasjb
ea138fdcb9 Docs: Typo correction in wp_dropdown_languages() DocBlock.
Follow-up to [52058].

See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51986 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-20 22:26:02 +00:00
Sergey Biryukov
c3112cab39 External Libraries: Update the SimplePie library to version 1.5.7.
This version shows significant improvements in the compatibility of SimplePie with PHP 8.0, 8.1, and even contains an initial PHP 8.2 fix. The release also contains a number of other bug fixes.

Release notes: https://github.com/simplepie/simplepie/releases/tag/1.5.7

For a full list of changes in this update, see the SimplePie GitHub:
https://github.com/simplepie/simplepie/compare/1.5.6...1.5.7

Follow-up to [47733], [49176].

Props jrf, SergeyBiryukov.
Fixes #54659.
Built from https://develop.svn.wordpress.org/trunk@52393


git-svn-id: http://core.svn.wordpress.org/trunk@51985 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-20 19:33:00 +00:00
jffng
9759353922 Twenty Twenty-Two: Sync updates from GitHub for Beta 4.
This commit syncs changes for the default theme from its active development repository to core. 

This is a follow up to [52081], [52107], [52164], [52222], [52283], [52335], and [52375]. It updates the theme's font size presets and fixes an issue with query padding.

To view the full set of changes, visit 623a4d7982...d6cb56cce4.

Props schlessera, williampatton, hellofromtonya, kjellr.
See #54318.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51984 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-20 16:50:05 +00:00
Sergey Biryukov
cc5119e5e1 Tests: Use shared fixtures in block theme tests.
This removes duplicate test data and aims to avoid future confusion about which themes to use in which tests.

Follow-up to [52049], [52246], [52247], [52279].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@52391


git-svn-id: http://core.svn.wordpress.org/trunk@51983 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-19 16:25:02 +00:00
John Blackbourn
3324ed52ad Build/Test Tools: Remove the assertion in filter_rest_url_for_leading_slash().
This assertion can mask the fact that some other tests don't perform an assertion.

Fixes #54661

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


git-svn-id: http://core.svn.wordpress.org/trunk@51982 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-19 14:29:00 +00:00
John Blackbourn
1af8544d80 Build/Test Tools: Reduce the use of unnecessary randomness in tests.
This increases the overall reliability of the tests.

Props johnillo

Fixes #37371

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


git-svn-id: http://core.svn.wordpress.org/trunk@51981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-19 13:44:00 +00:00
Sergey Biryukov
3d4ac53c89 Tests: Fix typo in a data provider name.
Follow-up to [52261], [52387].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@52388


git-svn-id: http://core.svn.wordpress.org/trunk@51980 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-18 21:46:00 +00:00
Sergey Biryukov
28b48cecd6 Tests: Fix typo in a test method name.
Follow-up to [52261].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@52387


git-svn-id: http://core.svn.wordpress.org/trunk@51979 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-18 21:17:59 +00:00
Sergey Biryukov
d37081cac2 Tests: Move the tests for theme features that block themes should support by default to a more appropriate place.
As these tests are intended for the `_add_default_theme_supports()` function rather than `WP_Theme` class methods, the `tests/theme.php` file is a more logical place for them than `tests/theme/wpTheme.php`.

Follow-up to [52369], [52383].

See #54597.
Built from https://develop.svn.wordpress.org/trunk@52386


git-svn-id: http://core.svn.wordpress.org/trunk@51978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-18 21:10:03 +00:00
audrasjb
8698dc9721 Site Health: Typo correction in Site Health help tab.
Follow-up to [52053].

Props pedromendonca.
Fixes #54656.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51977 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-18 21:02:04 +00:00
antpb
a6a27970a9 Media: Fix selections in Media Library Featured Image modal on open.
In [50829] infinite scrolling was removed from the Media Library and modal which introduced unintended behavior for featured images where only the selected image shows when opening the library. This change reverts only the logic that caused this and applies a proper fix when opening the library.

Props benitolopez, hellofromTonya, joedolson, peterwilsoncc, circlecube, danielbachhuber, PieWP, sabernhardt, szaqal21, dariak, sergeybiryukov.
Fixes #53765.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51976 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-17 20:17:05 +00:00
Sergey Biryukov
0795991b6f Tests: Add unit tests for theme features that block themes should support by default.
By default, block themes should have a few theme supports enabled:
* `post-thumbnails`
* `responsive-embeds`
* `editor-styles`
* `html5` for `comment-form`, `comment-list`, `style`, `script`
* `automatic-feed-links`

They should also load core block assets only when the blocks are rendered. This commit adds the associated tests.

Follow-up to [52369].

Props costdev.
See #54597.
Built from https://develop.svn.wordpress.org/trunk@52383


git-svn-id: http://core.svn.wordpress.org/trunk@51975 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-16 14:47:04 +00:00
Sergey Biryukov
1eb2a65984 Tests: Mock the HTTP request response in download_url() tests.
This aims to speed up the tests and minimize unrelated failures by avoiding an unnecessary external HTTP request, while still performing the intended functionality checks.

Update similar helpers in some other tests to use more consistent terminology.

Follow-up to [37907], [46175], [51626].

See #54420, #53363.
Built from https://develop.svn.wordpress.org/trunk@52382


git-svn-id: http://core.svn.wordpress.org/trunk@51974 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-15 20:01:00 +00:00
Sergey Biryukov
df494e0987 Tests: Add an assertion to test the WP_REST_Server::add_site_logo_to_index() method.
Additionally:
* Move the test for `WP_REST_Server::add_active_theme_link_to_index()` to a more logical place.
* Replace `assertEquals()` with `assertSame()` in site icon test to also check the type of the value.
* Use a more consistent pattern for the tests.

Follow-up to [51241], [52080].

Props ignatggeorgiev, desrosj, SergeyBiryukov.
Fixes #53516. See #53363.
Built from https://develop.svn.wordpress.org/trunk@52381


git-svn-id: http://core.svn.wordpress.org/trunk@51973 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-15 18:08:05 +00:00
isabel_brison
7b3c904f37 Fix deprecated usage of passing null to explode()
As of PHP 8.1, explode() does not permit null as its second argument. This results in warnings being spat out on every page because of a usage of this in wp-includes/block-supports/layout.php.

See #53635.
Props noisysocks.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51972 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-15 04:08:04 +00:00
Sergey Biryukov
e02e7be1b6 Post WordPress 5.9 Beta 3 version bump.
Built from https://develop.svn.wordpress.org/trunk@52379


git-svn-id: http://core.svn.wordpress.org/trunk@51971 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 21:25:01 +00:00
Sergey Biryukov
58bb50562c WordPress 5.9 Beta 3.
Built from https://develop.svn.wordpress.org/trunk@52378


git-svn-id: http://core.svn.wordpress.org/trunk@51970 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 20:25:59 +00:00
hellofromTonya
4132ac0f48 Editor: Add "Featured" patterns from pattern directory to Patterns in block inserter.
This commit backports the remote "Featured" category request and loads it into the Featured Patterns in the block inserter.

Props ryelle.
Fixes #54623.
Built from https://develop.svn.wordpress.org/trunk@52377


git-svn-id: http://core.svn.wordpress.org/trunk@51969 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 19:39:06 +00:00
hellofromTonya
84d67f77f6 REST API: Add block theme support for valid non-alphanumeric characters in theme's directory name.
Themes whose `wp-content/themes/<dirname>` include valid non-alphanumeric (cross-platform) characters work for non-block themes, but did not previously resolve for block themes. For example, a block theme in `wp-content/themes/twentytwentytwo-0.4.0/` directory resulted a 404 "No route was found matching the URL and request method" response when attempting to customize it in the Site Editor.

This commit adds support for the following characters in a theme's root directory: `_`, `.`, `@`, `[`, `]`, `(`, and `)`. Subdirectory themes and `-` are already supported.

Follow-up to [51003], [52051], [52275].

Props mkaz, costdev, hellofromTonya, jffng, justinahinon, peterwilsoncc, spacedmonkey, TimothyBlynJacobs.
Fixes #54596.
Built from https://develop.svn.wordpress.org/trunk@52376


git-svn-id: http://core.svn.wordpress.org/trunk@51968 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 18:24:01 +00:00
jffng
b3c06d8bb1 Twenty Twenty-Two: Sync updates from GitHub for Beta 3.
This commit syncs minor changes for the default theme from its active development repository to core. 

This is a follow up to [52081], [52107], [52164], [52222], [52283], and [52335]. The two main changes introduce global padding to site content while still allowing content to be full-width, and re-organize block patterns into Core's existing categories. 

To view the full set of changes, visit da994d1fe5...88a8f2e3b4.

Props onemaggie, joen, youknowriad, scruffian, sabernhardt, kjellr.
See #54318.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51967 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 17:11:01 +00:00
spacedmonkey
f1f71a0798 REST API: Ensure that the get_theme_item method should respect fields param.
Fix the `get_theme_item` method in the `WP_REST_Global_Styles_Controller` class to respect the fields param context filtering and to return links. 

Props spacedmonkey, hellofromtonya, peterwilsoncc, costdev.
Fixes #54595.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51966 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 16:31:00 +00:00
John Blackbourn
0124d01d1d Database: Correct and improve documentation for properties and parameters in wpdb.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51965 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 16:24:02 +00:00
hellofromTonya
65a4199149 Themes: Rename public static functions in WP_Theme_JSON_Resolver to remove custom_post_type references.
WordPress Core is not really custom and does not reference "custom post type" in its function naming. This commit renames 2 public static methods:

* `WP_Theme_JSON_Resolver::get_user_custom_post_type_id()` renamed to `WP_Theme_JSON_Resolver::get_user_global_styles_post_id()`.
* `WP_Theme_JSON_Resolver::get_user_data_from_custom_post_type()` renamed to `WP_Theme_JSON_Resolver:: get_user_data_from_wp_global_styles()`.

Follow-up to [52049], [52051], [52069], [52232], [52275], [52364].

Props antonvlasenko, bernhard-reiter, costdev, desrosj, hellofromTonya, noisysocks, oandregal, SergeyBiryukov.
Fixes #54517.
Built from https://develop.svn.wordpress.org/trunk@52372


git-svn-id: http://core.svn.wordpress.org/trunk@51964 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 16:14:01 +00:00
hellofromTonya
edf755823b Customize: Overlay incompatible banner for block themes.
Starting in 5.9, block themes are not compatible with (do not support) Customizer; rather, they use the Site Editor. Viewing installed themes in Customizer, this commit adds an overlay message to alert users and give them a way to activate the block theme. Clicking on the "Activate" button activates the block theme and redirects back to the Appearance > Themes interface, where the user can then enter the Site Editor for customization.

Non-block themes are not affected by this change and continue to work in Customizer.

Follow-up to [41648], [41893], [52279].

Props antonvlasenko, costdev, hellofromTonya, jffng, joyously, noisysocks, poena, shaunandrews.
Fixes #54549.
Built from https://develop.svn.wordpress.org/trunk@52371


git-svn-id: http://core.svn.wordpress.org/trunk@51963 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 15:33:01 +00:00
hellofromTonya
dfef2c917f Formatting: Use is_scalar() in sanitize_key().
This is a follow-up to [52292] which introduced `is_string()` to check the given key is a string to be sanitized, else the key is set to an empty string. 

`sanitize_key()` is clearly identified (in the documentation) to only work with ''string'' keys. However, it had a bug in it that allowed non-strings to pass through it:
* A non-scalar "key" would throw a PHP Warning (which was resolved in [52292]. 
* A non-string scalar "key" was handled by the PHP native `strtolower()` which converted it into a string.

While `is_string()` is valid, non-string scalar types passed as the key to be sanitized were being set to an empty string. Given that `strtolower()` handles these without error or deprecation as of PHP 8.1, `is_scalar()` protects the website from issues while retaining the past behavior of converting integer keys (for example) into a string.

Changes include:
* Using `is_scalar()` instead of `is_string()`
* Refactor for readability and less code
* More tests

Please note, this does not change the behavior of the function, nor redefine it to now accept non-string scalars.

References:
* https://developer.wordpress.org/reference/functions/sanitize_key/
* https://www.php.net/manual/en/function.strtolower.php

Follow-up [52292].

Props wppunk, hellofromTonya, costdev, jrf.
Fixes #54160.
Built from https://develop.svn.wordpress.org/trunk@52370


git-svn-id: http://core.svn.wordpress.org/trunk@51962 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 15:01:03 +00:00
audrasjb
9b694a6f49 Editor: Activate missing default theme features for block themes.
By default, block themes should have a few theme supports enabled by default. These are: `post-thumbnails`, `responsive-embeds`, `editor-styles`, `html5`, `automatic-feed-links`. This changeset backports the changes introduced in https://github.com/WordPress/gutenberg/pull/35593.

Props noisysocks, ocean90, youknowriad, audrasjb, hellofromTonya.
Fixes #54597.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51961 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 09:49:00 +00:00
audrasjb
1309e62457 Posts, Post Types: Add missing translation context on FSE related post types labels.
This makes it easier for translators to identify the context of each label. This change also brings consistency with other built-in post types.

Follow-up to [52145], [52069], [52062], [52041], [51003].

Props audrasjb, hellofromTonya.
Fixes #54611.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51960 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 09:09:01 +00:00
audrasjb
bcb9285589 Docs: Use generic references to "Database" in wp-config-sample.php.
This replaces the references to "MySQL" info in the WordPress configuration sample file. Using the generic term "Database" now refers to either MySQL or MariaDB.

Props Ov3rfly, audrasjb, hellofromTonya.
Fixes #54610.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51959 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 08:44:02 +00:00
audrasjb
e5a1ed2fb2 Docs: Typo correction in TinyMCE related JS file.
Follow-up to [45066].

See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51958 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 08:30:04 +00:00
noisysocks
3cd0e25c03 Filter custom block templates with PHP
This method calls get_block_templates once and uses block template properties
directly for filtering. This way, we can avoid hitting the database for each
public post type.

The previous method is useful when we already know the current post type we
request templates for, like when using REST API.

Follows [52334].
See #54335.
Props mamaduka, youknowriad.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51957 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 02:46:00 +00:00
noisysocks
935058d178 Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- Image block: Set image display to grid when no alignment sent to properly align caption on resize
- Update and align template descriptions
- Site Editor - prevent loading state from showing the admin menu.
- Add client side routing for Site Editor
- Navigation: Add clearance for appender in submenus.
- Fix CSS Custom Properties for presets in the site editor
- Add/navigation blocks post processing after migration from menu items
- Allow selector ordering to ensure theme.json root selector margin takes precedence 
- Do not remove theme presets if defaults are hidden
- Format library: fix unsetting highlight color
- FSE: Fix template resolution to give precedence to child theme PHP templates over parent theme block templates with equal specificity
- ColorPalette: Improving accessibility and visibility
- Update: Make the color popover on the gradient picker appear as expected
- Site Editor: Display a notice if export fails
- Fix docs and function naming for gallery block registration in PHP
- Switch to addEventListener for load event in the navigation block view script
- Fix mistake in _remove_theme_attribute_in_block_template_content
- Better synchronisation between Gutenberg and Core code
- Move the block page templates hook into compat/5.9 folder
- Moves to the template loader hooks and functions into lib/compat folder
- Refactor the gutenberg_is_fse_theme function to use wp_is_block_theme
- Site Editor: Update support doc URL in Welcome Guide
- Global Styles: Add Welcome Guide toggle
- Hide remove control point when removing would break gradient control
- Don't request the deprecated navigation areas endpoint outside of the Gutenberg plugin
- Image: Fix resizer controls being hidden in Safari when switching between alignments
- Remove Navigation Menus from WP Admin sidebar
- Site Editor: Hide the block appender in the Template Part editor
- Site Editor: Use server definition for the Template Areas
- Synchronize wp_is_block_theme and block-templates block support with Core
- E2E: Retry login again after a bad nonce request to prevent intermittent test failures 
- Fix theme requirement validation with WP 5.8
- Fix WP 5.9 check for conditionally running code
- Fix post comment form input width
- Border Style Control: Update styling for consistency with border width control
- Fix form-submit styles by adding button classes to the submit-button in post-comments block
- Site Editor: Fix edit template part link in header dropdown
- Move duotone palette to the bottom of global styles gradients
- Fix how appearanceTools works
- Move WP 5.9 wp-admin menus compatibility code to lib/compat folder
- Revert "Site Editor: Set the <title> on the list page to be same as the CPT name"
- Site Editor: Document Actions: add SR text to heading 1
- Do not register global styles CPT in WordPress 5.9
- Global Styles: Move the 'Edit colors' button to a standard menu item
- Fix styles for previews and patterns
- Site Editor: Fix failing E2E test
- Templates: Search for old template names in the parent theme too
- Remove 4 instances of 'gutenberg' text domain from WordPress core
- Fix content loss when ungrouping template parts or reusable blocks
- Simplify the RESET_BLOCK action to fix template part focus mode content loss
- [Global Styles]: Make Blocks section more distinguishable
- Only use block markup for comment form button when using a block theme
- Navigation: Fix vertical alignment of page list in modal.
- Fix: ToggleGroupControl active state
- Remove gutenberg_ prefix from @wordpress/block-library

Props ocean90, oandregal, hellofromtonya, youknowriad.
See #54487.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-14 01:57:26 +00:00
spacedmonkey
120b1ab117 REST API: Ensure that the parent link, uses the rest_get_route_for_post function.
In [51962] the `rest_get_route_for_post` function was implemented in all places where link to a post's REST API endpoint is needed. However in this commit, the up link, which links to the parent post of the current object, did not use this function.   

Props Spacedmonkey, SergeyBiryukov.
Fixes #53656.



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


git-svn-id: http://core.svn.wordpress.org/trunk@51955 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-13 15:20:03 +00:00
Sergey Biryukov
d09d194f12 Docs: Capitalize "ID", when referring to a widget ID or sidebar ID, in a more consistent way.
Follow-up to [48104], [52357], [52361].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@52362


git-svn-id: http://core.svn.wordpress.org/trunk@51954 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-13 10:21:07 +00:00
audrasjb
cfd6406f8f Docs: Capitalize "ID", when referring to a sidebar ID in a more consistent way.
Follow-up to [52016].

See #53399.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51953 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-12 19:01:02 +00:00
audrasjb
f4683efbc9 Docs: Document the global used in upgrade_590() function.
Follow-up to [51917].

See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-12 17:57:00 +00:00
Sergey Biryukov
02e384322f Build/Test Tools: Disable WP Cron when installing PHPUnit tests.
During the WordPress installation process when running the test suite, an HTTP request was always fired by a cron task and failed, because tests are run in CLI mode only.

To avoid that, the `DISABLE_WP_CRON` constant was previously added to the `bootstrap.php` file. However, the constant is not passed to the `install.php` script. This commit makes a similar change to `install.php`.

Follow-up to [760/tests], [872/tests].

Props Chouby.
Fixes #54612.
Built from https://develop.svn.wordpress.org/trunk@52359


git-svn-id: http://core.svn.wordpress.org/trunk@51951 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-12 15:48:00 +00:00
Sergey Biryukov
88bf87de8c General: Mark the recommended MariaDB version number in readme.html with a <strong> tag.
This brings consistency with the MySQL version number.

Follow-up to [52319].

See #41490.
Built from https://develop.svn.wordpress.org/trunk@52358


git-svn-id: http://core.svn.wordpress.org/trunk@51950 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-12 14:58:00 +00:00
Sergey Biryukov
6cb050d878 Docs: Capitalize "ID", when referring to a post ID, term ID, etc. in a more consistent way.
Follow-up to [48104].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@52357


git-svn-id: http://core.svn.wordpress.org/trunk@51949 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-12 14:54:00 +00:00
Sergey Biryukov
75fc6b755b Docs: Update a comment in wp-admin/load-styles.php per the documentation standards.
Follow-up to [52352].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@52356


git-svn-id: http://core.svn.wordpress.org/trunk@51948 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-12 14:52:02 +00:00
Sergey Biryukov
8bdaf90a14 Docs: Update some @var tags per the documentation standards.
Follow-up to [27398], [29487], [41626], [51003].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@52355


git-svn-id: http://core.svn.wordpress.org/trunk@51947 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-11 19:50:59 +00:00
audrasjb
adee0cbf6b Docs: Docblock adjustments in some 5.9 block related functions.
Adds missing `@since` mention to `wp_enqueue_block_style()` and `_wp_multiple_block_styles()`, and a few other minor changes. 

Follow-up to [52069].

See #53359.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51946 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-11 11:16:03 +00:00
hellofromTonya
f847144952 Themes: Show only "Customize" or "Activate" button in block theme's Theme Details modal.
At the bottom of a block theme's "Theme Details" modal, only one button will be displayed:
* "Customize" button when the block theme is activated;
* Else, the "Activate" button.

The "Live Preview", "Editor beta", and "Navigation Menus" buttons are removed.

Follow-up to [15646], [52341], [52346].

Props poena, ryelle, kafleg, antonvlasenko, costdev, SergeyBiryukov, hellofromTonya.
Fixes #54578.
Built from https://develop.svn.wordpress.org/trunk@52353


git-svn-id: http://core.svn.wordpress.org/trunk@51945 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-10 20:33:00 +00:00
Sergey Biryukov
3beb1d25ab Docs: Correct the format of some comments per the documentation standards.
Follow-up to [10357], [10939], [43309], [51003], [51266], [51653], [51738], [52110].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@52352


git-svn-id: http://core.svn.wordpress.org/trunk@51944 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-10 20:30:05 +00:00
Peter Wilson
88b1019dc3 Upgrade/install: Revert upgrader rollback features.
Revert the rollback features introduced for theme and plugin upgrades during the WordPress 5.9 cycle. A bug (suspected to be in third party virtualisation software) causes the upgrades to fail consistently on some set ups. The revert is to allow contributors further time to investigate mitigation options.

Reverts [52337], [52289], [52284], [51951], [52192], [51902], [51899], [51898], [51815].

Props pbiron, dlh, peterwilsoncc, galbaras, SergeyBiryukov, afragen, costdev, bronsonquick, aristath, noisysocks, desrosj, TobiasBg, hellofromTonya, francina, Boniu91.
See #54543, #54166, #51857.



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


git-svn-id: http://core.svn.wordpress.org/trunk@51943 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-10 00:06:04 +00:00
Sergey Biryukov
852fad7531 Coding Standards: Remove a trailing comma from a compact() call in _wp_customize_include().
This fixes a `Trailing comma's are not allowed in function calls in PHP 7.2 or earlier` error in the PHP compatibility check.

Follow-up to [52348].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@52350


git-svn-id: http://core.svn.wordpress.org/trunk@51942 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-09 15:32:01 +00:00
Sergey Biryukov
7ffc7c29cc Editor: Add an editor settings flag to enable the new gallery for mobile apps for 5.9.
Currently the WordPress mobile apps rely on the `__unstableGalleryWithImageBlocks` flag being set in order to enable the new gallery block format.

This commit includes the value in the `get_default_block_editor_settings()` function in order to ensure that versions of the mobile app >= 18.2 will be able to add and edit gallery blocks in the new format.

Props glendaviesnz, ocean90, hellofromTonya, noisysocks.
Fixes #54583.
Built from https://develop.svn.wordpress.org/trunk@52349


git-svn-id: http://core.svn.wordpress.org/trunk@51941 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-09 15:25:01 +00:00
Sergey Biryukov
d8934f9acb Coding Standards: Simplify or wrap some long conditions in wp-includes/theme.php for better readability.
Includes adjusting some DocBlocks per the documentation standards.

Follow-up to [35595], [41937], [52256].

See #53359, #53399.
Built from https://develop.svn.wordpress.org/trunk@52348


git-svn-id: http://core.svn.wordpress.org/trunk@51940 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-09 15:13:04 +00:00
youknowriad
0441885c15 Themes: Auto-enable block-templates support for all block themes.
Block themes without theme.json file used to have block-templates support disabled.
This commit brings this in sync with the behavior in the gutenberg plugin.

See #54335.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51939 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-09 09:56:04 +00:00
Sergey Biryukov
62574145ce Coding Standards: Use camel case with a lowercase first letter for the blockTheme array key.
This matches the WordPress JS naming conventions and the naming of other keys in the `$prepared_themes` array.

Follow-up to [52341].

See #54578, #53359.
Built from https://develop.svn.wordpress.org/trunk@52346


git-svn-id: http://core.svn.wordpress.org/trunk@51938 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-08 10:16:05 +00:00
audrasjb
12369a6425 Coding Standards: Correct alignment in blocks.php and class-wp-rest-templates-controller.
See #53359.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51937 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 22:49:59 +00:00
Sergey Biryukov
abed17b03d Post WordPress 5.9 Beta 2 version bump.
Built from https://develop.svn.wordpress.org/trunk@52344


git-svn-id: http://core.svn.wordpress.org/trunk@51936 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 21:58:01 +00:00
Sergey Biryukov
600aa23dd6 WordPress 5.9 Beta 2.
Built from https://develop.svn.wordpress.org/trunk@52343


git-svn-id: http://core.svn.wordpress.org/trunk@51935 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 21:20:59 +00:00
spacedmonkey
ec370a0af4 REST API: Improve permission handling in global style endpoint.
The new wp_global_styles post type is registered to use edit_theme_options in the capability settings. The WP_REST_Global_Styles_Controller class's permission checks methods use the capability in a hard coded form rather than looking up the capability via the post type object. Changing the permission callbacks to lookup capabilities via the post type object, allows theme and plugin developers to modify the capability used for editing global styles via a filter and these values to be respected via the Global Styles REST API.

Props Spacedmonkey, peterwilsoncc, hellofromTonya , antonvlasenko, TimothyBlynJacobs, costdev, zieladam.
Fixes #54516.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 20:58:00 +00:00
hellofromTonya
9aba2584bb Themes: Hide "Live Preview" button for FSE block themes.
Currently, the Site Editor does not have a live preview feature for non-activated block themes.

This commit is a stop-gate to remove the "Live Preview" button for those themes. It avoids confusing users and avoiding a notification message that doesn't make sense.

Props antonvlasenko, costdev, hellofromTonya, kafleg, paaljoachim.
Fixes #54578.
Built from https://develop.svn.wordpress.org/trunk@52341


git-svn-id: http://core.svn.wordpress.org/trunk@51933 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 20:07:00 +00:00
spacedmonkey
40b22d1209 REST API: Ensure that the export template endpoint returns a valid WP_Error object.
Ensure that the export template endpoint returns a WP_Error object, including code and message, so that the site editor can display an error message. 
Add some basic unit tests to ensure that permission checks are working as expected. 

Follow-up to [52286].

Props Spacedmonkey, dlh, hellofromTonya , Mamaduka, TimothyBlynJacobs.
Fixes #54448.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51932 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 18:38:02 +00:00
audrasjb
153e27f625 Coding Standards: Replace else if with elseif after [52338].
Follow-up to [52338].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51931 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 17:49:01 +00:00
audrasjb
cdafa716f7 Script Loader: Allow for wp_register_script() to be called after wp_enqueue_script().
When a plugin registers styles/scripts on `wp_enqueue_scripts` (as plugin authors are encouraged to do), and conditionally enqueues their script/style on `the_content` filter, things "just work". In block themes, `the_content` is run prior to the header being processed, which results in the above scenario failing.

This change makes a `wp_enqueue_script( 'example' ); wp_register_script( 'example' );` work, where as currently the enqueue silently fails (no "doing it wrong" message) and the following register has no impact. Scripts can therefore be enqueued and dequeued (by "handle") before they are registered.

Fixes #54529.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51930 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 17:46:01 +00:00
hellofromTonya
4f0c8ef665 Upgrade/Install: Fix moving plugins folder in WP_Upgrader:: move_to_temp_backup_dir().
[51815] introduced the creation of a temporary backup of plugins before updating.

The `move()` (and later, `move_dir()`) call) uses a `$src` parameter.
For Hello Dolly, this is `<path>/wp-contents/plugins/.` (note the period at the end).

For users on Linux and Mac, this doesn't appear to cause any problems.
However, on Windows, the move causes the plugins folder to be moved which then causes a failure when attempting to call `mkdir()`.

This commit skips any plugin whose slug is `'.'` as this slug results in the `$src` value ending in a period. 

Follow-up to [51815].

Props costdev, boniu91, hellofromTonya.
Fixes #54543.
Built from https://develop.svn.wordpress.org/trunk@52337


git-svn-id: http://core.svn.wordpress.org/trunk@51929 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 16:51:03 +00:00
youknowriad
ec25c4ee57 Site Editor: Render the template descriptions properly.
The initializaion of the editor was a bit different between Gutenberg and Core.
This brings them in sync which solves the missing descriptions from the template header
in the site editor.

See #54337.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51928 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 16:40:01 +00:00
jffng
ef4271cfee Twenty Twenty-Two: Sync updates from GitHub.
This commit syncs minor changes for the default theme from its active development repository to core. 

This is a follow up to [52081], [52107], [52164], [52222], and [52283]. It reduces the size of a video asset, renames the templates and template parts directories, and adds CSS for button hover states. To view the full set of changes, visit 1a121e0224...da994d1fe5.

Props kjellr, mburridge, sabernhardt, hellofromtonya, scruffian.
See #54318.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51927 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 16:38:02 +00:00
youknowriad
76419adcaa Block Editor: Only list custom block templates in the template selector.
Previously all block templates including the hierarchy templates were being shown in the CPT template selector.

Props mamaduka.
See #54335.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51926 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 16:33:05 +00:00
hellofromTonya
177a4d830b REST API: Pass post type name to rest_get_route_for_post_type_items().
The new `rest_get_route_for_post_type_items()` function accepts a string, not an object. This commit passes the post type name instead of the object to resolve a notice in the site editor page.

Follow-up to [52281].

Props walbo.
Fixes #54536.
Built from https://develop.svn.wordpress.org/trunk@52333


git-svn-id: http://core.svn.wordpress.org/trunk@51925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 16:15:02 +00:00
John Blackbourn
39bff93b6b Docs: Various inline documentation corrections and improvements.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51924 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 12:20:02 +00:00
youknowriad
bc3356601e Site Editor: Update the block template descriptions.
Align the template descriptions with the latest changes from the Gutenberg plugin.

Props jameskoster, SergeyBiryukov.
See #54335.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51923 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 12:12:04 +00:00
hellofromTonya
f70fb51f99 Themes: Better names for WP_Theme::is_block_theme() and wp_is_block_theme() and make wp_is_block_theme() a wrapper.
This commit renames the following method and function to better represent block theme terminology:

* `WP_Theme::is_block_based()` to `WP_Theme::is_block_theme()`
* `wp_is_block_template_theme()` to `wp_is_block_theme()`

It also changes `wp_is_block_theme()` to be a helper wrapper (sugar syntax) for `wp_get_theme()->is_block_theme();`. Why? To ensure both the method and function behave the same, to help Gutenberg maintain WordPress cross-version compatibility, and to make it less cumbersome to port changes from Gutenberg to Core.

Follow-up to [52069], [52247], [52279].

Props antonvlasenko, costdev, hellofromTonya, noisysocks.
Fixes #54550.
Built from https://develop.svn.wordpress.org/trunk@52330


git-svn-id: http://core.svn.wordpress.org/trunk@51922 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 00:02:02 +00:00
hellofromTonya
2e2829904b Editor: Allow theme.json to take precedence in setting the root level element's reset margin value.
Any margin added to the root element via `theme.json` is overwritten by a CSS reset margin value provided by the Gutenberg Plugin.

This commit makes `theme.json` setting take precedence by generating the global styles body reset prior to processing the theme.json.

Follow-up to [52049].

Props get_dave, hellofromTonya.
Fixes #54550.
Built from https://develop.svn.wordpress.org/trunk@52329


git-svn-id: http://core.svn.wordpress.org/trunk@51921 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-06 22:42:00 +00:00
Sergey Biryukov
47c4ff7102 HTTP API: Revert changeset [52244].
Reverting Requests 2.0.0 changes and moving to WordPress 6.0 cycle. Why? The namespace and file case renaming revealed 2 issues in Core's upgrader process.

See https://core.trac.wordpress.org/ticket/54504#comment:22 for more information.

Follow-up to [52327].

See #54562, #54504.
Built from https://develop.svn.wordpress.org/trunk@52328


git-svn-id: http://core.svn.wordpress.org/trunk@51920 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-06 21:30:03 +00:00
hellofromTonya
8045f6a42b HTTP API: Revert changeset [52315].
Reverting Requests 2.0.0 changes and moving to WordPress 6.0 cycle. Why? The namespace and file case renaming revealed 2 issues in Core's upgrader process.

See https://core.trac.wordpress.org/ticket/54504#comment:22 for more information.

See #54562, #54504.
Built from https://develop.svn.wordpress.org/trunk@52327


git-svn-id: http://core.svn.wordpress.org/trunk@51919 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-06 18:31:05 +00:00
Sergey Biryukov
18d741be37 KSES: Use the polyfilled PHP 8 string functions in _wp_kses_allow_pdf_objects():
* `str_contains()`
* `str_ends_with()`
* `str_starts_with()`

Additionally, include a test for a PDF file in an `<object>` tag with an unsupported protocol.

Follow-up to [51963], [52039], [52040], [52304], [52309].

Props TobiasBg, ramonopoly.
See #54261.
Built from https://develop.svn.wordpress.org/trunk@52326


git-svn-id: http://core.svn.wordpress.org/trunk@51918 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-06 11:08:01 +00:00
Sergey Biryukov
a9edd7ba88 Build/Test Tools: Remove the replace:emoji-banner-text Grunt task.
The task was previously used to ensure that `/*! This file is auto-generated */` comment is not included on front end as part of the inline emoji detection script.

As the `wp-emoji-loader.js` script is now included via `file_get_contents()` and `wp_print_inline_script_tag()` instead of `grunt-include` to simplify the logic, the task does not find anything to replace and is no longer necessary.

Additionally, include a line break before the `wp-emoji-loader.js` script content for better line wrapping.

Follow-up to [48096], [50651], [52132].

See #44632, #44306, #53363.
Built from https://develop.svn.wordpress.org/trunk@52325


git-svn-id: http://core.svn.wordpress.org/trunk@51917 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-06 10:14:06 +00:00
noisysocks
3060ce0b59 Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- Gallery block: turn on auto-migration of v1 Gallery blocks to v2 format when edited
- Add accessible labelling to submenu buttons.
- Improve performance of wp_navigation lookup. 
- Various inline docblock corrections
- Use core version of template and template part post types and REST endpoints for WP 5.9, with back compat for 5.8
- Gradients: Enable adding custom gradient when gradients are disabled
- Custom color palette: add default color name
- Color Picker: Re-instate debounce and controlled value to fix issue with gradient picker
- Add aria-current="page" to active navigation item
- Site Editor: Templat list fallback to slug
- Fix: Custom color picker popover position
- Fix: php 5.6 error in theme JSON class.
- Update the WP_Theme_JSON_Gutenberg class to be like the core one
- Update the WP_Theme_JSON_Resolver_Gutenberg class to be like the core one
- Move Global Styles code to lib/compat/wordpress-5.9 folder
- E2E Tests: Fix failing image e2e test by waiting for required element
- Navigation: Try removing absorb toolbar prop.
- Navigation: Fix navigation justifications.
- Fix wordbreak for URLs
- Polish unset color indicator.
- Template revert flow: Make label description source agnostic
- [Block Library - Navigation]: Fix vertical layout
- Add: Corners to custom color picker popover
- Add: Missing margin to the color picker clear button
- Gradient: Fix clearing a custom gradient from throwing a React warning
- [Block Library]: Rename Query Pagination blocks
- PHP Unit Tests: Use global transients 
- Remove CSS that causes conflict with theme.json
- Add actions which fire during the loading process of block template parts
- Fix usage of useSetting('color.palette')
- Update micromodal, include click-through fix
- Site Editor: Remove unused PHP code
- Don't try and render unstable location if Nav block has ID
- Fix gutenberg prefixed function references in core
- Card: support the extraSmall option for the size prop
- Gallery block: enable the new gallery block by default if running in core 
- Block fixtures: Change port to 8889 to placate KSES
- Full Site Editing: Remove block template resolution unit tests
- Site Editor: Sync export API

See #54487.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51916 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-06 06:20:27 +00:00
Sergey Biryukov
f5d79e0b23 Docs: Add missing summary for WP_Theme_JSON_Resolver::get_merged_data().
Follow-up to [50959].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@52323


git-svn-id: http://core.svn.wordpress.org/trunk@51915 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-05 18:02:08 +00:00
Sergey Biryukov
6e09421269 Coding Standards: Break the $path reference after a foreach loop in block_editor_rest_api_preload().
When using a `foreach` loop with a value assigned by reference, the variable continues to point to the last array element even after the loop, so it is recommended to destroy it by `unset()` to avoid unexpected behavior later on.

See [https://www.php.net/manual/en/control-structures.foreach.php PHP Manual: foreach].

Follow-up to [52312], [52313].

Props TobiasBg.
See #54558.
Built from https://develop.svn.wordpress.org/trunk@52322


git-svn-id: http://core.svn.wordpress.org/trunk@51914 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-04 17:20:00 +00:00
Sergey Biryukov
6b84ae03ad Docs: Further update some @since notes in WP_Theme_JSON methods for clarity.
Follow-up to [52049], [52306], [52320].

See #53399, #54336.
Built from https://develop.svn.wordpress.org/trunk@52321


git-svn-id: http://core.svn.wordpress.org/trunk@51913 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-04 15:57:01 +00:00
Sergey Biryukov
7f9d7a5905 Docs: Some documentation improvements for WP_Theme_JSON and WP_Theme_JSON_Resolver classes:
* Make the `@since 5.9.0` notes more specific. When mentioning that parameters or values have been added or changed, it is generally also helpful to include their exact names and the nature of changes for future reference.
* Update some DocBlocks per the documentation standards.

Follow-up to [52049], [52306].

See #53399, #54336.
Built from https://develop.svn.wordpress.org/trunk@52320


git-svn-id: http://core.svn.wordpress.org/trunk@51912 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-04 12:58:01 +00:00
audrasjb
3d5b5f21e1 General: Add MariaDB in the readme.html requirements.
This change updates the WordPress `readme.html` file to reflect WordPress.org requirements: as of WordPress 5.9, MariaDB 10.1 and higher versions are supported by WP. See https://wordpress.org/about/requirements/. 

Fixes #41490.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51911 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-03 23:09:59 +00:00
audrasjb
9a9afacf38 Docs: Replace @since 5.9 with @since 5.9.0 in block-template-utils.php.
Follow-up to [52317], [52275], [52062].

See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51910 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-03 22:26:59 +00:00
audrasjb
a945234aba Docs: Miscellaneous Docblock corrections for block-template-utils.php file.
Follow-up to [52275], [52062].

See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51909 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-03 22:09:59 +00:00
hellofromTonya
64fe3efe28 Editor: Resolve template request ?_wp-find-template=true for new posts and pages.
The template resolution system makes a request like `/?page_id=1234&_wp-find-template=true`, depending on `WP_Query` to resolve a page or post using the page_id or p (post_id) in the query string. With new posts/pages, a placeholder post with the status auto-draft is created. But by default `WP_Query` will not resolve these posts, unless the query is specifically set to look for them.

This commit handles the query string to properly resolve a page or post. It adds 2 private callbacks for the processing.

Props poena, noisysocks, bernhard-reiter, costdev, hellofromTonya.
Fixes #54553.
Built from https://develop.svn.wordpress.org/trunk@52316


git-svn-id: http://core.svn.wordpress.org/trunk@51908 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-03 19:39:00 +00:00
hellofromTonya
b32e8f7284 HTTP API: Fix classname WpOrg\Requests\Proxy\Http in WP_Http::request().
Renaming the classname was missed in [52244] when updating changes in `WP_Http::request()` for the Requests 2.0.0 external library upgrade. `HTTP` class no longer exists and caused a fatal error `Fatal error: Uncaught Error: Class 'WpOrg\Requests\Proxy\HTTP' not found`.

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

Follow-up to [52244].

Props alexeydemidov, costdev, mukesh27.
Fixes #54562.
Built from https://develop.svn.wordpress.org/trunk@52315


git-svn-id: http://core.svn.wordpress.org/trunk@51907 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-03 18:03:59 +00:00
hellofromTonya
6f51efd066 Editor: Enable incomplete unit tests in Tests_Block_Template_Utils:: test_get_block_template_from_file().
At the time tests were backported from Gutenberg, a block template theme was not available in the test suite; thus, the test was marked as `markTestIncomplete()`.

Now that `block-theme` and `block-theme-child` test fixture block template themes are available, this commit removes the `markTestIncomplete()` and adjusts the test to run by switching to the `block-theme` test fixture.

Follow-up to [51003], [52062], [52247].

Props bernhard-reiter.
Fixes #54551.
Built from https://develop.svn.wordpress.org/trunk@52314


git-svn-id: http://core.svn.wordpress.org/trunk@51906 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-03 16:59:00 +00:00
audrasjb
b09f0e4fdd Coding standards: Address a few coding standards issues after [52312].
Follow-up to [52312].

See #54558.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51905 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-03 15:36:00 +00:00
audrasjb
dc86357471 Editor: Avoid undefined index notices in the Template Parts Editor.
This changes adds a leading slash when needed in the `?context=edit` path to avoid an `undefined index` notice in the Template Parts Editor.

Follow-up to [52275].

Props kafleg, costdev, mukesh27, Boniu91.
Fixes #54558.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51904 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-03 15:30:08 +00:00
audrasjb
cbadb65a2a REST API: Use global transients for URL details endpoint.
Follow-up to [51973].

Props peterwilsoncc, costdev.
Fixes #54499.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51903 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-03 11:36:09 +00:00
Sergey Biryukov
9ff51215ad Tests: Fix typo in a WP_Test_REST_Posts_Controller test method name.
Follow-up to [42423].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@52310


git-svn-id: http://core.svn.wordpress.org/trunk@51902 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-03 05:59:01 +00:00
Peter Wilson
37180741b4 KSES: Accept port number in PDF upload paths.
Improves the URL validation in `_wp_kses_allow_pdf_objects()` to account for sites using an upload path that contains a port, for example wp.org:8080.

Follow up to [51963], [52304].

Props ocean90, ramonopoly, talldanwp.
See #54261.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51901 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-03 02:44:00 +00:00
audrasjb
ddfe23a9aa Editor: Allow child theme PHP templates to take precedence over parent theme block templates.
This change fixes template resolution to give precedence to child theme PHP templates over parent theme block templates with equal specificity.

Before this change, when a theme was using a PHP template of a certain specificity (e.g. `page-home.php`), and it happened to be a child theme of another theme which had a block template for the same specificity (e.g. `page-home.html`), WordPress was picking the parent theme’s block template over the child theme’s PHP template to render the page. If the PHP and block template have equal specificity, the child theme's template should be used.

The issue was fixed before in Gutenberg so the fix now needs to happen in Core.

This change also re-enables the preexisting template resolution unit tests.

Follow-up to [51003].

Props bernhard-reiter, youknowriad.
Fixes #54515.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51900 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-02 23:36:59 +00:00
audrasjb
53096e6796 Docs: Docblock typo correction in WP_Theme_JSON_Schema.
Follow-up to [52306].

See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51899 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-02 20:45:01 +00:00
audrasjb
ef4fe197b8 Docs: Add missing @since tag to WP_Theme_JSON_Schema functions.
Follow-up to [52049].

See #53399, #54336.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51898 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-02 20:27:07 +00:00
Sergey Biryukov
2d6493056b Docs: Fix typo in some get_edit_term_link() test DocBlocks.
Follow-up to [52180], [52255].

See #50225, #53399.
Built from https://develop.svn.wordpress.org/trunk@52305


git-svn-id: http://core.svn.wordpress.org/trunk@51897 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-02 05:41:04 +00:00
Peter Wilson
2d944ca1d9 KSES: Allow attributes to be restricted via callbacks.
Add callback validation to HTML tag attributes for increased flexibility over an array of values only.

In `object` tags, validate the `data` attribute via a callback to ensure it is a PDF and matches the `type` attribute. This prevents mime type mismatches in browsers.

Follow up to [51963].

Props Pento, dd32, swissspidy, xknown, peterwilsoncc.
Fixes #54261.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51896 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-02 00:56:01 +00:00
audrasjb
8d723966d0 Docs: Add missing @param to wp_set_unique_slug_on_create_template_part().
Follow-up to [52062].

See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51895 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-02 00:01:00 +00:00
audrasjb
38e19413f6 Docs: Miscellaneous Docblock corrections in several /block-supports files.
See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51894 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-01 23:16:04 +00:00
audrasjb
931b03e4f9 Docs: Misc Docblock corrections in duotone.php file.
Follow-up to [50929].

See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51893 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-01 14:07:59 +00:00
John Blackbourn
614b866cb0 Plugins: Correct the documented allowable types for to the $callback parameter of various hook related functions.
These functions don't require the callback to be a valid callable, therefore `array` and `string` are also valid types for this parameter.

Props malthert

Fixes #54440

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


git-svn-id: http://core.svn.wordpress.org/trunk@51892 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-01 13:22:01 +00:00
John Blackbourn
9a982b4ae8 Docs: Various docblock corrections.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51891 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-01 12:17:00 +00:00
audrasjb
15d7d368f3 Docs: Docblock corrections in _disable_block_editor_for_navigation_post_type().
Follow-up to [52145].

See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51890 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-01 11:41:59 +00:00
Sergey Biryukov
980ea5611a Docs: Use a duplicate hook reference for theme_file_path in WP_Theme::get_file_path().
Follow-up to [38578], [52279].

See #51506, #53399.
Built from https://develop.svn.wordpress.org/trunk@52297


git-svn-id: http://core.svn.wordpress.org/trunk@51889 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-01 09:20:04 +00:00
Sergey Biryukov
71f33ed63f Post WordPress 5.9 Beta 1 version bump.
Built from https://develop.svn.wordpress.org/trunk@52296


git-svn-id: http://core.svn.wordpress.org/trunk@51888 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 23:34:01 +00:00
Sergey Biryukov
0cb7d322c7 WordPress 5.9 Beta 1.
Built from https://develop.svn.wordpress.org/trunk@52295


git-svn-id: http://core.svn.wordpress.org/trunk@51887 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 21:36:02 +00:00
Sergey Biryukov
566d5d2170 Options, Meta APIs: Improve error handling in sanitize_option().
To prevent potential false negatives, set `$error` to `null` initially, so we can better tell if it was ever changed during the sanitization and be able to better react if an empty string is added to it.

Additionally, and mainly for the sake of the Settings API at this point, add error messages to some `WP_Error` objects returned from `wpdb` methods that were previously causing the issues here.

Follow-up to [32791].

Props iCaleb, audrasjb, hellofromTonya, SergeyBiryukov.
Fixes #53986.
Built from https://develop.svn.wordpress.org/trunk@52294


git-svn-id: http://core.svn.wordpress.org/trunk@51886 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 21:03:00 +00:00
hellofromTonya
2b2313d56b Editor: Hide visibility and status settings for wp_navigation post type.
Adds CSS to hide both the visibility and status settings for the `wp_navigation` post type.

Props antonvlasenko , costdev. 
Fixes #54407.
Built from https://develop.svn.wordpress.org/trunk@52293


git-svn-id: http://core.svn.wordpress.org/trunk@51885 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 21:01:02 +00:00
hellofromTonya
9ede1fe55b Formatting: Handle non-scalar types passed to sanitize_key().
`sanitize_key()` expects a string type for the given `key`. Passing any other data type to `strtolower()` can result in `E_WARNING: strtolower() expects parameter 1 to be string, array given`.

A check is added that if the key is not a string, the key is set to an empty string. For performance, the additional string processing is skipped if the key is an empty string.

This change maintains backwards-compatibility for valid string keys while fixing the bug of non-string keys.

Props costdev, dd32. 
Fixes #54160.
Built from https://develop.svn.wordpress.org/trunk@52292


git-svn-id: http://core.svn.wordpress.org/trunk@51884 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 20:11:02 +00:00
audrasjb
25b3d172b7 Editor: Avoid a JS console error on the Navigation block view.
Props mkaz, sabernhardt, costdev.
Fixes #54456.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 20:02:01 +00:00
hellofromTonya
68537a8eed Twenty Fourteen: Adjust capability queries when using version before WordPress 5.9-alpha.
As capability queries was introduced in 5.9, this commit allows for previous versions by assigning the "who" and unsetting "capability". 

Follow-up to [51943].

Props johnbillion, swissspidy.
Fixes #16841.
Built from https://develop.svn.wordpress.org/trunk@52290


git-svn-id: http://core.svn.wordpress.org/trunk@51882 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 19:25:01 +00:00
Sergey Biryukov
576116927b Upgrade/Install: Make some adjustments to the move_dir() function:
* Check for direct PHP flle access and only use `rename()` if true.
* Check whether the destination directory was successfully created.
* Clear the working directory so there is internal parity within the function between the results of a successful `rename()` and a fallback to `copy_dir()`.
* Use `move_dir()` in `WP_Upgrader::move_to_temp_backup_dir()` and `::restore_temp_backup()`.

Follow-up to [51815], [51898], [51899], [51902], [52192], [52284].

Props afragen, peterwilsoncc, dd32, SergeyBiryukov.
See #54166, #51857.
Built from https://develop.svn.wordpress.org/trunk@52289


git-svn-id: http://core.svn.wordpress.org/trunk@51881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 19:12:00 +00:00
hellofromTonya
308f814105 Media: Use infiniteScrolling global setting in js/media/controllers/featured-image.js and js/media/controllers/replace-image.js.
Follow-up to [52287] which added an undefined variable. The variable should have been the global `wp.media.view.settings.infiniteScrolling`. This commit brings that global setting into each of the functions and renames the variable using camelCase to comply with JS coding standards.

Follow-up to [52287].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51880 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 19:07:00 +00:00
hellofromTonya
be55859f78 Media: Featured image modal loads only selected image when infinite scroll is disabled.
Follow-up to [52167], which partially fixed a bug introduced in [50829] that caused media modal to only load the selected image.

This commit adds additional checks to ensure infinite scroll is disabled.

Follow-up to [50829], [52167].

Props dariak, joedolson, szaqal21. 
Fixes #53765.
Built from https://develop.svn.wordpress.org/trunk@52287


git-svn-id: http://core.svn.wordpress.org/trunk@51879 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 18:08:01 +00:00
spacedmonkey
13c5637263 Site Editor: Add site export REST API endpoint.
Add a REST API to export site templates and template part as html files. When the REST API is requested, it responds by downloading a single ZIP file and exits early, without completing full request.  To create the exported zip, the ZipArchive class is required. If this class is not present then the export will gracefully fail, returning a `WP_Error` object and 500 status error code. 

Props spacedmonkey, youknowriad, Mamaduka, walbo, peterwilsoncc. 
Fixes #54448 .


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


git-svn-id: http://core.svn.wordpress.org/trunk@51878 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 17:32:02 +00:00
hellofromTonya
5c414db9ad External Libraries: Further fix jQuery deprecations in WordPress core.
Follow-up to [50001], [50270], [50367], [50383], [50410], [50420], [50429], [50547].

Props chaion07, Clorith, costdev, desrosj, malthert, peterwilsoncc, presskopp, promz, sabernhardt, SergeyBiryukov, toro_unit, wpnomad.
Fixes #51519.
Built from https://develop.svn.wordpress.org/trunk@52285


git-svn-id: http://core.svn.wordpress.org/trunk@51877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 17:18:01 +00:00
Sergey Biryukov
5e35ad4b4a Upgrade/Install: Check that WordPress is installed before scheduling cleanup of the temp-backup directory.
Trying to schedule cron jobs before WordPress is installed results in DB errors, which is suboptimal.

This addresses a  `Table 'wp_options' doesn't exist` error when running the installation with `WP_DEBUG` enabled.

Follow-up to [51815], [51898], [51899], [51902], [52192].

Props dlh, pbiron.
See #51857.
Built from https://develop.svn.wordpress.org/trunk@52284


git-svn-id: http://core.svn.wordpress.org/trunk@51876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 17:12:01 +00:00
jffng
2caa789ee0 Twenty Twenty-Two: Sync updates from GitHub.
This commit syncs minor changes for the default theme from its active development repository to core. 

This is a follow up to [52081], [52107], [52164], and [52222]. It includes changes to template part markup, theme.json appearance flags, navigation block markup, and text domains. For a full set of changes, visit 742df6cb2b...1a121e0224.

Props poena, kjellr, onemaggie, hellofromtonya.
See #54318.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51875 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 16:19:00 +00:00
audrasjb
b22dfaf657 Tests: Update WP_REST_Global_Styles_Controller_Test "Custom Styles" string after [52280].
Follow-up to [52280].

See #54518.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51874 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 15:55:59 +00:00
hellofromTonya
14f6cf230b REST API: Replace hardcoded wp/v2/ preloaded paths with rest_get_route_for_taxonomy_items() and rest_get_route_for_post_type_items() in wp-admin/site-editor.php.
[51962] and [51964] introduced two new functions: `rest_get_route_for_post_type_items()` and `rest_get_route_for_taxonomy_items()`. These functions replaced hardcoded references in all parts of core that reference taxonomy and post type rest controller endpoints. However, several instances were missed in the `wp-admin/site-editor.php` file.

This commit replaces those remaining hardcoded instances.

Follow-up to [51962], [51964], [52232].

Props spacedmonkey.
Fixes #54536.
Built from https://develop.svn.wordpress.org/trunk@52281


git-svn-id: http://core.svn.wordpress.org/trunk@51873 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 15:54:03 +00:00
audrasjb
4212bcfe36 Editor: Do not translate the title of "Custom Styles" specific posts.
This change removes the internationalization of the "Custom Styles" specific posts as the post title being hardcoded is consistent with `wp_template_part` and `wp_template` post types, and is not publicly visible, except in the database. Moreover, using consistent "Custom Styles" post title may make is easier to retrieve the related posts in the database.

Props antonvlasenko, audrasjb, desrosj, hellofromTonya.
Fixes #54518.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51872 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 15:35:01 +00:00
hellofromTonya
ce3aed3186 Administration: For block themes, link to Site Editor interface instead of Customizer in Dashboard's welcome panel and Themes interface.
For block themes (like Twenty Twenty-Two), Customizer menu item is removed and replaced with the Site Editor menu item. However, other links exist in the Dashboard's welcome panel "Customize Your Site" button and the "Customize" button in each theme listed in the Appearance > Themes interface.

This commit changes each of those remaining links to link to the Site Editor interface instead of the Customizer.

To help identify block vs non-block themes, two method methods are introduced in `WP_Theme`:

* `WP_Theme:: is_block_based()` which identifies if the theme is a block theme or not.
* `WP_Theme::get_file_path()` which is similar to `get_theme_file_path()` but uses the directories within the theme object.

Both of these new methods include test coverage including the addition of a parent and child block theme in test data.

Follow-up to [18749], [35483], [42013], [42169].

Props antonvlasenko, jameskoster, hellofromTonya, matveb, noisysocks, poena, sergeybiryukov.
Fixes #54460.
Built from https://develop.svn.wordpress.org/trunk@52279


git-svn-id: http://core.svn.wordpress.org/trunk@51871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 14:27:03 +00:00
Sergey Biryukov
9c9c576d88 I18N: Remove redundant default text domain parameter in some __() calls.
Follow-up to [51160], [52069].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@52278


git-svn-id: http://core.svn.wordpress.org/trunk@51870 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 08:33:05 +00:00
noisysocks
dc3ffcbde3 Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- Include cascading properties in Navigation deprecation
- Reorganize e2e tests folders and file
- Border panel: Update to display multiple palette origins
- Add CSS fix for 33580
- Add: Uneditable duotone palette on the palette gradient panel
- Site Editor: Allow editing custom template title
- Writing Flow: Double escape unselects all blocks
- Fix icon scaling.
- [Block Library - Query Pagination Next/Previous]: Remove text and link color support
- Add: Border indication to global styles colors.
- Color Picker: Improve border, padding, and box shadow styles.
- theme.json: sort keys alphabetically
- Remove navigationArea context.

See #54487.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51869 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 05:48:28 +00:00
Peter Wilson
43290b2e04 REST API: Fire wp_after_insert_post later in new post object endpoints.
In the new menu items, global items and template controllers manually call the function `wp_after_insert_post()` to manually fire the action of the same name after all potential data is updated.

This accounts for the use case in which a theme or plugin developer has modified the endpoints use of either taxonomy or meta data.

The new parameter `$fire_after_hooks` is added to `wp_update_nav_menu_item()` to control whether the `wp_after_insert_post` action is fired when it in turn calls `wp_insert_post()`.

Props spacedmonkey, peterwilsoncc, zieladam.
Fixes #54536.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 01:10:08 +00:00
noisysocks
e4b553a201 Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- Update Pattern block category and add documentation
- Fix non existent menu handling in nav block
- Make Reusable blocks available in the Site Editor
- Add caching to WP_Theme_JSON_Resolver_Gutenberg::get_user_data_from_custom_post_type()
- theme.json: add appearanceTools flag to opt-in into appearance UI controls
- Update the block theme folders to templates and parts
- Remove reference to gutenberg_, swap with wp_
- Use table layout in templates list screen
- Update featured image placeholder graphic.
- [Inserter]: Adjust order of theme blocks and reorder inserter items
- Implement suitable fallback for Nav block on front end of site when no menu selected
- Toggle Group Control: add tooltip
- Use first non-empty Nav post as primary fallback for Nav block
- Change .nvmrc and documentation for Node.js version (LTS to 14.18.1)
- Update: Migrate global styles user database data on the rest endpoint
- Update global styles public API
- Update: Rename user preset origin to custom
- Try always generating navigation post title
- Show all templates and template parts on the site editor list screens
- Highlight "Site" in the navigation panel
- Fix template part slug generation when creating through the block placeholder
- [Block Library - Post Title]: Fix render error when setting Page to homepage
- Add 'Clear customizations' button to template list page
- Gallery v1: Allow clicks within replace media placeholder state
- Site Editor: Set the <title> on the list page to be same as the CPT name
- Gallery: Fix stuck image size options loader
- Cover: Fix undo trap
- Add success and error snackbars to the templates list page
- Fix: theme colors cannot override defaults
- Fix: Color palette is not being stored
- Add elements support to the typography panel in global styles
- Make links plural in global styles
- Add: Gradient palette editor
- Update some small style regressions in the template list
- Add: Transparency support on global styles colors
- Fix: apply by slug on all origins
- Render empty Nav block if no fallback block can be utilised
- Allow filtering of Nav block fallback
- Fix Nav block fallback DB query to match on full block grammar start tag
- Remove unstable max pages attribute from Nav block
- DateTimePicker: set PM hours correctly
- Update delete template button
- Site Editor: Template list add rename action
- Fix Nav block editing wrong entity on creation of new Menu
- [REST] Restore the missing double slash in the ID received by /templates
- Add icons to navigation sidebar items
- Update function names for the public global styles API functions
- Templates Controller: Add missing 'is_custom' prop
- Rename gutenberg_ to wp_ for some functions that land in WordPress 5.9
- [Block Library - Template Part]:Remove support for conversion to Reusable block
- Global Styles: Call "palettes" and not "color palettes" on panel label
- Add button text when no colors found
- Update: Global Styes: Count all color palette origins on the palette counter
- Rename navigationMenuId to ref
- Offset the parent iframe when computing Popover position 
- Fix: Failing PHPUnit test
- Show theme, plugin or author in Added By column with appropriate icon or avatar
- Add origin and author to template rest api

See #54487.
Props talldanwp, mamaduka, oandregal.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-30 00:24:27 +00:00
Peter Wilson
8294b090fb Build/Test Tools: Revert ignore prop change in [52272].
See #54506.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51866 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-29 23:45:03 +00:00
noisysocks
57aee3ba4d Restore block PHP to canonical version in @wordpress/block-library
r52272 erroneously modified `src/wp-includes/blocks/navigation.php`. This file
is copied from `@wordpress/block-library` and so must be updated via npm. This
commit restores the file by running `grunt build --dev`.

Follows [52272].
See #54506.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51865 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-29 23:31:05 +00:00
spacedmonkey
ebf7eb50dc Editor: Remove Navigation Areas
Navigation area were merged as part of full site editing and the new navigation block. This functionality is experimental and not currently used in WordPress core, so should be removed.

Props noisysocks, spacedmonkey, get_dave, zieladam.
Fixes #54506.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51864 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-29 22:06:01 +00:00
audrasjb
31a76e520b Twenty Twenty: Restore Editor post title styles after Gutenberg 11.4.0 updates.
This change restores the Editor post title alignement and font styles in Twenty Twenty after Gutenberg 11.4.0 updates on the editor markup.

Props shireling, mai21, hilayt24, desrosj, sabernhardt.
Fixes #54056.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51863 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-29 22:03:59 +00:00
hellofromTonya
9cc22d060f Media: Replace tests/phpunit/data/images/sugar-mountain.jpg test image.
The test image included in [52269] was invalid at 0 bytes. This commit adds the correct test image.

Follow-up [52269].

See #54385.
Built from https://develop.svn.wordpress.org/trunk@52270


git-svn-id: http://core.svn.wordpress.org/trunk@51862 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-29 20:18:00 +00:00
hellofromTonya
677e6e5b13 Media: Fix TypeError and improve wp_exif_frac2dec() to only return int or float.
For certain images, `wp_exif_frac2dec()` unexpectedly returned a string instead of `int` or `float`. This can occur when an image is missing meta and calls the function with `'0/0'`. For those images, a fatal error was thrown on PHP 8.0+:

{{{
TypeError: round(): Argument #1 ($num) must be of type int|float, string given
}}}

Upon deeper review, inconsistent and unexpected results were returned from different types of input values passed to the function.

Changes are:

* Maintains backwards-compatibility for valid input values.
* Fixes handling of invalid input values by bailing out to return the documented type of `int|float` by returning `0`.
* Improves the fractional conditional check.
* Improves the calculated fraction handling to ensure (a) the numerator and denominator are both numeric and (b) the denominator is not equal to zero.
* Safeguards the behavior via tests for all possible ways code could flow through the function.
* Safeguards the backwards-compatibility of the `wp_read_image_metadata()` by adding some defensive coding around the calls to the `wp_exif_frac2dec()` function.

These changes fix the fatal error and make the function more secure, stable, and predictable while maintaining backwards-compatibility for valid input values.

Follow-up to [6313], [9119], [22319], [28367], [45611], [47287].

Props adamsilverstein, jrf, peterwilsoncc, praem90, stevegs, tobiasbg.
Fixes #54385.
Built from https://develop.svn.wordpress.org/trunk@52269


git-svn-id: http://core.svn.wordpress.org/trunk@51861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-29 19:36:05 +00:00
spacedmonkey
2f6cf4ba81 REST API: Ensure that the rest_after_insert_ action is executed in the templates controller.
Fire the that dynamic action `rest_after_insert_{$this->post_type}` in templates controller, as this action is fired in other post based REST API controllers. 

Props spacedmonkey, peterwilsoncc, zieladam.
Fixes #54520.
Built from https://develop.svn.wordpress.org/trunk@52268


git-svn-id: http://core.svn.wordpress.org/trunk@51860 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-29 11:43:01 +00:00
audrasjb
0ca6469410 Feeds: Remove reference to wp-atom.php in Atom feeds xml:base attribute.
This change removes the optional `xml:base` attribute for Atom based feeds as `wp-atom.php` file was removed in [18540] (WordPress 3.3).

Follow-up to [18540].

Props tw2113, audrasjb, mukesh27.
Fixes #47955.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-29 09:52:00 +00:00
Sergey Biryukov
79884a72d4 Tests: Replace assertEquals() with assertSame() in block template tests.
This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using `assertSame()`, `assertSameSets()`, or `assertSameSetsWithIndex()` should generally be preferred, to make the tests more reliable.

Follow-up to [51003], [51079], [52062], [52265].

See #53364, #53363, #54335.
Built from https://develop.svn.wordpress.org/trunk@52266


git-svn-id: http://core.svn.wordpress.org/trunk@51858 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-29 08:47:05 +00:00
Sergey Biryukov
595b629f08 Tests: Rename classes in block template tests per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [51003], as a continuation of the previous changes in ​[47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491], [51492], [51493], [51623], [51639], [51646], [51650], [51651], [51860], [52264].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@52265


git-svn-id: http://core.svn.wordpress.org/trunk@51857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-29 03:23:03 +00:00
Sergey Biryukov
ee2423c236 Tests: Rename classes in phpunit/tests/block-supports/ per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [52069], as a continuation of the previous changes in ​[47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491], [51492], [51493], [51623], [51639], [51646], [51650], [51651], [51860].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@52264


git-svn-id: http://core.svn.wordpress.org/trunk@51856 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-29 03:12:02 +00:00
audrasjb
c9527eea2e Media: Ensure media preview is fully viewable in the "Add Media" modal.
This change ensures the media preview is not cut off in the "Add Media" modal box, when using the "Insert from URL" feature.

Props siliconforks, sabernhardt, mukesh27, ankit-k-gupta.
Fixes #53636.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-28 23:11:02 +00:00
audrasjb
dc853cb0e9 Script Loader: Enqueue block stylesheet only when the corresponding block is used.
Before this change, block stylesheets were enqueued although the corresponding blocks were not used in the current post, even if the `should_load_separate_core_block_assets` filter was set to `true`.

Props shimotomoki, devutpol, audrasjb.
Fixes #54457.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51854 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-28 21:12:06 +00:00
audrasjb
74d251884f Editor: Ensure block style name does not contain spaces before creating the class.
This change adds a check to ensure there is no spaces in block style variation names before generating the class. Returns `false` and a `_doing_it_wrong()` message if a space is detected.

Props amustaque97, costdev, hellofromtonya, pbiron, SergeyBiryukov, afragen.
Fixes #54296.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-28 13:53:00 +00:00
Sergey Biryukov
7290503480 Tests: Temporarily disable the check that the current recommended PHP version is actively supported.
As PHP 7.4 moved from active support to security support until 28 Nov 2022, and no discussions or decisions have been made yet on bumping the recommended version to PHP 8.0, this commit disables the failing assertion for now.

This should be revisited once WordPress achieves PHP 8.0 compatibility and the recommended PHP version in `readme.html` can be bumped, or another decision is made about this.

Follow-up to [26166], [33937], [33944], [33946], [35172], [39582], [39583], [40241], [46682], [46996], [46998].

Props costdev, audrasjb.
Fixes #54528.
Built from https://develop.svn.wordpress.org/trunk@52260


git-svn-id: http://core.svn.wordpress.org/trunk@51852 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-28 10:35:59 +00:00
Sergey Biryukov
5107bba1af Tests: Use a simpler approach to test the output in some tests.
Instead of ignoring the output and catching it later with `getActualOutput()`, we can use `expectOutputRegex()` directly, which evaluates the output after the rest of the test code has run, if no unexpected errors were encountered.

Follow-up to [52173], [52253].

Props jrf.
See #53635, #53363.
Built from https://develop.svn.wordpress.org/trunk@52259


git-svn-id: http://core.svn.wordpress.org/trunk@51851 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-27 16:18:00 +00:00
audrasjb
1f9eee5410 Taxonomy: Check $term object before using it in get_term_feed_link().
This change performs the type safety check on `$term` before it is used to retrieve the taxonomy in `get_term_feed_link()`. It also updates the related DocBlock after [52255].

Follow up to [52255].

Props dlh.
Fixes #50225.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51850 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-27 15:23:59 +00:00
Sergey Biryukov
7cbc31f7c0 Docs: Remove inaccurate part of the screen_settings filter description.
The filter is called for all admin screens, not just the Widgets screen.

Follow-up to [27256].

Props Starbuck.
Fixes #54524.
Built from https://develop.svn.wordpress.org/trunk@52257


git-svn-id: http://core.svn.wordpress.org/trunk@51849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-27 02:07:00 +00:00
audrasjb
da49813106 Media: Allow setting custom image alt text in custom header image.
This change applies the alternative text assigned to the custom header image, if available. Otherwise, it leaves it empty. It fixes an issue where the alternative text was always the site title, which is not relevant in most use cases.

Props webmandesign, mukesh27, afercia, anevins, mikeschroder, nrqsnchz, audrasjb, sabernhardt, joedolson, Boniu91.
Fixes #46124.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51848 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-26 22:56:02 +00:00
audrasjb
edd2ca2b6b Taxonomy: Use WP_Term object to retrieve the taxonomy in get_term_feed_link().
This change fixes a backward compatibility issue introduced in [52180] where `get_term_feed_link()` did not honor the `$taxonomy` parameter anymore. Rather than using the default `category` taxonomy when passing a term ID in `get_term_feed_link()`, use the `WP_Term` object to get the taxonomy.

Follow-up to [52180].

Props hugod.
Fixes #50225.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51847 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-26 11:43:03 +00:00
Sergey Biryukov
70f43f261b External Libraries: Update getID3 to version 1.9.21.
The latest version includes preliminary PHP 8.1 support, as well as a variety of bug fixes.

Release notes: https://github.com/JamesHeinrich/getID3/releases/tag/v1.9.21

A full list of changes in this update can be found on GitHub:
https://github.com/JamesHeinrich/getID3/compare/v1.9.20...v1.9.21

This commit also includes:
* Setting the `$options_audiovideo_quicktime_ReturnAtomData` property (now `false` by default) to `true` in `wp_read_video_metadata()` and `wp_read_audio_metadata()` in order to get the `created_timestamp` value.
* PHPCS adjustments previously made for a passing PHP Compatibility scan.

Follow-up to [47601], [47737], [47902], [48278], [49621], [50714].

Props jrf, SergeyBiryukov.
Fixes #54162.
Built from https://develop.svn.wordpress.org/trunk@52254


git-svn-id: http://core.svn.wordpress.org/trunk@51846 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-26 03:06:03 +00:00
Sergey Biryukov
904c4a8b5c Tests: Remove unexpected output in wp_dashboard_recent_drafts() tests on PHP 8.1.
This follows the approach used in other tests to let PHPUnit manage the output catching and effectively ignore the output until retrieving it later via `getActualOutput()`.

Follow-up to [45505], [51968], [52173].

See #53635, #53363.
Built from https://develop.svn.wordpress.org/trunk@52253


git-svn-id: http://core.svn.wordpress.org/trunk@51845 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-26 01:29:04 +00:00
Sergey Biryukov
1cca88b19b External Libraries: Upgrade PHPMailer to version 6.5.3.
The latest release includes official PHP 8.1 support, as well as some small bug fixes, including one for PHP 5.6 cross-version support.

Release notes:
* https://github.com/PHPMailer/PHPMailer/releases/tag/v6.5.2
* https://github.com/PHPMailer/PHPMailer/releases/tag/v6.5.3

For a full list of changes in this update, see the PHPMailer GitHub:
https://github.com/PHPMailer/PHPMailer/compare/v6.5.1...v6.5.3

Follow-up to [50628], [50799], [51169], [51634], [51635].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51844 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-26 00:43:01 +00:00
Sergey Biryukov
fe2a2ef0e4 Docs: Improve consistency of some DocBlocks in wp-admin/includes/post.php.
Follow-up to [52249].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@52251


git-svn-id: http://core.svn.wordpress.org/trunk@51843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-26 00:28:03 +00:00
audrasjb
0c54c14a37 Twenty Twenty One: Remove Image block placeholder alignment override in editor styles.
This changes excludes the Image block placeholder from the default image centering in Twenty Twenty-One editor styles.

Props multidots1896, sabernhardt, Boniu91, justinahinon.
Fixes #54254.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51842 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-25 22:31:04 +00:00
audrasjb
b0743f17e1 Docs: Miscellaneous DocBlock corrections in wp-admin/includes/post.php.
See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51841 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-25 20:39:00 +00:00
John Blackbourn
7494eb1e5c Build/Test Tools: Correct the order and naming of expected and actual values in various tests.
This corrects the order of the parameters when used in assertions so if/when they fail the failure message is correct.

See #53363

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


git-svn-id: http://core.svn.wordpress.org/trunk@51840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-25 19:41:04 +00:00
youknowriad
5d73860e5c Themes: Update the base folders for templates and template parts in block themes.
Block Themes should now use the following folders:

 - templates instead of block-templates
 - parts instead of block-template-parts

Existing themes and folders will continue to work without impact.

Props bernhard-reiter.
Fixes #54493.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-25 10:59:04 +00:00
youknowriad
322b60f600 Themes: Add block template resolution algorithm unit tests.
Backports the unit tests for block templates
and hybrid themes template resolution from the Gutenberg plugin.

Props bernhard-reiter, jorgefilipecosta.
Fixes #54478. 

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


git-svn-id: http://core.svn.wordpress.org/trunk@51838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-25 09:22:00 +00:00
audrasjb
f69b6a04fb Media: Replace some array keys with their numeric equivalent.
This change replaces `['0']` with `[0]` which brings better consistency, readability and performance.

Props chintan1896, adamsilverstein, costdev.
Fixes #53540.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51837 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-25 08:35:09 +00:00
Sergey Biryukov
95f823d933 External Libraries: Update the 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

Follow-up to [50842], [51078].

Props jrf, schlessera, datagutten, wojsmol, dd32, dustinrue, soulseekah, costdev, szepeviktor.
Fixes #54504.
Built from https://develop.svn.wordpress.org/trunk@52244


git-svn-id: http://core.svn.wordpress.org/trunk@51836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-25 01:12:02 +00:00
noisysocks
67e0125bc2 Themes: Move the skip link to outside the canvas in block themes
Fix Twenty Twenty-one having an erroneous margin above the Header template part
by moving the skip link outside of the wp-site-blocks canvas.

This is a backport of https://github.com/WordPress/gutenberg/pull/34986.

Props youknowriad.
Fixes #54491.




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


git-svn-id: http://core.svn.wordpress.org/trunk@51835 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-25 01:07:01 +00:00
Sergey Biryukov
dfdbbb4e62 Docs: Miscellaneous DocBlock corrections.
See #53399.
Built from https://develop.svn.wordpress.org/trunk@52242


git-svn-id: http://core.svn.wordpress.org/trunk@51834 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-24 23:59:59 +00:00
desrosj
91c7a9ba2a Build/Test Tools: Configure Dependabot scanning for GitHub Actions.
This eliminates the need to manually check all GitHub Actions used within workflow files for updates.

Fixes #54503.
Built from https://develop.svn.wordpress.org/trunk@52241


git-svn-id: http://core.svn.wordpress.org/trunk@51833 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-24 14:51:00 +00:00
desrosj
63a5bda86a Build/Test Tools: Specify NodeJS version 14.x in the .nvmrc file.
As of 2021-10-26, the LTS version of NodeJS is now `16.x`.

This pins the `14.x` version in the `.nvmrc` file to ensure contributors are able to contribute without issue until compatibility with version `16.x` can be confirmed in both `trunk` and the Gutenberg repository on GitHub.

Fixes #54502.
Built from https://develop.svn.wordpress.org/trunk@52240


git-svn-id: http://core.svn.wordpress.org/trunk@51832 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-24 14:07:01 +00:00
audrasjb
c66d278da5 Docs: Document the globals used in some Privacy API methods.
See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51831 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-24 11:41:03 +00:00
Peter Wilson
d8bbb335cb Twenty Twenty-One: Combine duplicate CSS rules.
Use the postcss-merge-rules package when building TT1 stylesheets to reduce duplicate code in production CSS.

Props SergeyBiryukov, ryelle, Shaharyar10, shital-patel, mukesh27, poena.
Fixes #53605.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-24 03:35:03 +00:00
audrasjb
a930237618 Twenty Twenty-One: Style adjustments for list-based widgets in the widget editor.
This change brings style consistency between front-end and widget editor for list-based widgets.

Props circlecube, Rahmohn.
Fixes #53629.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-23 23:25:02 +00:00
John Blackbourn
92f0b0cb48 Docs: Various docblock corrections and improvements.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-23 21:37:01 +00:00
hellofromTonya
d472b34c89 Build/Test Tools: Fix warnings from stdClass::__invoke() callback mocks in REST API tests.
When running core tests on PHPUnit 8.x and 9.x, four non-blocking warnings were displayed for the REST API tests:

{{{
There were 4 warnings:

1) Tests_REST_Request::test_route_level_validate_callback
createPartialMock called with method(s) __invoke that do not exist in stdClass. This will not be allowed in future versions of PHPUnit.

2) Tests_REST_Request::test_route_level_validate_callback_no_parameter_callbacks
createPartialMock called with method(s) __invoke that do not exist in stdClass. This will not be allowed in future versions of PHPUnit.

3) Tests_REST_Request::test_route_level_validate_callback_is_not_executed_if_parameter_validation_fails
createPartialMock called with method(s) __invoke that do not exist in stdClass. This will not be allowed in future versions of PHPUnit.

4) Tests_REST_Server::test_callbacks_are_not_executed_if_request_validation_fails
createPartialMock called with method(s) __invoke that do not exist in stdClass. This will not be allowed in future versions of PHPUnit.
}}}

These warnings are due to the PHP native `stdClass` not having a `__invoke()` method declared.

This commit adds a `Mock_Invokable` reusable class and replaces the `stdClass` with this new class.

Follow-up to [48945], [48947].

Props sourovroy, jrf.
Fixes #53844.
Built from https://develop.svn.wordpress.org/trunk@52235


git-svn-id: http://core.svn.wordpress.org/trunk@51827 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-23 18:57:00 +00:00
Sergey Biryukov
86cd872c29 Docs: Add a @since note and description to wp_kses_attr() for new attribute-related KSES options:
* Support for an array of allowed values for attributes.
* Support for required attributes.

Follow-up to [51963].

See #54261.
Built from https://develop.svn.wordpress.org/trunk@52234


git-svn-id: http://core.svn.wordpress.org/trunk@51826 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-23 18:39:00 +00:00
John Blackbourn
f02e2e6265 Build/Test Tools: Lower the timeout for GitHub Actions jobs so runaway or stalled processes don't risk running for the default timeout duration of six hours.
See #53363

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


git-svn-id: http://core.svn.wordpress.org/trunk@51825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-23 17:41:03 +00:00
noisysocks
121c824ccd Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- FSE: Add welcome guide
- Update theme styles for the code block
- Add feature flag to toggle the new site editor sidebar
- Add templates list page for site editor
- Cover Block: Fix default background dim
- E2E: Add more Cover block tests
- Cover Block: Fix regressions
- Post Comments Form: ensure typography styles are applied to child elements
- Navigation: Fix space-between
- Fix background colours in nested submenus.
- Fix duplicate custom classnames in navigation submenu block
- Fix colour rendering in Navigation overlay
- Fix: Add ability to opt out of Core color palette V2
- Change @package to WordPress in block-library
- Make the core color palette opt-in for themes with not theme.json
- Remove textdomain from calendar block
- Page List block: fix space before href attribute
- Try: Let Featured Image block inherit dimensions, look like a placeholder
- [Global Styles]: Add block icon next to blocks list
- Page List: Use core entities instead of direct apiFetch
- Site Editor: Stabilize export endpoint
- Fix mobile horizontal scrollbar.
- Multi-entity save: Only set site entity to pending if really saving
- Add page list to navigation direct insert conditions
- Implement "Add New" for templates list in Site Editor
- Post Featured Image: Remove withNotices HOC
- Fix page list missing button styles when set to open on click.
- Make appender fixed position to avoid jumps in the UI
- Color UI component: reorder palettes and update names (core by defaults, user by custom)
- Remove the Styles link in Site Editor
- GlobalStyles sidebar: do not show default palette if theme opts-out
- Only render the site editor canvas when the global styles are ready.
- Global Styles: rename core origin key to default for presets
- Clarify i18n context for PostTemplateActions's "New" label
- Revert erroneous native editor package version bumps
- Try: Hide the columns inserter in pattern previews.
- Fix site editor region navigation
- Update navigation sidebar responsiveness
- Add _wp_array_set and _wp_to_kebab_case to 5.8 compat
- Make user able to change all color palette origins
- Site Editor: Update hrefs to not specifically refer to themes.php?page=gutenberg-edit-site
- Site Editor: Validate the postType query argument
- Navigation: Scale submenu icon.
- Move the theme editor under tools for FSE themes
- Deprecate navigation areas

See #54487.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-23 05:40:38 +00:00
Sergey Biryukov
d2c41142ed Editor: Check the correct post type support property for initial_edits.
The property to check should be `editor` instead of `content`, as posts don't have a `content` support property.

This addresses an e2e test failure in Gutenberg.

Follow-up to [52230].

Props talldanwp.
See #53813.
Built from https://develop.svn.wordpress.org/trunk@52231


git-svn-id: http://core.svn.wordpress.org/trunk@51823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-22 08:42:03 +00:00
audrasjb
9ee35e14c2 Editor: Do not provide initial_edits for properties that are not supported by the current post type.
Previously, the block editor initialization always provided "title", "content" and "excerpt" initial edits in the `initializeEditor` call even though these properties might not be supported by the current post type being edited. This leads to a bug in the post editor where as soon as one would open a "new post", the editor considers the content "dirty", meaning changes are applied and it is not possible to leave the editor without encountering an "unsaved changes" notice.

This change updates the `$initial_edits` variable declaration to only provide the properties that are supported by the current post type.

Props youknowriad, h71.
Fixes #53813.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51822 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-21 19:28:03 +00:00
Sergey Biryukov
1d1581b660 KSES: Use correct global in wp_kses_xml_named_entities().
This fixes a discrepancy where the the global name used in the function did not match the one declared at the beginning of `kses.php`, and ensures that the function gets the correct array of allowed XML entity names.

Includes unit tests.

Follow-up to [48072].

Props ovidiul, costdev, peterwilsoncc, SergeyBiryukov.
Fixes #54060.
Built from https://develop.svn.wordpress.org/trunk@52229


git-svn-id: http://core.svn.wordpress.org/trunk@51821 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-21 17:17:02 +00:00
Sergey Biryukov
c9ecd13aca Coding Standards: Wrap some long lines in js/_enqueues/admin/post.js per the JS coding standards for better readability.
See #53359.
Built from https://develop.svn.wordpress.org/trunk@52228


git-svn-id: http://core.svn.wordpress.org/trunk@51820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-20 02:49:58 +00:00
Sergey Biryukov
742cd201e6 Docs: Update documentation for the $plugin_data parameter of various hooks:
* Document the structure of the `$plugin_data` array passed to the `plugin_row_meta` filter.
* Document some missing values returned by `get_plugin_data()`:
 * `PluginURI`
 * `AuthorName`
* Link to `get_plugin_data()` and the `plugin_row_meta` filter as the canonical sources in other various filters and actions which receive the `$plugin_data` parameter:
 * `network_admin_plugin_action_links`
 * `network_admin_plugin_action_links_{$plugin_file}`
 * `plugin_action_links`
 * `plugin_action_links_{$plugin_file}`
 * `plugin_auto_update_setting_html`
 * `manage_plugins_custom_column`
 * `after_plugin_row`
 * `after_plugin_row_{$plugin_file}`
 * `in_plugin_update_message-{$file}`
* Update documentation for the `$response` parameter of the `in_plugin_update_message-{$file}` filter:
 * Correct type for the `id` value. It contains a string like `w.org/plugins/[plugin-name]`, not a numeric ID.
 * Update `$icons`, `$banners`, and `$banners_rtl` values to use typed array notation.

Follow-up to [8367], [8402], [12976], [16758], [26540], [30544], [34818], [51733], [52212], [52224].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@52227


git-svn-id: http://core.svn.wordpress.org/trunk@51819 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-20 02:23:02 +00:00
John Blackbourn
fa62df0774 Query: Correct and standardise the meta query documentation.
Also improves the formatting of some surrounding documentation.

Props audrasjb, johnbillion

Fixes #53467

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


git-svn-id: http://core.svn.wordpress.org/trunk@51818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-20 00:07:59 +00:00
audrasjb
1bd5af61d2 Editor: Add missing label to new-post-slug input on Classic Editor.
Previously, the input for changing the permalink of a post does not have a label in the Classic Editor. This change adds a visually hidden label. It also makes sure browsers do not run spellcheck on the input field.

Props sabernhardt.
Fixes #53725.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51817 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 22:55:59 +00:00
Sergey Biryukov
966c7376b4 Docs: Restore [51733], accidentally reverted in [52212].
Document some more `$response` values in the `in_plugin_update_message-{$file}` filter:
* `banners_rtl`
* `requires_php`

Follow-up to [51733], [52212].

Fixes #40006.
Built from https://develop.svn.wordpress.org/trunk@52224


git-svn-id: http://core.svn.wordpress.org/trunk@51816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 22:16:58 +00:00
hellofromTonya
30c9e4338d Comments: Fix PHP Notice "trying to get property of non-object" in comments_open() and pings_open().
The post for the comments or pings is retrieved by `get_post()`. If the post exists, `get_post()` returns an instance of `WP_Post`; else, it returns `null`.

In both `comments_open()` and `pings_open()`, the returned value from `get_post()` is used without checking if the object returned, if the post exists. When the post does not exist, the following notices occur:

{{{
PHP Notice:  Trying to get property 'comment_status' of non-object in .../src/wp-includes/comment-template.php on line 1244
}}}

and

{{{
PHP Notice:  Trying to get property 'pings_open' of non-object in ../src/wp-includes/comment-template.php on line 1274
}}}

This commit fixes these notices by checking if the post has a non-falsey value before using it as an object to set the `$open` state. As the return from `get_post()` will only be an object or `null`, the truthy check is appropriate and slightly more performant.

Tests added to validate the fix.

Follow-up to [1964], [40666].

Props dd32, audrasjb, costdev, hellofromTonya, sergeybiryukov.
Fixes #54159.
Built from https://develop.svn.wordpress.org/trunk@52223


git-svn-id: http://core.svn.wordpress.org/trunk@51815 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 20:24:00 +00:00
jffng
6ebd3a8fc9 Twenty Twenty-Two: Sync updates from GitHub.
This commit syncs several changes for the default theme from its active development repository to core. 

This is a follow up to [52081], [52107], and [52164]. It includes improvements to the home page template, adding a filter for block patterns, pre-loading the web font, improvements and bug fixes to block patterns, and more. For a full list of changes, visit e4f69d0b7e...25d74deaa5.

Props jeffpaul, richtabor, netweb, luminuu, melchoyce, beafealho, clucasrowlands, desrosj, flixos90, joen, otto42, saju4wordpress, westonruter, kjellr, poena.
See #54318.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51814 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 20:13:59 +00:00
desrosj
07bf9f55e2 Bundled Themes: Update the “Tested up to” header to 5.9.
This updates the “Tested up to” header in the `readme.txt` file for all bundled theme.

This also adds the “Tested up to” header to the `style.css` file for older default themes (Twenty Twenty and earlier). Previously, this header was only recommended, so it was not included. It is now required, per the theme handbook: https://make.wordpress.org/themes/handbook/review/required/#9-files.

Props kafleg, mukesh27, ravipatel.
Fixes #53797.
Built from https://develop.svn.wordpress.org/trunk@52221


git-svn-id: http://core.svn.wordpress.org/trunk@51813 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 19:34:00 +00:00
desrosj
47dc41cc05 Build/Test Tools: Add the ruleset file to the cache key for PHPCS and PHP compatibility scans.
This ensures that the cache is busted properly when the ruleset is adjusted but the `composer.json` file is not.

See #54425.
Built from https://develop.svn.wordpress.org/trunk@52220


git-svn-id: http://core.svn.wordpress.org/trunk@51812 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 19:23:00 +00:00
desrosj
ab2dcd8303 Docs: Improve the documentation for registering block patterns and block pattern categories.
This expands the `@param` tag for the property argument available for the `register()` method in `WP_Block_Patterns_Registry` and `WP_Block_Pattern_Cattegories_Registry`.

See #53399.
Built from https://develop.svn.wordpress.org/trunk@52219


git-svn-id: http://core.svn.wordpress.org/trunk@51811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 19:05:59 +00:00
hellofromTonya
807cba060e WPDB: Call wp_load_translations_early() in wpdb::query() and wpdb::process_fields().
For consistency and simplification, replaces the `function_exists( '__' )` checks with `wp_load_translations_early()` to make sure i18n functions are available. This change removes the extra code introduced in [52176] for using non-translated error messages when `__()` is not available.

Improves the plural versions of the error messages.

For performance, when there are more than one problem field, uses `reset()` to populate the field in the error message.

Follow-up to [52176], [52195].

Props sergeybiryukov, hellofromTonya.
Fixes #32315.
Built from https://develop.svn.wordpress.org/trunk@52218


git-svn-id: http://core.svn.wordpress.org/trunk@51810 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 19:00:00 +00:00
audrasjb
dc1136b94e Twenty Twenty-One: Prevent notice thrown in twenty_twenty_one_get_attachment_image_attributes().
Calling `twenty_twenty_one_get_attachment_image_attributes()` was causing an `Undefined index: width|height` notice to be thrown when the result from `wp_get_attachment_metadata()` does not set any value to `$meta`. This change adds an `isset()` check to prevent it.

Props wetah, hasanuzzamanshamim.
Fixes #54464.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 17:56:00 +00:00
desrosj
fac3744387 Script Loader: Document path as an accepted value for $key in wp_style_add_data().
Follow up to [50836].

Props tmatsuur.
Fixes #53792.
Built from https://develop.svn.wordpress.org/trunk@52216


git-svn-id: http://core.svn.wordpress.org/trunk@51808 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 15:14:00 +00:00
desrosj
9d86fba4db Docs: Remove instances of the “eg.” abbreviation in favor of “example” or “for example”.
See #53330.
Built from https://develop.svn.wordpress.org/trunk@52215


git-svn-id: http://core.svn.wordpress.org/trunk@51807 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 14:44:01 +00:00
desrosj
b0b9e23c70 Upgrade/Install: Improve the accuracy of the auto_update_{$type} filter docblock.
This updates the filter documentation for `auto_update_{$type}` to account for the changes to default auto-update behaviors made in WordPress 5.6.

Starting in WordPress 5.6, all new installs auto-update major versions by default.

Props felipeloureirosantos, audrasjb, marybaum, davidbaumwald.
Fixes #53330.
Built from https://develop.svn.wordpress.org/trunk@52214


git-svn-id: http://core.svn.wordpress.org/trunk@51806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 14:19:59 +00:00
audrasjb
096e903010 Twenty Twenty-One: Check if anchor exists before triggering in-page navigation.
This prevents JavaScript errors when using hash in URLs without matching them to any existing anchor in the page.

Props rixeo, sabernhardt, pbearne.
Fixes #53619.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51805 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-19 13:03:01 +00:00
audrasjb
9f91a2a245 Docs: Add missing parameters in in_plugin_update_message-{$file} filter.
Follow-up to [51733].

Props costdev, audrasjb, SergeyBiryukov.
Fixes #40006.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-18 23:19:08 +00:00
desrosj
03a901192a Twenty Twenty-One: Correct description of Dark Mode in the Customizer.
The Dark Mode toggle can appear in both bottom corners. This removes “right” from the description to be accurate for both RTL and LTR languages.

Props musabshakeel, dilipbheda, sabernhardt.
Fixes #53892.
Built from https://develop.svn.wordpress.org/trunk@52211


git-svn-id: http://core.svn.wordpress.org/trunk@51803 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-18 20:43:00 +00:00
desrosj
74d4822bf5 Twenty Sixteen: Correctly align columns within table blocks as configured in the editor.
Previously, all columns were forced to be aligned left, and aligned right for RTL languages.

Props robertghetau, umesh84, sabernhardt.
Fixes 54317.
Built from https://develop.svn.wordpress.org/trunk@52210


git-svn-id: http://core.svn.wordpress.org/trunk@51802 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-18 20:22:01 +00:00
davidbaumwald
b0c805d644 Toolbar: Refine "Edit site" link.php.
The 'Edit site' link was added to core in [52158], but did not include an icon and was hidden for smaller screen sizes.  This change adds the "Appearance" icon to the link and hides the link text when necessary on smaller screen sizes.

Props sabernhardt, desrosj, shaunandrews.
Fixes #54441.
Built from https://develop.svn.wordpress.org/trunk@52209


git-svn-id: http://core.svn.wordpress.org/trunk@51801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-18 16:48:01 +00:00
audrasjb
1a02e65df9 Docs: Add missing null allowed type for the $id parameter of wp_set_current_user().
Props andy-schmidt.
See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51800 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-18 16:04:00 +00:00
audrasjb
4b322d9de3 Posts, Post Types: Multisite: Decrement post_count option value when a post is deleted.
Previously, the `post_count` option value was not decremented when a post was deleted.

This change moves the `_update_posts_count_on_delete` action from `delete_post` hook to `after_delete_post` to ensure the deletion is taken into account.

Props henry.wright, pbearne, audrasjb.
Fixes #53443.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51799 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-18 15:11:59 +00:00
Sergey Biryukov
173a9cb89a Database: Check if the $args[0] value exists in wpdb::prepare() before accessing it.
This avoids an `Undefined array key 0` PHP warning if no values are passed to the method besides the query string.

Follow-up to [41470].

Props mjaschen.
Fixes #54453.
Built from https://develop.svn.wordpress.org/trunk@52206


git-svn-id: http://core.svn.wordpress.org/trunk@51798 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-18 14:37:01 +00:00
John Blackbourn
40626108d0 Docs: Corrections relating to types used in inline documentation for comment ID and site ID proprties.
Includes a correction for a typo introduced in [52204].

See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51797 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-18 13:57:01 +00:00
John Blackbourn
c9746ab584 Docs: Various corrections and improvements relating to types used in inline documentation.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51796 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-18 13:50:05 +00:00
audrasjb
b3b8d6959c Upgrade/Install: Add timezone info to last checked update time.
The time displayed on the Updates screen matches the server time which may not be the timezone the person viewing the page is in. This change includes the timezone information with the time.

Props mkaz.
Fixes #53554.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51795 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-18 09:25:03 +00:00
audrasjb
03b59ce449 Posts, Post Types: Increment post_count option value only on multisite installations.
Avoid the `post_count` option to be created on single-site installations.

Follow-up to [52201].

Props dlh, henry.wright.
Fixes #54462.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51794 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-18 00:20:59 +00:00
audrasjb
cbac37d16d Posts, Post Types: Increment post_count option value during blog creation.
Previously, the `post_count` option value was not incremented when the default "Hello world!" post is inserted during blog creation on a multisite installation.

Props henry.wright.
Fixes #54462.
See #53443.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51793 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-17 23:08:03 +00:00
joedolson
387f4467a4 Comments: Change new comment required text class.
Change the new class on comment required text from `comment-required-message` to `required-field-message` for better future-compatibility, enabling better reuse.

Props sabernhardt.
Fixes #16206.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-17 18:38:02 +00:00
hellofromTonya
d4b3deddda Upgrade/Install: Remove 5.8 function and fix deactivate Gutenberg plugin version compare < 11.9.
Follow-up to [52165] where the `version_compare()` fails for 11.8.x versions. This commit changes the version comparison to < 11.9 for deactivating the Gutenberg plugin. 

The `_upgrade_580_force_deactivate_incompatible_plugins()` function is no longer needed in 5.9. It's redundant and unnecessary as `_upgrade_590_force_deactivate_incompatible_plugins()` deactivates those versions as well.

Removing `_upgrade_580_force_deactivate_incompatible_plugins()` and moving the deactivation logic back into the `_deactivate_gutenberg_when_incompatible_with_wp()`, thus removing the new private function `_deactivate_gutenberg_when_incompatible_with_wp()` introduced in [52165].

Follow-up [51180], [51266], [52165].

Props hellofromTonya, tobiasbg, clorith, sergeybiryukov, costdev.
Fixes #54405. 
Built from https://develop.svn.wordpress.org/trunk@52199


git-svn-id: http://core.svn.wordpress.org/trunk@51791 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-17 17:45:00 +00:00
joedolson
bba44bf5e5 Toolbar: Prevent adminbar from hiding in-page anchors.
Use scroll-padding-top to offset scroll position on in-page anchors when adminbar is active. Also adjusts existing scroll padding for core themes that implement it.

Props afercia, kingkero, audrasjb, dufresnesteven, thimalw, sabernhardt, costdev.
Fixes #46371.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-17 17:20:00 +00:00
audrasjb
1589bba4f5 Upgrade/Install: Differentiate en_US version strings from localized ones.
Adds a condition to `$version_string` to determine whether the Core update is the original en_US package, or a localized one.

This change fixes an issue where these packages were not differentiated and duplicate messages were displayed.

Props Presskopp, benjamingosset.
Fixes #53710.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51789 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-17 16:24:00 +00:00
joedolson
74395140ad Media: Move dismiss upload errors button after errors.
Change the button that dismissess upload errors so it appears after the relevant errors. Change button from icon-only to text-based. Removes ambiguity about what you are cancelling when using the control.

Props ComputerGuru, melchoyce, vdwijngaert, alexislloyd, joedolson, shaunandrews, sabernhardt.
Fixes #42979.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51788 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-17 15:56:03 +00:00
Sergey Biryukov
5e48f0c591 WPDB: Call wp_load_translations_early() in wpdb::_real_escape().
This follows the pattern used in other `wpdb` methods to make sure the i18n functions are available.

Follow-up to [29840].

Props nacin, johnbillion.
See #32315.
Built from https://develop.svn.wordpress.org/trunk@52195


git-svn-id: http://core.svn.wordpress.org/trunk@51787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-17 04:05:02 +00:00
Peter Wilson
ab78f7561a Posts, Post Types: Use global post as the default for wp_get_post_parent_id().
Convert the `$post` parameter of `wp_get_post_parent_id()` to optional, defaulting to the current global post object when called within the loop.

Props danielpost, davidbaumwald, SergeyBiryukov, birgire, audrasjb, hellofromTonya, TimothyBlynJacobs.
Fixes #48358.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51786 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-17 03:25:06 +00:00
audrasjb
0a8b1555b8 Login and Registration: auto-focus the reset password field.
Although auto-focusing form fields can be arguable in some cases, it makes sense when there is a very specific task to accomplish and when there is no relevant content before the auto-focused field.

This change brings consistency between various forms generated by `wp-login.php`.

Props afercia, donmhico, sabernhardt.
Fixes #40302.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-17 00:14:01 +00:00
Sergey Biryukov
8a5e1aa0b3 Upgrade/Install: Correct the weekly cron event for clearing the temp-backup directory:
* Make sure the `wp_delete_temp_updater_backups` event has an action associated with it when it runs.
* Check if the cron event already exists before scheduling it, to avoid scheduling duplicate events. 
* Move the code for clearing the `temp-backup` directory to a standalone function.

Follow-up to [51815], [51898], [51899].

Props pbiron, johnbillion.
See #51857.
Built from https://develop.svn.wordpress.org/trunk@52192


git-svn-id: http://core.svn.wordpress.org/trunk@51784 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 22:19:59 +00:00
audrasjb
a9da3e2474 Twenty Twenty-One: Remove RSS feed widget icon link.
Use the `rss_widget_feed_link` filter to disable the output of the icon on RSS feed widgets in Twenty Twenty-One. Improves accessibility by preventing invisible links.

Props sabernhardt, poena.
Fixes #52880.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 21:48:05 +00:00
hellofromTonya
4586cfe5a0 Media: Add support for v1 and v2 gallery block in get_post_galleries().
The `get_post_galleries()` function only handled galleries from the `[gallery]` shortcode. It did not process gallery blocks.

Introducing v1 and v2 gallery block support in `get_post_galleries()` including support for innerblock nesting.

There are no changes to how the function is called. It detects if the post content has one or more gallery blocks. If detected, it parses the blocks and then processes to add each gallery block's HTML to the array of galleries before being passed through the filter and returned.

Includes integration tests.

Follow-up to [24682], [43309], [48262], [52042].

Props glendaviesnz, costdev, antpb, audrasjb, birgire, celloexpressions, desrosj, hellofromTonya, jeffpaul, lynk, pento, ramonopoly, russhylov, takahashi_fumiki, tellyworth.
Fixes #43826.
Built from https://develop.svn.wordpress.org/trunk@52190


git-svn-id: http://core.svn.wordpress.org/trunk@51782 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 21:25:03 +00:00
Adam Silverstein
09b9af2c76 Media: improve error message for failed image uploads.
Clarify error language and change the maximum suggested size to match the large image threshold.

Props zodiac1978, SergeyBiryukov, antpb, webcommsat, hellofromTonya. 
Fixes 53985.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51781 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 20:01:00 +00:00
hellofromTonya
8d5af49e49 Formatting: Add additional support for single and nestable tags in force_balance_tags().
Adds `track` and `wbr` support for single tags.

Adds `article`, `aside`, `details`, `figure`, and `section` for nestable tags.

Updates tests.

Follow-up to [5805], [21828], [45929].

Props glendaviesnz, costdev, talldanwp, ramonopoly, sergeybiryukov.
Fixes #50225.
Built from https://develop.svn.wordpress.org/trunk@52188


git-svn-id: http://core.svn.wordpress.org/trunk@51780 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 19:42:01 +00:00
hellofromTonya
ec522e3f98 HTTP API: Remove empty ? when only anchor remains in add_query_arg().
If after processing through `add_query_arg()` a `?#` remains, this commit removes the unnecessary and unused `?` character as there are no query args in the URL.

Includes tests.

Follow-up to [1823], [5193], [5999], [6005].

Props benjaminanakenam, sabernhardt, costdev, hellofromTonya.
Fixes #44499.
Built from https://develop.svn.wordpress.org/trunk@52187


git-svn-id: http://core.svn.wordpress.org/trunk@51779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 18:50:00 +00:00
spacedmonkey
33499dc6d8 REST API: Make the templates controller follow core REST patterns.
The templates controller now respects the `_fields` parameter and filters the response accordingly. The schema has been updated to include all the fields returned. The `content.block_version` field has been added. The controller now returns WP_Error objects for improved error handling.

Add new unit tests.

Props TimothyBlynJacobs, hellofromtonya, zieladam.
Fixes #54422.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51778 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 18:06:00 +00:00
ryelle
4a18ff86c9 Themes: Force a scrollbar on the Themes page to prevent visual shake on hover.
On some browser & window size combinations (near where a scrollbar would appear), hovering over the theme card causes a layout shift. This makes the screen visually "jump" as the scrollbar appears and disappears. By forcing the scrollbar to be visible on this page, hovering doesn't cause the layout shift anymore.

Props wparslan, sabernhardt, costdev, audrasjb.
Fixes #53478.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 17:18:00 +00:00
spacedmonkey
b9ee5a4b29 REST API: Remove experimental block menu item types.
The menu items REST API controller was added in [52079]. This included functionality to add a "block" menu item type. This functionality is experimental and not currently used in WordPress core, so should be removed. 

Props noisysocks.
See #40878.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 17:09:00 +00:00
desrosj
1966c81a18 Build/Test Tools: Update all 3rd party GitHub actions to the latest versions.
See #53363.
Built from https://develop.svn.wordpress.org/trunk@52183


git-svn-id: http://core.svn.wordpress.org/trunk@51775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 16:10:04 +00:00
desrosj
a2323a0c63 Twenty Nineteen: Apply coding standards fix from running composer format.
Follow up to [52149].

See #54392.
Built from https://develop.svn.wordpress.org/trunk@52182


git-svn-id: http://core.svn.wordpress.org/trunk@51774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 15:03:00 +00:00
desrosj
533afcd3b9 Themes: Check both parent and child themes for a theme.json file.
This updates `WP_Theme_JSON_Resolver::theme_has_support()` to properly check for a `theme.json` file in both parent and child themes when determining whether a theme supports block templates.

Follow up to [52077].

Props Mamaduka.
Fixes #54401.
Built from https://develop.svn.wordpress.org/trunk@52181


git-svn-id: http://core.svn.wordpress.org/trunk@51773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 14:58:59 +00:00
hellofromTonya
c5518c2f11 Taxonomy: Allow get_*_*_link() and edit_term_link() functions to accept a term ID, WP_Term, or term object.
`get_term()` accepts a term ID, instance of `WP_Term`, or an object (i.e. `stdClass` as a result of a db query). Functions that use `get_term()` also now allow for the same data types.

Why? For consistency, removing extra processing code in consuming functions, and performance.

Functions changed in this commit are:
* `get_category_feed_link()`
* `get_term_feed_link()`
* `get_tag_feed_link()`
* `get_edit_tag_link()`
* `get_edit_term_link()`
* `edit_term_link()`

For each of consumer of these functions, changes to pass the object instead of the term ID.

Includes unit/integration tests for test coverage of these changes.

Follow-up to [6365], [9136], [9340], [14711], [15792], [15800], [18827], [32606], [36646], [37252].

Props davidbinda, johnbillion, peterwilsoncc, hellofromTonya, sergeybiryukov, mista-flo, hareesh-pillai, audrasjb, jeffpaul, chaion07.
Fixes #50225.
Built from https://develop.svn.wordpress.org/trunk@52180


git-svn-id: http://core.svn.wordpress.org/trunk@51772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 14:57:02 +00:00
desrosj
873c2deba4 Build/Test Tools: Cache the results of PHP_CodeSniffer across workflow runs.
When the `PHP_CodeSniffer` runs, it produces a cache file. When a cache file is present, only changed files are rescanned, making subsequent scans significantly faster.

This adds the needed steps to the corresponding GitHub Actions workflows to cache these files across runs. The cache keys include the date of the previous Monday to ensure that the cache is flushed at least weekly.

Since GitHub Action caches cannot be updated once created, the scans will take slightly longer as the week progresses and more PHP files are updated. The date within the cache key can be updated to purge twice weekly if the scan time starts to approach the current scan times.

This change also introduces a `.cache` directory for all caching files related to build/test tools.

Props johnbillion, jrf.
Fixes #49783.
Built from https://develop.svn.wordpress.org/trunk@52179


git-svn-id: http://core.svn.wordpress.org/trunk@51771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 14:19:05 +00:00
hellofromTonya
9cf709d6b6 Administration: Restores "Customize" menu item for non-block themes and moves for block themes.
For themes without non-block themes (i.e. without a `/block-templates/index.html` file), restores the "Customize" menu item under "Appearance" menu to its original location of `6`.

For block themes, moves it to position `8`, as "Styles" is in position `7` as of [52158].

Follow-up to [29026], [52069], [52158].

Props poena, davidbaumwald, sabernhardt, hellofromTonya.
Fixes #54418.
Built from https://develop.svn.wordpress.org/trunk@52178


git-svn-id: http://core.svn.wordpress.org/trunk@51770 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 04:45:00 +00:00
hellofromTonya
3f7dbfd6a9 Widgets: Wraps long widget titles in classic Widgets screen.
Follow-up to [18577], [26426].

Props afercia, bravokeyl, drewapicture, gkloveweb, hitendra-chopda, hellofromTonya, ianhayes94, ovann86, pankajmohale, poena, sabrib, swissspidy, xkon.
Fixes #37451.
Built from https://develop.svn.wordpress.org/trunk@52177


git-svn-id: http://core.svn.wordpress.org/trunk@51769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 03:17:58 +00:00
hellofromTonya
7a4c5007b6 WPDB: Capture error in wpdb::$last_error when insert fails instead of silently failing for invalid data or value too long.
Instead of silently failing when attempting to insert a value into a field, this commit saves the error in the `wpdb::$last_error` property.

Sets `last_error` with an error message if:
* `wpdb::query()` fails for invalid data
* `wpdb::process_fields()` fails to process the value(s) for the field(s) where the value could be too long or contain invalid data

Sets `last_query` if `wpdb::query()` fails for invalid data.

If `__()` is not available, uses non-translated error message to ensure the error is captured.

There is no change to wpdb aborting when an error occurs.

Adds tests.

Props dlt101, mnelson4, dd32, pento, hellofromTonya, davidbaumwald, sergeybiryukov, johnbillion, swissspidy, datainterlock, anandau14, anthonyeden, asif2bd, audrasjb, chaion07, dpegasusm, fpcsjames, galbaras, jdgrimes, justindocanto, kwisatz, liammitchell, lucasw89, lukecarbis, nettsite, nlpro, procodewp, psufan, richardfoley, skunkbad, travisnorthcutt, woodyhayday, zoiec.
Fixes #37267.
Built from https://develop.svn.wordpress.org/trunk@52176


git-svn-id: http://core.svn.wordpress.org/trunk@51768 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 02:59:00 +00:00
hellofromTonya
df540dbd95 Comments: Don't output "cancel comment reply link" if comments aren't threaded.
Though hidden via `style="display:none;"`, if the comments aren't threaded, this commit doesn't output the cancel comment reply link (skips over that logic). Change in `comment_form()`.

Adds tests.

Follow-up to [12810], [38959].

Props henrywright, jigneshnakrani, rachelbaker, desrosj, audrasjb, hellofromTonya.
Fixes #37267.
Built from https://develop.svn.wordpress.org/trunk@52175


git-svn-id: http://core.svn.wordpress.org/trunk@51767 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 02:14:59 +00:00
hellofromTonya
a393ec95a5 Login and Registration: Wrap long usernames in login error message.
Adds `word-wrap: break-word` to wrap long usernames in the login's error message. Using `word-wrap` instead of `word-break` for better cross-browser support and to avoid the deprecation (see Ref below).

For consistency, also changes `#backtoblog`.

Ref:
* `word-break: break-word` deprecation https://developer.mozilla.org/en-US/docs/Web/CSS/word-break#syntax

Follow-up to [51108].

Props soniakash, audrasjb, sabernhardt, hellofromTonya, desrosj, ocean90.
Fixes #37617.
Built from https://develop.svn.wordpress.org/trunk@52174


git-svn-id: http://core.svn.wordpress.org/trunk@51766 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 01:56:58 +00:00
hellofromTonya
df4834caea Widgets: Use isset() in WP_Widget:: display_callback() to support ArrayIterator and ArrayObject.
[33696] introduced support returning `ArrayIterator` and `ArrayObject` objects from `WP_Widget::get_settings()`. 

Per the PHP manual, `array_key_exists()` stopped supporting this in PHP 8.0.0 and deprecated in PHP 7.4.0.

>For backward compatibility reasons, array_key_exists() will also return true if key is a property defined within an object given as array. This behaviour is deprecated as of PHP 7.4.0, and removed as of PHP 8.0.0.

This commit uses `isset()` instead of `array_key_exists()` which is supported on all current versions of PHP.

Includes unit tests.

Ref:
* https://www.php.net/manual/en/function.array-key-exists.php#refsect1-function.array-key-exists-notes

Follow-up to [32602], [33696].

Props dlh, hellofromTonya, jrf, sergeybiryukov.
Fixes #52728.
Built from https://develop.svn.wordpress.org/trunk@52173


git-svn-id: http://core.svn.wordpress.org/trunk@51765 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 01:43:00 +00:00
joedolson
9cb60e437f Coding Standards: Revert accidental image changes in [52171].
Reverts images changed in [52171].

Follow up to [52171].

See #54168.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51764 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-16 00:04:01 +00:00
joedolson
3b1d5aec7c Media: Revert media uploader input change in [52059].
Based on follow-up research, this change was never necessary in order to use e2e tests in the media library uploader. Additionally, it created several complicated side effects. Without significant benefit, it's not valuable to pursue the change further.

Follow up to [52059].

See #54168, #54411.
Fixes #54168.
Built from https://develop.svn.wordpress.org/trunk@52171


git-svn-id: http://core.svn.wordpress.org/trunk@51763 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 23:22:02 +00:00
joedolson
dbc8d76a9f Taxonomy: Display update notices when adding terms.
Display notice and announce to screen readers when a new term is added. 

Props manishamakhija, birgire, dilipbheda, afercia, hellofromTonya.
Fixes #42937.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 22:24:01 +00:00
joedolson
06e7a012b1 Commit Standards: Revert [52168] to correct commit message.
Used incorrect commit message..

Follow up to [52168].

See #42937.
Built from https://develop.svn.wordpress.org/trunk@52169


git-svn-id: http://core.svn.wordpress.org/trunk@51761 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 22:18:00 +00:00
joedolson
b07f107447 Media: Featured image modal loads only selected image.
Fix bug introduced in [50829] that caused media modal to only load the selected image. Executes `.more()` when loading the modal to ensure that the media collection is available.

Props manishamakhija, birgire, dilipbheda, afercia, hellofromTonya.
Fixes #42937.
Built from https://develop.svn.wordpress.org/trunk@52168


git-svn-id: http://core.svn.wordpress.org/trunk@51760 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 21:55:00 +00:00
joedolson
20fdff756b Media: Featured image modal loads only selected image.
Fix bug introduced in [50829] that caused media modal to only load the selected image. Executes `.more()` when loading the modal to ensure that the media collection is available.

Props benitolopez, hellofromTonya, peterwilsoncc, danielbachhuber, PieWP, sabernhardt, szaqal21.
Fixes #53765.
Built from https://develop.svn.wordpress.org/trunk@52167


git-svn-id: http://core.svn.wordpress.org/trunk@51759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 21:37:03 +00:00
joedolson
6912dc20b9 Menus: Add audible notice on menu item add or remove.
Call `wp.a11y.speak()` to add audible notification when a menu item is added or removed from a menu.

Props joedolson, costdev, hellofromTonya.
Fixes #53840.
Built from https://develop.svn.wordpress.org/trunk@52166


git-svn-id: http://core.svn.wordpress.org/trunk@51758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 20:00:59 +00:00
hellofromTonya
1f608d5d5c Upgrade/Install: Deactivate the Gutenberg plugin if its version is 11.8 or lower.
Avoid a fatal error due to `WP_Theme_JSON_Schema` and potentially other classes and/or functions redeclarations when updating to WordPress 5.9 with an incompatible version of the Gutenberg plugin.

This commit uses the same strategy from 5.8. Moves the plugin deactivation code (introduced in [51266]) to a private function for reuse in 5.8, 5.9, and future major releases.

Follow-up to [51180], [51266].

Props hellofromTonya, johnbillion, jorbin.
See #54405.
Built from https://develop.svn.wordpress.org/trunk@52165


git-svn-id: http://core.svn.wordpress.org/trunk@51757 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 19:59:03 +00:00
jffng
9043992e3b Twenty Twenty-Two: Import the latest changes from GitHub.
Updates `theme.json` to use v2 shape, adds styles to search and file block as well as generic text decoration. Fixes a bug in the layout of a query block pattern.

This is a follow-up to [52081]. These changes are ongoing and development continues on GitHub. To view all of the changes included in this commit, see GitHub: 99db6063be...a11fb4932a

Props desrosj, kjellr, poena.
See #54318.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51756 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 19:15:04 +00:00
Sergey Biryukov
9ac09f5a67 Taxonomy: Clarify the taxonomy labels for customizing the field descriptions on Edit Tags screen:
* Update the label names to make it clear that these descriptions are not for the term name or slug itself, but for the Name, Slug, Parent, and Description fields:
 * `name_field_description`
 * `slug_field_description`
 * `parent_field_description`
 * `desc_field_description`
* Update the array structure to make it clear that the default values for these labels are the same for both hierarchical and non-hierarchical taxonomies, with the exception of `parent_field_description`.
* Add documentation and a `@since` note for the new labels.

Follow-up to [52094].

Fixes #43060.
Built from https://develop.svn.wordpress.org/trunk@52163


git-svn-id: http://core.svn.wordpress.org/trunk@51755 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 16:45:01 +00:00
desrosj
230fa090e8 External Libraries: Update the regenerator-runtime package to version 0.13.9.
Props hareesh-pillai, sourovroy, hellofromTonya.
Fixes #54027.
Built from https://develop.svn.wordpress.org/trunk@52162


git-svn-id: http://core.svn.wordpress.org/trunk@51754 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 16:35:13 +00:00
noisysocks
c2d0fb2040 Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- Navigation: Fix click-button size, submenu directions, scrollbars.
- Group - Fix overzealous regex when restoring inner containers
- Babel Preset: Update Babel packages to 7.16 version
- theme.json: adds a setting property that enables some other ones
- Polish metabox container.
- Fix submenu justification and spacer orientation.
- Fix Gutenberg 11.8.2 in WordPress trunk
- Strip meta tags from pasted links in Chromium
- Hide visilibility and status for navigation posts
- Navigation: Refactor and simplify setup state.
- Nav block menu switcher - decode HTML entities and utilise accessible markup pattern
- Rename fse_navigation_area to wp_navigation_area
- theme.json: adds a setting property that enables some other ones
- Revert "theme.json: adds a setting property that enables some other ones"
- Skip flaky image block test
- WordPress/gutenberg@3c935c4
- React to any errors coming up in gutenberg_migrate_menu_to_navigation_post
- Return wp error from wp_insert_post
- Fix not transforming logical assignments for packages

See #54337.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 12:50:17 +00:00
noisysocks
5b85c73194 Editor: Load iframed assets in Site Editor
Configure the Site Editor to load iframed block editor assets. This fixes some
styling issues in the Site Editor.

Follows [52069].
See #54337.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51752 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 11:01:00 +00:00
noisysocks
892da9af91 Editor: Fix fatal call to add_query_args()
It should be add_query_arg(), not add_query_args().

Follows [52145].
See #54337.
Props sabernhardt.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51751 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 06:19:01 +00:00
noisysocks
40cd53a573 Editor: Fix how the Site Editor is linked to
- Add 'Edit site' to the top admin bar.
- Link to the Template and Template Part CPTs.
- Add deep link to the Global Styles UI.

Follows [52069].
See #54337.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51750 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 03:43:59 +00:00
TimothyBlynJacobs
b2253ef74c Users: Prevent infinite loop when using capability checks during determine_current_user on multisite.
On multisite, when checking if a user has a certain capability WordPress makes an additional check to see if the user is a super admin. The `is_super_admin()` function contained a call to `wp_get_current_user()` so as the global current user object could be used if it matched the queried user id.

This would cause an infinite loop if a hook attached to the `determine_current_user` filter was itself making a permission check. For example when limiting who can use the Application Passwords feature based on their capabilities.

Since [50790] the `WP_User` instance for the current user is shared between `wp_get_current_user()` and `get_userdata()`. This means we can remove the `wp_get_current_user` call from `is_super_admin()` while still retaining the same behavior.

Props chrisvanpatten, peterwilsoncc.
Fixes #53386.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51749 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 01:09:59 +00:00
noisysocks
0f18fb0bd8 Build/Test Tools: Restore the https URL for browserify-aes
Follows [52143].
See #54337.
Props TobiasBg.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51748 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 00:19:00 +00:00
noisysocks
2b4a846798 Editor: Fix incorrect access of ID field
Now that WP_Query is set to return 'ids', accessing $matching_posts[0]->ID is
incorrect.

Props spacedmonkey.
Follows [52145].
See #54337.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51747 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-15 00:11:59 +00:00
Sergey Biryukov
17ae1d0c7f Comments: Use get_comment_author() to retrieve the comment author name in get_comment_reply_link().
This ensures that the `get_comment_author` filter is applied to the comment author name as expected.

Follow-up to [29822], [47506].

Props mjulian7, audrasjb, chaion07, hellofromTonya, SergeyBiryukov.
Fixes #53678.
Built from https://develop.svn.wordpress.org/trunk@52154


git-svn-id: http://core.svn.wordpress.org/trunk@51746 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-14 18:01:04 +00:00
Weston Ruter
718adc4c9d Embeds: Fix parsing of post embeds in wp_filter_oembed_result() by appending wp-embed script instead of prepending it in get_post_embed_html().
Due to the way that the `blockquote` and `iframe` are being parsed with a regular expression in `wp_filter_oembed_result()`, if there is any content at all before the `blockquote` start tag then it will fail to be included in the first matching group. By appending the `wp-embed` script instead of prepending it in `get_post_embed_html()`, then the parsing issue is avoided.

Also use non-greedy match `wp_maybe_enqueue_oembed_host_js()`.

Amends [52132].
Fixes #44632.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51745 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-13 07:28:00 +00:00
Sergey Biryukov
654f9063cc Twenty Eleven: Improve comment form styling for required fields.
Previously, with absolute positioning, the star character to signify required comment form fields could overlap the text in some languages. The star's styling was also inconsistent between the input labels and the comment notes paragraph.

This commit makes the star's styling more consistent and ensures it does not overlap with the text.

Follow-up to [52029].

Props sabernhardt, hellofromTonya.
Fixes #54408.
Built from https://develop.svn.wordpress.org/trunk@52152


git-svn-id: http://core.svn.wordpress.org/trunk@51744 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-13 04:24:59 +00:00
Weston Ruter
b665eab47e Embeds: Fix inclusion of wp-embed-template script and style when SCRIPT_DEBUG is disabled.
Amends [52132].
See #44632.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-13 00:58:59 +00:00
Sergey Biryukov
ad3ad59c4d Coding Standards: Rename the $gzData argument to $gz_data in WP_Http_Encoding::compatible_gzinflate().
This fixes a `Variable "$gzData" is not in valid snake_case format` WPCS warning.

Follow-up to [11684].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@52150


git-svn-id: http://core.svn.wordpress.org/trunk@51742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-12 23:51:59 +00:00
joedolson
8b53b4960d Bundled Theme: Display required text field in core themes.
Fix Twenty Nineteen and Twenty Twenty-One setting the `logged_in_as` parameter to null, which also eliminated the required field text. See #16206.

Props sabernhardt, poena.
Fixes #54392.
Built from https://develop.svn.wordpress.org/trunk@52149


git-svn-id: http://core.svn.wordpress.org/trunk@51741 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-12 22:46:59 +00:00
desrosj
1d093f699c Build/Test Tools: Exclude plugins and non-bundled themes from PHP compatibility scans.
Fixes #54425.
Built from https://develop.svn.wordpress.org/trunk@52148


git-svn-id: http://core.svn.wordpress.org/trunk@51740 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-12 18:40:00 +00:00
Weston Ruter
719ec3ae6d Twenty Twenty-One: Prevent printing skip link focus fix when SCRIPT_DEBUG is enabled.
An `else` statement was missing in `twenty_twenty_one_skip_link_focus_fix()`. See ba83586ff1.

Fixes #54429.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51739 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-12 16:07:59 +00:00
hellofromTonya
41072d4e53 Build/Test Tools: Mock no results remote request in WP_REST_Block_Directory_Controller:: get_items().
* Refactors the mock logic to a helper function for reuse in multiple tests.
* Mocks the remote request in `WP_REST_Block_Directory_Controller_Test:: test_get_items_no_results()` using the mock helper.

Follow-up to [48242], [52137].

Props hellofromTonya, sergeybiryukov.
See #54420.
Built from https://develop.svn.wordpress.org/trunk@52146


git-svn-id: http://core.svn.wordpress.org/trunk@51738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-12 13:47:01 +00:00
noisysocks
93d4851bbf Editor: Add Navigation Area infrastructure
Copies Navigation Area infrastrucutre from lib/navigation.php in Gutenberg. This
allows a Navigation block to be associated with a particular area which persists
when switching theme.

Props antonvlasenko, mamaduka, spacedmonkey.
See #54337.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-12 03:55:01 +00:00
hellofromTonya
2128238311 Bootstrap/Load: Check $_SERVER['SCRIPT_NAME'] exists before passing to strpos() in wp_fix_server_vars().
If `SCRIPT_NAME'` does not exist (which can happen in cron jobs), the following happens:

* PHP 8.1+:
    * `Warning: Undefined array key "SCRIPT_NAME"`
    * `Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated` 
* PHP 8.0: `Warning: Undefined array key "SCRIPT_NAME"`
* PHP 5.6-7.4: No warning or notice

This commit checks if the key exists before passing it to `strpos()`. This resolves the warning, notice, and future error.

Follow-up to [3034], [3069], [12732].

Props audrasjb, costdev, hellofromTonya, karpstrucking, mcjambi, sergeybiryukov.
Fixes #54142.
Built from https://develop.svn.wordpress.org/trunk@52144


git-svn-id: http://core.svn.wordpress.org/trunk@51736 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-12 01:10:01 +00:00
noisysocks
33bb9d7c6b Update 'react' and 'react-dom'
Update 'react' and 'react-dom' packages to version 17.0.1. This is the version
expected by @wordpress components.

See #54337.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51735 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-12 00:05:15 +00:00
Sergey Biryukov
97f3ab0f2a Twenty Twenty-One: Correct default image alignment in the editor.
By default, the theme centers images on the front end when no alignment is selected. In the editor, however, images were aligned to the left side of the block.

This commit ensures that the alignment in the editor matches the one on the front end.

Props sabernhardt, ashfame, poena, annezazu.
Fixes #53809.
Built from https://develop.svn.wordpress.org/trunk@52142


git-svn-id: http://core.svn.wordpress.org/trunk@51734 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-11 19:35:00 +00:00
davidbaumwald
00403bc675 Posts, Post Types: Update _edit_last meta when posts are edited in bulk.
When posts are edited in bulk, the `_edit_last` meta was not updated for each post.  This change adds a call to update the `_edit_last` meta to the current user ID for each post the is updated.

Props calebwoodbridge, peterwilsoncc, guillaumeturpin, audrasjb.
Fixes #42446.
Built from https://develop.svn.wordpress.org/trunk@52141


git-svn-id: http://core.svn.wordpress.org/trunk@51733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-11 19:09:00 +00:00
davidbaumwald
841e45a864 Options, Meta APIs: Correct docs for $_meta_value parameter in xxx_{$meta_type}_meta hooks.
In `add_{$meta_type}_meta`, `added_{$meta_type}_meta`, `update_{$meta_type}_meta`, `updated_{$meta_type}_meta`, `delete_{$meta_type}_meta`, and `deleted_{$meta_type}_meta` hooks, the `$_meta_value` parameter was documented as "Serialized if non-scalar".  However, `$_meta_value` is a copy of the raw meta value before `maybe_serialize` is run and is not serialized.  This change updates each of the above hooks' docblocks to remove "Serialized if non-scalar" from the `$_meta_value` parameter description.

Props pputzer, hasanuzzamanshamim.
Fixes #53102.
Built from https://develop.svn.wordpress.org/trunk@52140


git-svn-id: http://core.svn.wordpress.org/trunk@51732 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-11 18:32:00 +00:00
joedolson
356fe8c2dd Upgrade/Install: Update screen reader text counts in adminbar.
Update the hidden screen-reader-text update count in the adminbar when updates are run on the plugin or theme screens.

Props pento, paulschreiber, adamsilverstein, afercia, SergeyBiryukov, sabernhardt.
Fixes #29022.
Built from https://develop.svn.wordpress.org/trunk@52139


git-svn-id: http://core.svn.wordpress.org/trunk@51731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-11 17:20:58 +00:00
hellofromTonya
2ff53354c1 Build/Test Tools: Mock remote request for unknown plugin in WP_REST_Plugins_Controller::create_item().
Instead of hitting the live API, this commit mocks the remote request when testing creating an item that's an unknown plugin.

Follow-up to [48242].

Props hellofromTonya, noisysocks, sergeybiryukov, TimothyBlynJacobs.
See #54420.
Built from https://develop.svn.wordpress.org/trunk@52138


git-svn-id: http://core.svn.wordpress.org/trunk@51730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-11 17:00:05 +00:00
hellofromTonya
b68878b83f Build/Test Tools: Mock remote request for WP_REST_Block_Directory_Controller::get_items().
Instead of hitting the live API, this commit mocks the remote request.

Follow-up to [48242].

Props hellofromTonya, noisysocks, sergeybiryukov, TimothyBlynJacobs.
Fixes #54420.
Built from https://develop.svn.wordpress.org/trunk@52137


git-svn-id: http://core.svn.wordpress.org/trunk@51729 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-11 16:53:59 +00:00
hellofromTonya
2ae0e77e47 Template: Fix "undefined index: 00" when archive month query is empty in wp_title().
When `m` query_tag has a valid year, i.e. `?m=2021`, and there are posts for that year, `substr()` returns a `false` on PHP 5.6 and an empty string on PHP 7.0+. Passing either of those values to `$wp_locale->get_month()` results in a PHP notice on PHP 5.6 to PHP 7.4 and a PHP Warning on PHP 8.0+.

Why? The `$month` lookup table has zeroized keys from '01' to '12'. A empty value is passed to `zeroise()` returns `'00'` which is directly passed as a key in the month property. That key does not exist.

While `$wp_locale->get_month()` would benefit from guarding/validation, this fix ensures a falsey value is not passed as a month.

Tests are added including a test that fails with this fix not applied.

Follow-up to [801], [35294], [35624].

Props antpb, audrasjb, costdev, davidmosterd, drewapicture, herregroen, hellofromTonya, michelwppi, sergeybiryukov.
Fixes #31521.
Built from https://develop.svn.wordpress.org/trunk@52136


git-svn-id: http://core.svn.wordpress.org/trunk@51728 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-11 16:29:00 +00:00
noisysocks
51d95be654 Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- Group - Fix inner container regexes using fixed div tag
- Image block: Make sure the Image block border radius is inherited if the image is linked
- Navigation: Small fixes
- FSE: Add template_type guards
- Template Part Block: Add some guards
- Fix getEntityRecords to ensure resolution on REST API failure
- Ensure menus before map operation in Nav block
- Link editing: Account for link anchor no longer being present when generating unique link instance key
- Navigation: Hide post attributes meta box
- Fix failing tests and compatibility with 5.9.
- Fix missing <MainDashboardButton> slot fill in site editor
- Move WP_REST_Block_Navigation_Areas_Controller from Gutenberg to Core.
- Fix site editor reset styles in WP 5.9

See #54337.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51727 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-11 07:43:31 +00:00
noisysocks
ad15f6422f Hide Customize from admin bar when using a block theme
Don't add the Customize link to the admin bar when a block theme is activated.

See #54337.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51726 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-11 04:47:02 +00:00
noisysocks
449f1bb07a REST API: Add /wp/v2/block-navigation-areas endpoint
Copies WP_REST_Block_Navigation_Areas_Controller from the Gutenberg plugin. This
provides the /wp/v2/block-navigation-areas endpoint used by the Navigation
block.

Props antonvlasenko, TimothyBlynJacobs.
Fixes #54393.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51725 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-11 03:52:00 +00:00
Weston Ruter
9038612705 Embeds: Conditionally enqueue wp-embed only if needed and send ready message in case script loads after post embed windows.
* Prevent loading `wp-embed` script unconditionally on every page in favor of conditionally enqueueing when a post embed is detected. The `wp-embed` script is also explicitly marked as being in the footer group. Sites which currently disable post embed scripts from being enqueued via `remove_action( 'wp_head', 'wp_oembed_add_host_js' )` will continue to do so.
* Send a `ready` message from the host page to each post embed window in case the `iframe` loads before the `wp-embed` script does. When the `ready` message is received by the post embed window, it sends the same `height` message as it sends when it loads.
* Eliminate use of `grunt-include` to inject emoji script and the post embed script. Instead obtain the script contents via `file_get_contents()` (as is done elsewhere in core) and utilize `wp_print_inline_script_tag()`/`wp_get_inline_script_tag()` to construct out the script. This simplifies the logic and allows the running of src without `SCRIPT_DEBUG` enabled.
* For the embed code that users are provided to copy for embedding outside of WP, add the `secret` on the `blockquote` and `iframe`. This ensures the `blockquote` will be hidden when the `iframe` loads. The embed code in question is accessed here via `get_post_embed_html()`.

Props westonruter, swissspidy, pento, flixos90, ocean90.
Fixes #44632, #44306.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-11 02:49:18 +00:00
davidbaumwald
dd80fd488b Taxonomy: Document that the get_terms filter can have null for $taxonomies.
The `get_terms` filter currently documents that the filter passes an array as both the first and second parameters, which is normally true, except that the second can be `null` when not specified.  This change updates the filter's docblock to indicate that the second parameter can also be of a `null` type.

Props dd32, audrasjb, mukesh27.
Fixes #54222.
Built from https://develop.svn.wordpress.org/trunk@52131


git-svn-id: http://core.svn.wordpress.org/trunk@51723 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 21:11:00 +00:00
Aaron Jorbin
268feb8c36 Build/Test: Change default GitHub branch to trunk
See: https://make.wordpress.org/core/2021/11/10/default-git-branch-for-wordpress-wordpress-develop/
See: https://make.wordpress.org/core/2020/06/18/proposal-update-all-git-repositories-to-use-main-instead-of-master/

Fixes #54399


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


git-svn-id: http://core.svn.wordpress.org/trunk@51722 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 21:00:00 +00:00
desrosj
7fae079419 Tests: Update qUnit test fixtures after [52128].
See #54336.
Built from https://develop.svn.wordpress.org/trunk@52129


git-svn-id: http://core.svn.wordpress.org/trunk@51721 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 20:27:59 +00:00
desrosj
d77367a962 General: Minor fixes to Global Style related code.
Follow up to [52041,52049-52052,52054,52106,52108-52110].

Props swisspidy, TobiasBg, spacedmonkey, kebbet, oandregal.
See #54336.
Built from https://develop.svn.wordpress.org/trunk@52128


git-svn-id: http://core.svn.wordpress.org/trunk@51720 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 19:56:00 +00:00
John Blackbourn
62fc5121f2 Docs: Add missing documentation for the $javascript parameter of the wp_inline_script_attributes filter.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51719 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 18:41:03 +00:00
Sergey Biryukov
5781b8c80e Docs: List the expected return type first in a few functions:
* `get_previous_post()`
* `get_next_post()`
* `get_adjacent_post()`.

Follow-up to [46696], [47060], [49929], [49963], [51286].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@52111


git-svn-id: http://core.svn.wordpress.org/trunk@51703 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 15:32:01 +00:00
desrosj
b6d67c1519 Docs: Avoid using “CPT” instead of “custom post type”.
Additionally, when referring to built in Core post types, “custom” is unnecessary.

This also adds a period to the end of the `wp_global_styles` post type description.

Follow up to [38829], [51003], [52041], [52049], [52062].

See #53399, #54335, #54336.
Built from https://develop.svn.wordpress.org/trunk@52110


git-svn-id: http://core.svn.wordpress.org/trunk@51702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 14:18:06 +00:00
desrosj
b1996cbec4 i18n: Add missing translation wrapper for the Global Styles post type description.
Follow up to [52041].

See #54336.
Built from https://develop.svn.wordpress.org/trunk@52109


git-svn-id: http://core.svn.wordpress.org/trunk@51701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 14:07:00 +00:00
desrosj
5932a68ba6 Posts, Post Types: Mark the wp_global_styles post type as _builtin.
All native or “built-in” post types should be marked as such.

Follow up to [52041].

See #54336.
Built from https://develop.svn.wordpress.org/trunk@52108


git-svn-id: http://core.svn.wordpress.org/trunk@51700 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 14:01:59 +00:00
desrosj
2803958573 Twenty Twenty-Two: Import the assets directory from GitHub.
This directory was missed during the initial import.

Follow up to [52081].

Props kafleg.
See #52081.
Built from https://develop.svn.wordpress.org/trunk@52107


git-svn-id: http://core.svn.wordpress.org/trunk@51699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 13:53:59 +00:00
desrosj
a64530a976 Posts, Post Types: Remove gutenberg text domain from post type strings.
Introduced in [52041], and [52069].

See #54336, #54337.
Built from https://develop.svn.wordpress.org/trunk@52106


git-svn-id: http://core.svn.wordpress.org/trunk@51698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 13:46:00 +00:00
noisysocks
3e094c27d0 Update @wordpress packages
Update packages to include these bug fixes from Gutenberg:

- Force remount LinkControl when moving between links within same richtext block
- Site Editor: Change ToolsMoreMenuGroup slot-fill name
- Respect fields param for global styles REST API requests.
- Try ensuring the item after post content clears floats
- Fix submenus not opening on click
- Apply i18n functions to Nav block menu drops when selecting existing Menu
- Gallery: Make sure the mobile warning notice only runs when images are added to a new block
- Prepare navigation php code for core patch
- Address deprecation issues from Buttons flex layout PR.
- Block Library: Fix incorrect attributes definitions
- Fix Navigation accessibility issues

See #54337.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 06:01:30 +00:00
desrosj
80f38671d0 Build/Test Tools: Make adjustments to how Quick Draft tests confirm expected behavior.
Twenty Twenty-One contained a filter on `the_title` to change the default post title to “Untitled”.

Whenever possible, the default behavior of Core without theme modifications should be confirmed in tests. The default behavior here is for a post title to be “(no title)” when one is not entered.

This change also makes an adjustment to be more specific when retrieving the text to verify results to prevent dates and post statuses from being pulled in.

Props davidbaumwald, desrosj, peterwilsoncc, hellofromTonya.
Fixes #54409.
Built from https://develop.svn.wordpress.org/trunk@52096


git-svn-id: http://core.svn.wordpress.org/trunk@51688 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 01:50:00 +00:00
hellofromTonya
d9d820660f Revisions: Introduce wp_get_post_revisions_url() to get URL for editing revisions.
There's now a way to get a link to a given post's revisions. Introducing `wp_get_post_revisions_url()` and its unit tests.

Props adamsilverstein, audrasjb, costdev, davidbaumwald, garrett-eclipse, georgestephanis, hellofromTonya, iaaxpage.
Fixes #39062.
Built from https://develop.svn.wordpress.org/trunk@52095


git-svn-id: http://core.svn.wordpress.org/trunk@51687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 01:26:59 +00:00
Peter Wilson
37c02eb5fe Taxonomy: Change some static strings to registration labels.
Add additional label options to `register_taxonomy()` to allow developers further flexibility for customizing the edit taxonomy screen.

Props mclaurent, swissspidy, johnbillion, jeremyescott, theMikeD, jeremyfelt, dontgo2sleep, SergeyBiryukov, audrasjb, Boniu91.
Fixes #43060.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 00:46:00 +00:00
desrosj
1dac2cdae7 Themes: Twenty Twenty-Two is now the default theme.
It's Friday night, and I feel alright. The party is here in the block theme.

See #54318.
Built from https://develop.svn.wordpress.org/trunk@52093


git-svn-id: http://core.svn.wordpress.org/trunk@51685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 00:41:00 +00:00
Peter Wilson
951ec3905d Quick/Bulk Edit: Disable auto-correct for slugs.
Disable auto-correct for the slug field on the quick/bulk edit interface. As slugs may consist of a number of words combined in to a single string, they are unlikely to pass spell checkers.

Props swb1192, SergeyBiryukov, afragen, Clorith, desrosj, JeffPaul, sabernhardt, Boniu91, costdev, hellofromTonya.
Fixes #50499.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-10 00:02:59 +00:00
davidbaumwald
372c7476b2 Login and Registration: Pass $errors parameter to registration_redirect filter.
On user registration, the `$errors` variable is the result of `register_new_user` which contains either the newly registered user's ID on success or a `WP_Error` object on failure.  This change passes that context to the `registration_redirect` filter.

Props Collizo4sky, aadilali, mukesh27, audrasjb.
Fixes #53992.
Built from https://develop.svn.wordpress.org/trunk@52091


git-svn-id: http://core.svn.wordpress.org/trunk@51683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 23:47:59 +00:00
Peter Wilson
ac37144d96 Block Editor: Update SVN props to ignore new asset files.
Update svn props to ignore additional CSS, JavaScript and source map files following the package updates preparing for WordPress 5.9.

Follow up to [52042], [52046], [52069] and [52089].
See #54337, #53361.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 23:42:00 +00:00
Peter Wilson
d05a2816ce Block Editor: Update SVN props to ignore new asset files.
Update svn props to ignore additional CSS, JavaScript and source map files following the package updates preparing for WordPress 5.9.

Follow up to [52042], [52046], [52069].
See #54337, #53361.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51681 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 23:32:59 +00:00
Peter Wilson
f888c5cbbb Login and Registration: Improve messaging for invalid log-out nonces.
Clarify messaging of when `wp_nonce_ays('log-out')` is called due to an invalid log out nonce. The HTML title now describes the action being taken rather than using the generic text "something went wrong".

Props davidkryzaniak, hellofromTonya, peterwilsoncc.
Fixes #52600.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 23:09:00 +00:00
davidbaumwald
d5f7417686 Bootstrap/Load: Add HTTP/3 as a valid HTTP protocol.
As of November 2021, the `HTTP/3` protocol is still officially an Internet Draft, but is already supported by 74% of running web browsers and, according to W3Techs, 23% of the top 10 million websites. It has been supported by Google Chrome (including Chrome for Android, and Microsoft Edge, which is based on it) since April 2020 and by Mozilla Firefox since May 2021. Safari 14 (on macOS Big Sur and iOS 14) has also implemented the protocol but support is hidden behind a feature flag.

Based on the wide support, this change adds `HTTP/3` as a valid HTTP protocol.

Props malthert.
Fixes #54404.
Built from https://develop.svn.wordpress.org/trunk@52087


git-svn-id: http://core.svn.wordpress.org/trunk@51679 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 23:07:01 +00:00
Sergey Biryukov
878c7c0486 Coding Standards: Use strict comparison in wp-admin/includes/ms.php.
Props davidbaumwald, audrasjb.
Fixes #47422.
Built from https://develop.svn.wordpress.org/trunk@52086


git-svn-id: http://core.svn.wordpress.org/trunk@51678 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 23:06:01 +00:00
hellofromTonya
9d4d3f8fba HTTP API: Ensure value returned from 'http_allowed_safe_ports' is an array to avoid PHP 8+ TypeError fatal error.
Adds an `is_array()` check before the `in_array()`. Why? `in_array()` requires a array for the haystack. Any other data type will cause a fatal error on PHP 8.0 or higher:

{{{
Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array
}}}

As this is a new filter, this type check properly guards to avoid the fatal error.

Follow-up to [52084].

See #54331.
Built from https://develop.svn.wordpress.org/trunk@52085


git-svn-id: http://core.svn.wordpress.org/trunk@51677 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 22:59:58 +00:00
hellofromTonya
2f84a45fdf HTTP API: Introduce 'http_allowed_safe_ports' filter in wp_http_validate_url().
Adds a new filter `'http_allowed_safe_ports'` to control which ports are allowed for remote requests. By default, ports 80, 443, and 8080 are allowed for safe remote requests.

Adds tests. 

Follow-up to [24480].

Props xknown, johnbillion, jorbin, costdev, dd32.
Fixes #54331.
Built from https://develop.svn.wordpress.org/trunk@52084


git-svn-id: http://core.svn.wordpress.org/trunk@51676 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 22:39:00 +00:00
davidbaumwald
d6de0e4498 Mail: Add wp_mail_succeeded hook to wp_mail.
Adds a new `wp_mail_succeeded` action in `wp_mail` after the mail is sent.  Also, adds a disclaimer to the hook's docblock, clarifying that the hook's firing doesn't necessarily mean the recipient received the mail, only that the mail was processed without any errors.

Props birgire, donmhico, johnbillion.
Fixes #53826.
Built from https://develop.svn.wordpress.org/trunk@52083


git-svn-id: http://core.svn.wordpress.org/trunk@51675 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 22:27:59 +00:00
hellofromTonya
2c874cfabc Twenty Twenty-One: Add privacy policy link to footer.
If a privacy policy is set, the page links to the footer of the site. As done in the other bundled themes, this link is added using `the_privacy_policy_link()`.

Follow-up to [49216].

Props ryelle, desrosj, kapilpaul, sabernhardt, audrasjb, justinahinon.
Fixes #53445.
Built from https://develop.svn.wordpress.org/trunk@52082


git-svn-id: http://core.svn.wordpress.org/trunk@51674 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 22:26:01 +00:00
desrosj
b04ed7ed22 Bundled Themes: Import Twenty Twenty-Two, the new default theme for WordPress 5.9.
Twenty Twenty-Two arrives during an exciting time for WordPress themes. With the advent of Full Site Editing and Global Styles, themes are changing structurally and functionally to enable far more avenues for customization than users have come to expect in the past.

To take advantage of these new abilities, Twenty Twenty-Two has been designed to be the most flexible default theme ever created for WordPress.

Props sourav926, aristath, audrasjb, bgardner, briceduclos, poena, colorful-tones, dgwyer, dimadin, gregrickaby, ellenbauer, jffng, kafleg, karmatosed, kraftbj, kjellr, littlebigthing, onemaggie, matveb, mburridge, mtoensing, nickcernis, nielslange, williampatton, pgking, ribaricplusplus, scruffian, soean, utz119, youknowriad, desrosj, richtabor.
See #54318.
Built from https://develop.svn.wordpress.org/trunk@52081


git-svn-id: http://core.svn.wordpress.org/trunk@51673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 21:02:02 +00:00
TimothyBlynJacobs
d224b7cf10 REST API: Expose the site icon in the REST API index.
Props spacedmonkey, palmiak.
Fixes #52321.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 20:37:59 +00:00
TimothyBlynJacobs
e2d4385a4f REST API: Introduce Menu management endpoints.
This commit introduces the `/wp/v2/menus`, `/wp/v2/menu-items` and `/wp/v2/menu-locations` REST API endpoints. These endpoints are fully available to users with the `edit_theme_options` capability, but can be read by any user who can edit a REST API available post type.

The `nav_menu` taxonomy and `nav_menu_item` post type now map their capabilities to the `edit_theme_options` primitive capability. This allows developers to provide more fine-grained access control. However, if a developer is currently dynamically removing the `edit_theme_options` capability using `map_meta_cap`, they should use the `user_has_cap` filter instead.

The `wp_update_nav_menu_item()` function has been adjusted to return an error if saving the menu item post or assigning the menu item to a menu generate an error.

Lastly, a new menu item type is introduced, `block`, that can be used to store a Block as a menu item.

Props andraganescu, antonvlasenko, dingo_d, dlh, isabel_brison, kadamwhite, Mamaduka, NateWr, noisysocks, peterwilsoncc, ryelle, schlessera, soean, Spacedmonkey, talldanwp, TimothyBlynJacobs, tobifjellner, westonruter, wpscholar, zieladam.
Fixes #40878.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51671 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 19:00:01 +00:00
desrosj
c86f41d98b Coding Standards: Minor alignment fix after [52058].
See #52058.
Built from https://develop.svn.wordpress.org/trunk@52078


git-svn-id: http://core.svn.wordpress.org/trunk@51670 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 18:51:02 +00:00
desrosj
de1c682e0a Themes: Avoid fatal error loading admin styles when SCRIPT_DEBUG is false.
This removes the use of `get_theme_file_path()` within `WP_Theme_JSON_Resolver` in favor of the similar `get_file_path_from_theme()` method.

The former is found within `wp-includes/link-template.php`, which is not currently loaded when `load-styles.php` attempts to load the necessary styles. `self::get_file_path_from_theme()` was used previously, but this was changed in [52049].

Props Mamaduka, audrasjb, hellofromTonya, jorbin, desrosj.
Fixes #54401. See #54336.
Built from https://develop.svn.wordpress.org/trunk@52077


git-svn-id: http://core.svn.wordpress.org/trunk@51669 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 18:08:01 +00:00
Sergey Biryukov
ea201ced16 Coding Standards: Revert unrelated change to wp_send_user_request().
This fixes a mix of tabs and spaces in the email template. Spaces inside a string are not considered WPCS errors, and are not required to be converted to tabs.

Follow-up to [52060], [52063].

See #43700.
Built from https://develop.svn.wordpress.org/trunk@52076


git-svn-id: http://core.svn.wordpress.org/trunk@51668 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 16:22:58 +00:00
hellofromTonya
80c868534a Login and Registration: Fix failing test for "email already exists" registration error improvement.
Follow-up to [52074].

Fixes #53631.
Built from https://develop.svn.wordpress.org/trunk@52075


git-svn-id: http://core.svn.wordpress.org/trunk@51667 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 16:21:01 +00:00
hellofromTonya
0fd9ad6c2f Login and Registration: Improve "email already exists" registration error message.
Adds the `wp_login_url()` login link to the Error message to be more helpful to users when their user email already is registered.

Improves the error message to more clearly communicate next step.

Follow-up to [16009], [22124], [31963].

Props andynick, costdev, dansoschin, sabernhardt, webcommsat.
Fixes #53631.
Built from https://develop.svn.wordpress.org/trunk@52074


git-svn-id: http://core.svn.wordpress.org/trunk@51666 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 15:28:59 +00:00
Adam Silverstein
e47027ff1f Media: Add "webp" extension to wp.media.controller.Library isImageAttachment.
Add "webp" extension to a media extension check, fixing an issue where the last used media
link type was not used for WebP images.

Props almendron, desrosj, kallookoo.
Fixes #53917.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 15:01:00 +00:00
Dominik Schilling
0b45e56052 Editor, Docs: Add documentation for the $block_editor_context parameter of the block_editor_rest_api_preload_paths hook.
See #52920.
See #53399.
Built from https://develop.svn.wordpress.org/trunk@52072


git-svn-id: http://core.svn.wordpress.org/trunk@51664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 13:00:00 +00:00
youknowriad
55840750c5 Site Editor: Load as full screen by default.
To avoid UI jumps when loading the page, the site-editor.php page
is marked as full screen by default. 
This also matches the behavior of the post editor.

See #54337.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51663 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 09:14:02 +00:00
TimothyBlynJacobs
e5a988644b REST API: Regenerate wp-api-generated.js after [52068].
See #53063.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51662 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 02:28:00 +00:00
noisysocks
c421e9b34a Add Site Editor and PHP changes from Gutenberg 10.1 - 11.9
- First pass at adding the site editor from the Gutenberg plugin to
  wp-admin/site-editor.php.
- Adds miscellaneous PHP changes from Gutenberg 10.1 - 11.9.

Follows [52042].
See #54337.
Props youknowriad, aristath, hellofromtonya, gziolo.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 02:17:17 +00:00
TimothyBlynJacobs
84dae82fd3 REST API: Add batch support for posts and terms controllers.
This also exposes the value of `allow_batch` in `OPTIONS` requests to a route.

A future commit will add batch support to more resources.

Props spacedmonkey, chrisvanpatten.
See #53063.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 01:59:02 +00:00
hellofromTonya
5c47273f06 Posts, Post Types: Add $old_status parameter to {$new_status}_{$post->post_type} action.
Follow-up to [5797], [28106], [31461].

Props aaroncampbell, audrasjb, desrosj, johnbillion, sebastianpisula, swissspidy.
Fixes #36180.
Built from https://develop.svn.wordpress.org/trunk@52067


git-svn-id: http://core.svn.wordpress.org/trunk@51659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 01:30:58 +00:00
hellofromTonya
8853582220 General: Convert wp_list_filter() into a wrapper for wp_filter_object_list().
The code in `wp_list_filter()` was a duplicate of `wp_filter_object_list()`, minus the `WP_List_Util::pluck()` (used when `$field` is configured).

In testing the wrapper, discovered an edge case (and potential bug) in `WP_List_Util::filter()` where if the operator matches an empty array was returned without resetting the output property. Without that property being set correctly, `WP_List_Util::get_output()` was not correct. This commit also fixes this by resetting the property to an empty array.  

Follow-up to [15686], [17427], [38928], [51044].

Props pbearne, sergeybiryukov, hellofromTonya.
Fixes #53988.
Built from https://develop.svn.wordpress.org/trunk@52066


git-svn-id: http://core.svn.wordpress.org/trunk@51658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 01:10:59 +00:00
Felix Arntz
780b0399f7 Media: Refine the heuristics to exclude certain images and iframes from being lazy-loaded to improve performance.
This changeset implements the refined lazy-loading behavior outlined in https://make.wordpress.org/core/2021/07/15/refining-wordpress-cores-lazy-loading-implementation/ in order to improve the Largest Contentful Paint metric, which can see a regression from images or iframes above the fold being lazy-loaded. Adjusting this so far has been possible for developers via filters and still is, however this enhancement brings a more accurate behavior out of the box for the majority of themes.

Specifically, this changeset skips the very first "content image or iframe" on the page from being lazy-loaded. "Content image or iframe" denotes any image or iframe that is found within content of any post in the current main query loop as well as any featured image of such a post. This applies both to "singular" as well as "archive" content: On a "singular" page the first image/iframe of the post is not lazy-loaded, while on an "archive" page the first image/iframe of the _first_ post in the query is not lazy-loaded.

This approach refines the lazy-loading behavior correctly for the majority of themes, which use a single-column layout for post content. For themes with multi-column layouts, a new `wp_omit_loading_attr_threshold` filter can be used to change how many of the first images/iframes are being skipped from lazy-loaded (default is `1`). For example, a theme using a three-column grid of latest posts for archives could use the filter to override the threshold to `3` on archive pages, so that the first three content images/iframes would not be lazy-loaded.

Props adamsilverstein, azaozz, flixos90, hellofromtonya, jonoaldersonwp, mte90, rviscomi, tweetythierry, westonruter.
Fixes #53675. See #50425.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 00:36:01 +00:00
hellofromTonya
c610440f46 Users: Introduce wp_list_users() function.
Introduces a new function called `wp_list_users()`. Similar to other list functions such as `wp_list_authors()`, it lists all the users of the site. Options are available to configure the HTML output.

Following the same pattern of the other list functions, the list's HTML output is rendered by default. Setting the `echo` argument to `false`, returns the list's HTML output.

A new test class is included.

Props afercia, audrasjb, chriscct7, costdev, desrosj, greenshady, hellofromTonya, mte90, nacin, rohan013, sergeybiryukov.
Fixes #15145.
Built from https://develop.svn.wordpress.org/trunk@52064


git-svn-id: http://core.svn.wordpress.org/trunk@51656 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 00:23:58 +00:00
joedolson
98cb0591eb Coding Standards: PHP Code style errors.
Fixes coding standards issues.

Follow up to [52060].

See #43700.
Built from https://develop.svn.wordpress.org/trunk@52063


git-svn-id: http://core.svn.wordpress.org/trunk@51655 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-09 00:01:57 +00:00
noisysocks
f05f235042 Editor: Add block theme infrastructure
Adds the required infrastructure to render block-based themes. This is sourced
from the Gutenberg plugin.

Fixes #54335.
Props bernhard-reiter, youknowriad, ntsekouras, hellofromtonya.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51654 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 23:10:59 +00:00
hellofromTonya
85fedc53ba General: Add "noopener" to wp_list_bookmarks() output.
In the bookmarks walker `_walk_bookmarks()`, add a `'noopener'` to the bookmark's `rel` attribute when there's `target` attribute.

Adds a new test class for `wp_list_bookmarks()` and tests for this change.

Follow-up to [3880], [10712].

Props birgire, costdev, hellofromTonya, mukesh27 , sergeybiryukov, tw2113.
Fixes #53839.
Built from https://develop.svn.wordpress.org/trunk@52061


git-svn-id: http://core.svn.wordpress.org/trunk@51653 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 23:06:58 +00:00
joedolson
a308811553 Coding Standards: PHP Code style errors.
Fixes coding standards issues.

Follow up to [52058].

See #43700.
Built from https://develop.svn.wordpress.org/trunk@52060


git-svn-id: http://core.svn.wordpress.org/trunk@51652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 23:03:58 +00:00
antpb
975f56e42b Media: Change upload button to a file input for better e2e targeting.
Changes the media library upload button to `input type="file"` for better end to end testing capabilities.

Props  justinahinon, joedolson, sabernhardt, audrasjb.
Fixes #54168.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51651 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 22:49:00 +00:00
joedolson
d00b86ff06 I18N: Add language switcher on login/registration screens.
Load a language switcher on the login and registration screens that allows users to choose any already-installed language. Set user locale on registration.

Props johnbillion, Nikschavan, afercia, sabernhardt, garrett-eclipse, keyur5, paaljoachim, Clorith, tobifjellner.
Fixes #43700.
Built from https://develop.svn.wordpress.org/trunk@52058


git-svn-id: http://core.svn.wordpress.org/trunk@51650 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 22:37:59 +00:00
jorgefilipecosta
8e7b8a1837 Add: get_query_pagination_arrow function to core.
Fixes a crash that is happening when using an FSE theme because a function required is missing. Ports the function from the Gutenberg plugin.

Props oandregal, youknowriad.
Built from https://develop.svn.wordpress.org/trunk@52057


git-svn-id: http://core.svn.wordpress.org/trunk@51649 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 22:31:58 +00:00
jorgefilipecosta
934efac655 Fix: Linting error affecting trunk.
Props oandregal.
Built from https://develop.svn.wordpress.org/trunk@52056


git-svn-id: http://core.svn.wordpress.org/trunk@51648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 21:57:58 +00:00
johnjamesjacoby
65866fa233 Admin/Help: add commas to end of multi-line array items.
Follow up to r52053.

See #54357.
Built from https://develop.svn.wordpress.org/trunk@52055


git-svn-id: http://core.svn.wordpress.org/trunk@51647 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 21:55:00 +00:00
jorgefilipecosta
d8fe393934 Add: Public functions for interacting with global styles & settings.
This commit ports the public functions to interact with the global styles & settings.

See #54336.
Props oandregal.
Built from https://develop.svn.wordpress.org/trunk@52054


git-svn-id: http://core.svn.wordpress.org/trunk@51646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 21:45:58 +00:00
johnjamesjacoby
8dfb59d4de Admin/Help: add docs links to several screens.
This change intends to better guide users towards many of the useful resources available on WordPress.org.

* Appearance/Customizer - Add link to Customizer docs.
* Appearance/Editor - Improve link text & destination.
* Privacy Settings - Link to Privacy Settings docs.
* Site Health - Link to Site Health docs.

Props audrasjb, jdy68, webcommsat.

Fixes #54357.
Built from https://develop.svn.wordpress.org/trunk@52053


git-svn-id: http://core.svn.wordpress.org/trunk@51645 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 21:43:01 +00:00
jorgefilipecosta
d8da1f0ac9 Add: Global styles user content escaping.
This commit adds global styles user content escaping. In addition, it ports the logic on the Gutenberg plugin implemented on WordPress/gutenberg#28061 to the core.
The logic tries to follow what was done for standard post content.

See #54336.
Props oandregal.
Built from https://develop.svn.wordpress.org/trunk@52052


git-svn-id: http://core.svn.wordpress.org/trunk@51644 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 21:24:59 +00:00
jorgefilipecosta
db5d8b5e03 Add: Global Styles Rest endpoints.
This commit ports the global styles rest endpoints from the Gutenberg plugin into the core.

See #54336.
Props oandregal, aristath, timothyblynjacobs, spacedmonkey, youknowriad.
Built from https://develop.svn.wordpress.org/trunk@52051


git-svn-id: http://core.svn.wordpress.org/trunk@51643 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 21:00:07 +00:00
jorgefilipecosta
cba4afb663 Fix: Update block-theme-pl_PL.mo file.
See #54336.
Props oandregal.
Built from https://develop.svn.wordpress.org/trunk@52050


git-svn-id: http://core.svn.wordpress.org/trunk@51642 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 20:33:59 +00:00
jorgefilipecosta
065c639a2a Update theme.json classes for WordPress 5.9.
This commit ports to core the changes to the classes that deal with theme.json code.

See #54336.
Props oandregal, spacedmonkey, noisysocks, hellofromtonya, youknowriad.
Built from https://develop.svn.wordpress.org/trunk@52049


git-svn-id: http://core.svn.wordpress.org/trunk@51641 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 19:19:58 +00:00
Sergey Biryukov
25b9998213 Tests: Remove the formatting group from wp_is_numeric_array() tests.
Similar to `wp_array_slice_assoc()` or other array-related functions, this appears to be a general-purpose function unrelated to the Formatting component.

Add missing `public` visibility keyword.

Follow-up to [52037].

See #53971.
Built from https://develop.svn.wordpress.org/trunk@52048


git-svn-id: http://core.svn.wordpress.org/trunk@51640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 17:08:59 +00:00
desrosj
80b78b077d Build/Test Tools: Update/Audit NPM dependencies for bundled themes.
This updates several NPM dependencies to their latest (or latest allowed) versions for bundled themes that have a `package.json` file (Twenty Nineteen and newer).

These updates did not result in any changes to the built files in Twenty Nineteen or Twenty Twenty. Some unnecessary parenthesis have been removed from `calc()` function calls within Twenty Twenty-One.

This change also contains several updates to the `package-lock.json` files made by running `npm audit fix` within each of these themes.

See #53361.
Built from https://develop.svn.wordpress.org/trunk@52047


git-svn-id: http://core.svn.wordpress.org/trunk@51639 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 16:26:01 +00:00
desrosj
713dd52b78 Build/Test Tools: Update/Audit NPM dependencies for 5.9.
This updates several NPM dependencies to their latest (or latest allowed) versions.

- `autoprefixer` from `9.8.6` to `9.8.8`
- `chalk` from `4.1.1` to `4.1.2`
- `grunt-contrib-concat` from `1.0.1` to `2.0.0`
- `grunt-contrib-jshint` from `3.0.0` to `3.1.1`
- `grunt-contrib-qunit` from `4.0.0` to `5.1.1`
- `qunit` from `2.16.0` to `2.17.2`
- `sass` from `1.34.1` to `1.43.4`
- `sinon` from `11.1.1` to `12.0.1`
- `sinon-test` from `3.1.0` to `3.1.1`
- `uglify-js` from `3.13.9` to `3.14.3`
- `wait-on` from `5.3.0` to `6.0.0`

This change also contains several updates to the `package-lock.json` file made by running `npm audit fix`.

See #53361.
Built from https://develop.svn.wordpress.org/trunk@52046


git-svn-id: http://core.svn.wordpress.org/trunk@51638 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 16:15:22 +00:00
hellofromTonya
4ba2fd6f0e Posts/Post Types: Improves the 'is_post_type_viewable' filter boolean return.
As a follow-up to [52024], simplifies the strict boolean type check to conserve memory and processing. Also includes an explanation of why a strict boolean is required as the returned filtered value. This commit is consistent with the implementation in [52043].

Follow-up to [33666], [36402], [52024].

Props hellofromTonya, peterwilsoncc, cybr, jrf.
Fixes #49628.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51637 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 15:34:59 +00:00
desrosj
c2a7d2a773 Themes: Remove temporary Full Site Editing safety checks.
These checks were added in [51193] and [51197] as a temporary measure to prevent a site owner from activating a Full Site Editing theme when Gutenberg plugin was not active.

Because Core only had partial support for the features required for FSE, the front end of the site would display a white screen or error message to visitors. Unless the site owner visited the front end, there would be no indication that there was a problem.

Since 5.9 will include the remaining features required for FSE, these checks can be removed.

Props poena, jffng.
Fixes #54366. See #534190.
Built from https://develop.svn.wordpress.org/trunk@52044


git-svn-id: http://core.svn.wordpress.org/trunk@51636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 15:27:59 +00:00
hellofromTonya
cc39667fc1 Posts/Post Types: Introduce 'is_post_status_viewable ' filter in is_post_status_viewable().
Introduces a new filter 'is_post_status_viewable' which allows overriding the check.

The function's return signature is a boolean type. This commit ensures
the return signature remains unchanged by requirinng a strict boolean
type of the returned filtered value.

Why?
* To maintain this signature and backwards-compatibility.
* To future prepare for PHP 8.1 and beyond.

An explanation is included in the filter's DocBlock.

Follow-up to [50130].

Props audrasjb, hellofromTonya, peterwilsoncc.
Fixes #54375.
Built from https://develop.svn.wordpress.org/trunk@52043


git-svn-id: http://core.svn.wordpress.org/trunk@51635 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 15:21:59 +00:00
youknowriad
ebca9841e8 Block Editor: Update the WordPress Packages based on Gutenberg 11.9 RC1.
This brings the JS packages up to date and is the first step that will allow us 
to include the other block editor updates for WordPress 5.9:
FSE infrastrucutre, site editor and global styles.

Props noisysocks.
See #54337.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 14:29:21 +00:00
jorgefilipecosta
0b4ecc9b23 Add: wp_global_styles custom post type.
This commit adds the wp_global_styles custom post type following the same approach used to add other core custom post types. It also updates the wp_theme taxonomy to include the wp_global_styles post type.
The post type is registered in the same way it is on the plugin we just adapt the location for the core.

See #54336.
Props oandregal.
Built from https://develop.svn.wordpress.org/trunk@52041


git-svn-id: http://core.svn.wordpress.org/trunk@51633 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 14:26:00 +00:00
hellofromTonya
3d10105120 General: Introduce polyfills for str_ends_with() and str_starts_with() added in PHP 8.0.
PHP 8.0 introduced two new functions: `str_ends_with()` and `str_starts_with()`. These perform a case-sensitive check indicating if the string to search in (haystack) ends or begins with the given substring (needle).

These polyfills make these functios available for use in Core.

Ref:
* PHP RFC https://wiki.php.net/rfc/add_str_starts_with_and_ends_with_functions
* PHP manual `str_ends_with()` https://www.php.net/manual/en/function.str-ends-with.php
* PHP manual `str_starts_with()`  https://www.php.net/manual/en/function.str-starts-with.php

Props costdev, hellofromTonya, pbearne, pbiron.
Fixes #54377.
Built from https://develop.svn.wordpress.org/trunk@52040


git-svn-id: http://core.svn.wordpress.org/trunk@51632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 14:22:57 +00:00
hellofromTonya
87557c6260 General: Introduce polyfill for str_contains() added in PHP 8.0.
PHP 8.0 introduced a new function: `str_contains()`. It performs a case-sensitive check indicating if given substring (needle) is contained in the string to search in (haystack).

This polyfill makes this function available for use in Core.

Ref:
* PHP RFC https://wiki.php.net/rfc/str_contains
* PHP manual https://www.php.net/manual/en/function.str-contains.php

Props ayeshrajans, costdev, desrosj, hellofromTonya, knutsp, pbearne.
Fixes #49652.
Built from https://develop.svn.wordpress.org/trunk@52039


git-svn-id: http://core.svn.wordpress.org/trunk@51631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 14:03:58 +00:00
hellofromTonya
10dc403b88 General: Introduce polyfills for array_key_first() and array_key_last() added in PHP 7.3.0.
PHP 7.3.0 introduced two new functions: `array_key_first()` and `array_key_last()`. These two functions return the first and last key of each array respectively, without affecting the internal state of the array.

The polyfills make these two functions available for use in Core on PHP versions less than 7.3.0.

Ref:
* PHP RFC https://wiki.php.net/rfc/array_key_first_last
* PHP manual `array_key_first()` https://www.php.net/manual/en/function.array-key-first.php
* PHP manual `array_key_last()` https://www.php.net/manual/en/function.array-key-last.php

Props desrosj, pbearne, costdev, hellofromTonya, ayeshrajans, manzoorwanijk, audrasjb, sergeybiryukov.
Fixes #45055.
Built from https://develop.svn.wordpress.org/trunk@52038


git-svn-id: http://core.svn.wordpress.org/trunk@51630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 13:51:57 +00:00
hellofromTonya
1a04cb44d2 General: Add phpunit tests for wp_is_numeric_array().
Adds new test class `Tests_Functions_WpIsNumericArray` for `wp_is_numeric_array()`.

Props pbearne, hareesh-pillai, hellofromTonya.
Fixes #53971.
Built from https://develop.svn.wordpress.org/trunk@52037


git-svn-id: http://core.svn.wordpress.org/trunk@51629 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 13:30:56 +00:00
gziolo
b519028ab2 Fix relative URLs in inlined block styles that involve external assets
When styles got inlined, relative URLs break. The problem was that URLs inside CSS files are relative to the stylesheet's path, and when styles get inlined that relation is lost. This patch fixes the issue by finding relative URLs which then get modified to be relative to the site's root.

Fixes #54243.
Props aristath, cdyerkes, hellofromtonya.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51628 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 13:24:58 +00:00
John Blackbourn
2a3ad7c430 Docs: Various docblock improvements and corrections.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51627 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 10:48:59 +00:00
John Blackbourn
4c3a23ba40 Docs: Fix some docblock syntax errors and add a missing canonical reference.
See #53399, #52867, #38942, #53668

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


git-svn-id: http://core.svn.wordpress.org/trunk@51626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 10:44:59 +00:00
antpb
3dc76d614a Media: Adjust alt text info link text.
Previous messaging of this link was confusing given it went to an external source. This change describes more accurately that it will perform the action of taking you to the resource.

Props karmatosed, joedolson, melchoyce, hellofromTonya, afercia, sabernhardt, antpb.
Fixes #48939.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-08 00:22:57 +00:00
antpb
c1f6817cad Media: Remove security messaging in media upload failures.
Previously, when uploading a media item type that is not supported, the default error message claims that the reason it cannot upload is due to security reasons. This is not always true. Now the warning says that the type is not allowed, which is always true.

Props antpb, Presskopp, peterwilsoncc, desrosj, iluy, circlecube, mikeschroder.
Fixes #53626.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-07 23:29:56 +00:00
joedolson
fffde30995 Widgets: Add filter to disable RSS widget icon.
Add a filter that disables output of the icon on RSS feed widgets. Improves accessibility by providing a path to prevent duplicate or invisible links.

Props sabernhardt, Boniu91.
Fixes #52224.
Built from https://develop.svn.wordpress.org/trunk@52031


git-svn-id: http://core.svn.wordpress.org/trunk@51623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-07 23:04:56 +00:00
joedolson
201f4ddfbe Editor: Update structure of title element for editing.
Re-format the title element for post editing to follow general scheme for WordPress admin screens.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-07 22:09:56 +00:00
joedolson
56b07f0ea2 Comments: Mark comment text field as required.
Add required asterisk to the comment text field. Historically, the name and email fields are marked as required, but the comment text field is not, though it is actually a required field.

Props infected, solarissmoke, rianrietveld, afercia, sabernhardt, strider72, mai21, audrasjb.
Fixes #16206.
Built from https://develop.svn.wordpress.org/trunk@52029


git-svn-id: http://core.svn.wordpress.org/trunk@51621 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-07 21:14:58 +00:00
antpb
78d274099a Media: Add filter for post thumbnail id.
Introduces new filter `post_thumbnail_id` which allows overriding the default id returned from `get_post_thumbnail_id()`.

Props engelen, alexvorn2, gilbitron, sebastianpisula, SergeyBiryukov, leogermani, rzen, joemcgill, audrasjb.
Fixes #23983.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-07 20:37:58 +00:00
antpb
5df077df8a Media: Add filter for post thumbnail url.
Introduces new filter `post_thumbnail_url` which allows overriding the default url returned from `wp_get_attachement_image_url()`.

Props ibenic, SergeyBiryukov, jackreichert, audrasjb.
Fixes #40547.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51619 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-07 19:29:00 +00:00
Sergey Biryukov
107d13bc28 Coding Standards: Move wp-includes/class-http.php to wp-includes/class-wp-http.php.
This renames the file containing the `WP_Http` class to conform to the coding standards.

This commit also includes:

- A new `class-http.php` that includes the new file, for anyone that may've been including the file directly.
- Replaces references to the old filename with the new filename.

Follow-up to [8516], [13274], [33748].

Fixes #54389. See #53359.
Built from https://develop.svn.wordpress.org/trunk@52026


git-svn-id: http://core.svn.wordpress.org/trunk@51618 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-07 01:36:57 +00:00
Sergey Biryukov
6ad1bf0e3e Coding Standards: Rename the $strResponse argument to $str_response in WP_Http::processResponse().
This fixes a `Variable "$strResponse" is not in valid snake_case format` WPCS warning.

Additionally, rename a `$res` variable to `$response` for clarity.

Follow-up to [8516], [51823], [51826], [51877].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@52025


git-svn-id: http://core.svn.wordpress.org/trunk@51617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-06 21:56:59 +00:00
hellofromTonya
862f6e9569 Posts/Post Types: Add filter to is_post_type_viewable().
Introduces a new filter `'is_post_type_viewable'` which allows overriding the check. The expected filtered value is a boolean. As filtered values can change, including the data type, this commit includes a `is_bool()` check, thus ensuring backwards-compatibility.

Follow-up to [33666], [36402].

Props audrasjb, deepaklalwani, hellofromTonya, peterwilsoncc, powerbuoy, sergeybiryukov.
Fixes #49628.
Built from https://develop.svn.wordpress.org/trunk@52024


git-svn-id: http://core.svn.wordpress.org/trunk@51616 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-05 23:01:58 +00:00
hellofromTonya
c5662ee7a1 Bundled Theme: Add privacy policy link to Twenty Twenty footer.
If a privacy policy is set, its page is now linked in the footer.

Follow-up to [46271].

Props audrasjb, justinahinon, kapilpaul, ryelle, sabernhardt.
Fixes #53446.
Built from https://develop.svn.wordpress.org/trunk@52023


git-svn-id: http://core.svn.wordpress.org/trunk@51615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-05 22:29:01 +00:00
hellofromTonya
d4c8830ae3 Bundled Theme: Ensure logo displays in Customizer previewer.
Fixes an issue with the logo not displaying the Customizer previewer when changing the site title or description.

Follow-up to [46271].

Props acosmin, boniu91, sabernhardt.
Fixes #51337.
Built from https://develop.svn.wordpress.org/trunk@52022


git-svn-id: http://core.svn.wordpress.org/trunk@51614 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-05 22:20:58 +00:00
Clorith
44f50060eb Site Health: Add the constant WP_ENVIRONMENT_TYPE for debug data.
As a legacy from the old Health Check plugin, the constant `WP_LOCAL_DEV` was included in the debug data under the "WordPress Constants" section. This was incorrect, and has never been a constant used by core.

Instead, that field is now replaced by `WP_ENVIRONMENT_TYPE`, which was introduced with WordPress 5.5, and is a much more appropriate value to provide in a debug scenario.

Props johnbillion, bgoewert, sabbirshouvo.
Fixes #54340.
Built from https://develop.svn.wordpress.org/trunk@52021


git-svn-id: http://core.svn.wordpress.org/trunk@51613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-05 21:05:00 +00:00
Sergey Biryukov
0531cc11b4 Coding Standards: Consistently escape attribute in wp-admin/themes.php.
Follow-up to [27012], [38057], [47816], [51083].

Props sabbirshouvo, audrasjb.
Fixes #54256.
Built from https://develop.svn.wordpress.org/trunk@52020


git-svn-id: http://core.svn.wordpress.org/trunk@51612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-05 17:58:57 +00:00
hellofromTonya
b9d15392bf Code Modernization: Pass correct default value to http_build_query() in get_core_checksums() and wp_version_check().
The `get_core_checksums()` and `wp_version_check()` functions call the PHP native `http_build_query()` function, the second parameter of which is the ''optional'' `$numeric_prefix` parameter which expects a non-nullable `string`.

A parameter being optional, however, does not automatically make it nullable.

As of PHP 8.1, passing `null` to a non-nullable PHP native function will generate a deprecation notice.

In this case, this function call yielded a `http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated` notice.

Changing the `null` to an empty string fixes this without a backward compatibility break.

References:
* [https://www.php.net/manual/en/function.http-build-query.php PHP Manual: http_build_query()]
* [https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg PHP RFC: Deprecate passing null to non-nullable arguments of internal functions]

Follow-up to [18697], [25540].

Props bjorsch, kraftbj, hellofromTonya, jrf.
See #54229.
Built from https://develop.svn.wordpress.org/trunk@52019


git-svn-id: http://core.svn.wordpress.org/trunk@51611 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-05 12:18:58 +00:00
Clorith
500da91f70 Site Health: Update the icon used when no issues are reported.
The icon used to be a rather blocky checkmark, but has now been changed to the more friendly, and less ambiguous, smiley dashicon.

It also helps cover a rare cases where a checkmark, while often used to mark something as done, may also be used to indicate that something is incorrect (many thanks to my 6th grade teacher for this rationale).

As an added bonus, this commit also adjusts the margins used around the icon, to make it fit more nicely on both large and small viewports.

Props sabernhardt, generosus.
Fixes #53980.
Built from https://develop.svn.wordpress.org/trunk@52018


git-svn-id: http://core.svn.wordpress.org/trunk@51610 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-05 11:41:01 +00:00
TimothyBlynJacobs
fa473014dc REST API: Support subdirectory themes in the Themes controller.
This allows for themes that are included inside of a subdirectory, for example `subdir/my-theme`, to be accessed via the single item route of the `/wp/v2/themes` controller.

Fixes #54349.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51609 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-05 02:30:57 +00:00
TimothyBlynJacobs
04a853195b REST API: Allow sidebars and their widgets to be public.
By default, only users with the `edit_theme_options` capability can access the sidebars and widgets REST API endpoints. In this commit, A new `show_in_rest` parameter is added to the `register_sidebar` function. When enabled, all users will be able to access that sidebar and any widgets belonging to that sidebar.

This commit reduces the `context` for a widget's `instance` information to only `edit`. This is to ensure that internal widget data is not inadvertently exposed to the public. A future ticket may expose additional APIs to allow widget authors to indicate that their instance data can be safely exposed. REST API consumers intending to access this `instance` information should take care to explicitly set the `context` parameter to `edit`.

Props spacedmonkey, zieladam.
Fixes #53915.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51608 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-05 02:15:59 +00:00
Peter Wilson
cae71f232c Comments: Avoid reparenting during post deletion.
Delete comments in a descending order by comment ID when deleting a post.

This avoids the expense of additional database queries required to re-parent threaded comments that are themselves about to be deleted.

Props Mte90, andraganescu, johnbillion, hellofromTonya, peterwilsoncc.
Fixes #37703.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51606 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-04 23:56:58 +00:00
hellofromTonya
9036739acc Administration: Make dashboard widget control submit button text more clear.
Changes the submit button text from "Submit" to "Save Changes".

Why? The text is more semantic and clear of what happens when activating that button.

Follow-up to [9103].

Props zodiac1978, knutsp, hilayt24, audrasjb.
Fixes #54229.
Built from https://develop.svn.wordpress.org/trunk@52014


git-svn-id: http://core.svn.wordpress.org/trunk@51605 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-04 23:30:58 +00:00
hellofromTonya
fcf096f4b9 Bundled Themes: Remove the "role" attribute on HTML elements with a default landmark role.
With IE11 no longer supported, the primary problem with assistive technology support for native HTML5 elements no longer applies.

This commit removes the `role` attribute from the following HTML5 elements with default landmark roles, per formerly required role attributes and W3C.

Follow-up to [17669], [21261], [23452], [24832], [29892], [38833], [40851], [43842], [46271], [49216].

Props costdev, craigfrancis, joedolson, mukesh27, ryokuhi, sabernhardt.
Fixes #54079.
Built from https://develop.svn.wordpress.org/trunk@52013


git-svn-id: http://core.svn.wordpress.org/trunk@51604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-04 18:18:01 +00:00
gziolo
e4da863a6f Docs: Clarify the path usage register_block_type_from_metadata
The filename passed with the first param must end with `block.json`.

Fixes #53806.
Props coreyw, costdev.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51603 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-04 16:03:57 +00:00
gziolo
56e4bf827d Build: Remove polyfills from block view scripts
Related changes in Gutenberg: https://github.com/WordPress/gutenberg/pull/35038.

When adding a block with a view.js script, the frontend loads an additional ~20kb of scripts that were previously not there. These are coming from polyfills that are defined as a dependency for view.js scripts.
Since WordPress dropped support for IE, these polyfills are no longer needed and can be removed.

Follow-up to [51501].
See #53690.
Props aristath.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-04 15:57:58 +00:00
hellofromTonya
507cc58f72 Coding Standards: Add visibility to methods in tests/phpunit/tests/.
Adds a `public` visibility to test fixtures, tests, data providers, and callbacks methods.

Adds a `private` visibility to helper methods within test classes.

Renames callbacks and helpers that previously started with a `_` prefix. Why? For consistency and to leverage using the method visibility. Further naming standardizations is beyond the scope of this commit.

Props costdev, jrf, hellofromTonya.
Fixes #54177.
Built from https://develop.svn.wordpress.org/trunk@52010


git-svn-id: http://core.svn.wordpress.org/trunk@51601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-04 15:23:59 +00:00
hellofromTonya
ce599b652a Coding Standards: Add public visibility to methods in tests/phpunit/includes/.
This commit adds the `public` visibility keyword to each method which did not have an explicit visibility keyword.

Why `public`?

With no visibility previously declared, these methods are implicitly `public` and available for use. As these are part of the WordPress testing framework (for Core and extenders), changing them to anything else would be a backwards-compatibility break.

Props costdev, jrf, hellofromTonya.
See #54177.
Built from https://develop.svn.wordpress.org/trunk@52009


git-svn-id: http://core.svn.wordpress.org/trunk@51600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-04 13:16:57 +00:00
hellofromTonya
27d239d01b REST API: Improve translations, comments, and readability in URL Details endpoint.
Improvements:
* Removes HTML tags from translatable strings. Uses `sprintf` with placeholder and translators comment.
* Spells out "OG" to "Open Graph" to help translators.
* Adds `@since` param to new filters.
* Improves comments for code standards and consistency.
* Improves readability by making multiple args multiline.
* Micro-optimizations to avoid unnecessary variable assignments.

Follow-up to [51973].

Props hellofromTonya, sergeybiryukov, swissspidy.
Fixes #54358.
Built from https://develop.svn.wordpress.org/trunk@52008


git-svn-id: http://core.svn.wordpress.org/trunk@51599 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-04 12:44:01 +00:00
davidbaumwald
2e249395de Comments: Add noopener noreferrer to author links in list table.
When viewing the listing of all comments, author links previously passed referrer information to untrusted URLs.  This change adds `noreferrer` to each author link, as well as `noopener` to prevent the passing of information about the parent window.

Props cybr, adam3128, erayalakese, andraganescu, audrasjb, joedolson, sabernhardt. 
Fixes #40916.
Built from https://develop.svn.wordpress.org/trunk@52007


git-svn-id: http://core.svn.wordpress.org/trunk@51596 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-03 20:02:02 +00:00
Sergey Biryukov
aa62c253e0 External Libraries: Update the Iris color picker to version 1.1.1.
The latest version includes jQuery 3.x deprecation fixes:
* `$.isArray` → `Array.isArray`
* Event attachment/trigger shorthands → `.on()` and `.trigger()`

For a full list of changes in this update, see the PR on GitHub:
https://github.com/Automattic/Iris/pull/72

Follow-up to [22030], [22033], [22385], [22457], [22697], [22732], [23443], [26334], [30551], [30650], [38931], [50547].

Props Clorith, mattwiebe, Cybr.
Fixes #54224.
Built from https://develop.svn.wordpress.org/trunk@52006


git-svn-id: http://core.svn.wordpress.org/trunk@51595 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-03 19:40:00 +00:00
Sergey Biryukov
8117af8bb2 General: Remove the svn:executable property from wp-admin/_index.php.
The property appears to be added accidentally. The removing was mentioned but not included in the previous commit.

Follow-up to [38049], [42200], [46585], [51995], [52001].

See #54321.
Built from https://develop.svn.wordpress.org/trunk@52005


git-svn-id: http://core.svn.wordpress.org/trunk@51594 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-03 17:23:56 +00:00
johnjamesjacoby
3e81de0a3d Themes/TwentySixteen: correct invalid CSS font-style value.
This change swaps out `none` for `normal` in the `.wp-block-pullquote cite` styling of `blocks.css`.

Props malae, mukesh27, sabernhardt.

Fixes #46807.
Built from https://develop.svn.wordpress.org/trunk@52004


git-svn-id: http://core.svn.wordpress.org/trunk@51593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-03 17:01:57 +00:00
hellofromTonya
6a10d18458 Customize: Fix focus() to collapse child panels and show parent panel.
When a child panel is open, `wp.customize.panel('parent_panel').focus()` (e.g. `'parent_parent'` might be `'nav_menus'`) collapses the child panel(s) to show the parent panel. 

Follow-up to [30102], [31920], [38648].

Props celloexpressions, costdev, dlh, hareesh-pillai, hellofromTonya, westonruter, wpweaver. 
Fixes #34436.
Built from https://develop.svn.wordpress.org/trunk@52003


git-svn-id: http://core.svn.wordpress.org/trunk@51592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-03 15:05:58 +00:00
desrosj
e2315352e9 Build/Test Tools: Pass workflow outcome to Slack Notifications.
When using a workflow as a callable workflow, the job status check functions do not take the called workflow into account. This has caused some failures to be incorrectly reported as successful.

This adds an input to the Slack notifications workflow for when the `workflow_call` event is used.

See #53363.
Built from https://develop.svn.wordpress.org/trunk@52002


git-svn-id: http://core.svn.wordpress.org/trunk@51591 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-03 14:56:04 +00:00
Sergey Biryukov
a59ade2290 Help/About: Improve typography in the Welcome to your WordPress Dashboard! text.
Per the general consensus in #8714 and similar tickets, user-facing strings should use “curly quotes” for better typography.

Remove the `svn:executable` property that appears to be added accidentally.

Follow-up to [38049], [42200], [46585], [51995].

See #54321.
Built from https://develop.svn.wordpress.org/trunk@52001


git-svn-id: http://core.svn.wordpress.org/trunk@51590 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-03 03:16:57 +00:00
Sergey Biryukov
7effeb4fc1 Build/Test Tools: Restore the https URL for browserify-aes.
Follow-up to [51967], [51974].

See #54054.
Built from https://develop.svn.wordpress.org/trunk@52000


git-svn-id: http://core.svn.wordpress.org/trunk@51589 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-03 03:00:57 +00:00
Sergey Biryukov
8ea16bd30e Tests: Clean up the $_REQUEST superglobal in WP_UnitTestCase_Base::clean_up_global_scope().
This resolves an issue where setting up `$_REQUEST['post_type']` and not clearing it afterwards in `Tests_Admin_IncludesScreen::setup_block_editor_test()` started affecting a few `WP_Comments_List_Table` tests after [51997]. It also ensures a similar issue does not inadvertently happen in other tests.

Follow-up to [760/tests], [51997].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51999


git-svn-id: http://core.svn.wordpress.org/trunk@51588 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-03 02:57:58 +00:00
Sergey Biryukov
a949417a2e Tests: Correct @covers tags in WP_Comments_List_Table tests.
Follow-up to [51993], [51997].

See #39265.
Built from https://develop.svn.wordpress.org/trunk@51998


git-svn-id: http://core.svn.wordpress.org/trunk@51587 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-03 00:55:56 +00:00
Sergey Biryukov
012f50f565 Tests: Split WP_Posts_List_Table and WP_Comments_List_Table tests into two separate files for clarity.
These were previously combined in the `includesListTable.php` file. Since the tests were specific neither to the `_get_list_table()` function nor the parent `WP_List_Table` class, the naming was confusing, which should now be resolved.

Follow-up to [31730], [38854], [40297], [48151], [48521], [49190], [51993].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51997


git-svn-id: http://core.svn.wordpress.org/trunk@51586 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-03 00:49:58 +00:00
hellofromTonya
b87617e271 Customizer: Make range controls full width.
Adds CSS for range controls in the Customizer to be as wide as possible allowing for smaller increments to be more easily obtained by the user.

Follow-up to [28930].

Props domainsupport, dlh, sabernhardt, audrasjb.
Fixes #54329.
Built from https://develop.svn.wordpress.org/trunk@51996


git-svn-id: http://core.svn.wordpress.org/trunk@51585 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 23:19:59 +00:00
hellofromTonya
22e4a52258 Help/About: Improve the Welcome text in wp-admin/_index.php.
Improves the `Welcome to your WordPress Dashboard!` copy in the `Overview` section of the help tab.

Follow-up to [18914], [19007], [37680].

Props webcommsat, marybaum, costdev, audrasjb.
Fixes #54321.
Built from https://develop.svn.wordpress.org/trunk@51995


git-svn-id: http://core.svn.wordpress.org/trunk@51584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 22:54:59 +00:00
hellofromTonya
973f1f1cac Build/Test Tools: Add missing @covers and visibility for Tests_Admin_includesMisc.
Adds the `@covers` tag to the test DocBlock.
Adds missing `public` visibility to the test method.

Follow-up to [25002].

Props pbearne, jrf, hellofromTonya.
See #39265.
Built from https://develop.svn.wordpress.org/trunk@51994


git-svn-id: http://core.svn.wordpress.org/trunk@51583 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 22:08:59 +00:00
hellofromTonya
f45b359aa2 Build/Test Tools: Add missing @covers tags for Tests_Admin_includesListTable.
Follow-up to [31730].

Props pbearne, jrf, hellofromTonya.
See #39265.
Built from https://develop.svn.wordpress.org/trunk@51993


git-svn-id: http://core.svn.wordpress.org/trunk@51582 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 22:01:59 +00:00
hellofromTonya
9869a44a0f Build/Test Tools: Add missing @covers tags for Tests_Admin_includesFile.
Follow-up to [25002], [42773].

Props pbearne, jrf, hellofromTonya.
See #39265.
Built from https://develop.svn.wordpress.org/trunk@51992


git-svn-id: http://core.svn.wordpress.org/trunk@51581 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 21:57:57 +00:00
hellofromTonya
3819fa7340 Help/About: Simplifies WordPress version in "Help" sidebar.
Simplifies the logic for when not in alpha/beta/RC.

The changelog URL is translatable in a few other places in core. This commit uses the same pattern for consistency.

Follow-up to [51985].

Props sergeybiryukov.
Fixes #47848.
Built from https://develop.svn.wordpress.org/trunk@51991


git-svn-id: http://core.svn.wordpress.org/trunk@51580 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 21:43:57 +00:00
hellofromTonya
db11516237 Build/Test Tools: Add end-to-end (e2e) tests for edit posts page.
Adds e2e tests for 'Edit Posts':
* No posts found
* Shows a single post after publishing
* Edit existing post via Edit button
* Quick edit existing post via Quick Edit button
* Delete post

Props isabel_brison, azaozz, hellofromTonya, justinahinon, talldanwp, youknowriad.
Fixes #49507.
Built from https://develop.svn.wordpress.org/trunk@51990


git-svn-id: http://core.svn.wordpress.org/trunk@51579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 21:26:58 +00:00
hellofromTonya
e7e57a7aeb Build/Test Tools: Introduce local visual regression testing.
Adds the ability to ''locally'' run visual regression testing for wp-admin pages via `npm run test:visual`. Snapshots are stored on contributors' local machines.

Note:
Wiring to the CI is not included. Why? The challenges for the CI are storage of the artifacts and unreliability of testing these across different environments.

This commit is a first step towards visual regression testing. Running it locally provides a learning opportunity which could help to craft how to build it into the automated CI process.

Props isabel_brison, andraganescu, azaozz, danfarrow, desrosj, hellofromTonya, justinahinon, netweb, talldanwp.
Fixes #49606.
Built from https://develop.svn.wordpress.org/trunk@51989


git-svn-id: http://core.svn.wordpress.org/trunk@51578 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 21:05:13 +00:00
Sergey Biryukov
1fdea15a96 Coding Standards: Fix some WPCS errors and warnings in wp-admin/user-edit.php:
* Add missing translators comment.
* Add missing space, correct indentation.
* Put opening and closing PHP tag on a line by itself.
* Remove unnecessary escaping for consistency with other strings.

Follow-up to [51980].

See #53658.
Built from https://develop.svn.wordpress.org/trunk@51988


git-svn-id: http://core.svn.wordpress.org/trunk@51577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 20:19:59 +00:00
johnjamesjacoby
88e9e36233 Help/About: add WordPress version to contextual "Help" sidebar area.
This change adds a new way for users to quickly identify what version of WordPress they are looking at, directly from the "Help" sidebar on the main "Dashboard" page.

* Stable versions will link to their respective support documents.
* Development versions (alpha/beta/RC) will not link anywhere.

Props audrasjb, costdev, donmhico, hellofromtonya, ipstenu, justinahinon, karmatosed, knutsp, marybaum, sergeybiryukov, webcommsat.

Fixes #47848.
Built from https://develop.svn.wordpress.org/trunk@51985


git-svn-id: http://core.svn.wordpress.org/trunk@51574 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 19:09:03 +00:00
johnjamesjacoby
43644069ea Permalinks: Sanitize non-visible characters inside sanitize_title_with_dashes().
This change prevents non-visible characters in titles from creating encoded values in permalinks, opting instead for the following replacement strategy:

* Non-visible non-zero-width characters are replaced with hyphens
* Non-visible zero-width characters are removed entirely

Included with this change are 64 additional PHPUnit assertions to confirm that only the targeted non-visible characters are sanitized as intended.

Before this change, URLs would unintentionally contain encoded values where these non-visible characters were. After this change, URLs intentionally strip out or hyphenate these non-visible characters.

Props costdev, dhanendran, hellofromtonya, paaljoachim, peterwilsoncc, poena, sergeybiryukov.

Fixes #47912.
Built from https://develop.svn.wordpress.org/trunk@51984


git-svn-id: http://core.svn.wordpress.org/trunk@51573 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 18:47:57 +00:00
Sergey Biryukov
3ab8d52d78 Media: Use WP_Query::get() method to retrieve the posts_per_page value in wp_ajax_query_attachments().
This avoids a PHP notice and ensures that a default value is always provided if none is set by the user.

Follow-up to [51145], [51485].

Props davidwebca, mukesh27.
Fixes #54129.
Built from https://develop.svn.wordpress.org/trunk@51982


git-svn-id: http://core.svn.wordpress.org/trunk@51571 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 18:30:02 +00:00
johnjamesjacoby
fae48afc92 Application Passwords: display guiding text & link in user-edit.php when unavailable.
This change intends to avoid confusion around the requirements of the Application Passwords feature, specific to it requiring HTTPS and the `WP_ENVIRONMENT_TYPE` constant.

It does this by conditionally hiding the traditional UI and showing some insightful explanations instead, including a translatable link to the `WP_ENVIRONMENT_TYPE` documentation on the "Editing wp-config.php" support page.

Props ashfame, audrasjb, iluy, johnbillion.

Fixes  #53658.
Built from https://develop.svn.wordpress.org/trunk@51980


git-svn-id: http://core.svn.wordpress.org/trunk@51569 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 17:57:03 +00:00
johnjamesjacoby
6d451fb64b Admin/UI-Copy: reword some "we" usages.
This changes some admin-area, user-facing text, to better match the guidelines and recommendations set forth in the make/core handbook, specifically:

> the word “we” should be avoided (...) unless its made very clear which group is speaking

(There are several more usages of "we" that will receive this same scrutiny in future commits/releases.)

Props audrasjb, johnbillion, marybaum, peterwilsoncc, sergeybiryukov, shital-patel.

Fixes  #46057.
Built from https://develop.svn.wordpress.org/trunk@51979


git-svn-id: http://core.svn.wordpress.org/trunk@51568 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 17:37:57 +00:00
johnjamesjacoby
f5991aed63 Themes: Introduce get_header_image_tag_attributes hook.
This change adds a filter inside of the `get_header_image_tag()` function allowing developers to filter the attributes of the header image HTML tag before they are escaped, concatenated, and returned.

Before this change, it was not possible to externally and preemptively intercept this array of attributes. After this change, these attributes can now be easily filtered, matching it nicely to the `wp_get_attachment_image_attributes` hook.

Props audrasjb, chaion07, junaidbhura, sabernhardt.

Fixes #38942.
Built from https://develop.svn.wordpress.org/trunk@51978


git-svn-id: http://core.svn.wordpress.org/trunk@51567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 17:21:58 +00:00
johnjamesjacoby
f60dae0731 Admin/Menu: include 960 exact pixel width in collapse measurements.
This change removes a 1 pixel gap in the measurement of the viewport width when clicking the "Collapse menu" button (at the bottom of the admin menu UI) when already collapsed, causing the menu not to open as intended when exactly 960 pixels wide.

Before this change, the menu would be stuck in the collapsed position. After this change, the menu opens as expected.

Props abesell132, ankit-k-gupta, audrasjb, boniu91, mai21, sabernhardt, webaxones.

Fixes #54210.
Built from https://develop.svn.wordpress.org/trunk@51977


git-svn-id: http://core.svn.wordpress.org/trunk@51566 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 17:07:57 +00:00
johnjamesjacoby
dd7cb532a1 Admin/Discussion Settings: attempt to clarify intent of "Default post settings" section.
This changes the descriptive text underneath 3 settings that are frequently overridden by individual posts & pages, and are also often misunderstood to work differently than they do.

"(These settings may be overridden for individual posts.)"

...becomes...

"Individual posts may override these settings. Changes here will only be applied to new posts."

* Parenthesis were removed to improve text layout and flow for RTL languages.
* Original statement was reworded to emphasize "individual posts".
* New statement provides clarity to users about settings changes not being retroactive.

Props audrasjb, johnjamesjacoby, sabbirshouvo, sabernhardt, tobifjellner.

Fixes #54300.
Built from https://develop.svn.wordpress.org/trunk@51976


git-svn-id: http://core.svn.wordpress.org/trunk@51565 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 16:42:59 +00:00
johnjamesjacoby
791998fb7c Admin/Comments: remove bespoke truncation from search string HTML.
This change removes a call to `wp_html_excerpt()` used on the HTML output of the search string, supplied by the current user in the previous page request via the named `s` input in the search-box UI.

If the search string is extremely long, it wraps around the available empty space in a way that is not visually displeasing, confirming that truncation is not a requirement here.

This also addresses a small accessibility concern as the non-truncated string was not alternatively presented, and helps normalize the output of `$_REQUEST['s']` for more broad improvements in the future.

Props hareesh-pillai, jakubtyrcha, johnjamesjacoby, lukecavanagh, sabernhardt.

Fixes #17636.
Built from https://develop.svn.wordpress.org/trunk@51975


git-svn-id: http://core.svn.wordpress.org/trunk@51564 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 15:57:59 +00:00
joedolson
a5293aa581 Build/Test Tools: Restore changes to package.json.
Reverts changes to package.json and package-lock.json accidentally committed in [51967].

Props tobiasbg.
Fixes #54054.
Built from https://develop.svn.wordpress.org/trunk@51974


git-svn-id: http://core.svn.wordpress.org/trunk@51563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 14:26:14 +00:00
hellofromTonya
cf0274e1ca REST API: Add URL Details endpoint.
Adds a new REST API endpoint (`/wp-block-editor/v1/url-details`) for retrieving information from an external URL.

Information retrieved:

* Title: content of the `<title>` element
* Icon: favicon image link
* Description: content of the `description` or `og:description` meta element
* Image: OG image link

This endpoint is used by the block editor for link previews.

Props get_dave, aduth, andraganescu, beaulebens, hellofromTonya, kevin940726, mamaduka, marekhrabe, mnelson4, noisysocks, obenland, ocean90, retrofox, shaunandrews, spacedmonkey, swissspidy, timothyblynjacobs, xknown, youknowriad.
Fixes #54358.
Built from https://develop.svn.wordpress.org/trunk@51973


git-svn-id: http://core.svn.wordpress.org/trunk@51562 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-02 12:48:00 +00:00
joedolson
c90e2fe4f2 Widgets: Remove unused CSS breaking wp_text_diff layout.
Remove CSS used in version of `wp_text_diff` prior to [50034]. Orphaned CSS breaks default layout of function output, but is overridden in the revisions screen.

Props mt8.biz, hareesh-pillai, mukesh27.
Fixes #54140.
Built from https://develop.svn.wordpress.org/trunk@51972


git-svn-id: http://core.svn.wordpress.org/trunk@51561 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-01 23:14:00 +00:00
joedolson
67779da49f Widgets: Use a text-based button to select location.
The WordPress Events and News widget used an icon-only button to select a location. The Pencil icon alone provided insufficient context and labeling for accessibility. Add text to clearly describe button action and change icon to represent a location marker. 

Props AmethystAnswers, sabernhardt.
Fixes #53311.
Built from https://develop.svn.wordpress.org/trunk@51971


git-svn-id: http://core.svn.wordpress.org/trunk@51560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-01 22:54:57 +00:00
hellofromTonya
69dc72d0b9 Site Health: Internationalizes count in the info section headings.
If a site health info section includes the `show_count` parameter, this commit internationalizes the count.

Follow-up to [45176].

Props johnbillion, swissspidy.
Fixes #54341.
Built from https://develop.svn.wordpress.org/trunk@51970


git-svn-id: http://core.svn.wordpress.org/trunk@51559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-01 22:36:59 +00:00
joedolson
a841368a3e Editor: Include post's title in editor title element.
Include the current post title in the `title` element when editing a post. Improve accessibility by distinguishing between different edit screens in the browser tab list. 

Props skierpage, alexstine, audrasjb, sabernhardt.
Fixes #52314.
Built from https://develop.svn.wordpress.org/trunk@51969


git-svn-id: http://core.svn.wordpress.org/trunk@51558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-01 22:32:58 +00:00
hellofromTonya
1c73f953c3 Build/Test Tools: Ignore "null to nullable" deprecations for select tests.
Adds an expectation for PHP 8.1 "passing null to non-nullable" deprecation notice to select tests where the deprecation is generated by one of the functions in the `wp-includes/formatting.php` file, either via a filter hook callback or by a direct call.

Instead of haphazardly fixing these issues exposed by the tests, a more structural and all-encompassing solution for input validation should be architected and implemented as otherwise, we'll keep running into similar issues time and again with each new PHP version.

To discourage people from "fixing" these issues now anyway, this commit "hides" nearly all of these issues from the test runs.

Once a more structural solution is designed, these tests and the underlying functions causing the deprecation notices should be revisited and the structural solution put in place.

Includes a few minor other tweaks to select tests:
* Removing a stray `return` (twice) from assertion statements.
* Removing calls to `ob_*()` functions in favour of letting PHPUnit manage the output catching. This prevents warnings along the lines of `Test code or tested code did not (only) close its own output buffers`.

Props jrf, hellofromTonya.
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51968


git-svn-id: http://core.svn.wordpress.org/trunk@51557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-01 22:24:00 +00:00
joedolson
a3a61c5a3e General: Remove role="navigation" from nav elements.
Role="navigation" was required for assistive technology to recognize HTML5 element's native ARIA roles while HTML5 and ARIA were being introduced. With the deprecation of IE11, the role attribute is only required when mapping elements that don't have native role.

Props costdev, mukesh27.
Fixes #54054.
Built from https://develop.svn.wordpress.org/trunk@51967


git-svn-id: http://core.svn.wordpress.org/trunk@51556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-01 21:47:13 +00:00
hellofromTonya
78e5b8481c Application Passwords: Add end-to-end (e2e) tests.
Adds end-to-end (e2e) tests for the following test scenarios:
* Create a new application password.
* Create an application password with an existing name.
* Revoke a single application password.
* Bulk revoke applications passwords.

Follow-up to [49109], [49276], [49562], [50001], [50367], [51463].

Props justinahinon, swissspidy, juhise, kevin940726, isabel_brison.
Fixes #54241.
Built from https://develop.svn.wordpress.org/trunk@51966


git-svn-id: http://core.svn.wordpress.org/trunk@51555 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-01 21:42:00 +00:00
Sergey Biryukov
b855ffec3f Docs: Add a @since note for the rest_namespace argument of register_post_type() and register_taxonomy().
Use 3-digit, x.x.x-style semantic versioning for `@since` tags of the `$rest_namespace` property in `WP_Post_Type` and `WP_Taxonomy`.

Add a `@since` note to `WP_REST_Taxonomies_Controller::get_item_schema()` for the `visibility` and `rest_namespace` properties.

The `rest_base` property was also added after the method was initially introduced, but that happened during the same release cycle, so it doesn't need a separate `@since` note.

Follow-up to [38832], [39191], [42729], [51959], [51961], [51962], [51964].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@51965


git-svn-id: http://core.svn.wordpress.org/trunk@51554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-01 14:31:00 +00:00
TimothyBlynJacobs
c0995319f4 REST API: Support custom namespaces for taxonomies.
While a taxonomy can define a custom route by using the rest_base argument, a namespace of wp/v2 was assumed. This commit introduces support for a rest_namespace argument.

A new rest_get_route_for_taxonomy_items function has been introduced and the rest_get_route_for_term function updated to facilitate getting the correct route for taxonomies.

For maximum compatibility sticking with the default wp/v2 namespace is recommended until the API functions see wider use.

Props spacedmonkey.
Fixes #54267.
See [51962].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51553 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-01 03:27:55 +00:00
Gary Pendergast
2c3205bb84 KSES: Add options for restricting tags based upon their attributes.
This change adds two now attribute-related config options to KSES:
- An array of allowed values can be defined for attributes. If the attribute value doesn't fall into the list, the attribute will be removed from the tag.
- Attributes can be marked as required. If a required attribute is not present, KSES will remove all attributes from the tag. As KSES doesn't match opening and closing tags, it's not possible to safely remove the tag itself, the safest fallback is to strip all attributes from the tag, instead.

Included with this change is an implementation of these options, allowing the `<object>` tag to be stored in posts, but only when it has a `type` attribute set to `application/pdf`.

Props pento, swissspidy, peterwilsoncc, dd32, jorbin.
Fixes #54261.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51552 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-11-01 02:13:56 +00:00
TimothyBlynJacobs
bac6e41c85 REST API: Support custom namespaces for custom post types.
While a custom post type can define a custom route by using the `rest_base` argument, a namespace of `wp/v2` was assumed. This commit introduces support for a `rest_namespace` argument. 

A new `rest_get_route_for_post_type_items` function has been introduced and the `rest_get_route_for_post` function updated to facilitate getting the correct route for custom post types.

While the WordPress Core Block Editor bootstrap code has been updated to use these API functions, for maximum compatibility sticking with the default `wp/v2` namespace is recommended until the API functions see wider use.

Props spacedmonkey, swissspidy.
Fixes #53656.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-31 23:16:58 +00:00
Sergey Biryukov
c60a9d92e2 Docs: Add a @since note to WP_REST_Post_Types_Controller::get_item_schema() for the supports and visibility properties.
The `taxonomies` and `rest_base` properties were also added after the method was initially introduced, but that happened during the same release cycle, so they don't need a separate `@since` note.

Follow-up to [38832], [39097], [39191], [39647], [51959].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@51961


git-svn-id: http://core.svn.wordpress.org/trunk@51550 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-31 20:28:01 +00:00
TimothyBlynJacobs
af212ad9b3 REST API: Send a 500 status code when JSON encoding fails.
Previously, a 200 status code would be sent despite the 500 status code present in the response body.

Props hermpheus, lalitjalandhar.
Fixes #53056.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51549 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-31 06:07:56 +00:00
TimothyBlynJacobs
f76071026b REST API: Add visibility information to the Post Types controller.
Props spacedmonkey, peterwilsoncc.
Fixes #54055.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51548 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-31 05:19:01 +00:00
John Blackbourn
3d86f8af55 Application Passwords: Various docblock improvements.
See #53399, #42790

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


git-svn-id: http://core.svn.wordpress.org/trunk@51547 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-30 20:26:59 +00:00
John Blackbourn
c274d3c520 Docs: Miscellaneous docblock improvements.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-30 20:17:01 +00:00
Sergey Biryukov
4459eaf392 Docs: Further update the debug_information filter description per the documentation standards.
Specifically, this ensures that the DocBlock follows the line wrapping recommendations.

Follow-up to [44986], [45156], [45259], [51949].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@51956


git-svn-id: http://core.svn.wordpress.org/trunk@51545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-30 13:41:02 +00:00
John Blackbourn
6babc3833b Docs: Miscellaneous docblock improvements.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51544 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-29 23:13:05 +00:00
desrosj
4a0480a67d Build/Test Tools: Use correct URL for a GitHub Action workflow run.
Follow up to [51921], [51937], [51953].
Unprops desrosj.
See #53363.
Built from https://develop.svn.wordpress.org/trunk@51954


git-svn-id: http://core.svn.wordpress.org/trunk@51543 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-29 20:34:58 +00:00
desrosj
ab1786d059 Build/Test Tools: Adjust Slack notifications for scheduled and workflow_dispatch events.
This makes the needed adjustments to fix Slack notifications for `scheduled` and `workflow_dispatch` events. The data needed to send notifications for these events are stored in different locations, or need to be accessed through API requests.

Follow up to [51921], [51937].
See #53363.
Built from https://develop.svn.wordpress.org/trunk@51953


git-svn-id: http://core.svn.wordpress.org/trunk@51542 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-29 20:00:58 +00:00
desrosj
deb3eca81a Build/Test Tools: Escape $ within commit messages for `$variables.
This ensures the variables are preserved in the Slack message.

Props ocean90, desrosj.
See #53363.
Built from https://develop.svn.wordpress.org/trunk@51952


git-svn-id: http://core.svn.wordpress.org/trunk@51541 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-29 19:41:56 +00:00
Sergey Biryukov
0e2f9ad5b6 Coding Standards: Correct alignment in WP_Site_Health::get_test_update_temp_backup_writable().
This fixes an `Equals sign not aligned with surrounding assignments; expected 1 space but found 6 spaces` WPCS warning.

Follow-up to [51815].

See #51857, #53359.
Built from https://develop.svn.wordpress.org/trunk@51951


git-svn-id: http://core.svn.wordpress.org/trunk@51540 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-29 16:52:57 +00:00
John Blackbourn
0775153e27 Date/Time: Improve the docblocks for various date and time related functions.
See #53399, #28992, #40653

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


git-svn-id: http://core.svn.wordpress.org/trunk@51539 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-29 16:51:56 +00:00
John Blackbourn
a0d8a60547 Site Health: Correct and improve the documentation for the debug_information hook.
This corrects the structure of the documentation so it accurately reflects the array elements contained within.

See #53399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51538 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-29 15:35:00 +00:00
joedolson
2f3b779563 Media: Remove deprecated click function in media uploader.
Replace the call to jQuery's deprecated click handler.

Props kapilpaul.
Fixes #53261.
Built from https://develop.svn.wordpress.org/trunk@51947


git-svn-id: http://core.svn.wordpress.org/trunk@51536 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-28 17:50:58 +00:00
joedolson
d71ae9a7e3 Administration: Hide mobile menu on focusout.
Closes the admin menu on mobile devices when keyboard focus moves outside of the menu or menu toggle elements. Improves the usability of the menu on mobile by allowing closure anywhere outside the menu rather than only on the toggle. 

Props kaneva, costdev, sabernhardt
Fixes #53587.
Built from https://develop.svn.wordpress.org/trunk@51946


git-svn-id: http://core.svn.wordpress.org/trunk@51535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-28 17:28:56 +00:00
joedolson
acabcf82ff Media: Close attachment details modal with esc key.
The event that fired closing the attachment details modal also removed the keydown event listener, so subsequent modals could not be closed with the escape key.

Props vondelphia, sourovroy, sabernhardt
Fixes #53924.
Built from https://develop.svn.wordpress.org/trunk@51945


git-svn-id: http://core.svn.wordpress.org/trunk@51534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-28 16:07:59 +00:00
Sergey Biryukov
a5926f8ece Coding Standards: Correct alignment in wp_enqueue_global_styles().
This fixes an `Equals sign not aligned with surrounding assignments; expected 5 spaces but found 1 space` WPCS warning.

Follow-up to [50973], [51819].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@51944


git-svn-id: http://core.svn.wordpress.org/trunk@51533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-28 14:10:59 +00:00
Pascal Birchler
a225165010 Role/Capability: Add support for capability queries in WP_User_Query.
Similar to the existing `role`/`role__in`/`role__not_in` query arguments, this adds support for three new query arguments in `WP_User_Query`:

* `capability` 
* `capability__in`
* `capability__not_in`

These can be used to fetch users with (or without) a specific set of capabilities, for example to get all users
with the capability to edit a certain post type.

Under the hood, this will check all existing roles on the site and perform a `LIKE` query against the `capabilities` user meta field to find:

* all users with a role that has this capability
* all users with the capability being assigned directly

Note: In WordPress, not all capabilities are stored in the database. Capabilities can also be modified using filters like `map_meta_cap`. These new query arguments do NOT work for such capabilities.

The prime use case for capability queries is to get all "authors", i.e. users with the capability to edit a certain post type.

Until now, `'who' => 'authors'` was used for this, which relies on user levels. However, user levels were deprecated a long time ago and thus never added to custom roles. This led to constant frustration due to users with custom roles missing from places like author dropdowns.

This updates any usage of `'who' => 'authors'` in core to use capability queries instead.

Subsequently, `'who' => 'authors'` queries are being **deprecated** in favor of these new query arguments.

Also adds a new `capabilities` parameter (mapping to `capability__in` in `WP_User_Query`) to the REST API users controller.

Also updates `twentyfourteen_list_authors()` in Twenty Fourteen to make use of this new functionality, adding a new `twentyfourteen_list_authors_query_args` filter to make it easier to override this behavior.

Props scribu, lgladdly, boonebgorges, spacedmonkey, peterwilsoncc, SergeyBiryukov, swissspidy.
Fixes #16841.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-27 18:43:57 +00:00
Sergey Biryukov
311cf99866 Docs: Document the usage of some globals in wp-includes/script-loader.php.
Follow-up to [44114], [44262], [49080], [50761], [51471].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@51942


git-svn-id: http://core.svn.wordpress.org/trunk@51531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-27 18:21:58 +00:00
Sergey Biryukov
6a5a0062ff Script Loader: Correct the number of arguments passed to the closure in enqueue_block_styles_assets().
This avoids an `Uncaught ArgumentCountError: Too few arguments to function {closure}(), 1 passed` PHP fatal error when registering a block style with the `should_load_separate_core_block_assets` filter enabled.

Follow-up to [51471].

Props aristath, shimon246, jrf, gziolo.
Fixes #54323.
Built from https://develop.svn.wordpress.org/trunk@51941


git-svn-id: http://core.svn.wordpress.org/trunk@51530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-27 17:10:01 +00:00
Sergey Biryukov
156a453ed9 Coding Standards: Rename the $process variable to $processed_response for clarity in WP_Http_Streams::request().
Includes minor code layout fixes for better readability.

Follow-up to [8516], [51826], [51929], [51931].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@51940


git-svn-id: http://core.svn.wordpress.org/trunk@51529 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-27 15:03:58 +00:00
johnjamesjacoby
7a0a07d691 Admin/HTTP API: add suggested filename support to download_url().
This change allows for external clients to supply a suggested filename via a `Content-Disposition` response header. This filename is processed through `sanitize_file_name()` to ensure it is allowable (on the server, MIME's, etc...) and `validate_file()` to prevent directory traversal.

If the suggested filename fails the above processing/checks, that suggestion is discarded and the standard temporary filename (generated by WordPress) is used.

If no `Content-Disposition` header is found in the response headers, the standard temporary filename continues to be used as per normal.

Included in this change are 6 additional PHPUnit tests with 9 assertions. These tests confirm that valid filename values are correctly saved, and invalid filename values are correctly rejected.

Props cklosows, costdev, dd32, johnjamesjacoby, ocean90, psrpinto.

Fixes #38231.
Built from https://develop.svn.wordpress.org/trunk@51939


git-svn-id: http://core.svn.wordpress.org/trunk@51528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-27 15:00:01 +00:00
Sergey Biryukov
b8e6a3c334 Tests: Some test improvements for clean_dirsize_cache() tests:
* Move the directory being tested to the `data` directory, for consistency with other test data.
* Set the `svn:eol-style` property to `native`, for consistency with other files.
* Correct the test class name in `dummy.txt`.

Follow-up to [51246], [51910], [51911].

See #52241, #53363.
Built from https://develop.svn.wordpress.org/trunk@51938


git-svn-id: http://core.svn.wordpress.org/trunk@51527 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-26 02:03:58 +00:00
desrosj
3867e66520 Build/Test Tools: Use the correct workflow name in notifications on workflow_run.
When a workflow is triggered through a `workflow_run` event, the context is not the original workflow. The details about the original workflow are passed through the `github.event` context.

This also moves the conditional check controlling whether the Slack workflow is run into the calling workflows to prevent them from running for pull requests.

Follow up to [51921-51922,51924-51925,51934].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51937


git-svn-id: http://core.svn.wordpress.org/trunk@51526 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-25 20:27:56 +00:00
desrosj
fc06dda73e Build/Test Tools: Restore Slack notifications for older branches.
In [51921], the GitHub Actions workflows were updated to utilize the Slack notifications workflow as a callable one instead of on the `workflow_run` event.

This eliminated the need for an additional “Slack Notifications” workflow run for every completed workflow, but only when other workflows are updated as well. This resulted in notifications from older branches breaking, as the changes in [51921] were not backported.

Instead of backporting the needed changes now (the Slack workflow is still being polished), this commit partially restores the `workflow_run` event for older branches so that notifications will resume.

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51934


git-svn-id: http://core.svn.wordpress.org/trunk@51525 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-25 19:30:00 +00:00
Sergey Biryukov
d31f31c579 Coding Standards: Rename $theHeaders variable to $processed_headers in WP_Http_Curl::request().
This fixes a `Variable "$theHeaders" is not in valid snake_case format` WPCS warning.

Follow-up to [8516], [8520], [51826], [51929].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@51931


git-svn-id: http://core.svn.wordpress.org/trunk@51524 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-25 16:20:00 +00:00
Peter Wilson
cdf1000cbb Docs: Use sign-up & signup consistently in wp-signup.php.
In the docblocks throughout `wp-signup.php` use sign up for verbs and sign-up for nouns.

Props audrasjb, jeffpaul.
Fixes #54041. See #53399.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51523 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-25 00:23:57 +00:00
Sergey Biryukov
f8f74e7aa5 Coding Standards: Rename the $arrHeaders variable to $processed_headers in WP_Http_Streams::request().
This fixes a `Variable "$arrHeaders" is not in valid snake_case format` WPCS warning.

Follow-up to [8516], [51826].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@51929


git-svn-id: http://core.svn.wordpress.org/trunk@51522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-24 19:23:00 +00:00
Sergey Biryukov
50aa2df391 Tests: Add @ticket references for page_on_front canonical tests.
Follow-up to [669/tests], [849/tests], [36238], [47760].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51928


git-svn-id: http://core.svn.wordpress.org/trunk@51521 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-23 12:38:01 +00:00
Sergey Biryukov
d468eb17c3 Coding Standards: Escape id attributes in WP_Customize_Control::render_content() and ::print_template().
Follow-up to [30014], [38906].

Props sabbirshouvo.
See #54295.
Built from https://develop.svn.wordpress.org/trunk@51927


git-svn-id: http://core.svn.wordpress.org/trunk@51520 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-22 16:09:59 +00:00
Sergey Biryukov
4152fbfdb2 Coding Standards: Improve escaping in wp_login_form().
* Split long concatenated lines using `sprintf()`. This aims to improve readability and avoid multiple `esc_attr()` calls for the same value.
* Escape the form `name` and `id` attributes.

Follow-up to [12696], [18444], [19033].

Props sabbirshouvo, mukesh27, audrasjb, henry.wright, SergeyBiryukov.
Fixes #54279.
Built from https://develop.svn.wordpress.org/trunk@51926


git-svn-id: http://core.svn.wordpress.org/trunk@51519 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-21 18:19:00 +00:00
desrosj
e791d7f5db Build/Test Tools: Fix syntax for passing secrets to a called workflow.
Follow up to [51923].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51925


git-svn-id: http://core.svn.wordpress.org/trunk@51518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-20 19:51:58 +00:00
desrosj
1d76e9f33c Build/Test Tools: Pass required secrets to the Slack notifications workflow.
Secrets are not available within callable workflows by default. They must be defined within the callable workflow, and passed from the calling workflow.

Follow up to [51921-51922].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51924


git-svn-id: http://core.svn.wordpress.org/trunk@51517 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-20 19:26:57 +00:00
Sergey Biryukov
e6ede0c816 Coding Standards: Improve escaping in wp-admin/theme-install.php.
* Rename a duplicate `$feature_name` variable to `$feature_group` for clarity.
* Escape the remaining `$feature_name` variable.

Follow-up to [27636], [35273].

Props sabbirshouvo, sabernhardt, mukesh27, afragen.
Fixes #54277.
Built from https://develop.svn.wordpress.org/trunk@51923


git-svn-id: http://core.svn.wordpress.org/trunk@51516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-20 19:18:01 +00:00
desrosj
b54ec08215 Build/Test Tools: Adjustments as a follow up to [51921].
This adjusts the syntax for using the `github-scripts` action.

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51922


git-svn-id: http://core.svn.wordpress.org/trunk@51515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-20 15:36:58 +00:00
desrosj
0f8c4989b0 Build/Test Tools: Modify the Slack notifications workflow to be a reusable one.
The ability to reuse workflow files within GitHub Action workflows was recently added and allows for less code duplication.

In the context of WordPress Core, this also eliminates the need for an additional “Slack Notifications” workflow to run for every completed workflow.

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51921


git-svn-id: http://core.svn.wordpress.org/trunk@51514 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-20 14:42:02 +00:00
Sergey Biryukov
2c84d63322 Help/About: Don't output empty <span> tags on Credits screen.
If the contributor does not have a title, the empty tags are not necessary.

Follow-up to [17877], [17909], [17942], [18162], [19143], [46709].

Props sayedulsayem, audrasjb, mukesh27.
Fixes #54275.
Built from https://develop.svn.wordpress.org/trunk@51920


git-svn-id: http://core.svn.wordpress.org/trunk@51513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-19 23:09:00 +00:00
hellofromTonya
234877c9c3 Coding Standards: Add public visibility to methods in src directory.
This commit adds the `public` visibility keyword to each method which did not have an explicit visibility keyword.

Why `public`?

With no visibility previously declared, these methods are implicitly `public` and available for use. Changing them to anything else would be a backwards-compatibility break.

Props costdev, jrf.
See #54177.
Built from https://develop.svn.wordpress.org/trunk@51919


git-svn-id: http://core.svn.wordpress.org/trunk@51512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-18 17:52:58 +00:00
Sergey Biryukov
a60032feec Coding Standards: Add a leading zero in the CSS declarations printed by the print_emoji_styles() function.
Follow-up to [31733], [31786].

Props audrasjb, sabernhardt.
Fixes #54284.
Built from https://develop.svn.wordpress.org/trunk@51918


git-svn-id: http://core.svn.wordpress.org/trunk@51511 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-18 16:53:57 +00:00
hellofromTonya
db3a05178b Cron: Remove errant false values in cron array when upgrading to 5.9+.
[51916] fixed a bug where `array( `false` )` was added to the cron array when `_get_cron_array()` returned `false`. 

This commit:
* Removes any `false` values from the cron array when upgrading to 5.9+.
* Bumps the database version.

Follow-up to [44917], [51916].

Props peterwilsoncc, jrf.
See #53950.
Built from https://develop.svn.wordpress.org/trunk@51917


git-svn-id: http://core.svn.wordpress.org/trunk@51510 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-18 13:30:57 +00:00
hellofromTonya
248c36d748 Cron: Fix malformed cron array in wp_schedule_single_event() when _get_cron_array() returns false.
In `wp_schedule_single_event()`, the cron info array is retrieved via a call to `_get_cron_array()` and straight away cast to an array. But as the documentation for that function (correctly) states, the return type of that function is `array|false`, where `false` is returned for a site where no cron jobs have been scheduled (yet).

In the case that `_get_cron_array()` would return `false`, this would now unintentionally create an array with a single entry with key `0` and as the value `false`.

This is a bug. Fixed now by adding validation to the output of `_get_cron_array()` and initializing `$crons` to an empty array if `false` was returned.

Tests added first to prove the bug (a) was introduced in #44818 [44917] and (b) is now fixed.

Follow-up to [44917].

Props jrf, peterwilsoncc.
Fixes #53950.
Built from https://develop.svn.wordpress.org/trunk@51916


git-svn-id: http://core.svn.wordpress.org/trunk@51509 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-18 12:51:58 +00:00
John Blackbourn
00b914db08 REST API: Correct the order of the parameters documented for WP_REST_Server::respond_to_request().
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51508 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-18 11:14:57 +00:00
Sergey Biryukov
cea5785cdb Coding Standards: Consistently escape form action URL in wp-admin/update-core.php.
Follow-up to [10166], [23739], [25806].

Props sabbirshouvo, mukesh27.
Fixes #54278.
Built from https://develop.svn.wordpress.org/trunk@51914


git-svn-id: http://core.svn.wordpress.org/trunk@51507 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-17 20:31:02 +00:00
Sergey Biryukov
8447683474 Docs: Improve documentation for the tax_input parameter of wp_insert_post().
Follow-up to [10222], [13217], [33922].

Props dingo_d.
Fixes #54264.
Built from https://develop.svn.wordpress.org/trunk@51913


git-svn-id: http://core.svn.wordpress.org/trunk@51506 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-16 02:38:58 +00:00
hellofromTonya
4a1cc2c3e2 FileSystem API: Add safeguard for invalid return from get_attached_file() in wp_delete_attachment().
The `get_attached_file()` function is supposed to return the path to the file, but could:
1. Return `false` if the file doesn't exist.
2. Return literally anything else, as a filter is being applied to the value on return.

As the `clean_dirsize_cache()` now has input validation, passing anything but a non-empty string to `clean_dirsize_cache()` will result in a PHP error notice.

This was exposed by the `Tests_Post_GetPostStatus::wpSetUpBeforeClass()` method which started generating unexpected output (the doing it wrong message) during the test run.

While this indicates that there is a flaw in the mocking being done in the test suite, debugging that is outside of the scope of the current patch.

At the same time, as based on the above point, this ''could'' potentially happen in a real-world situation as well, adding additional conditions to the `if` in the `wp_delete_attachment()` function before calling the `clean_dirsize_cache()` function, is warranted.

As there are no tests for the `wp_delete_attachment()` function at all at this time, we're not adding a test specifically for this change for now. This should however be addressed in the future, when tests will be added to cover the `wp_delete_attachment()` function completely. 

Follow-up to [32619], [49212], [51910].

Props jrf, hellofromTonya.
See #52241.
Built from https://develop.svn.wordpress.org/trunk@51912


git-svn-id: http://core.svn.wordpress.org/trunk@51505 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-15 22:58:56 +00:00
hellofromTonya
4471c3787c FileSystem API: Fix autovivification deprecation notice in recurse_dirsize().
>PHP natively allows for autovivification (auto-creation of arrays from falsey values). This feature is very useful and used in a lot of PHP projects, especially if the variable is undefined. However, there is a little oddity that allows creating an array from a `false` and `null` value.

The above quote is from the PHP 8.1 RFC and the (accepted) RFC changes the behaviour described above to deprecated auto creation of arrays from `false`. As it is deprecated, it _will_ still work for the time being, but as of PHP 9.0, this will become a Fatal Error, so we may as well fix it now.

The `recurse_dirsize()` function retrieves a transient and places it in the `$directory_cache` variable, but the `get_transient()` function in WP returns `false` when the transient doesn't exist, which subsequently can lead to the above mentioned deprecation notice.

By verifying that the `$directory_cache` variable is an array before assigning to it and initializing it to an empty array, if it's not, we prevent the deprecation notice, as well as harden the function against potentially corrupted transients where this transient would not return the expected array format, but some other variable type.

Includes adding dedicated unit tests for both the PHP 8.1 issue, as well as the hardening against corrupted transients.

Includes some girl-scouting: touching up a parameter description and some code layout.

Refs:
* https://wiki.php.net/rfc/autovivification_false
* https://developer.wordpress.org/reference/functions/get_transient/

Follow-up to [49212], [49744].

Props jrf, hellofromTonya.
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51911


git-svn-id: http://core.svn.wordpress.org/trunk@51504 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-15 22:53:58 +00:00
hellofromTonya
82141be0d8 FileSystem API: Fix infinite loop on Windows for clean_dirsize_cache().
When the PHP native `dirname()` function is used on a Windows disk name - i.e. `C:\`-, it will return the same, i.e, it will return `C:\` again.

The `clean_dirsize_cache()` function didn't have guard clause against this, which meant that on Windows based systems and IIS servers, this function would result in WordPress getting stuck into an infinite loop.

The adjustment to the `while` part of the function fix this by checking if the return value of the `dirname()` function call is the same as the original path passed to `dirname()`, which effectively fixes the infinite loop.

A number of other improvements made:

1. Add input validation for the `$path` parameter to guard against invalid variable types being passed into the function.

2. Guard against an empty `$path` parameter, which would result in an infinite loop on both Windows as well as *nix based systems.

In both these cases, a PHP notice will now be thrown.

3. When a non-empty string, which isn't a path would previously be passed, the `dirname()` function would transform that to a `.` and the `.` key in the transient cache would be cleared out.
This was a bug as there is no relation between a non-path string and the root directory of file system.

This bug has been fixed by checking that something could actually be a path and handling received non-empty, non-path input parameters in a special way, i.e only removing the cache key for the passed string and bowing out from further processing.

Unfortunately, no tests can be added to guard against the infinite loop.

For the other fixes, we have added appropriate unit tests. 

Follow-up up [49212], [49616], [49744].

Props jrf, hellofromTonya, raubvogel, sergeybiryukov, codezen8, sjlevy, drosmog, teachlynx, ekojr, bartoszgrzesik, joegasper, janthiel, josephdickson, ocean90, audrasjb.
Fixes #52241.
Built from https://develop.svn.wordpress.org/trunk@51910


git-svn-id: http://core.svn.wordpress.org/trunk@51503 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-15 22:25:01 +00:00
Gary Pendergast
44caec31bd Embeds: Add Wolfram Notebook as a trusted oEmbed provider.
Fixes #53326.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51502 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-15 05:04:56 +00:00
Rachel Baker
1f261d083a REST API: Add text-field and textarea-field as available schema formats for string sanitization.
Props ocean90, TimothyBlynJacobs.
Fixes #49960.
Built from https://develop.svn.wordpress.org/trunk@51908


git-svn-id: http://core.svn.wordpress.org/trunk@51501 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-15 02:04:56 +00:00
Sergey Biryukov
8b8b5d8ecc Media: Display the unsaved changes dialog in image edit form using jQuery .text() function.
This ensures that HTML entities like non-breaking spaces are properly displayed instead of being encoded.

Props jdy68, sebastienserre, audrasjb, mukesh27, SergeyBiryukov.
Fixes #54232.
Built from https://develop.svn.wordpress.org/trunk@51907


git-svn-id: http://core.svn.wordpress.org/trunk@51500 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-15 00:18:56 +00:00
Sergey Biryukov
000a1202ad Docs: Update WP_Date_Query documentation to reflect changes in accepted column names.
Remove outdated list of accepted column name values, add a reference to `WP_Date_Query::validate_column()` and the `date_query_valid_columns` filter instead for a more detailed description.

Follow-up to [25139], [25860], [29933], [29934], [29938], [37477], [51905].

Props dimadin, johnjamesjacoby.
Fixes #54248.
Built from https://develop.svn.wordpress.org/trunk@51906


git-svn-id: http://core.svn.wordpress.org/trunk@51499 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-14 18:05:04 +00:00
Sergey Biryukov
b2c8d3bb8c Docs: Update documentation for the date_query_valid_columns filter.
Add a `@since` note for `registered` and `last_updated` as default recognized date query columns. 

Follow-up to [25139], [25860], [29933], [29934], [29938], [37477].

Props dimadin, johnjamesjacoby.
See #54248.
Built from https://develop.svn.wordpress.org/trunk@51905


git-svn-id: http://core.svn.wordpress.org/trunk@51498 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-13 20:00:01 +00:00
hellofromTonya
d2694aa466 Build/Test Tools: Add end-to-end (e2e) tests README.md.
Adds a readme to the `/tests/e2e/` folder to provide (a) instructions of how to run the tests locally and (b) links to documentation.

Follow-up to [45570].

Props isabel_brison, desrosj, justinahinon.
Fixes #53550.
Built from https://develop.svn.wordpress.org/trunk@51904


git-svn-id: http://core.svn.wordpress.org/trunk@51497 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-12 18:52:00 +00:00
Sergey Biryukov
1020306fe9 I18N: Add context for some Media Library filter strings:
* Audio
* Video
* Unattached

This allows for more homogeneous translations in languages where keeping a plural form is important.

Follow-up to [6910], [7397], [8901], [9556], [11749], [13100], [12110], [15491], [15578], [22743], [29426], [29625], [34256], [45651], [46437].

Props jdy68, audrasjb, SergeyBiryukov.
Fixes #54238.
Built from https://develop.svn.wordpress.org/trunk@51903


git-svn-id: http://core.svn.wordpress.org/trunk@51496 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-12 16:44:01 +00:00
Sergey Biryukov
2030b6e313 Upgrade/Install: Restore or clean up the temporary plugin or theme backup on shutdown.
This allows these actions to run ''after'' the main process, without affecting the update. Actions running on `shutdown` are immune to PHP timeouts, so in case the failure was due to a PHP timeout, we'll still be able to properly restore the previous version.

Follow-up to [51815], [51898], [51899].

Props aristath, peterwilsoncc.
See #54166.
Built from https://develop.svn.wordpress.org/trunk@51902


git-svn-id: http://core.svn.wordpress.org/trunk@51495 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-11 15:09:05 +00:00
Sergey Biryukov
130979f91e External Libraries: Revert [51900] for now to investigate test failures.
See #54162.
Built from https://develop.svn.wordpress.org/trunk@51901


git-svn-id: http://core.svn.wordpress.org/trunk@51494 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-10 01:16:57 +00:00
Sergey Biryukov
0c2f44099a External Libraries: Update getID3 to version 1.9.21.
The latest version includes preliminary PHP 8.1 support, as well as a variety of bug fixes.

Release notes: https://github.com/JamesHeinrich/getID3/releases/tag/v1.9.21

A full list of changes in this update can be found on GitHub:
https://github.com/JamesHeinrich/getID3/compare/v1.9.20...v1.9.21

This commit also includes PHPCS adjustments previously made for a passing PHP Compatibility scan.

Follow-up to [47601], [47737], [47902], [48278], [49621], [50714].

Props jrf, SergeyBiryukov.
Fixes #54162.
Built from https://develop.svn.wordpress.org/trunk@51900


git-svn-id: http://core.svn.wordpress.org/trunk@51493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-10 00:13:58 +00:00
Sergey Biryukov
d5887aeec3 Upgrade/Install: Introduce a move_dir() function.
This replaces the `copy_dir()` usage in `WP_Upgrader::install_package()` and aims to avoid PHP timeout issues when installing or updating large plugins on slower systems like Vagrant or the WP Docker test environment.

The new function attempts a native PHP `rename()` function first and falls back to the previous `copy_dir()`.

Follow-up to [51815], [51898].

Props afragen, aristath, peterwilsoncc, galbaras, noisysocks, pbiron.
Fixes #54166. See #51857.
Built from https://develop.svn.wordpress.org/trunk@51899


git-svn-id: http://core.svn.wordpress.org/trunk@51492 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-09 03:38:57 +00:00
Sergey Biryukov
0f2d2264b5 Site Health: Use an integer value as a fallback in the available disk space check.
This avoids a few type problems further in the code: boolean divided by a number, or passing `false` to `size_format()` which is documented to accept integers or strings only.

Follow-up to [51815].

Props TobiasBg.
See #51857.
Built from https://develop.svn.wordpress.org/trunk@51898


git-svn-id: http://core.svn.wordpress.org/trunk@51491 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-09 02:50:56 +00:00
Andrew Ozz
aef14e6d1b External Libraries: Update jQuery UI to 1.13.0 final.
Props Clorith, mgol, azaozz.
Fixes #52163.
Built from https://develop.svn.wordpress.org/trunk@51897


git-svn-id: http://core.svn.wordpress.org/trunk@51490 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-08 18:06:00 +00:00
Sergey Biryukov
c477dcda88 Taxonomy: Populate the WP_Terms_List_Table::$items property in ::prepare_items().
This allows the parent `WP_List_Table::has_items()` method to work as expected, and the override in the child class can now be removed. It also makes the class more consistent with other list table classes.

As a result of this change, the "Bulk actions" dropdown is no longer unnecessarily displayed if there are no terms.

Follow-up to [15491], [17025], [17026].

Props mattoakley, swissspidy, audrasjb, SergeyBiryukov.
Fixes #54181.
Built from https://develop.svn.wordpress.org/trunk@51896


git-svn-id: http://core.svn.wordpress.org/trunk@51489 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-08 00:38:00 +00:00
Sergey Biryukov
f57070bfd1 Docs: Add a @since note for the new $parent_block parameter of several filters:
* `pre_render_block`
* `render_block_data`
* `render_block_context`

Follow-up to [51894].

See #51612.
Built from https://develop.svn.wordpress.org/trunk@51895


git-svn-id: http://core.svn.wordpress.org/trunk@51488 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-07 13:15:59 +00:00
Andrew Ozz
2dc8f381ca Apply the pre_render_block, render_block_data, and render_block_context filters when rendering inner/nested blocks. Introdices another param to these filters: $parent_block that is the "parent" WP_Block instance for nested blocks and null for top level blocks. Adds unit tests for the filters.
Props noisysocks, gaambo, azaozz.
Fixes #51612.
Built from https://develop.svn.wordpress.org/trunk@51894


git-svn-id: http://core.svn.wordpress.org/trunk@51487 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-06 18:49:01 +00:00
Sergey Biryukov
b3d3473ba0 Twenty Twenty-One: Remove duplicate width and height values from social icons.
These values are added dynamically by the `Twenty_Twenty_One_SVG_Icons::get_svg()` method and are not needed in the source array.

Follow-up to [49216].

Props max-dayala, laxman-prajapati, sabernhardt, Presskopp, mukesh27.
Fixes #54208.
Built from https://develop.svn.wordpress.org/trunk@51893


git-svn-id: http://core.svn.wordpress.org/trunk@51486 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-06 15:39:05 +00:00
hellofromTonya
84e3375cd7 Permalinks: Move the Nginx documentation link to help sidebar in wp-admin/options-permalink.php.
The "Documentation on Nginx configuration." link is out of place being below the "Save Changes" button on the Settings > Permalinks UI.

This commit relocates the link to join the other support related content links in the help tab's "For more information:" right sidebar area.

Follow-up to [34691], [45674].

Props audrasjb, hellofromTonya, johnjamesjacoby, mukesh27, peterwilsoncc, timlappe.
Fixes #39258.
Built from https://develop.svn.wordpress.org/trunk@51892


git-svn-id: http://core.svn.wordpress.org/trunk@51485 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-05 23:11:06 +00:00
Sergey Biryukov
a1c50512d7 Accessibility: Privacy: Use red color for action buttons on the Erase Personal Data screen:
* "Erase Personal Data" button in the Next Steps column.
* "Force Erase Personal Data" row action.

This highlights the destructive nature of those buttons to avoid an accidental erasure, and is consistent with other similar UI elements in the admin, e.g. various "Delete", "Spam", or "Trash" buttons.

Props arena, sabernhardt, carike, azaozz, joedolson, audrasjb, SergeyBiryukov.
Fixes #49603.
Built from https://develop.svn.wordpress.org/trunk@51891


git-svn-id: http://core.svn.wordpress.org/trunk@51484 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-05 20:32:05 +00:00
desrosj
dca9c85ff7 Build/Test Tools: Change the patch version used for testing the 5.6 branch of PHP.
This unpins the version of PHP 5.6.20 used when testing the 5.6 branch of PHP.

Using 5.6.20 was an intentional decision in [49162], as that patch version is the oldest version of PHP 5.6 still supported by WordPress. However, as of September 30, 2021, the `5.6.20` image contains a version of OpenSSL with an expired certificate, sometimes resulting in an expired trust chain.

Props Clorith, hellofromTonya, SergeyBiryukov, desrosj.
Merges [51889] to `trunk`.
Fixes #54223.
Built from https://develop.svn.wordpress.org/trunk@51890


git-svn-id: http://core.svn.wordpress.org/trunk@51483 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-05 17:34:59 +00:00
hellofromTonya
a64837dfde Coding Standards: Use strict type check for in_array() in register_block_script_handle().
Follow-up to [51501].

Props aristath, sergeybiryukov.
Fixes #54206. See #53359.
Built from https://develop.svn.wordpress.org/trunk@51888


git-svn-id: http://core.svn.wordpress.org/trunk@51481 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-05 16:53:00 +00:00
hellofromTonya
3c16cc2cfb Administration: Allow plugin action links row to wrap.
When there are several action links or the text for these links is long, the plugin name column's width extends causing the other columns to shrink in width. This case is a less than desirable user experience.

The plugin name's column has `white-space: nowrap` (on larger screens). This commit changes the `white-space` to `normal`, allowing the plugin action links row to wrap into more than one line.

Follow-up to [41695].

Props ankit-k-gupta, nekojonez, sabernhardt, sergeybiryukov.
Fixes #53275.
Built from https://develop.svn.wordpress.org/trunk@51887


git-svn-id: http://core.svn.wordpress.org/trunk@51480 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-05 15:07:05 +00:00
John Blackbourn
cf84fbc988 Docs: Improve various inline documentation for admin bar functions and hooks.
Props audrasjb

See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51479 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-04 20:46:59 +00:00
John Blackbourn
41995176f6 Docs: Miscellaneous inline documentation improvements, including:
* Document the post statuses global as an array of `stdClass` objects
* Document the taxonomies global as an array of `WP_Taxonomy` objects
* Document the return value of the post count functions as `stdClass` objects
* Fix some typos

See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51478 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-04 20:44:02 +00:00
Sergey Biryukov
fb5454c94f Build/Test Tools: Update the @wordress/e2e-test-utils package to version 5.4.3.
This is needed in order to use the [7a33cd43a2/packages/e2e-test-utils/src/rest-api.js REST API functions] implemented in a recent version in Core e2e tests.

Props justinahinon.
Fixes #54215.
Built from https://develop.svn.wordpress.org/trunk@51884


git-svn-id: http://core.svn.wordpress.org/trunk@51477 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-04 11:46:23 +00:00
Sergey Biryukov
b5f1eb9103 HTTP: Remove the DST Root CA X3 certificate expired on September 30, 2021.
> The currently recommended certificate chain as presented to Let’s Encrypt ACME clients when new certificates are issued contains an intermediate certificate (ISRG Root X1) that is signed by an old DST Root CA X3 certificate that expires on 2021-09-30. In some cases the OpenSSL 1.0.2 version will regard the certificates issued by the Let’s Encrypt CA as having an expired trust chain.
> 
> Most up-to-date CA cert trusted bundles, as provided by operating systems, contain this soon-to-be-expired certificate. The current CA cert bundles also contain an ISRG Root X1 self-signed certificate. This means that clients verifying certificate chains can find the alternative non-expired path to the ISRG Root X1 self-signed certificate in their trust store.
> 
> Unfortunately this does not apply to OpenSSL 1.0.2 which always prefers the untrusted chain and if that chain contains a path that leads to an expired trusted root certificate (DST Root CA X3), it will be selected for the certificate verification and the expiration will be reported.

References:
* [https://www.openssl.org/blog/blog/2021/09/13/LetsEncryptRootCertExpire/ Old Let’s Encrypt Root Certificate Expiration and OpenSSL 1.0.2]
* [https://letsencrypt.org/docs/dst-root-ca-x3-expiration-september-2021/ DST Root CA X3 Expiration (September 2021)]

Follow-up to [25224], [25426], [25569], [27307], [30491], [30765], [34283], [35919], [36570], [46094].

Props bradleyt, fierevere.
Fixes #54207. See #50828.
Built from https://develop.svn.wordpress.org/trunk@51883


git-svn-id: http://core.svn.wordpress.org/trunk@51476 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-03 17:51:06 +00:00
TimothyBlynJacobs
bb7a0cf334 REST API: Sort widget types by their id.
Fixes #53303.
Props spacedmonkey.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51475 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-02 21:45:03 +00:00
Sergey Biryukov
e286586eda Twenty Twenty-One: Keep the closing </span> tag in footer links.
When the `link_after` value is emptied to reset any description markup, make sure not to remove the closing tag within footer links.

Follow-up to [49216].

Props sabernhardt, mukesh27.
Fixes #54209.
Built from https://develop.svn.wordpress.org/trunk@51881


git-svn-id: http://core.svn.wordpress.org/trunk@51474 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-02 17:06:00 +00:00
hellofromTonya
b3c6ad3a6b Administration: Enable first and last page buttons in WP_List_Table::pagination().
Previously the first and last page pagination buttons were disabled when on their next or previous page respectively. This commit removes that unnecessary logic to keep these buttons enabled and avoid confusion in the user's navigation workflow. 

New behavior:
- When on page 2, the go to first page `«` button is enabled
- When on the page before the last page, the go to last page `»` button is enabled

Follow-up to [32948], [47219].

Props wp_kc, ronakganatra, knutsp, sabernhardt, Hareesh Pillai, audrasjb, hellofromTonya.
Fixes #42763.
Built from https://develop.svn.wordpress.org/trunk@51880


git-svn-id: http://core.svn.wordpress.org/trunk@51473 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-01 18:39:58 +00:00
Sergey Biryukov
3fd3bc0cde Coding Standards: Use strict comparison in wp-includes/class-wp-http-ixr-client.php.
Follow-up to [16064], [16871], [17928].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@51879


git-svn-id: http://core.svn.wordpress.org/trunk@51472 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-01 15:00:58 +00:00
hellofromTonya
bc217668e2 App Passwords: Remove placeholder from the app password name input field.
In [49294, 49752], the `placeholder` attribute changed to `"WordPress App on My Phone"`. This change causes confusion as the field can be used in a variety of ways and is not limited to a phone.

Given a label exists for each field and clearly identifies its purpose, this commit removes the `placeholder` attribute from the `input` field.

Follow-up to [49109], [49294], [49752].

Props seedsca, audrasjb, joedolson, rehanali.
Fixes #54047.
Built from https://develop.svn.wordpress.org/trunk@51878


git-svn-id: http://core.svn.wordpress.org/trunk@51471 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-10-01 13:49:00 +00:00
Sergey Biryukov
1cad6cfc26 Coding Standards: Use strict comparison in wp-includes/class-http.php.
Follow-up to [10625], [10864], [13274], [29661], [33748], [47508], [47808].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@51877


git-svn-id: http://core.svn.wordpress.org/trunk@51470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-30 14:05:02 +00:00
Sergey Biryukov
fee2d3ed94 Docs: Improve documentation for WP_Admin_Bar methods.
Add some missing descriptions and `@since` tags.

Follow-up to [15671], [19120], [19429], [19501], [19558], [25475], [25478], [25563], [32534], [35157], [40947], [45821], [48826].

Props yagniksangani, hellofromTonya, audrasjb, sabernhardt, mukesh27, rehanali, SergeyBiryukov.
Fixes #54191.
Built from https://develop.svn.wordpress.org/trunk@51876


git-svn-id: http://core.svn.wordpress.org/trunk@51469 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-29 13:39:59 +00:00
Sergey Biryukov
06cea7de84 Twenty Twenty-One: Remove duplicate class name from localized font-family elements.
Follow-up to [46613], [49216], [51874].

Props tmatsuur, aezazshekh.
See #54196.
Built from https://develop.svn.wordpress.org/trunk@51875


git-svn-id: http://core.svn.wordpress.org/trunk@51468 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-28 10:02:57 +00:00
Sergey Biryukov
e7cfe2c963 Twenty Twenty: Remove duplicate class name from localized font-family elements.
Follow-up to [46613].

Props tmatsuur, aezazshekh.
Fixes #54196.
Built from https://develop.svn.wordpress.org/trunk@51874


git-svn-id: http://core.svn.wordpress.org/trunk@51467 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-28 10:00:59 +00:00
Sergey Biryukov
8c52bfe712 Coding Standards: Remove duplicate assignment from a ternary operator in WP_MS_Sites_List_Table::site_states().
Adjust similar code in `_post_states()` and `_media_states()` for consistency.

Follow-up to:
* [12897], [15491], [32755], [46153], [48424] for `WP_MS_Sites_List_Table::site_states()`.
* [17793], [47775], [49223] for `_media_states()`.
* [9153], [46309] for `_post_states()`.

Props joelcj91, audrasjb, desrosj.
Fixes #38296.
Built from https://develop.svn.wordpress.org/trunk@51873


git-svn-id: http://core.svn.wordpress.org/trunk@51466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-27 00:37:01 +00:00
Sergey Biryukov
e85dab2fa8 Tests: Update the Services_JSON test for PHPUnit 9.5.10/8.5.21+.
Since PHPUnit 9.5.10 and 8.5.21, PHP deprecations are no longer converted to exceptions by default (`convertDeprecationsToExceptions="true"` can be configured to enable this).

Reference: [fac02620f6 Do not convert PHP deprecations to exceptions by default]; [https://github.com/sebastianbergmann/phpunit/blob/9.5.10/ChangeLog-9.5.md#9510---2021-09-25 PHPUnit 9.5.10 changelog].

With this change, the test for the `Services_JSON` compat class started failing:
{{{
There was 1 failure:

1) Tests_Compat_jsonEncodeDecode::test_json_encode_decode
Failed asserting that exception of type "PHPUnit\Framework\Error\Deprecated" is thrown.
}}}

This converts the native PHPUnit `::expectDeprecation()` method call in the test to a set of individual WP-specific `::setExpectedDeprecated()` method calls in order to not depend on PHPUnit behavior that is no longer the default.

Additionally, this commit includes support for catching deprecation notices from `_deprecated_file()` function calls to the `WP_UnitTestCase_Base::expectDeprecated()` method.

Follow-up to [46205], [46625], [48996], [51563], [51852], [51871].

Props jrf, netweb, SergeyBiryukov.
See #54183, #54029, #53363.
Built from https://develop.svn.wordpress.org/trunk@51872


git-svn-id: http://core.svn.wordpress.org/trunk@51465 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-26 03:28:58 +00:00
Sergey Biryukov
d227f83302 Build/Test Tools: Update PHPUnit configuration for PHPUnit 9.5.10/8.5.21+.
Since PHPUnit 9.5.10 and 8.5.21, PHP deprecations are no longer converted to exceptions by default (`convertDeprecationsToExceptions="true"` can be configured to enable this).

Reference: [fac02620f6 Do not convert PHP deprecations to exceptions by default]; [https://github.com/sebastianbergmann/phpunit/blob/9.5.10/ChangeLog-9.5.md#9510---2021-09-25 PHPUnit 9.5.10 changelog].

Let's unpack this:

Previously (PHPUnit < 9.5.10/8.5.21), if PHPUnit would encounter a PHP native deprecation notice, it would:
1. Show a test which causes a deprecation notice to be thrown as **"errored"**,
2. Show the **first** deprecation notice it encountered and
3. PHPUnit would exit with a **non-0 exit code** (2), which will fail a CI build.

As of PHPUnit 9.5.10/8.5.21, if PHPUnit encounters a PHP native deprecation notice, it will no longer do so. Instead PHPUnit will:
1. Show a test which causes a PHP deprecation notice to be thrown as **"risky"**,
2. Show the **all** deprecation notices it encountered and
3. PHPUnit will exit with a **0 exit code**, which will show a CI build as passing.

This commit reverts PHPUnit to the previous behaviour by adding `convertDeprecationsToExceptions="true"` to the PHPUnit configuration. It also adds the other related directives for consistency.

Props jrf, netweb, costdev, SergeyBiryukov.
See #54183.
Built from https://develop.svn.wordpress.org/trunk@51871


git-svn-id: http://core.svn.wordpress.org/trunk@51464 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-26 03:12:57 +00:00
Sergey Biryukov
7d3ddd45f6 Tests: Don't skip some Ajax tests on multisite, add them to the ms-excluded group instead.
Follow-up to [46693], [49835].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51870


git-svn-id: http://core.svn.wordpress.org/trunk@51463 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-26 00:14:03 +00:00
Sergey Biryukov
0d262c0b50 Tests: Remove unnecessary setUp() and tearDown() methods in multisite tests.
These were originally added in [26252] to suppress database errors on `setUp()` and restore on `tearDown()` for tests that call `wpmu_create_blog()`, blog factory, or installation code that attempts to clear transients.

As the multisite test coverage expanded, these methods ended up being unnecessarily copied into other test classes, where database error suppression is not required.

Follow-up to [26252], [29916], [30286], [33184], [34898], [34899], [34901], [37234], [37477], [37894], [49212], [49616], [51859].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51869


git-svn-id: http://core.svn.wordpress.org/trunk@51462 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-25 01:28:57 +00:00
hellofromTonya
9de31fa1ab Build/Test Tools: Remove the PHPUnit container from local Docker environment.
This commit:

* Removes the PHPUnit `wordpressdevelop/phpunit` container as a service to the Docker environment.
* Updates `test:php` (the default way to run tests) to run the Composer PHPUnit package  default.
* Removes the `test:php-composer` script.

There is no longer a need for core to keep the `wordpressdevelop/phpunit` container as a service in `docker-compose.yml`. Removing it will reduce the overhead and bandwidth needed to set up WordPress locally and remove confusion about its use.

Follow-up to [45783-45784], [49099], [49362], [51545], [51736], [51685].

Props johnbillion, hellofromTonya.
Fixes #54112.
Built from https://develop.svn.wordpress.org/trunk@51868


git-svn-id: http://core.svn.wordpress.org/trunk@51461 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-24 16:56:00 +00:00
Sergey Biryukov
71d35a918f Tests: Rename classes in phpunit/tests/multisite/ per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491], [51492], [51493], [51623], [51639], [51646], [51650], [51651].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51860


git-svn-id: http://core.svn.wordpress.org/trunk@51459 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-24 00:46:56 +00:00
Sergey Biryukov
b19cb16e34 Tests: Further improve the tests for avoid_blog_page_permalink_collision():
* Rename the test filename and class to match the name of the function being tested.
* Remove unnecessary `setUp()` and `tearDown()` methods.
* Replace the `only` test group with `post`.

Follow-up to [51855-51857].

See #51147.
Built from https://develop.svn.wordpress.org/trunk@51859


git-svn-id: http://core.svn.wordpress.org/trunk@51458 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-24 00:30:56 +00:00
Sergey Biryukov
6341115d9c Tests: Correct the @ticket reference in wp_terms_checklist() tests.
Follow-up to [48880].

See #53363, #51137.
Built from https://develop.svn.wordpress.org/trunk@51858


git-svn-id: http://core.svn.wordpress.org/trunk@51457 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-24 00:13:57 +00:00
hellofromTonya
e2b13ae81b Build/Test Tools: Upgrades Tests_Multisite_MS_Permalink_Collision fixture methods and strict assertion.
Improvements include:

- Upgrades the test fixture methods to the new snake_case methods.
- Reorders the fixture methods for consistency.
- Uses strict assertions of assertSame and assertNotSame.

Follow-up to [51855-51856].

Props hellofromTonya.
See #51147.
Built from https://develop.svn.wordpress.org/trunk@51857


git-svn-id: http://core.svn.wordpress.org/trunk@51456 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-23 21:30:57 +00:00
whyisjake
7ce933c695 Coding Standards: Fix the alignment of the array.
Unprops: whyisjake.
See [51855].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51455 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-23 20:34:56 +00:00
whyisjake
f2d1e16f50 Posts, Post Types: Don't add a trailing number when there is a unique post parent.
WordPress tries to avoid an issue where slugs might match an existing slug of a page/post. 
If we are in a hierarchical post type, there will be a level, and we can leave it the same.

Props stormrockwell, SergeyBiryukov, terriann, tubys, jeremyfelt, Daschmi, MaximeCulea, knutsp, whyisjake.
Fixes #51147.
See also #44112 and #45260.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51454 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-23 20:27:58 +00:00
Sergey Biryukov
052b00b0c4 Docs: Fix typo in the $clear_working parameter description in WP_Upgrader methods.
Follow-up to [30758], [51527].

Props zenithcity, aezazshekh, pbiron, mukesh27.
Fixes #54163.
Built from https://develop.svn.wordpress.org/trunk@51854


git-svn-id: http://core.svn.wordpress.org/trunk@51453 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-23 14:23:01 +00:00
hellofromTonya
847b7d8690 Code Modernization: Fix "passing null to non-nullable" deprecation in _mb_substr().
The `_mb_substr()` function expects a string for the `$str` parameter, but does not do input validation. This function contains a `preg_match_all()` which also expects a string type for the given subject (i.e. `$str`). 

Passing `null` to this parameter results in `preg_match_all(): Passing null to parameter #2 ($subject) of type string is deprecated` notice on PHP 8.1.

To maintain the same behaviour as before, a guard clause is added to bail out early when `$str` is passed as `null`. The outcome will, in that case, only ever be an empty string.

Note: this does mean that the `_mb_substr()` function now has a subtle difference in behaviour compared to the PHP native `mb_substr()` function as the latter ''will'' throw the deprecation notice.

The existing tests already cover this issue.

Follow-up to [17621], [36017], [32364].

Props jrf, hellofromTonya.
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51853


git-svn-id: http://core.svn.wordpress.org/trunk@51452 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-22 23:34:57 +00:00
hellofromTonya
f52bf291cb Build/Test Tools: Splits and improves compat tests.
Splits the tests in the `tests/phpunit/tests/compat.php` file up into individual test classes for each function being tested.

Improvements to individual test cases:
* Adds `@covers` tags.
* Adds visibility modifiers to all methods.
* Adds function availability test.
* Where relevant, fixes the assertion parameter order.
* Data provider:
   * Where relevant, reworks a test to use a data provider.
   * Where relevant, renames data provider methods to have a more obvious link to the test it applies to.
   * Makes the data provider more readable by adding keys within the data sets.
   * Moves the data provider below its associated tests.
   * Adds/removes data sets in data providers.
* Makes the actual test code more readable by using descriptive variables and multi-line function calls.
* Adds the `$message` parameter to all assertions when a test method contains more than one assertion.

Specifically for the `_mb_substr()` tests:
* Splits the `test_mb_substr_phpcore()` method into two test methods based on the PHP Core test files they are emulating.
* Makes the actual test code within the `test_mb_substr_phpcore_basic()` method more readable by using descriptive variables and multi-line function calls.
* Splits the data used for the second part of the `test_mb_substr_phpcore()` function, now `test_mb_substr_phpcore_input_type_handling()`, off into a separate data provider with named data sets.
* Removes duplicate data sets from the `data_mb_substr_phpcore_input_type_handling()`. 
   * Why? The PHP native tests test against upper/lowercase `false`, `true`, `null` and some other text string single quote/double quote variations. As things were, those differentiations had been undone when the coding standards were put in place, so in effect those weren't being tested anymore. And as this is userland code, there's no point in adding these differentiations back as they will be handled the same by PHP anyway (and that is safeguarded via the PHP native tests).
* Removes the "undefined variable" and "unset variable" test cases as, while those are relevant to the C code in which PHP is written, they are not relevant for testing userland code and will behave the same as the test passing `null`.

Follow-to [25002], [32364], [42228], [42343], [43034], [43036], [43220], [43571], [45607], [47122], [47198], [48937], [48996], [51415], [51563], [51594].

Props jrf, hellofromTonya.
See #39265, #53363.
Built from https://develop.svn.wordpress.org/trunk@51852


git-svn-id: http://core.svn.wordpress.org/trunk@51451 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-22 23:06:56 +00:00
John Blackbourn
6e1cc35a98 Docs: Miscellaneous docblock corrections and improvements.
See #52217, #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51450 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-22 21:23:00 +00:00
John Blackbourn
07f3c35467 General: Fix code quality issues which were identified by static analysis.
This fixes minor issues that could cause PHP notices under the right conditions, and fixes some general incorrectness.

Props jrf, hellofromTonya for review

See #52217

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


git-svn-id: http://core.svn.wordpress.org/trunk@51449 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-22 21:01:00 +00:00
Sergey Biryukov
a016bf3172 Docs: Update description for retrieve_widgets() per the documentation standards.
Follow-up to [51842].

See #53811.
Built from https://develop.svn.wordpress.org/trunk@51849


git-svn-id: http://core.svn.wordpress.org/trunk@51448 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-22 14:11:00 +00:00
Andrew Ozz
25daf03a8e Update and enhance the docs for retrieve_widgets().
Props zieladam, hellofromtonya.
Fixes #53811.
Built from https://develop.svn.wordpress.org/trunk@51842


git-svn-id: http://core.svn.wordpress.org/trunk@51447 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-21 22:13:57 +00:00
John Blackbourn
01ff7448d2 Formatting: Pass the block instance as a parameter to the render_block filters.
This allows filters to access properties and methods on the block instance.

Fixes #53596

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


git-svn-id: http://core.svn.wordpress.org/trunk@51446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-21 21:32:57 +00:00
John Blackbourn
ae9eae8f64 Docs: Document some more common names for dynamic hooks and standardise the phrasing used.
Fixes #53581

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


git-svn-id: http://core.svn.wordpress.org/trunk@51444 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-21 18:21:00 +00:00
Sergey Biryukov
70f1109c9f Docs: Add @since notes to register_setting() for the deprecated misc and privacy option groups.
Follow-up to [13745], [13746], [13749], [21838], [51827].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@51832


git-svn-id: http://core.svn.wordpress.org/trunk@51439 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-21 13:22:01 +00:00
hellofromTonya
eb85900d55 Build/Test Tools: Fix null handling and string type casting in WP_UnitTestCase_Base::assertSameIgnoreEOL().
Basically, the whole `assertSameIgnoreEOL()` assertion was fundamentally flawed. The assertion contends that it checks that the expected and actual values are of the same type and value, but the reality was very different.

* The function uses `map_deep()` to potentially handle all sorts of inputs.
* `map_deep()` handles arrays and objects with special casing, but will call the callback on everything else without further distinction.
* The callback used passes the expected/actual value on to the `str_replace()` function to remove potential new line differences.
* And the `str_replace()` function will - with a non-array input for the `$subject` - always return a string.
* The output of these calls to `map_deep()` will therefore have "normalized" _all properties_ in objects, _all values_ in arrays and _all non-object, non-array values_ to strings.
* And a call to `assertSame()` will therefore NEVER do a proper type check as the type of all input has already, unintentionally, been "normalized" to string.

Aside from this clear flaw in the design of the assertion, PHP 8.1 now exposes a further issue as a `null` value for an object property, an array value or a plain value, will now yield a ` str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated` notice.

To fix both these issues, the fix in this PR ensures that the call to `str_replace()` will now only be made if the input is a text string.
All other values passed to the callback are left in their original type.

This ensures that a proper value AND type comparison can be done as well as prevents the PHP 8.1 deprecation notices.

Ref:
* https://developer.wordpress.org/reference/functions/map_deep/
* https://www.php.net/manual/en/function.str-replace.php

This commit:
- Fixes type-casting of non-string values to `string` (the flawed part of this assertion) by invoking `str_replace()` when the value is of string type.
- Fixes the PHP 8.1 `str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated` deprecation notice.
- Micro-optimization: skips `map_deep()` when actual and/or expected are `null` (no need to process).
- Adjusts the method documentation for both this method and the `assertEqualsIgnoreEOL()` alias method to document that the `$expected` and `$actual` parameters can be of any type.

Follow-up to [48937], [51135], [51478].

Props jrf, hellofromTonya.
See #53363, #53635.
Built from https://develop.svn.wordpress.org/trunk@51831


git-svn-id: http://core.svn.wordpress.org/trunk@51438 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-20 19:59:55 +00:00
hellofromTonya
bb4c9b56f3 REST API: Fix autovivification deprecation notice in WP_Test_REST_Widgets_Controller::set_up().
If the `'widget_testwidget'` option does not exist, `false` was returned from `get_option()`. The `set_up()` logic expects an `array()` and assigns values to keys without checking for an array. The automatic creation of an array (autovivification) triggers a `Deprecated: Automatic conversion of false to array is deprecated in` deprecation notice on PHP 8.1.

This commit:
- Fixes the deprecation notice by making the default value an empty array.
- Moves getting the option within the conditional where it's needed.
- Provides a micro-optimization by only getting the options when the conditions are correct for processing.
- Makes the code consistent within the `set_up()` for both `get_option()` instances.

Follow-up to [51029].

Props jrf, hellofromTonya, BinaryKitten.
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51830


git-svn-id: http://core.svn.wordpress.org/trunk@51437 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-20 18:49:58 +00:00
hellofromTonya
1c55ce2482 Login and Registration: Fix "passing null to non-nullable" deprecation for authorize_application error message.
If there is no URL query in the `$_GET['redirect_to'], `wp_parse_url()` will return `null`. Passing `null` to `parse_str()` results in a PHP 8.1 deprecation notice
{{{
Deprecated: parse_str(): Passing null to parameter #1 ($string) of type string is deprecated
}}}

This commit:
- Fixes the deprecation notice.
- Skips doing the `parse_str()` when there's no URL query.
- Provides a micro-optimization performance boost.

Follow-up to [49109].

Props jrf, hellofromTonya, BinaryKitten.
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51829


git-svn-id: http://core.svn.wordpress.org/trunk@51436 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-20 18:22:57 +00:00
hellofromTonya
e2f3071988 Build/Test Tools: Improve Composer update command in bootstrap error messages.
Refines the test bootstrap error message to include the `-W` in the Composer update command.

Why?

To also update the chain of dependencies for the tests' dependencies. 

`composer update` will update the tests' direct dependencies.
 
`composer update -W` will update the dependencies including *their* dependencies, which is the recommended course of action for WP.

Follow-up to [51598], [51811], [51813].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51435 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-20 16:44:59 +00:00
johnjamesjacoby
79c59fa78c Docs: Remove deprecated option groups from register_setting() and add_option_update_handler().
* `misc` was deprecated in version 3.0.0.
* `privacy` was deprecated in version 3.5.0.

See #53399.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51434 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-20 16:20:00 +00:00
Sergey Biryukov
64857a2a8e Coding Standards: Rename the $processedHeaders variable to $processed_headers in WP_Http::request().
This fixes a `Variable "$processedHeaders" is not in valid snake_case format` WPCS warning.

Follow-up to [8620], [51823].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@51826


git-svn-id: http://core.svn.wordpress.org/trunk@51433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-20 12:07:00 +00:00
Sergey Biryukov
baa81b67d1 Coding Standards: Rename the $arrURL variable to $parsed_url in WP_Http_Streams::request().
This fixes a `Variable "$arrURL" is not in valid snake_case format` WPCS warning.

Follow-up to [8620], [10509], [25044], [25224], [45667], [51823], [51824].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@51825


git-svn-id: http://core.svn.wordpress.org/trunk@51432 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-19 17:00:57 +00:00
Sergey Biryukov
4892fd7bac Coding Standards: Rename the $arrURL variable to $parsed_url in WP_Http_Cookie::__construct().
This fixes a `Variable "$arrURL" is not in valid snake_case format` WPCS warning.

Follow-up to [10509], [25044], [45667], [51823].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@51824


git-svn-id: http://core.svn.wordpress.org/trunk@51431 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-19 16:59:56 +00:00
Sergey Biryukov
dfbdd86d59 Coding Standards: Rename the $arrURL variable to $parsed_url in WP_Http::request().
This fixes a `Variable "$arrURL" is not in valid snake_case format` WPCS warning.

Follow-up to [10509], [45667].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@51823


git-svn-id: http://core.svn.wordpress.org/trunk@51430 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-19 16:58:59 +00:00
Sergey Biryukov
01e6d31b3f Coding Standards: Use strict comparison in wp-inclues/class-wp-http-cookie.php.
Follow-up to [10512].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@51822


git-svn-id: http://core.svn.wordpress.org/trunk@51429 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-18 19:56:04 +00:00
Gary Pendergast
8a5e9b79ed Embeds: Add Pinterest as a trusted oEmbed provider.
Props ayeshrajans, pento.

Fixes #53448.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51428 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-17 03:13:56 +00:00
Sergey Biryukov
8feb26bcfe Twenty Twenty-One: Add missing escaping for the "Secondary menu" label.
Props muhammadfaizanhaidar, teucrium, sabernhardt, mukesh27, SergeyBiryukov.
Fixes #54127.
Built from https://develop.svn.wordpress.org/trunk@51820


git-svn-id: http://core.svn.wordpress.org/trunk@51427 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-16 21:32:00 +00:00
jorgefilipecosta
5932bb0f8e Block editor: Cache global stylesheet by theme key.
Global styles are used in a few different contexts (front, editor, customizer, the theme directory). In the last two contexts, it's important that switching themes immediately refreshes the global stylesheet, to avoid situations in which the styles of the previous theme load with the new one. This was brought up at WordPress/gutenberg#34531 (customizer) and at meta.trac.wordpress.org/ticket/5818 (theme directory).
This commit makes sure the stylesheet is regenerated upon switching themes.

Props oandregal, dd32.
See #53175.
Built from https://develop.svn.wordpress.org/trunk@51819


git-svn-id: http://core.svn.wordpress.org/trunk@51426 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-16 18:05:00 +00:00
hellofromTonya
4fe5f325ad Options, Meta APIs: Fix "passing null to non-nullable" deprecations to (get|add|update|delete)_option().
In all four of the `get_option()`, `add_option()`, `update_option()` and `delete_option()` functions, the `$option` parameter (i.e. the option name) is passed to the PHP native `trim()` function without prior input validation.

In PHP 8.1, this could lead to a `trim(): Passing null to parameter #1 ($string) of type string is deprecated` for each of these functions.

`trim()`:

- expects a text string and is only useful when ''passed'' a text string as no other variable type can contain whitespace.
- will always return a `string`, which means that in practice for any non-string values passed, it would effectively function as a type cast to string.

This commit:
- Adds a check to verify the `$option` name is a scalar before processing it with `trim()`.
- The "type cast" behavior is maintained.
- If the given `$option` name is not a scalar, such as `null`, the fix prevents the PHP 8.1 deprecation notice.
- Tests are added for valid but undesired option names to safeguard against regressions.

This issue is already covered by:
- the existing `Tests_Option_Option::test_bad_option_names()` test group.
- the new `test_valid_but_undesired_option_names()` tests.

Follow-up to [13858], [22633], [23510], [25002], [51817].

Props jrf, hellofromTonya, pbearne.
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51818


git-svn-id: http://core.svn.wordpress.org/trunk@51425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-15 22:19:58 +00:00
hellofromTonya
8dd2206ab1 Build/Test Tools: Reworks Tests_Option_Option::test_bad_option_names() into data provider.
The existing tests were running multiple functions through a `foreach()`. If any test failed, it would bail out and not test against the other scenarios.

This commit:

- Moves the scenarios to a data provider with named data sets, i.e. to ensure all scenarios are run and tested regardless if any fail.
- Splits each function under test into individual test methods.
- Adds a float scenario.
- Adds method visibility modifiers.

Follow-up to [25002].

Props jrf, hellofromTonya, pbearne.
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51817


git-svn-id: http://core.svn.wordpress.org/trunk@51424 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-15 21:22:58 +00:00
hellofromTonya
4b9a809bd7 Media: Fix $content parameter default value in img_caption_shortcode().
The shortcode content is expected to be a string, not `null`. `do_shortcode()` expects a string for `$content`.

The `img_caption_shortcode()` also expects a string for the `$content` parameter and is expected to return a string for the HTML content to display the caption. 

Prior to this commit:
The default value for the `$content` parameter was set to `null`. If no `$content` was passed, the function:
- could return `null` when the `$atts['width'] < 1` or there was no caption
- else, it invoked `do_shortcode( $content )` passing `null` which on PHP 8.1+ triggers a deprecation notice:
{{{
strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated
}}}

This commit:

- Fixes the default `$content` value to align to the expected shortcode content of `string`, not `null`.
- Fixes the PHP 8.1 deprecation notice when `null` was being passed to `do_shortcode()`.
- Changes the assertion in a couple of tests to check for the empty string instead of `null.

Follow-up to [8196], [8925], [8239], [26915], [31530], [42704].

Props jrf, hellofromTonya, azaozz, joedolson.
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51816


git-svn-id: http://core.svn.wordpress.org/trunk@51423 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-15 19:06:57 +00:00
Sergey Biryukov
dcca93232b Upgrade/Install: Create a temporary backup of plugins and themes before updating.
This aims to make the update process more reliable and ensures that if a plugin or theme update fails, the previous version can be safely restored.

* When updating a plugin or theme, the old version is moved to a temporary backup directory:
 * `wp-content/upgrade/temp-backup/plugins/[plugin-slug]` for plugins
 * `wp-content/upgrade/temp-backup/themes/[theme-slug]` for themes.

* If the update fails, then the temporary backup kept in the `upgrade/temp-backup` directory is restored to its original location.
* If the update succeeds, the temporary backup is deleted.

To further help troubleshoot plugin and theme updates, two new checks were added to the Site Health screen:
* A check to make sure that the `temp-backup` directory is writable.
* A check that there is enough disk space available to safely perform updates.

To avoid confusion: The `temp-backup` directory will NOT be used to "roll back" a plugin to a previous version after a completed update. This directory will simply contain a transient backup of the previous version of a plugin or theme being updated, and as soon as the update process finishes, the directory will be empty.

Props aristath, afragen, pbiron, dd32, poena, TimothyBlynJacobs, audrasjb, mikeschroder, a2hosting, hellofromTonya, KZeni, galbaras, richards1052, Boniu91, mai21, francina, SergeyBiryukov.
See #51857.
Built from https://develop.svn.wordpress.org/trunk@51815


git-svn-id: http://core.svn.wordpress.org/trunk@51422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-15 18:41:00 +00:00
Sergey Biryukov
a13f7b31cd I18N: Add a translator comment to clarify the "Block HTML" string in the Block widget settings form.
The string refers to HTML code of the block, not an option that blocks HTML.

Follow-up to [50995].

Props Amieiro, NekoJonez, knutsp, johnbillion, namith.jawahar, SergeyBiryukov.
Fixes #54110.
Built from https://develop.svn.wordpress.org/trunk@51814


git-svn-id: http://core.svn.wordpress.org/trunk@51421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-15 11:49:01 +00:00
hellofromTonya
3e3c3541e5 Build/Test Tools: Expect an absolute path in WP_TESTS_PHPUNIT_POLYFILLS_PATH constant.
This commit:
* Removes the use of `realpath()` to prevent issues with WSL and other virtualized filesystems.
* Changes the logic of the Polyfill bootstrap loading to expect an absolute path, rather than a relative path to the root directory of the PHPUnit Polyfills library.
* Adjusts the relevant inline documentation and error messages to expect an absolute path.
* Breaks up error messages into smaller line lengths for readability.

Follow-up to [51598], [51810], [51811], [51812].

Props jrf, schlessera, hellofromTonya, jeherve, lucatume.
See #46149.
Built from https://develop.svn.wordpress.org/trunk@51813


git-svn-id: http://core.svn.wordpress.org/trunk@51420 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-14 18:53:57 +00:00
hellofromTonya
dde311cae9 Build/Test Tools: Improve messaging when PHPUnit Polyfills do not comply with version requirements.
Previously, two situations were taken in to account:
1. The `WP_TESTS_PHPUNIT_POLYFILLS_PATH` constant is defined => just show a message about the version mismatch.
2. The constant is not defined => show a message to run `composer update`. This message is intended for people trying to run the WP Core tests.

This could lead to an unclear situation for people trying to run plugin/theme integration tests without the new `WP_TESTS_PHPUNIT_POLYFILLS_PATH` constant being defined.

They could be shown the message to run `composer update` while if they would do so for their local install without adding the Polyfills, the message would still display the next time they would attempt to run the tests.

This commit:
1. Provides more information about the PHPUnit Polyfills version detected vs the version expected.
2. Shows a more specific message to guide users which have the `WP_TESTS_PHPUNIT_POLYFILLS_PATH` constant declared.
3. Only shows the message to run `composer update` when the `WP_RUN_CORE_TESTS` constant is declared to prevent confusing people more.

Follow-up to [51598], [51810], [51811].

Props jrf, schlessera, hellofromTonya, jeherve, lucatume.
See #46149.
Built from https://develop.svn.wordpress.org/trunk@51812


git-svn-id: http://core.svn.wordpress.org/trunk@51419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-14 18:48:56 +00:00
hellofromTonya
0c8b83a7c2 Build/Test Tools: Improve messaging when PHPUnit Polyfills cannot be found.
Previously, two situations were taken in to account:
1. The `WP_TESTS_PHPUNIT_POLYFILLS_PATH` constant is defined => show message specific to that constant not being set correctly.
    This message would typically be shown for plugin/theme integration tests which are already aware of the changes in WP 5.9.
2. The constant is not defined => show a message to run `composer update`.
    This message is intended for people trying to run the WP Core tests.

This left two situations unaccounted for:
- Someone trying to run the WP Core tests, but not having set the `WP_RUN_CORE_TESTS` constant or not having set it to `1`.
- Someone trying to run plugin/theme integration tests without the new `WP_TESTS_PHPUNIT_POLYFILLS_PATH` constant being defined as they are not (yet) aware of the changes made in WP 5.9.

The changes made in this commit, are intended to improve the error messages displayed in those situations.

Follow-up to [51598], [51810].

Props jrf, schlessera, hellofromTonya, jeherve, lucatume.
See #46149.
Built from https://develop.svn.wordpress.org/trunk@51811


git-svn-id: http://core.svn.wordpress.org/trunk@51418 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-14 18:41:56 +00:00
hellofromTonya
130040c54e Build/Test Tools: Make WP_TESTS_PHPUNIT_POLYFILLS_PATH more flexible.
The constant `WP_TESTS_PHPUNIT_POLYFILLS_PATH` is intended to contain the path to the root directory of the PHPUnit Polyfills library without trailing slash.

The code already took into account that the value could potentially include a trailing slash.

Now it will also take into account if it is accidentally set to point to the autoload file instead of the path.

Follow-up to [51598].

Props jrf, schlessera, hellofromTonya, jeherve, lucatume.
See #46149.
Built from https://develop.svn.wordpress.org/trunk@51810


git-svn-id: http://core.svn.wordpress.org/trunk@51417 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-14 18:33:57 +00:00
Sergey Biryukov
d6cb1e4317 Docs: Update description for the $wp_version global.
In addition to holding the version number, the WordPress version string is used to bust caches and to enable development mode for scripts when running from the `/src` directory.

Follow-up to [803], [2585], [6554], [47230].

Props muhammadfaizanhaidar, azaozz.
Fixes #53413.
Built from https://develop.svn.wordpress.org/trunk@51809


git-svn-id: http://core.svn.wordpress.org/trunk@51416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-14 17:31:59 +00:00
Sergey Biryukov
128975e7ce Twenty Seventeen: Make blog header margin more specific on front page.
This avoids a large gap between title and content when the layout is set to one column.

Props laurelfulford, sabernhardt, hirofumi2012, jainnidhi, mukesh27.
Fixes #43628.
Built from https://develop.svn.wordpress.org/trunk@51808


git-svn-id: http://core.svn.wordpress.org/trunk@51415 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-14 10:19:01 +00:00
Sergey Biryukov
7d6308c3c7 Twenty Eleven: Set a fixed height for search form when header image is added.
This ensures that the search form does not collide with the menu on smaller screens.

Props sabernhardt, fedepia, Soean, lukecavanagh, mukesh27.
Fixes #40398.
Built from https://develop.svn.wordpress.org/trunk@51807


git-svn-id: http://core.svn.wordpress.org/trunk@51414 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-13 20:41:56 +00:00
hellofromTonya
e838c96df4 Code Modernization: Fix "passing null to non-nullable" deprecation notice in WP_Comment_Query::get_comment_ids().
The `WP_Comment_Query::get_comment_ids()` method is supposed to handle `null` as a search query, but was throwing a `strlen(): Passing null to parameter #1 ($string) of type string is deprecated` notice on PHP 8.1.

Discovered via and already covered via the pre-existing `Tests_Comment_Query::test_search_null_should_be_ignored()` test method.

Follow-up to [36345], [48275].

Props jrf, hellofromTonya.
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51806


git-svn-id: http://core.svn.wordpress.org/trunk@51413 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-13 18:54:59 +00:00
Sergey Biryukov
65ff35bb75 Site Health: Move the Imagick entry higher in the list of recommended PHP extensions.
This better matches its position in the [https://make.wordpress.org/hosting/handbook/server-environment/#php-extensions Hosting Team's handbook] recommendations.

Follow-up to [44986], [46268], [51804].

See #52654.
Built from https://develop.svn.wordpress.org/trunk@51805


git-svn-id: http://core.svn.wordpress.org/trunk@51412 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-12 10:09:57 +00:00
Sergey Biryukov
e76b896881 Site Health: Add Intl to the list of recommended PHP extensions.
**Why is the PHP Intl extension important?**

WordPress is a global, international software, with support for a multitude of languages and with infinite combinations. Approximately half of the installations are in a language that is not the default (English), and this leads us to think about localization, transliteration, encoding conversions, calendar operations, collation… in short, everything you have with the different languages and formats that are around the planet. And this is what the [https://www.php.net/manual/en/intro.intl.php PHP Intl extension] provides.

**What do we as the WordPress Community gain from this extension?**

This extension provides a lot of functions for better internationalization support, including but not limited to:
* [https://www.php.net/manual/en/collator.compare.php collator_compare()] to compare Unicode text strings
* [https://www.php.net/manual/en/numberformatter.format.php numfmt_format()] to format a number according to the selected locale
* the [https://www.php.net/manual/en/normalizer.normalize.php normalization] of characters
* the [https://www.php.net/manual/en/messageformatter.formatmessage.php formatting] of messages
* getting the [https://www.php.net/manual/en/intlcalendar.getfirstdayofweek.php first day of the week] according to the locale.


In addition to functionality and ease of development, the extension can also help improve security, with classes like `Spoofchecker` that can tell you [https://www.php.net/manual/en/spoofchecker.areconfusable.php if ‘google.com’, ‘goog1e.com’ can confuse the user], or functions related to Internet domains, both to convert an [https://www.php.net/manual/en/function.idn-to-ascii.php IDN domain to text] and [https://www.php.net/manual/en/function.idn-to-utf8.php text to IDN].

**Hosting Team Recommendation**

Taking into account that WordPress continues to grow, the Hosting Team has considered a good recommendation, but not an obligation, for all hosts that work with WordPress to offer this extension, by default, to all users.

Reference: [https://make.wordpress.org/hosting/2021/05/20/why-hosters-should-install-the-php-intl-extension/ Why hosters should install the PHP-intl extension].

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

Props zodiac1978, JavierCasares, jrf, Clorith, josklever.
Fixes #52654.
Built from https://develop.svn.wordpress.org/trunk@51804


git-svn-id: http://core.svn.wordpress.org/trunk@51411 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-11 18:20:59 +00:00
hellofromTonya
e16eaa4935 Code Modernization: Fix "passing null to non-nullable" deprecation notices in WP_Http::normalize_cookies().
The `Requests_Cookie` class expects valid - non-`null` - attributes to be passed, either as an array or as a `Requests_Utility_CaseInsensitiveDictionary` object.

However, the `WP_Http_Cookie::get_attributes()` explicitly sets the `expires`, `path` and `domain` index keys in an array with values which _may_ be `null`. This will cause `strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated`-like errors when the attributes are passed to the `Requests_Cookie` class.

Note: a `null` value for `path` would generate a similar deprecation notice, but for the `preg_match()` function.

Fixed by using `array_filter()` on the attributes to explicitly filter out `null` values before passing the attributes to `Requests_Cookie`.

Note: I'm choosing to explicitly only filter `null` values. Using `array_filter()` without a callback would filter out all "empty" values, but that may also remove values which are explicitly set to `false` or `0`, which may be valid values.

Fixes two errors in the `external-http` group in the WordPress Core test suite:
{{{
1) Tests_HTTP_Functions::test_get_response_cookies_with_wp_http_cookie_object
strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated

/var/www/src/wp-includes/Requests/Cookie.php:268
/var/www/src/wp-includes/Requests/Cookie.php:237
/var/www/src/wp-includes/Requests/Cookie.php:90
/var/www/src/wp-includes/class-http.php:460
/var/www/src/wp-includes/class-http.php:349
/var/www/src/wp-includes/class-http.php:624
/var/www/src/wp-includes/http.php:162
/var/www/tests/phpunit/tests/http/functions.php:156

2) Tests_HTTP_Functions::test_get_cookie_host_only
strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated

/var/www/src/wp-includes/Requests/Cookie.php:268
/var/www/src/wp-includes/Requests/Cookie.php:237
/var/www/src/wp-includes/Requests/Cookie.php:90
/var/www/src/wp-includes/class-http.php:460
/var/www/tests/phpunit/tests/http/functions.php:235
}}}

Follow-up to [38164], [45135], [51657].

Props jrf, hellofromTonya.
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51801


git-svn-id: http://core.svn.wordpress.org/trunk@51408 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-10 17:43:57 +00:00
hellofromTonya
5081870aa8 Tests: Fix "null to non-nullable" deprecation notice in Tests_Admin_IncludesPlugin::test_get_plugin_files_folder().
The `Tests_Admin_IncludesPlugin::_create_plugin()` expects the first parameter to be a text string to be written to a plugin file using `fwrite()`.

Passing null causes a `fwrite(): Passing null to parameter #2 ($data) of type string is deprecated` notice.

Ref: https://www.php.net/manual/en/function.fwrite

Follow-up to [31002]. [41806].

Props jrf, hellofromTonya.
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51800


git-svn-id: http://core.svn.wordpress.org/trunk@51407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-10 17:27:57 +00:00
hellofromTonya
d345fe2e69 Code Modernization: Fix "passing null to non-nullable" deprecation in wpdb::_real_escape().
The PHP native `mysqli_real_escape_string()` function expects to be passed a string as the second parameter and this is not a nullable parameter.

Passing `null` to it will result in a `mysqli_real_escape_string(): Passing null to parameter #2 ($string) of type string is deprecated` notice on PHP 8.1.

Previously, an input type check was put in place to prevent fatal errors on PHP 8.0 when an array, object or resource was passed. Changeset [48980].

A `null` value was explicitly excluded from that check, even though a `null` value being passed would only ever result in an empty string anyway.

This commit changes the previous input type check to also bow out early for `null` values and to automatically return an empty string for those.

Refs:
- https://www.php.net/manual/en/mysqli.real-escape-string.php
- https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg

Follow-up to [48980].

Props jrf, hellofromTonya.
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51799


git-svn-id: http://core.svn.wordpress.org/trunk@51406 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-10 16:36:57 +00:00
hellofromTonya
62709d3d26 Tests: Add tests for wpdb::_real_escape().
Adds a new dedicated test file.

Adds a test to check that various input types passed to `wpdb::_real_escape()` are handled correctly.

Note: This new test does not test the actual escaping or other logic in the function. Rather, it just and only tests and documents how the function handles various input types.

Props jrf, hellofromTonya.
See #53363.
Built from https://develop.svn.wordpress.org/trunk@51798


git-svn-id: http://core.svn.wordpress.org/trunk@51405 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-10 16:30:57 +00:00
hellofromTonya
1c8de0817f Code Modernization: Fix null to non-nullable deprecations in WP_Meta_Query::get_sql_for_clause().
In the `WP_Meta_Query::get_sql_for_clause()`, the `'value'` index from a meta query array is passed to the PHP native `trim()` function without prior validation.

In PHP 8.1, this could lead to a `trim(): Passing null to parameter #1 ($string) of type string is deprecated` notice.

`trim()` expects a text string and is only useful when ''passed'' a text string as no other variable type can contain whitespace.

Fixed now by verifying that the ''value'' is a string before processing it with `trim()`.

This issue is already covered by the existing `Tests_Meta_Query::test_null_value_sql()` and the `Tests_Meta_Query::test_convert_null_value_to_empty_string()` tests.

Follow-up to [17699], [29887], [29940].

Props jrf, hellofromTonya.
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51797


git-svn-id: http://core.svn.wordpress.org/trunk@51404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-10 16:01:03 +00:00
hellofromTonya
243e75eb41 Code Modernization: Fix null to non-nullable deprecation in term_exists().
The `term_exists()` function expects a string or an integer for the `$term` parameter. It validates for integer, but not for string or `null`.

One of the pre-existing test cases, passed `null` to the function, leading to a `trim(): Passing null to parameter #1 ($string) of type string is deprecated` notice on PHP 8.1.

Fixed now by doing a cursory check on the variable at the start of the function and bowing out early in case the `$term` is `null`.

The issue was discovered via and is already covered by the `Tests_TermExists::test_term_exists_unknown()` test method.

Follow-up to [15220]. [38716].

Props jrf, hellofromTonya.
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51796


git-svn-id: http://core.svn.wordpress.org/trunk@51403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-10 15:03:57 +00:00
Sergey Biryukov
018ad6098c Accessibility: Administration: Improve aria-label on network admin Themes screen.
This ensures that the beginning of the label matches the visible link text.

Add a similar label for the plugin URI link on the Plugins screen when the plugin is outside of the directory.

Follow-up to [28673], [28706], [35924].

Props sabernhardt, zeo, audrasjb.
Fixes #24442.
Built from https://develop.svn.wordpress.org/trunk@51795


git-svn-id: http://core.svn.wordpress.org/trunk@51402 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-10 14:49:00 +00:00
Andrew Ozz
e175db4ae1 External Libraries: Update jQuery UI to 1.13.0-rc2.
The final release is expected at the beginning of October. Updating to rc2 now gives everybody plenty of time to test and report any issues either with UI 1.13.0 or with the WordPress implementation.

Props Clorith, mgol, azaozz.
See #52163.
Built from https://develop.svn.wordpress.org/trunk@51794


git-svn-id: http://core.svn.wordpress.org/trunk@51401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-10 00:02:59 +00:00
hellofromTonya
b8322a053e Code Modernization: Fix null to non-nullable deprecation in wp_privacy_anonymize_ip().
The `wp_privacy_anonymize_ip()` function expects a string for the `$ip_addr` parameter, but did not do any input validation.

One of the pre-existing test cases, passed `null` to the function, leading to a `substr_count(): Passing null to parameter #1 ($haystack) of type string is deprecated` notice on PHP 8.1.

Fixed now by doing a cursory check on the variable at the start of the function and bowing out early for a number of cases (`null`, `false`, `0`, `''`) which would all result in the same `0.0.0.0` output anyway.

Follow-up [42971].

Props jrf, hellofromTonya.
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51793


git-svn-id: http://core.svn.wordpress.org/trunk@51400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-09 22:56:56 +00:00
hellofromTonya
78b5f27b1e Tests: Add more invalid IP test cases and @covers to Tests_Functions_Anonymization.
Adds a few more invalid IP test cases.

Adds extra `@covers` tag for the two functions which are testing the `wp_privacy_anonymize_ip()` function.

(At class level, the `wp_privacy_anonymize_data()` is set as covered).

Follow-up to [42971].

Props jrf, hellofromTonya.
See #53363.
Built from https://develop.svn.wordpress.org/trunk@51792


git-svn-id: http://core.svn.wordpress.org/trunk@51399 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-09 22:44:56 +00:00
hellofromTonya
07139653b9 Widgets: Revert [51705].
While the new name is much better, it doesn't fully tell what will happen when invoked nor does it fully solve the root problems. 

Why? The function is doing too much. And naming is hard.

Props azaozz, desrosj, andraganescu, zieladam, hellofromTonya.
See #53811.
Built from https://develop.svn.wordpress.org/trunk@51791


git-svn-id: http://core.svn.wordpress.org/trunk@51398 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-09 21:40:57 +00:00
hellofromTonya
1d0e1397fd Code Modernization: Fix parameter name mismatches for parent/child classes in WP_Image_Editor::save().
Renames the first parameter in `WP_Image_Editor_GD::save()` to match the parent's method signature.
Why? PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match.

Adds @since to clearly specify why the change happened.

Adds parameter descriptions to parent and both child classes. 

Follow-up to [22094], [22619], [30681].

Props jrf, hellofromTonya, sergeybiryukov, azaozz, desrosj, johnbillion.
See #51553.
Built from https://develop.svn.wordpress.org/trunk@51790


git-svn-id: http://core.svn.wordpress.org/trunk@51397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-09 20:39:58 +00:00
hellofromTonya
68e0c5e520 Code Modernization: Fix parameter name mismatches for parent/child classes in WP_Widget::update().
In each child class, renames the parameter to match the parent's method signature.
Why? PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match.

Adds @since to clearly specify why the change happened.

Replaces the original with the variable name with within each method.
Why? The new name is more specific and descriptive, which improves readability.

Follow-up to [10782], [25090], [26556], [40640].

Props jrf, hellofromTonya, sergeybiryukov, azaozz, desrosj, johnbillion.
See #51553.
Built from https://develop.svn.wordpress.org/trunk@51789


git-svn-id: http://core.svn.wordpress.org/trunk@51396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-09 20:13:57 +00:00
hellofromTonya
f2f05f8e04 Code Modernization: Fix parameter name mismatches for parent/child classes in WP_Sitemaps_Provider::get_max_num_pages().
In each child class, renames the parameter to match the parent's method signature.
Why? PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match.

Adds @since to clearly specify why the change happened.

Reassigns the generic parameter to the original parameter.
Why? Restoring the original name keeps the context intact within the method and makes the code more readable. An inline comment explains why this reassignment is made.

Note: Reassignment is done after the guard clause.
Why? To avoid unnecessary processing and memory should the method bail out.

Follow-up to [48072].

Props jrf, hellofromTonya, sergeybiryukov, azaozz, desrosj, johnbillion.
See #51553.
Built from https://develop.svn.wordpress.org/trunk@51788


git-svn-id: http://core.svn.wordpress.org/trunk@51395 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-09 19:42:56 +00:00
hellofromTonya
a4b163a674 Code Modernization: Fix parameter name mismatches for parent/child classes in WP_Sitemaps_Provider::get_url_list().
In each child and grandchild class, renames the second parameter to match the parent's method signature.
Why? PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match.

Adds @since to clearly specify why the change happened.

Reassigns the generic parameter to the original parameter.
Why? Restoring the original name keeps the context intact within the method and makes the code more readable. An inline comment explains why this reassignment is made.

Follow-up to [48072].

Props jrf, hellofromTonya, sergeybiryukov, azaozz, desrosj, johnbillion.
See #51553.
Built from https://develop.svn.wordpress.org/trunk@51787


git-svn-id: http://core.svn.wordpress.org/trunk@51394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-09 19:21:57 +00:00
hellofromTonya
41307cd4e6 Code Modernization: Fix parameter name mismatches for parent/child classes in WP_REST_Controller::prepare_item_for_response().
In each child and grandchild class, renames the first parameter to match the parent's method signature.

Why? PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match.

Changes for readability:

- `@since` clearly specifies the original parameter name and its new name as well as why the change happened.

- In methods longer than a single line, the generic parameter is reassigned to the original parameter restoring it for context for use within the method. An inline comment is added to explain why this reassignment is made.

Follow-up to [38832], [39011], [39015], [39021], [39024], [39025], [39031], [39036], [43519], [43735], [43739], [43768], [46821], [48173], [48242], [49088], [50995], [51003], [51021].

Props jrf, hellofromTonya, sergeybiryukov, azaozz, desrosj, johnbillion.
See #51553.
Built from https://develop.svn.wordpress.org/trunk@51786


git-svn-id: http://core.svn.wordpress.org/trunk@51393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-09 18:36:57 +00:00
hellofromTonya
aaee916444 Code Modernization: Fix parameter name mismatch with parent in WP_Customize_Custom_CSS_Setting::validate().
Renames the parameter to match the parent's method signature.
Why? PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match.

Adds `@since` to clearly specify why the change happened.

Reassigns the generic parameter to the original parameter.
Why? Restoring the original name keeps the context intact within the method and makes the code more readable. An inline comment explains why this reassignment is made

Follow-up to [37476], [38829], [41376].

Props jrf, hellofromTonya, sergeybiryukov, azaozz, desrosj, johnbillion.
See #51553.
Built from https://develop.svn.wordpress.org/trunk@51785


git-svn-id: http://core.svn.wordpress.org/trunk@51392 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-09 15:18:55 +00:00
hellofromTonya
6a19a16872 Code Modernization: Fix parameter name mismatches for parent/child classes in WP_Customize_Setting::update().
In each child class: renames the parameter to match the parent's method signature.

Why? PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match.

Changes for readability:

- `@since` clearly specifies the original parameter name and its new name as well as why the change happened.

- In methods longer than a single line, the generic parameter is reassigned to the original parameter restoring it for context for use within the method. An inline comment is added to explain why this reassignment is made.

Follow-up to [19995], [21037], [21053], [21354], [38829], [51298].

Props jrf, hellofromTonya, sergeybiryukov, azaozz, desrosj, johnbillion.
See #51553.
Built from https://develop.svn.wordpress.org/trunk@51784


git-svn-id: http://core.svn.wordpress.org/trunk@51391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-09 14:48:55 +00:00
hellofromTonya
071c322bf2 Code Modernization: Fix parameter name mismatches for parent/child classes in WP_Customize_Setting::sanitize().
In each child class: renames the parameter to match the parent's method signature.

Why? PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match.

Changes for readability:

- `@since` clearly specifies the original parameter name and its new name as well as why the change happened.

- In methods longer than a single line, the generic parameter is reassigned to the original parameter restoring it for context for use within the method. An inline comment is added to explain why this reassignment is made.

Follow-up to [19995], [32806].

Props jrf, hellofromTonya, sergeybiryukov, azaozz, desrosj, johnbillion.
See #51553.
Built from https://develop.svn.wordpress.org/trunk@51783


git-svn-id: http://core.svn.wordpress.org/trunk@51390 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-09 14:32:57 +00:00
hellofromTonya
5887edee86 Code Modernization: Fix parameter name mismatches for parent/child classes in WP_Upgrader_Skin::error().
In each child class: renames the parameter to match the parent's method signature.

Why? PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match.

Changes for readability:

- `@since` clearly specifies the original parameter name and its new name as well as why the change happened.

Follow-up to [11005], [25806], [32655], [38199].

Props jrf, hellofromTonya, sergeybiryukov, azaozz, desrosj, johnbillion.
See #51553.
Built from https://develop.svn.wordpress.org/trunk@51782


git-svn-id: http://core.svn.wordpress.org/trunk@51389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-09 13:59:56 +00:00
hellofromTonya
03331f52ff Code Modernization: Fix reserved keyword and parameter name mismatches for parent/child classes in WP_Upgrader_Skin::feedback().
In the parent class, renames the parameter `$string` to `$feedback`.
Why? `string` is a PHP reserved keyword.

In each child class: renames the parameter to match the parent's method signature.

Why? PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match.

Changes for readability:

- `@since` clearly specifies the original parameter name and its new name as well as why the change happened.

Follow-up to [11005], [25228], [30680], [32655], [38199], [49596].

Props jrf, hellofromTonya, sergeybiryukov, azaozz, desrosj, johnbillion.
See #51553.
Built from https://develop.svn.wordpress.org/trunk@51781


git-svn-id: http://core.svn.wordpress.org/trunk@51388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-09 13:48:56 +00:00
hellofromTonya
a395d4c50e Code Modernization: Fix reserved keyword and parameter name mismatches for parent/child classes in Walker::end_el().
In the parent class, renames the parameter `$object` to `$data_object`.
Why? `object` is a PHP reserved keyword. The parameter name is selected for consistency with `Walker::start_el()`.

In each child class: renames the parameter to match the parent's method signature.
Why? PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match.

Changes for readability:

- `@since` clearly specifies the original parameter name and its new name as well as why the change happened.

Follow-up to [7737], [8900], [8970], [14248], [16100], [25642], [25644], [37051], [37056].

Props jrf, hellofromTonya, sergeybiryukov, azaozz, desrosj, johnbillion.
See #51553.
Built from https://develop.svn.wordpress.org/trunk@51780


git-svn-id: http://core.svn.wordpress.org/trunk@51387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-09 13:03:55 +00:00
hellofromTonya
7abc752329 Code Modernization: Fix last parameter name mismatches for parent/child classes in Walker::start_el().
The parent class uses `$current_object_id` while most of the child classes use `$id`. As the parent class' is more descriptive, renaming the last parameter in each of child class.

Why? PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match.

Changes for readability:

- `@since` clearly specifies the original parameter name and its new name as well as why the change happened.

- In methods longer than a single line, the generic parameter is reassigned to the original parameter restoring it for context for use within the method. An inline comment is added to explain why this reassignment is made.

- In cases where the original parameter name was too generic or misleading, renamed (when reassigning) to a more descriptive name for use within the method.

Follow-up to [7737], [8900], [8970], [14248], [15077], [16100], [25642], [25644], [37051], [37054], [37056], [46271], [47189], [51739].

Props jrf, hellofromTonya, sergeybiryukov, azaozz, desrosj, johnbillion.
See #51553.
Built from https://develop.svn.wordpress.org/trunk@51779


git-svn-id: http://core.svn.wordpress.org/trunk@51386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-09 12:39:59 +00:00
Andrew Ozz
0fcde6de17 Editor: Revert [51748] and [51649]. They intorduced a bug where wp.editor may be replaced with wp.oldEditor in certain cases.
Props desrosj, davidbinda, azaozz.
Fixes #53762.
Built from https://develop.svn.wordpress.org/trunk@51768


git-svn-id: http://core.svn.wordpress.org/trunk@51375 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-08 23:29:58 +00:00
Andrew Ozz
03bbf916a9 Editor: fix the replacement of wp.editor with wp.oldEditor in the inline script outputted when enqueueing the old editor.
Props fullofcaffeine, davidbinda, grantmkin, get_dave, azaozz.
Fixes #53762.
Built from https://develop.svn.wordpress.org/trunk@51748


git-svn-id: http://core.svn.wordpress.org/trunk@51356 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-08 19:16:02 +00:00
Sergey Biryukov
e1e1d021ea General: Only use _jsonp_wp_die_handler() for JSONP REST API requests.
Props mdawaffe, peterwilsoncc.
Built from https://develop.svn.wordpress.org/trunk@51740


git-svn-id: http://core.svn.wordpress.org/trunk@51348 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-08 17:16:57 +00:00
hellofromTonya
1105ddf965 Code Modernization: Fix reserved keyword and parameter name mismatches for parent/child classes in Walker::start_el().
In the parent class, renames the parameter `$object` to `$data_object`.

Why? `object` is a PHP reserved keyword.

In each child class: renames the corresponding parameter to match the parent's method signature.

Why? 

PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match.

Changes for readability:

- `@since` clearly specifies the original parameter name and its new name as well as why the change happened.

- in methods longer than a single line, the generic parameter is reassigned to the original parameter restoring it for context for use within the method. An inline comment is added to explain why this reassignment is made.

- in cases where the original parameter name was too generic, renamed (when reassigning) to a more descriptive name for use within the method.

Follow-up to [7737], [8900], [8970], [14248], [15077], [16100], [25642], [25644], [37051], [37054], [37056], [46271], [47189].

Props jrf, hellofromTonya, sergeybiryukov, azaozz, desrosj, johnbillion.
See #51553.
Built from https://develop.svn.wordpress.org/trunk@51739


git-svn-id: http://core.svn.wordpress.org/trunk@51347 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-08 15:36:59 +00:00
John Blackbourn
25da00ea81 Users: Introduce a meta_input argument for wp_insert_user().
This allows custom user meta values to be provided when creating or updating a user in the same way custom post meta can be provided to `wp_insert_post()` when creating or updating a post.

Also introduces the `insert_custom_user_meta` to filter these values.

Props desrosj, donmhico

Fixes #41950

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


git-svn-id: http://core.svn.wordpress.org/trunk@51346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-07 21:31:55 +00:00
hellofromTonya
aebe05f6f4 Code Modernization: Fix parameter name mismatches for parent/child classes in WP_List_Table::handle_row_actions().
Matches the method signatures of the parent class and each child class.

Why? PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match.

For readability:

- `@since` clearly specifies the original parameter name and its new name as well as why the change happened

- in methods longer than a single line, the generic parameter is reassigned to the original parameter restoring it for context for use within the method. An inline comment is added to explain why this reassignment is made.

Follow-up to [32644], [32664], [32798], [38489], [49183], [49197].

Props jrf, hellofromTonya, sergeybiryukov, azaozz, desrosj, johnbillion.
See #51553.
Built from https://develop.svn.wordpress.org/trunk@51737


git-svn-id: http://core.svn.wordpress.org/trunk@51345 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-07 19:24:53 +00:00
John Blackbourn
172541c6f1 Build/Test Tools: Fix CI for running tests on PHP 8.1.
This fixes the CI for PHP 8.1 while retaining the needed improvements for local testing when running `npm run test:php-composer` by:

* Replacing the npm script with the full node command
* Removing the `composer update` command from the `env:install` process

Props BinaryKitten, hellofromTonya

See #53945

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


git-svn-id: http://core.svn.wordpress.org/trunk@51344 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-07 19:23:56 +00:00
hellofromTonya
7d6a70107a Code Modernization: Fix parameter name mismatches for parent/child classes in WP_List_Table::column_cb().
Matches the method signatures of the parent class and each child class.

Why? PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match.

For readability:

- `@since` clearly specifies the original parameter name and its new name as well as why the change happened

- in methods longer than a single line, the generic parameter is reassigned to the original parameter restoring it for context for use within the method. An inline comment is added to explain why this reassignment is made.

Follow-up to [15632], [30679], [31210], [32740], [32753], [32754], [32755], [32756], [32757].

Props jrf, hellofromTonya, sergeybiryukov, azaozz, desrosj, johnbillion.
See #51553.
Built from https://develop.svn.wordpress.org/trunk@51735


git-svn-id: http://core.svn.wordpress.org/trunk@51343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-07 18:19:56 +00:00
hellofromTonya
213ce0c7ea Code Modernization: Improve @since message in WP_List_Table::column_default().
Improves the `@since` message to more clearly specify the reason for this change" for PHP 8 named parameter support.

Follow-up to [51728].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51342 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-07 16:57:58 +00:00
Sergey Biryukov
5a7eca9a0e Docs: Correct documentation for the in_plugin_update_message-{$file} filter.
The `$response` parameter is an object, not an array.

This is a minor inconsistency with the corresponding `in_theme_update_message-{$theme_key}` action for themes, where the `$response` parameter is an array.

For backward compatibility, it is safer not to change the parameter type at this point, but to make sure the documentation is correct.

Follow-up to [11193], [16141], [26540].

Props davidmosterd, audrasjb, SergeyBiryukov.
See #40006.
Built from https://develop.svn.wordpress.org/trunk@51733


git-svn-id: http://core.svn.wordpress.org/trunk@51341 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-07 12:55:00 +00:00
Sergey Biryukov
de70e2c68b Docs: Correct the post_submitbox_minor_actions hook description.
The action fires after the Save Draft (or Save as Pending) and Preview (or Preview Changes) buttons in the Publish meta box.

The previous description stated that the action fires before the post date/time setting, which was not quite correct, as there are also post status and visibility settings between the action and the date/time setting.

Follow-up to [34895].

Props bedas, audrasjb.
Fixes #54045.
Built from https://develop.svn.wordpress.org/trunk@51732


git-svn-id: http://core.svn.wordpress.org/trunk@51338 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-06 13:36:01 +00:00
Sergey Biryukov
c5d96d88a3 Docs: Сlarify that term_id is a valid value for the $field parameter of get_term_by().
As `term_id` is the actual property name of the `WP_Term`, it should appear first and we should make it more clear that `id` and `ID` are aliases.

Follow-up to [6254], [25334], [38677], [47865], [47870].

Props gazchap, audrasjb.
Fixes #54065.
Built from https://develop.svn.wordpress.org/trunk@51731


git-svn-id: http://core.svn.wordpress.org/trunk@51337 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-05 11:06:59 +00:00
Sergey Biryukov
bd3465828e Docs: Fix typo in a comment in WP_Customize_Manager::get_return_url().
Follow-up to [46754].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@51730


git-svn-id: http://core.svn.wordpress.org/trunk@51336 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-04 00:39:04 +00:00
Sergey Biryukov
15e552e105 Docs: Move @since notes from the safe_style_css filter to the safecss_filter_attr() function.
The filter allows to modify the list of allowed CSS attributes, however support for specific CSS attributes is added to the function rather than the filter.

Follow-up to [37931], [38121], [42880], [44136], [44531], [45242], [45363], [46235], [46793], [50634], [50923].

Props tmatsuur, muhammadfaizanhaidar, sabernhardt.
Fixes #53731.
Built from https://develop.svn.wordpress.org/trunk@51729


git-svn-id: http://core.svn.wordpress.org/trunk@51335 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-03 01:37:57 +00:00
hellofromTonya
2c91899724 Code Modernization: Fix parameter name mismatches for parent/child classes in WP_List_Table::column_default().
Matches the method signatures of the parent class and each child class.

Why? PHP 8 introduces the ability to pass named arguments to function/method calls. This means the child and parent method signatures (i.e. parameter names) need to match.

For readability:

- `@since` clearly specifies the original parameter name and its new name as well as why the change happened

- in methods longer than a single line, the generic parameter is reassigned to the original parameter restoring it for context for use within the method. An inline comment is added to explain why this reassignment is made.

Follow-up to [15632], [30679], [31210], [32740], [32753], [32754], [32755], [32756], [32757].

Props jrf, hellofromTonya, @sergeybiryukov, @azaozz, @desrosj, @johnbillion
See #51553.
Built from https://develop.svn.wordpress.org/trunk@51728


git-svn-id: http://core.svn.wordpress.org/trunk@51334 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-02 22:26:56 +00:00
ryelle
c11fbdc7ae Coding Standards: Apply coding standards on CSS.
Remove units when the value is zero. Combine redundant values in shorthand declarations.
This was generated with `stylelint --fix` and a custom config (see #53866).

Props ankitmaru, audrasjb, pbiron, ayeshrajans, hareesh-pillai, netweb, mukesh27.
Fixes #53866.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51333 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-02 22:18:00 +00:00
Sergey Biryukov
fcc79f847a Docs: Provide a more accurate description for a few script and style functions.
This should make it clear that the functions only work if the script or style has already been registered.

This affects:
* `wp_localize_script()`
* `wp_set_script_translations()`
* `wp_script_add_data()`
* `wp_style_add_data()`

Follow-up to [7970], [18464], [25594], [31223], [36633], [44169], [44350].

Props audrasjb.
Fixes #54044.
Built from https://develop.svn.wordpress.org/trunk@51726


git-svn-id: http://core.svn.wordpress.org/trunk@51332 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-02 08:30:58 +00:00
hellofromTonya
9b3202eafd Tests: Add missing @covers tags for Tests_Admin_wpCommunityEvents.
Adds missing and moves placement of existing @covers tags for consistency.

Follow-up to [40607], [42726], [49145].

Props pbearne, jrf, hellofromTonya.
See #39265.
Built from https://develop.svn.wordpress.org/trunk@51725


git-svn-id: http://core.svn.wordpress.org/trunk@51331 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 22:27:57 +00:00
hellofromTonya
380b5563ad Tests: Add missing @covers tags for Tests_Admin_IncludesComment.
Follow-up to [34456], [34460].

Props pbearne, jrf, hellofromTonya.
See #39265.
Built from https://develop.svn.wordpress.org/trunk@51724


git-svn-id: http://core.svn.wordpress.org/trunk@51330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 21:59:56 +00:00
desrosj
c886de61f9 Editor: Update block editor packages for WordPress 5.8.1.
The following packages were updated:
- @wordpress/a11y to `3.1.2`
- @wordpress/annotations to `2.1.6`
- @wordpress/api-fetch to `5.1.2`
- @wordpress/autop to `3.1.2`
- @wordpress/babel-preset-default to `6.2.1`
- @wordpress/blob to `3.1.2`
- @wordpress/block-directory to `2.1.21`
- @wordpress/block-editor to `6.1.14`
- @wordpress/block-library to `3.2.19`
- @wordpress/block-serialization-default-parser to `4.1.2`
- @wordpress/blocks to `9.1.8`
- @wordpress/components to `14.1.11`
- @wordpress/compose to `4.1.6`
- @wordpress/core-data to `3.1.12`
- @wordpress/customize-widgets to `1.0.20`
- @wordpress/data-controls to `2.1.6`
- @wordpress/data to `5.1.6`
- @wordpress/date to `4.1.2`
- @wordpress/deprecated to `3.1.2`
- @wordpress/dom-ready to `3.1.2`
- @wordpress/dom to `3.1.5`
- @wordpress/e2e-test-utils to `5.3.1`
- @wordpress/edit-post to `4.1.21`
- @wordpress/edit-widgets to `2.1.21`
- @wordpress/editor to `10.1.17`
- @wordpress/element to `3.1.2`
- @wordpress/escape-html to `2.1.2`
- @wordpress/format-library to `2.1.14`
- @wordpress/html-entities to `3.1.2`
- @wordpress/i18n to `4.1.2`
- @wordpress/icons to `4.0.3`
- @wordpress/interface to `3.1.12`
- @wordpress/keyboard-shortcuts to `2.1.7`
- @wordpress/keycodes to `3.1.2`
- @wordpress/list-reusable-blocks to `2.1.11`
- @wordpress/media-utils to `2.1.2`
- @wordpress/notices to `3.1.6`
- @wordpress/nux to `4.1.11`
- @wordpress/plugins to `3.1.6`
- @wordpress/primitives to `2.1.2`
- @wordpress/priority-queue to `2.1.2`
- @wordpress/react-i18n to `2.1.2`
- @wordpress/redux-routine to `4.1.2`
- @wordpress/reusable-blocks to `2.1.17`
- @wordpress/rich-text to `4.1.6`
- @wordpress/scripts to `16.1.5`
- @wordpress/server-side-render to `2.1.12`
- @wordpress/shortcode to `3.1.2`
- @wordpress/url to `3.1.2`
- @wordpress/viewport to `3.1.6`
- @wordpress/warning to `2.1.2`
- @wordpress/widgets to `1.1.19`
- @wordpress/wordcount to `3.1.2`

Props oandregal, juanmaguitar, gziolo, jblz, talldanwp, ribaricplusplus, peterwisoncc, youknowriad, paaljoachim, kreppar, ellatrix, aristath, walbo, ajlende, kevin940726, mamaduka, ntsekouras, toro_unit, mkaz, joen, noisysocks, zieladam, andraganescu, antonvlasenko, terraling, dariak, vladytimy, circlecube, desrosj.
Fixes #54052, #52818.
Built from https://develop.svn.wordpress.org/trunk@51719


git-svn-id: http://core.svn.wordpress.org/trunk@51325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 19:08:24 +00:00
desrosj
da38a95d77 Media: Remove documentation detailing specific edge cases in the image_editor_output_format filter.
In [51422], a few specific edge cases were detailed so that developers using the hook were aware of known pitfalls.

These edge cases have been fixed in 5.8.1 through [51653] and [51704], so the documentation is no longer necessary.

Props azaozz, audrasjb.
Fixes #53955.
Built from https://develop.svn.wordpress.org/trunk@51717


git-svn-id: http://core.svn.wordpress.org/trunk@51323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 17:17:58 +00:00
noisysocks
9697e5a63b Customize: Add wp-embed-responsive class to body if using widgets block editor
Appends the wp-embed-responsive class to the body if the widgets block editor is
enabled. This fixes a bug preventing embeds (e.g. YouTube embeds) appearing in
the widgets block editor.

Fixes #53609.
Props walbo, kevin940726.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51322 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 07:10:56 +00:00
Sergey Biryukov
049bbe8356 Site Health: Remove MySQL query cache size from the Site Health Info screen.
The query cache is deprecated as of MySQL 5.7.20, and is removed in MySQL 8.0.

Reference: [https://dev.mysql.com/doc/refman/5.7/en/query-cache-configuration.html MySQL 5.7 Reference Manual: Query Cache Configuration].

Follow-up to [51522], [51523].

Props johnbillion, zodiac1978.
Fixes #53845.
Built from https://develop.svn.wordpress.org/trunk@51715


git-svn-id: http://core.svn.wordpress.org/trunk@51321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 07:01:56 +00:00
Peter Wilson
33f4f396ef Build: Clean css/dist as part of the webpack build step.
Move the cleaning of the `wp-includes/css/dist` folder from `clean:css` to `clean:webpack-assets` to avoid an order of operations issue in which the files were built shortly before been deleted later in the build process.

Follow up to [51689].

Props netweb, ramonopoly, peterwilsoncc.
Fixes #53719.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51319 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 04:00:59 +00:00
desrosj
3dd999bb14 Build/Test Tools: Double escape quotation marks() for Slack “messages”.
This prevents quotation marks from producing invalid JSON errors.

See #52644.
Built from https://develop.svn.wordpress.org/trunk@51709


git-svn-id: http://core.svn.wordpress.org/trunk@51315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-09-01 00:26:55 +00:00
hellofromTonya
71977c215d Widgets: Rename and soft deprecate retrieve_widgets().
The original name `retrieve_widgets()` was unclear as it suggested it was a getter, i.e. getting the widgets. This function does more than get: finds orphaned widgets, assigns them to the inactive sidebar, and updates the database.

The new name is `sync_registered_widgets()` which better represents what happens when this function is invoked.

The original `retrieve_widgets()` function is soft deprecated to avoid unnecessary code churn downstream for developers that support more than the latest version of WordPress.

Follow-up to [18630].

Props zieladam, timothyblynjacobs, andraganescu, hellofromTonya.
See #53811.
Built from https://develop.svn.wordpress.org/trunk@51705


git-svn-id: http://core.svn.wordpress.org/trunk@51311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-31 19:58:58 +00:00
Andrew Ozz
f405add8f0 Media: apply the wp_editor_set_quality filter not only when loading an image in the editor but also when saving an converted image, after the mime-type of the output image has changed.
Props mikeschroder, desrosj, azaozz.
Fixes #53667.
Built from https://develop.svn.wordpress.org/trunk@51704


git-svn-id: http://core.svn.wordpress.org/trunk@51310 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-31 18:59:03 +00:00
Andrew Ozz
4112d77597 Media: fix showing of the "Filter Media" filds when replacing an image from the media modal.
Props mhuntdesign, sabernhardt, azaozz.
Fixes #53833.
Built from https://develop.svn.wordpress.org/trunk@51703


git-svn-id: http://core.svn.wordpress.org/trunk@51309 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-31 17:27:57 +00:00
hellofromTonya
46ba4f8b70 Tests: Add missing @covers tags for actions' tests.
Props pbearne, hudson-atwell, jrf, hellofromTonya.
See #39265.
Built from https://develop.svn.wordpress.org/trunk@51702


git-svn-id: http://core.svn.wordpress.org/trunk@51308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-31 17:23:55 +00:00
desrosj
e91f690333 Widgets: Show title and media select fields in Accessibility Mode.
This updates the Custom HTML and Media widgets to display the correct fields when adding or editing a widget when using accessibility mode through the Classic Widgets experience.

Follow up to [49973].

Props mark-k, sabernhardt, alexstine, circlecube, audrasjb.
Fixes #53641.
Built from https://develop.svn.wordpress.org/trunk@51701


git-svn-id: http://core.svn.wordpress.org/trunk@51307 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-31 13:51:00 +00:00
Sergey Biryukov
892c8ecbdb Widgets: Pass correct context to get_block_categories() calls.
The `get_block_categories()` function expects either a `WP_Post` or a `WP_Block_Editor_Context` instance as the context argument, not a string.

Follow-up to [50996], [50997].

Props Enchiridion, pbearne, audrasjb.
Fixes #53757.
Built from https://develop.svn.wordpress.org/trunk@51700


git-svn-id: http://core.svn.wordpress.org/trunk@51306 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-31 13:38:58 +00:00
Sergey Biryukov
c73609fe10 Docs: Improve documentation in wp-signup.php.
* Document the `$active_signup` global in `signup_user()`.
* Update some DocBlocks per the documentation standards.
* Expand some function descriptions for clarity.

Follow-up to [37535], [37536], [41200], [43326], [49078], [50828].

Props mt8.biz, sabernhardt, audrasjb, westonruter, jayupadhyay01, mukesh27, SergeyBiryukov.
Fixes #41566.
Built from https://develop.svn.wordpress.org/trunk@51699


git-svn-id: http://core.svn.wordpress.org/trunk@51305 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-31 12:25:00 +00:00
hellofromTonya
4abb89f6c6 Tests: Do whitespace replacement in assertDiscardWhitespace() only when string.
The `assertDiscardWhitespace()` method uses `assertEquals()` under the hood, meaning that in reality any type of actual/expected value should be accepted by the function. Fixed the documentation to reflect that.

At the same time, only strings can contain whitespace differences. So the whitespace replacement should only be done when string values are passed.

This change (a) prevents potential `passing null to non-nullable` errors on PHP 8.1, if either of the inputs would turn out to be `null` and (b) increases tests stability.

Follow-up to [35003], [44902].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51304 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-30 20:41:59 +00:00
hellofromTonya
702ea22639 Tests: Test custom assertions parameter data type in WP_UnitTestCase_Base.
The following changes improve tests stability.

The `assertEqualFields()` method expects an object and a fields array as inputs and subsequently approaches the received parameters as such, but did not verify whether the received parameters are of the expected types.

Along the same lines, the `assertSameSets()`, `assertEqualSets()`, `assertSameSetsWithIndex()` and the `assertEqualSetsWithIndex()` methods all expect arrays for both the actual as well as the expected values and uses the array function `[k]sort()` on both, but never verified that the received inputs were actually arrays, which could lead to PHP errors on the sorting function calls.

Follow-up to [30687], [42343], [48937], [48939], [51480], [51481].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-30 20:19:59 +00:00
hellofromTonya
6b2eccb0e3 Code Modernization: Add input validation to _set_cron_array().
The private `_set_cron_array()` function expects a cron array as the first parameter, but will often be passed the - potentially updated - output of a call to `_get_cron_array()`.

When the `_get_cron_array()` function returns `false`, a "Deprecated: Automatic conversion of false to array is deprecated" warning will be thrown on PHP 8.1.

The input validation resolves the deprecation warning by setting the cron value to an empty array when not given an `array` data type.

Adds a full set of `_set_cron_array()` tests.

Follow-up to [4189], [50152].

Props jrf, hellofromTonya, peterwilsoncc.
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51695


git-svn-id: http://core.svn.wordpress.org/trunk@51301 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-30 15:20:56 +00:00
desrosj
5090761b4f Coding Standards: Apply some minor alignment fixes.
These are updates caused by running `composer format`.

Follow up to [51501], [51599], [51618], [51653].
See #53359, #50542, #53238, #53668, #53690.
Built from https://develop.svn.wordpress.org/trunk@51693


git-svn-id: http://core.svn.wordpress.org/trunk@51299 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-30 14:09:58 +00:00
Sergey Biryukov
09f22e5b24 External Libraries: Update whatwg-fetch package to version 3.6.2.
This matches the version used in the Gutenberg project.

While WordPress core no longer depends on this polyfill as of [50934], this brings the latest updates of the library to anyone still utilizing it.

For a full list of changes in this update, see the `whatwg-fetch` GitHub:
https://github.com/github/fetch/compare/v3.0.0...v3.6.2

Follow-up to [43719], [50934].

Props hareesh-pillai, rsiddharth, desrosj.
Fixes #53929.
Built from https://develop.svn.wordpress.org/trunk@51692


git-svn-id: http://core.svn.wordpress.org/trunk@51298 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-30 13:51:11 +00:00
Peter Wilson
1ac69fa78e Build: Remove css/dist in grunt clean command.
Modify the `grunt clean:css` command to include the folder `wp-includes/css/dist` to ensure legacy files do not remain if the built files are removed/relocated.

Props desrosj, netweb.
Fixes #53719.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51295 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-30 04:35:57 +00:00
Peter Wilson
34d8dd914c Menus: Save display locations for new menus.
Fixes a bug preventing the locations saving when creating a new menu. Introduced in [50938].

Props dlh, andraganescu, mukesh27, desrosj.
Fixes #53877.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51294 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-30 04:12:57 +00:00
Sergey Biryukov
26a276db6f Filesystem API: Make sure to only call fread() on non-empty files in PclZip::privAddFile().
This avoids a fatal error on PHP 8 caused by passing a zero value to `fread()` as the `$length` argument, which must be greater than zero.

This commit also amends the previous solution for similar issues elsewhere in the file to ensure consistent type for string values, instead of changing the type from `string` to `bool` when trying to read from an empty file.

Follow-up to [50355].

Props DavidAnderson, jrf, SergeyBiryukov.
Fixes #54036.
Built from https://develop.svn.wordpress.org/trunk@51686


git-svn-id: http://core.svn.wordpress.org/trunk@51292 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-29 01:33:58 +00:00
John Blackbourn
b441808aee Build/Test Tools: Install the Composer package dependencies within the Docker environment as part of the local development environment installation and testing processes.
This makes the use of Composer on the host machine optional when using the Docker environment, which means there is no change to the process for installing, updating, and running the tests since [51559].

Props hellofromTonya, azaozz, netweb, desrosj, jrf, johnbillion

Fixes #53945

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


git-svn-id: http://core.svn.wordpress.org/trunk@51291 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-28 21:17:56 +00:00
John Blackbourn
80c7b3cdf3 Administration: Remove a misleading pointer cursor from list items in the admin menu.
This prevents unclickable areas within the menu from appearing clickable.

Props circlecube, kurudrive, ryelle, opurockey

Fixes #51551

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


git-svn-id: http://core.svn.wordpress.org/trunk@51290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-28 13:45:56 +00:00
Sergey Biryukov
42c7a1fad5 Coding Standards: Fix WPCS issue in [51682].
This fixes a "Misleading line break before `'||'`; readers may interpret this as an expression boundary" error.

See #54030.
Built from https://develop.svn.wordpress.org/trunk@51683


git-svn-id: http://core.svn.wordpress.org/trunk@51289 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-28 01:34:56 +00:00
Sergey Biryukov
79b0d3f3e8 Customize: Prevent collapsing expanded panel/section/control when Esc is pressed on a block editor instance.
This ensures that the current panel is not collapsed when hitting `Esc` with the focus on the widget block editor.

Follow-up to [37347], [39120].

Props gwwar, dlh.
Fixes #54030.
Built from https://develop.svn.wordpress.org/trunk@51682


git-svn-id: http://core.svn.wordpress.org/trunk@51288 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-28 01:25:59 +00:00
desrosj
ed0e054f34 Build/Test Tools: Preserve text within backticks in Slack notifications.
Props SergeyBiryukov, johnbillion, earnjam.
See #52644.
Built from https://develop.svn.wordpress.org/trunk@51679


git-svn-id: http://core.svn.wordpress.org/trunk@51285 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-27 17:35:58 +00:00
Sergey Biryukov
0ae0fbedce Plugins: Display a message on Plugins list table if a plugin requires a higher version of PHP or WordPress.
Installation and activation of incompatible plugins was previously disallowed in [43436] and [44978], but if such a plugin was installed manually, there was nothing on the Plugins screen that would show its compatibility status.

Showing an appropriate notice with a documentation link makes the UI more consistent and improves user experience.

Follow-up to [43436], [44937], [44939], [44978], [45043], [45165], [45546], [47573], [47816], [47819], [48172], [48636], [48637], [48638], [48640], [48652], [48653], [48654], [48660].

Props TacoVerdo, SergeyBiryukov.
Fixes #53990.
Built from https://develop.svn.wordpress.org/trunk@51678


git-svn-id: http://core.svn.wordpress.org/trunk@51284 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-27 15:43:57 +00:00
Mike Schroder
9aeacc728a Customizer: Respect prefers-reduced-motion media query in Customizer animations.
Disables Customizer animations when media query `prefers-reduced-motion: reduce` returns true.

Continues the effort to reduce motion within the WordPress admin panel when users have enabled this feature in their operating system or browser.

It has the additional effect of making the Block Editor's end-to-end tests run faster, as explored initially with a different approach in #53562.

See https://github.com/WordPress/gutenberg/issues/32024 for the related Gutenberg issue.

See https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion for ways to enable this feature on various platforms.

Props kevin940726, isabel_brison, zieladam, youknowriad, desrosj, mamaduka, mikeschroder.
Previously [51389], [50028], [47813].
Fixes #53542.
Built from https://develop.svn.wordpress.org/trunk@51677


git-svn-id: http://core.svn.wordpress.org/trunk@51283 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-27 09:36:57 +00:00
John Blackbourn
b3226d8e62 REST API: Correct the description for the last_updated property in the block-directory endpoint.
This field shows the date in ISO 8601 format.

Fixes #53595

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


git-svn-id: http://core.svn.wordpress.org/trunk@51282 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-26 19:34:56 +00:00
John Blackbourn
52d6bd3529 Security: Correct the inline docs for the wp_kses_allowed_html filter.
Props peterwilsoncc

Fixes #53597

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


git-svn-id: http://core.svn.wordpress.org/trunk@51281 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-26 19:28:57 +00:00
desrosj
9bc8352b00 Editor: Ensure block attribute serialization in PHP matches the JavaScript equivalent.
The `serializeAttributes()` function in JavaScript uses `JSON.stringify`, which does not encode slashes and unicode characters by default. This resulted in the PHP serialization through `json_encode()` producing different results.

This also switches from `json_encode()` to `wp_json_encode()` to prevent failures when any non UTF-8 characters are included.

Props kevinfodness, SergeyBiryukov, timothyblynjacobs.
Fixes #53936.
Built from https://develop.svn.wordpress.org/trunk@51674


git-svn-id: http://core.svn.wordpress.org/trunk@51280 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-26 19:10:58 +00:00
desrosj
b6f34e7b44 Build/Test Tools: Use list format when defining environment variables in Docker compose file.
This is the correct formatting detailed in the Docker `compose` documentation examples and helps to avoid ambiguities in the yaml parser when values that may cause warnings.

Props pbrearne, ocean90, johnbillion, desrosj.
Fixes #53820.
Built from https://develop.svn.wordpress.org/trunk@51673


git-svn-id: http://core.svn.wordpress.org/trunk@51279 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-26 18:41:58 +00:00
ryelle
e32d9ec522 Toolbar: Provide a CSS custom property for the admin bar height.
This new custom property, `--wp-admin--admin-bar--height`, reflects the admin bar's height and adjusts responsively on smaller screens. It can be used to offset content to avoid overlapping the admin bar, without needing to copy the media query.

This also removes a workaround only needed for Internet Explorer 6 and below.

Props nico23, sabernhardt.
Fixes #52623.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51278 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-26 18:24:58 +00:00
desrosj
2ddca7fd4a Build/Test Tools: Remove shell: bash from code coverage workflow.
bash is the default shell for all non-Windows GitHub Action runners, so this is not necessary.

Follow up to [51670].
See #53363.
Built from https://develop.svn.wordpress.org/trunk@51671


git-svn-id: http://core.svn.wordpress.org/trunk@51277 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-26 18:22:57 +00:00
desrosj
59faf7aeb6 Build/Test Tools: Remove shell: bash from PHPUnit test workflow.
bash is the default shell for all non-Windows GitHub Action runners, so this is not necessary.

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51670


git-svn-id: http://core.svn.wordpress.org/trunk@51276 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-26 18:21:58 +00:00
hellofromTonya
31def8058e Tests: Improve bootstrap error message for when ABSPATH folder does not exist.
The PHPUnit tests are/should generally be run on the `src` directory, so changes just made can be tested. While testing via the `build` directory is also still supported, this is not the default.

This was last changed in [50441], but that commit did not remove/update the error message thrown by the test bootstrap file.

This last change also did not take into account that that change meant that people had to update their own `wp`tests-config.php` file to match the change made in Core and would otherwise still get the outdated error message.

This commit changes the messaging in the test bootstrap file to be more in line with the current reality, while still accounting for the fact that tests can be run from both `src` as well as `build`.

Follow-up to [49569], [50441], [51581].
Props jrf, hellofromTonya.
Built from https://develop.svn.wordpress.org/trunk@51669


git-svn-id: http://core.svn.wordpress.org/trunk@51275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-26 17:56:57 +00:00
Sergey Biryukov
1f7f8fb16a Coding Standards: Add missing visibility keywords for wp_filter_object_list() and wp_list_pluck() tests.
Follow-up to [51663-51667].

Props pbearne.
See #53363, #53987.
Built from https://develop.svn.wordpress.org/trunk@51668


git-svn-id: http://core.svn.wordpress.org/trunk@51274 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-26 16:51:57 +00:00
Sergey Biryukov
4810f47fd5 Tests: Move wp_list_sort() tests to their own file.
This matches the name of the function being tested.

Follow-up to [38928], [51663-51666].

See #53363, #53987.
Built from https://develop.svn.wordpress.org/trunk@51667


git-svn-id: http://core.svn.wordpress.org/trunk@51273 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-26 16:30:56 +00:00
Sergey Biryukov
48aa9e7147 Tests: Move wp_list_filter() tests to their own file.
This matches the name of the function being tested.

Follow-up to [38928], [51663-51665].

See #53363, #53987.
Built from https://develop.svn.wordpress.org/trunk@51666


git-svn-id: http://core.svn.wordpress.org/trunk@51272 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-26 16:21:58 +00:00
Sergey Biryukov
5cfd90b427 Tests: Rename the test file and class for wp_filter_object_list() tests.
This matches the name of the function being tested.

Follow-up to [410/tests], [51663], [51664].

See #53363, #53987.
Built from https://develop.svn.wordpress.org/trunk@51665


git-svn-id: http://core.svn.wordpress.org/trunk@51271 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-26 16:09:56 +00:00
Sergey Biryukov
18ef0d4252 Tests: Remove duplicate wp_list_pluck() tests.
The tests were partially duplicated in two separate files, and are now located in their own file.

Follow-up to [431/tests], [28900], [38928], [42527], [51663].

See #53363, #53987.
Built from https://develop.svn.wordpress.org/trunk@51664


git-svn-id: http://core.svn.wordpress.org/trunk@51270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-26 16:03:57 +00:00
Sergey Biryukov
a9cff26ae7 Tests: Move wp_list_pluck() tests to their own file.
The tests were partially duplicated in two separate files.

Follow-up to [431/tests], [28900], [38928], [42527].

See #53363, #53987.
Built from https://develop.svn.wordpress.org/trunk@51663


git-svn-id: http://core.svn.wordpress.org/trunk@51269 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-26 15:55:57 +00:00
hellofromTonya
ab252fb910 Coding Standards: Fix indentation and remove ignore annotation in wp_privacy_send_personal_data_export_email().
Follow-up to [51129], [51410].

Props jrf, hellofromTonya.
See #53359.
Built from https://develop.svn.wordpress.org/trunk@51662


git-svn-id: http://core.svn.wordpress.org/trunk@51268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-26 14:05:58 +00:00
hellofromTonya
2e9fe3c986 Coding Standards: Make ignore annotation more specific in WP_Site_Health_Auto_Updates::test_vcs_abspath().
Follow-up to [44986].

Props jrf, hellofromTonya.
See #53359.
Built from https://develop.svn.wordpress.org/trunk@51661


git-svn-id: http://core.svn.wordpress.org/trunk@51267 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-26 13:59:59 +00:00
hellofromTonya
a91fc400a0 Coding Standards: Remove redundant ignore annotation in populate_options().
Follow-up to [43627], [43628].

Props jrf, hellofromTonya.
See #53359.
Built from https://develop.svn.wordpress.org/trunk@51660


git-svn-id: http://core.svn.wordpress.org/trunk@51266 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-26 13:50:59 +00:00
hellofromTonya
90a950783d Coding Standards: Update the config for WordPress.PHP.FileName in PHPCS ruleset.
The WPCS sniff already takes the test classes in the `tests/phpunit/includes` directory into account.

Only the test cases outside of that directory, i.e. in the `tests/phpunit/tests` directory need to be listed here.

Includes alphabetizing the list.

Follow-up to [42346], [45607].

Props jrf, hellofromTonya, SergeyBiryukov.
See #53359.
Built from https://develop.svn.wordpress.org/trunk@51659


git-svn-id: http://core.svn.wordpress.org/trunk@51265 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-26 13:36:56 +00:00
hellofromTonya
958cd3a964 Coding Standards: Update the config for WordPress.PHP.NoSilencedErrors in PHPCS ruleset.
Follow-up to [45611].

Props jrf, hellofromTonya.
See #53359.
Built from https://develop.svn.wordpress.org/trunk@51658


git-svn-id: http://core.svn.wordpress.org/trunk@51264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-26 13:20:56 +00:00
hellofromTonya
c7d3e267b8 Coding Standards: Use static closures when not using $this.
When a closure does not use `$this`, it can be made `static` for improved performance.

Static closures are supported in PHP since PHP 5.4. ​

Props jrf, hellofromTonya, swissspidy, SergeyBiryukov.
See #53359.
Built from https://develop.svn.wordpress.org/trunk@51657


git-svn-id: http://core.svn.wordpress.org/trunk@51263 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-26 12:59:02 +00:00
Sergey Biryukov
622985b69c Docs: Add missing @since tag for the $check_signatures parameter of WP_Upgrader::run().
This matches the `WP_Upgrader::download_package()` documentation more closely.

Follow-up to [44954], [45262].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@51655


git-svn-id: http://core.svn.wordpress.org/trunk@51261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-25 14:39:59 +00:00
Sergey Biryukov
d529999e5b Docs: Clarify a comment in WP_Upgrader::run().
This matches the `WP_Upgrader::download_package()` documentation more closely.

Follow-up to [11005], [30758], [33685].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@51654


git-svn-id: http://core.svn.wordpress.org/trunk@51260 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-24 23:10:06 +00:00
Andrew Ozz
94a990de99 Media: Fix wp_unique_filename() to check for name collisions with all alternate file names when an image may be converted after uploading. This includes possible collinions with pre-existing images whose sub-sizes/thumbnails are regenerated.
Props ianmjones, azaozz.
Fixes #53668.
Built from https://develop.svn.wordpress.org/trunk@51653


git-svn-id: http://core.svn.wordpress.org/trunk@51259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-24 20:52:03 +00:00
Sergey Biryukov
e53ffbaf95 Code Modernization: Pass correct default value to http_build_query() in WP_Sitemaps_Provider::get_sitemap_url().
The `WP_Sitemaps_Provider::get_sitemap_url()` method calls the PHP native `http_build_query()` function, the second parameter of which is the ''optional'' `$numeric_prefix` parameter which expects a `string`.

A parameter being optional, however, does not automatically make it nullable.

As of PHP 8.1, passing `null` to a non-nullable PHP native function will generate a deprecation notice.

In this case, this function call yielded a `http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated` notice.

Changing the `null` to an empty string fixes this without a backward compatibility break.

This change is already covered by tests as 14 of the existing tests failed on these function calls when running the tests on PHP 8.1.

References:
* [https://www.php.net/manual/en/function.http-build-query.php PHP Manual: http_build_query()]
* [https://wiki.php.net/rfc/deprecate_null_to_scalar_internal_arg PHP RFC: Deprecate passing null to non-nullable arguments of internal functions]

Follow-up to [48470].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51258 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-23 11:44:01 +00:00
Sergey Biryukov
cdf31027d6 Tests: Rename classes in phpunit/tests/feed/ per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491], [51492], [51493], [51623], [51639], [51646], [51650].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51651


git-svn-id: http://core.svn.wordpress.org/trunk@51257 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-22 10:08:59 +00:00
Sergey Biryukov
eec183cb63 Tests: Rename classes in phpunit/tests/error-protection/ per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491], [51492], [51493], [51623], [51639], [51646].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51650


git-svn-id: http://core.svn.wordpress.org/trunk@51256 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-21 15:34:01 +00:00
Andrew Ozz
774c8047c5 Editor: Replace the remaining references to wp.editor with wp.oldEditor.
Props zieladam.
Fixes #53762.
Built from https://develop.svn.wordpress.org/trunk@51649


git-svn-id: http://core.svn.wordpress.org/trunk@51255 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-21 00:20:00 +00:00
Andrew Ozz
7fc3aae637 REST API: Remove trailing slashes when preloading requests and add unit tests for it.
Props antonvlasenko.
Fixes #51636.
Built from https://develop.svn.wordpress.org/trunk@51648


git-svn-id: http://core.svn.wordpress.org/trunk@51254 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-20 23:44:57 +00:00
desrosj
f514f51180 Build/Test Tools: Include the commit short summary in Slack messages.
This gives more context to GitHub Action related Slack messages without the need to click the workflow URL, or unfurl the links (which shows lots of unnecessary information, such as the repository description and image).

Props earnjam.
See #52644.
Built from https://develop.svn.wordpress.org/trunk@51647


git-svn-id: http://core.svn.wordpress.org/trunk@51253 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-20 19:00:00 +00:00
Sergey Biryukov
1be5d3e997 Tests: Rename classes in phpunit/tests/editor/ per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491], [51492], [51493], [51623], [51639].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51646


git-svn-id: http://core.svn.wordpress.org/trunk@51252 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-20 16:13:04 +00:00
ryelle
899e4635de Privacy: Add space below page selector.
Sometimes the submit button wraps to a new line, either because the button label translation is long, or there are long page names. When it wraps, there should be space between the select dropdown and the button.

Props audrasjb, mukesh27, guillaumeturpin.
Fixes #53782.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51251 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-19 20:58:57 +00:00
ryelle
9d2e8c096f Toolbar: Limit the icon transition style to color only.
When transition is `all`, it also applies to the icon size, which can cause a bug in Safari where icons get stuck in the wrong size when resizing the browser window. The only expected animation is on the color property, so the transition can be limited to just `color`.

Props johnjamesjacoby, sabernhardt, SergeyBiryukov, audrasjb.
Fixes #43423.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51250 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-19 17:24:55 +00:00
Sergey Biryukov
87bd00ac5b Tests: Move loading the WP_Community_Events class to set_up_before_class().
This ensures that the class is loaded once before the first test of the test case class is run, and `require_once()` is not unnecessarily called for each test method individually.

Follow-up to [40607], [51628].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51641


git-svn-id: http://core.svn.wordpress.org/trunk@51247 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-19 14:00:57 +00:00
Sergey Biryukov
590f56db3b Tests: Rename classes in phpunit/tests/admin/ per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491], [51492], [51493], [51623].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51639


git-svn-id: http://core.svn.wordpress.org/trunk@51245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-19 13:09:57 +00:00
Sergey Biryukov
ccbd16fef1 Media: Check the return type of _get_cron_array() in WP_Media_List_Table::prepare_items().
The following warnings could, in very select circumstances, be shown:
{{{
// PHP 8.0 and higher:
Warning: foreach() argument must be of type array|object, bool given

// PHP 5.6 – 7.4
Warning: Invalid argument supplied for foreach()
}}}

In `WP_Media_List_Table::prepare_items()`, the cron info array is retrieved via a call to `_get_cron_array()`, but as the documentation (correctly) states, the return type of that function is `array|false`, where `false` is returned for a virgin site, with no cron jobs scheduled yet.

However, no type check is done on the return value, and the method just blindly continues by using it in a `foreach`.

Fixed by adding validation for the returned value from `_get_cron_array()` and only running the `foreach` when the returned value is an array.

Reference: [https://developer.wordpress.org/reference/functions/_get_cron_array/ WordPress Developer Resources: _get_cron_array()]

Follow-up to [48417].

Props jrf, hellofromTonya, mukesh27.
Fixes #53949.
Built from https://develop.svn.wordpress.org/trunk@51638


git-svn-id: http://core.svn.wordpress.org/trunk@51244 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-19 12:44:57 +00:00
Peter Wilson
cda7c787e8 Customize: Hide native control on background position field.
Hide the browser's native radio button on the custom background position selector in the Customizer and the legacy background screen. This fixes an issue causing both to display.

Props mukesh27, ravipatel, sabernhardt, walbo.
Fixes #53803.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51243 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-19 02:07:56 +00:00
Sergey Biryukov
27522c6f67 Code Modernization: Silence the deprecation warning for auto_detect_line_endings.
Since PHP 8.1, the `auto_detect_line_endings` setting is deprecated:

> The `auto_detect_line_endings` ini setting modifies the behavior of `file()` and `fgets()` to support an isolated `\r` (as opposed to `\n` or `\r\n`) as a newline character. These newlines were used by “Classic” Mac OS, a system which has been discontinued in 2001, nearly two decades ago. Interoperability with such systems is no longer relevant.

Reference: [https://wiki.php.net/rfc/deprecations_php_8_1#auto_detect_line_endings_ini_setting PHP RFC: Deprecations for PHP 8.1: auto_detect_line_endings ini setting]

> The `auto_detect_line_endings` ini setting has been deprecated. If necessary, handle `\r` line breaks manually instead.

Reference: [1cf4fb739f/UPGRADING (L456-L457) PHP 8.1 Upgrade Notes].

This commit fixes the warning when running tests for the `PO` class:
{{{
Deprecated: auto_detect_line_endings is deprecated in /var/www/src/wp-includes/pomo/po.php on line 16
}}}

While deprecated, the actual `auto_detect_line_endings` functionality has not been removed from PHP (yet) and will still work until PHP 9.0.

For now, we're silencing the deprecation notice as there may still be translation files around which haven't been updated in a long time and which still use the old MacOS standalone `\r` as a line ending.

This should be revisited when PHP 9.0 is in alpha/beta.

Follow-up to [51633].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51242 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-18 21:58:57 +00:00
Sergey Biryukov
74b515c1ba External Libraries: Restore the phpcs:ignore statements in PHPMailer.
These are necessary for a passing PHP Compatibility scan.

Follow-up to [48045], [51634].

See #53953.
Built from https://develop.svn.wordpress.org/trunk@51635


git-svn-id: http://core.svn.wordpress.org/trunk@51241 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-18 14:08:56 +00:00
Sergey Biryukov
fd5aea9246 External Libraries: Upgrade PHPMailer to version 6.5.1.
The latest release includes preliminary PHP 8.1 support, as well as some small bug fixes.

Release notes: https://github.com/PHPMailer/PHPMailer/releases/tag/v6.5.1

For a full list of changes in this update, see the PHPMailer GitHub:
https://github.com/PHPMailer/PHPMailer/compare/v6.5.0...v6.5.1

Follow-up to [50628], [50799], [51169].

Props jrf.
Fixes #53953.
Built from https://develop.svn.wordpress.org/trunk@51634


git-svn-id: http://core.svn.wordpress.org/trunk@51240 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-18 13:53:58 +00:00
Sergey Biryukov
0a2c7dc86c Code Modernization: Only set auto_detect_line_endings in PHP < 8.1.
Since PHP 8.1, the `auto_detect_line_endings` setting is deprecated:

> The `auto_detect_line_endings` ini setting modifies the behavior of `file()` and `fgets()` to support an isolated `\r` (as opposed to `\n` or `\r\n`) as a newline character. These newlines were used by “Classic” Mac OS, a system which has been discontinued in 2001, nearly two decades ago. Interoperability with such systems is no longer relevant.

Reference: [https://wiki.php.net/rfc/deprecations_php_8_1#auto_detect_line_endings_ini_setting PHP RFC: Deprecations for PHP 8.1: auto_detect_line_endings ini setting]

> The `auto_detect_line_endings` ini setting has been deprecated. If necessary, handle `\r` line breaks manually instead.

Reference: [1cf4fb739f/UPGRADING (L456-L457) PHP 8.1 Upgrade Notes].

This commit fixes the warning when running tests for the `PO` class:
{{{
Deprecated: auto_detect_line_endings is deprecated in /var/www/src/wp-includes/pomo/po.php on line 16
}}}

Follow-up to [10584], [51628].

See #53635.
Built from https://develop.svn.wordpress.org/trunk@51633


git-svn-id: http://core.svn.wordpress.org/trunk@51239 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-18 13:23:56 +00:00
Peter Wilson
43e86e620a Media: Increase number of media items displayed per page.
Increase the number of media items displayed per page from 40 to 80 to improve the experience for users navigating the library on sites with a large quantity of media in the library.

Props AlGala, antpb, hellofromTonya, joedolson, SergeyBiryukov, wb1234.
Fixes #53827.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51238 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-18 06:00:59 +00:00
Peter Wilson
c9bf6d13ef Media: Fix layout of media library modal on narrow screens.
Reduces the right margin of the media library modal on small and medium width screens to remove excess white-space. On very narrow screens this was preventing the media icons from displaying.

Props andraganescu, desrosj, joedolson, moch11, mukesh27, sabernhardt, SergeyBiryukov, zieladam.
Fixes #53679.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51237 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-18 05:37:57 +00:00
Sergey Biryukov
80548a4039 Code Modernization: Check the return type of parse_url() in ms_cookie_constants().
As per the PHP manual:
> If the `component` parameter is omitted, an associative array is returned.
> If the `component` parameter is specified, `parse_url()` returns a string (or an int, in the case of `PHP_URL_PORT`) instead of an array. If the requested component doesn't exist within the given URL, `null` will be returned.

Reference: [https://www.php.net/manual/en/function.parse-url.php#refsect1-function.parse-url-returnvalues PHP Manual: parse_url(): Return Values]

It is entirely possible for the `siteurl` option to not have a "path" component.

In PHP 8.1, this would lead to a `trim(): Passing null to parameter #1 ($string) of type string is deprecated` notice.

Changing the logic around and adding validation for the return type value of `parse_url()` prevents that.

As this function is declaring global constants, adding tests for this change is not really an option without potentially affecting other tests.

Follow-up to [51606], [51622], [51626], [51629].

Props jrf, hellofromTonya, SergeyBiryukov.
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51630


git-svn-id: http://core.svn.wordpress.org/trunk@51236 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-17 22:08:57 +00:00
Sergey Biryukov
1ee5e68a94 Code Modernization: Check the return type of parse_url() on Plugin/Theme Editor screens.
As per the PHP manual:
> If the `component` parameter is omitted, an associative array is returned.
> If the `component` parameter is specified, `parse_url()` returns a string (or an int, in the case of `PHP_URL_PORT`) instead of an array. If the requested component doesn't exist within the given URL, `null` will be returned.

Reference: [https://www.php.net/manual/en/function.parse-url.php#refsect1-function.parse-url-returnvalues PHP Manual: parse_url(): Return Values]

While it is probably unlikely that someone would have a direct link to the plugin/theme editor on their home page or even on someone else's homepage, it is entirely possible for the referrer URL to not have a "path" component.

In PHP 8.1, this would lead to a `basename(): Passing null to parameter #1 ($string) of type string is deprecated` notice.

Changing the logic around and adding validation for the return type value of `parse_url()` prevents that.

Follow-up to [51606], [51622], [51626].

Props jrf, hellofromTonya, SergeyBiryukov.
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51629


git-svn-id: http://core.svn.wordpress.org/trunk@51235 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-17 21:56:58 +00:00
Sergey Biryukov
28e10d9c17 Tests: Move loading the PO class to set_up_before_class().
This ensures that the class is loaded once before the first test of the test case class is run, and `require_once()` is not unnecessarily called for each test method individually.

Follow-up to [1106/tests].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51628


git-svn-id: http://core.svn.wordpress.org/trunk@51234 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-17 20:03:00 +00:00
Sergey Biryukov
912c683b49 Tests: Use a better return type check for parse_url() in do_enclose() tests.
Since the `pathinfo()` function accepts a string, checking for that specifically is more consistent with similar checks elsewhere in core.

Follow-up to [51606], [51622], [51626].

See #53635.
Built from https://develop.svn.wordpress.org/trunk@51627


git-svn-id: http://core.svn.wordpress.org/trunk@51233 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-17 00:29:03 +00:00
Sergey Biryukov
9f222b708a Code Modernization: Check the return type of parse_url() in download_url().
As per the PHP manual:
> If the `component` parameter is omitted, an associative array is returned.
> If the `component` parameter is specified, `parse_url()` returns a string (or an int, in the case of `PHP_URL_PORT`) instead of an array. If the requested component doesn't exist within the given URL, `null` will be returned.

Reference: [https://www.php.net/manual/en/function.parse-url.php#refsect1-function.parse-url-returnvalues PHP Manual: parse_url(): Return Values]

This commit adds three unit tests for `download_url()`:

* The first test is "girl-scouting" to make sure that the code up to the point where the error is expected is tested.
* The second test exposed a PHP 8.1 `basename(): Passing null to parameter #1 ($path) of type string is deprecated` error due to the call to `parse_url()` returning `null` when the component requested does not exist in the passed URL.
* The output of the call to `parse_url()` stored in the `$url_path` variable is used in more places in the function logic. The third test exposes a second PHP 8.1 deprecation notice, this time for `substr(): Passing null to parameter #1 ($string) of type string is deprecated`.

This commit also removes duplicate `parse_url()` calls. Neither `$url` nor `$url_filename` are changed between when they are first received/defined and when they are re-used, so there is no need to repeat the function calls.

Follow-up to [51606], [51622].

Props jrf, hellofromTonya, SergeyBiryukov.
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51626


git-svn-id: http://core.svn.wordpress.org/trunk@51232 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-17 00:16:01 +00:00
Sergey Biryukov
532bd808c9 Code Modernization: Check the input type in validate_file().
This fixes a `preg_match_all(): Passing null to parameter #2 ($subject) of type string is deprecated` notice on PHP 8.1.

The behavior for `null` and `string` input is covered by the existing `Tests_Functions::test_validate_file()` test.

Effect: Errors down by 238, assertions up by 1920, failures down by 1.

Props jrf, hellofromTonya, SergeyBiryukov.
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51625


git-svn-id: http://core.svn.wordpress.org/trunk@51231 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-16 22:53:02 +00:00
Sergey Biryukov
8a98b96f36 Code Modernization: Correct handling of null in wp_parse_str().
This fixes `parse_str(): Passing null to parameter #1 ($string) of type string is deprecated` notices on PHP 8.1, without change in behaviour.

Impact: 311 of the pre-existing tests are affected by this issue.

The PHP native `parse_str()` function expects a string, however, based on the failing tests, it is clear there are functions in WordPress which passes a non-string – including `null` – value to the `wp_parse_str()` function, which would subsequently pass it onto the PHP native function without further input validation.

Most notable offender is the `wp_parse_args()` function which special cases arrays and objects, but passes everything else off to `wp_parse_str()`.

Several ways to fix this issue have been explored, including checking the received value with `is_string()` or `is_scalar()` before passing it off to the PHP native `parse_str()` function.

In the end it was decided against these in favor of a string cast as:
* `is_string()` would significantly change the behavior for anything non-string.
* `is_scalar()` up to a point as well, as it does not take objects with a `__toString()` method into account.

Executing a string cast on the received value before passing it on maintains the pre-existing behavior while still preventing the deprecation notice coming from PHP 8.1.

Reference: [https://www.php.net/manual/en/function.parse-str.php PHP Manual: parse_str()]

Follow-up to [5709].

Props jrf, hellofromTonya, lucatume, SergeyBiryukov.
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51624


git-svn-id: http://core.svn.wordpress.org/trunk@51230 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-16 22:18:02 +00:00
Sergey Biryukov
864d9e9a35 Tests: Rename classes in phpunit/tests/formatting/ per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491], [51492], [51493].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51623


git-svn-id: http://core.svn.wordpress.org/trunk@51229 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-16 21:35:07 +00:00
Sergey Biryukov
5ca2a817ab Code Modernization: Check the return type of parse_url() in WP::parse_request().
As per the PHP manual:
> If the `component` parameter is omitted, an associative array is returned.
> If the `component` parameter is specified, `parse_url()` returns a string (or an int, in the case of `PHP_URL_PORT`) instead of an array. If the requested component doesn't exist within the given URL, `null` will be returned.

Reference: [https://www.php.net/manual/en/function.parse-url.php#refsect1-function.parse-url-returnvalues PHP Manual: parse_url(): Return Values]

In this case, `parse_url()` is called with the `PHP_URL_PATH` as `$component`. This will return `null` in the majority of cases, as – exсept for subdirectory-based sites – `home_url()` returns a URL without the trailing slash, like `http://example.org`.

The return value of `parse_url()` was subsequently passed to `trim()`, leading to a `trim(): Passing null to parameter #1 ($string) of type string is deprecated` notice on PHP 8.1.

Fixed by adjusting the logic flow to:
* Only pass the return value of `parse_url()` to follow-on functions if it makes sense, i.e. if it isn't `null`, nor an empty string.
* Preventing calls to `preg_replace()` and `trim()` further down in the function logic flow, when `preg_replace()`/`trim()` would have nothing to do anyhow.

Follow-up to [25617].

Props jrf, hellofromTonya, SergeyBiryukov.
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51622


git-svn-id: http://core.svn.wordpress.org/trunk@51228 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-16 20:17:57 +00:00
Sergey Biryukov
2ac9f0814d Code Modernization: Check the return type of _get_cron_array() in wp_schedule_event().
This fixes a "Deprecated: Automatic conversion of false to array is deprecated" warning on PHP 8.1.

In `wp_schedule_event()`, the cron info array is retrieved via a call to `_get_cron_array()`, but as the documentation (correctly) states, the return type of that function is `array|false`, where `false` is returned for a virgin site, with no cron jobs scheduled yet.

However, no type check is done on the return value, and the `wp_schedule_event()` function just blindly continues by assigning a value to a subkey of the `$crons` "array".

Fixed by adding validation for the returned value from `_get_cron_array()` and initializing an empty array if `false` was returned.

Reference: [https://developer.wordpress.org/reference/functions/_get_cron_array/ WordPress Developer Resources: _get_cron_array()]

Props jrf, hellofromTonya, lucatume, pbearne, iluy, pedromendonca, SergeyBiryukov.
See #53635.
Built from https://develop.svn.wordpress.org/trunk@51619


git-svn-id: http://core.svn.wordpress.org/trunk@51225 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-16 15:23:57 +00:00
Sergey Biryukov
a19a2ad8b1 Twenty Twenty: Add support for wa.me links in Social menu.
This ensures that `wa.me` links, currently preferred by WhatsApp, have the same icon as `whatsapp.com` links.

Follow-up to [47243], [51617].

Props sabernhardt, macmanx.
Fixes #50542.
Built from https://develop.svn.wordpress.org/trunk@51618


git-svn-id: http://core.svn.wordpress.org/trunk@51224 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-16 12:54:58 +00:00
Sergey Biryukov
d5ac679247 Twenty Seventeen: Add support for wa.me links in Social Links menu.
This ensures that `wa.me` links, currently preferred by WhatsApp, have the same icon as `whatsapp.com` links.

Follow-up to [48027].

Props sabernhardt, carepsules, dkarfa.
Fixes #51946.
Built from https://develop.svn.wordpress.org/trunk@51617


git-svn-id: http://core.svn.wordpress.org/trunk@51223 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-16 12:51:01 +00:00
Sergey Biryukov
cf4640b46e Docs: Fix typo in the get_block_editor_settings() description.
Follow-up to [50776].

Props tmatsuur, pbearne.
Fixes #53922.
Built from https://develop.svn.wordpress.org/trunk@51611


git-svn-id: http://core.svn.wordpress.org/trunk@51222 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-15 12:45:59 +00:00
Sergey Biryukov
b4ea83c22f Upgrade/Install: Use consistent capitalization for "web host" in setup messages.
Follow-up to [8887], [13163].

Props bradparbs, sabernhardt, mukesh27.
Fixes #53926.
Built from https://develop.svn.wordpress.org/trunk@51610


git-svn-id: http://core.svn.wordpress.org/trunk@51221 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-14 12:06:59 +00:00
Sergey Biryukov
6b144ab46a Docs: Correct @since version for the wp_parse_str filter.
The filter was introduced along with the `wp_parse_str()` function in WordPress 2.2.1.

Follow-up to [5709], [8662], [26485].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@51609


git-svn-id: http://core.svn.wordpress.org/trunk@51220 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-13 15:50:58 +00:00
Sergey Biryukov
e68985e506 Tests: Add unit tests for the wp_nonce_ays() function.
Update the `wp_die_handler()` method to pass the response into `WPDieException` so that `expectExceptionCode()` calls work as expected.

Follow-up to [1221/tests], [3934], [4009], [12309].

Props pbearne, jrf, mukesh27.
Fixes #53882.
Built from https://develop.svn.wordpress.org/trunk@51608


git-svn-id: http://core.svn.wordpress.org/trunk@51219 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-13 14:02:02 +00:00
Sergey Biryukov
a2a8b77806 Docs: Synchronize documentation for wp_get_attachment_image_attributes filter callbacks in bundled themes:
* Twenty Sixteen: Correct the `$attachment` parameter type, use typed array notation.
* Twenty Seventeen: Correct the `$attachment` parameter type, use typed array notation.
* Twenty Nineteen: Correct the `@return` value type, use typed array notation.
* Twenty Twenty-One: Add missing `@return` value description, use typed array notation.

Follow-up to [29836], [47249], [49021], [49597].

Props ankitmaru, mukesh27, SergeyBiryukov.
Fixes #53878.
Built from https://develop.svn.wordpress.org/trunk@51607


git-svn-id: http://core.svn.wordpress.org/trunk@51218 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-12 19:30:57 +00:00
Sergey Biryukov
0984eca703 Tests: Use correct comparison in do_enclose() tests.
As per the PHP manual:
> If the `component` parameter is omitted, an associative array is returned.
> If the `component` parameter is specified, `parse_url()` returns a string (or an int, in the case of `PHP_URL_PORT`) instead of an array. If the requested component doesn't exist within the given URL, `null` will be returned.

Reference: [https://www.php.net/manual/en/function.parse-url.php#refsect1-function.parse-url-returnvalues PHP Manual: parse_url(): Return Values]

In this case, `parse_url()` is called with the `PHP_URL_PATH` as `$component`, but the returned value is subsequently checked against `false`.

In other words, this condition would previously always result in `true` and would lead to `null` potentially being passed to the PHP native `pathinfo()` function which expects a string.

On PHP 8.1, this would result in a test failure with a `pathinfo(): Passing null to parameter #1 ($path) of type string is deprecated` error.

Reference: [https://www.php.net/manual/en/function.pathinfo.php PHP Manual: pathinfo()]

Follow-up to [46175].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51217 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-12 17:50:03 +00:00
Sergey Biryukov
e8a395819d Build/Test Tools: Hard deprecate WP_UnitTestCase_Base::checkRequirements().
The `WP_UnitTestCase_Base::checkRequirements()` method calls the `parent::checkRequirements()` method, but this method became `private` in PHPUnit 7.0 via commit  [932238a6a3 sebastianbergmann/phpunit@932238a].

Aside from that, the `TestCase::getAnnotations()` method which is called next is now also removed in PHPUnit 9.5.

WP core does not use the method anymore, and the method only remains to prevent potentially breaking external integration tests relying on the method. However, in effect, the method is not functional anymore in PHPUnit 7.0+.

Follow-up to [893/tests], [894/tests], [896/tests], [918/tests], [30526], [40520], [40564], [43005], [44701], [51559-51577].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51216 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-12 10:34:01 +00:00
Sergey Biryukov
9937fea517 Build/Test Tools: Simplify the PHPUnit test workflow.
This removes the previously duplicated set of test runs specifically for PHP 8.1 in favor of combining `if` conditions for individual test runs with the `continue-on-error` option.

Follow-up to [51588].

Props desrosj, swissspidy, jrf.
Fixes #53891.
Built from https://develop.svn.wordpress.org/trunk@51604


git-svn-id: http://core.svn.wordpress.org/trunk@51215 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-11 15:43:57 +00:00
Sergey Biryukov
c5c6b7de59 Build/Test Tools: Revert [51602] for now to investigate test failures on PHPUnit < 7.0.
See #46149.
Built from https://develop.svn.wordpress.org/trunk@51603


git-svn-id: http://core.svn.wordpress.org/trunk@51214 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-11 15:02:58 +00:00
Sergey Biryukov
8f95d5bb91 Build/Test Tools: Hard deprecate WP_UnitTestCase_Base::checkRequirements().
The `WP_UnitTestCase_Base::checkRequirements()` method calls the `parent::checkRequirements()` method, but this method became `private` in PHPUnit 7.0 via commit  [932238a6a3 sebastianbergmann/phpunit@932238a].

Aside from that, the `TestCase::getAnnotations()` method which is called next is now also removed in PHPUnit 9.5.

WP core does not use the method anymore, and the method only remains to prevent potentially breaking external integration tests relying on the method. However, in effect, the method is not functional anymore in PHPUnit 7.0+.

Follow-up to [893/tests], [894/tests], [896/tests], [918/tests], [30526], [40520], [40564], [43005], [44701], [51559-51577].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51213 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-11 14:31:57 +00:00
Sergey Biryukov
e2a64f0cd2 Themes: Make sure the theme API response is not an error before operating on it in themes_api().
This fixes a potential bug and avoids PHP warnings when `themes_api( 'query_themes' )` is called and a successful API response is not received.

Follow-up to [42632].

Props pierlo.
Fixes #53913.
Built from https://develop.svn.wordpress.org/trunk@51601


git-svn-id: http://core.svn.wordpress.org/trunk@51212 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-11 13:01:56 +00:00
gziolo
bf20ded7d6 Tests: Fix failing i18n unit tests for block metadata
Follow up for #53238.

Changes to the translation file weren't included in [51599].


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


git-svn-id: http://core.svn.wordpress.org/trunk@51211 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-11 10:38:57 +00:00
gziolo
2f6eb9d25e Blocks: Add support for variations in block.json` file
We integrated variations with block types and the corresponding REST API endpoint in #52688. It's a follow-up patch to add missing support to the `block.json` metadata file when using `register_block_type`.

Some fields for variations are translatable.Therefore, i18n schema was copied over from Gutenberg: https://github.com/WordPress/gutenberg/blob/trunk/packages/blocks/src/api/i18n-block.json. The accompanying implementation was adapted as `translate_settings_using_i18n_schema`.

Props: gwwar, swissspidy, schlessera, jorgefilipecosta.
Fixes #53238.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51210 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-11 09:08:01 +00:00
Sergey Biryukov
74c48a1af5 Build/Test Tools: Make the polyfills loading more flexible.
The PHPUnit Polyfills are, since [51559], a required dependency for the WP test suite and, by extension, for plugin/theme integration test suites which are based on and use (parts of) the WP core test suite.

However, plugin/theme integration test suites may not use a full WordPress installation.

This commit:
* Removes the presumption that a full WP install, including `vendor` directory, will be available when the test `bootstrap.php` file is run.
* Makes the loading of the PHPUnit Polyfills autoload file more flexible by:
  * Checking if the autoload class contained within the autoload file is already available before attempting to load the file.[[BR]]
    This allows for plugin/theme integration test suites to load the `phpunitpolyfills-autoload.php` file from any location, as long as it is loaded before the WP core test `bootstrap.php` file is run.
  * Allowing for the path to an arbitrary installation location for the PHPUnit Polyfills to be passed as a constant.[[BR]]
    As long as the provided location is a valid file path and the `phpunitpolyfills-autoload.php` file exists in the provided location, that file will be loaded.[[BR]]
    The constant can be declared in a plugin/theme integration test suite native test bootstrap file, or in the `wp-tests-config.php` file, or even in a `phpunit.xml[.dist]` file via `<php><const name="WP_TESTS_PHPUNIT_POLYFILLS_PATH" value="path/to/yoast/phpunit-polyfills"/></php>`.
* Adds a version check for the PHPUnit Polyfills to prevent a mismatch between the version of the package expected by WordPress and the version used by plugins/themes.[[BR]]
  The version this checks for should be in line with the minimum version requirement for the PHPUnit Polyfills as declared in the `composer.json` file.[[BR]]
  This version number should only be updated when new features added in later PHPUnit Polyfills releases are actually used in the WP core test suite.
* Adds appropriate error messages for every possible error condition.
* Upgrades the PHPUnit Polyfills to version 1.0.1, which now includes a version constant.

Follow-up to [51559-51577].

Props jrf, hellofromTonya, swissspidy, jeherve, thomasplevy, SergeyBiryukov.
See #46149.
Built from https://develop.svn.wordpress.org/trunk@51598


git-svn-id: http://core.svn.wordpress.org/trunk@51209 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-10 21:14:56 +00:00
Sergey Biryukov
d8413a32e1 General: Restore (un-deprecate) the sanitize_url() function.
A general security rule is "Sanitize when you save, escape when you echo", and for the most part WordPress has well-named functions like `sanitize_email()` and others, with `esc_url_raw()` being a single exception that does not follow the naming.

This commit restores the previously deprecated `sanitize_url()` function as a valid alias of `esc_url_raw()`.

This better aligns with the naming with other `sanitize_*()` functions:

* `sanitize_bookmark()`
* `sanitize_bookmark_field()`
* `sanitize_category()`
* `sanitize_category_field()`
* `sanitize_comment_cookies()`
* `sanitize_email()`
* `sanitize_file_name()`
* `sanitize_hex_color()`
* `sanitize_hex_color_no_hash()`
* `sanitize_html_class()`
* `sanitize_key()`
* `sanitize_meta()`
* `sanitize_mime_type()`
* `sanitize_option()`
* `sanitize_post()`
* `sanitize_post_field()`
* `sanitize_sql_orderby()`
* `sanitize_term()`
* `sanitize_term_field()`
* `sanitize_text_field()`
* `sanitize_textarea_field()`
* `sanitize_title()`
* `sanitize_title_for_query()`
* `sanitize_title_with_dashes()`
* `sanitize_trackback_urls()`
* `sanitize_user()`
* `sanitize_user_field()`

Follow-up to [11383], [13096].

Props Ipstenu, aadilali.
Fixes #53876.
Built from https://develop.svn.wordpress.org/trunk@51597


git-svn-id: http://core.svn.wordpress.org/trunk@51208 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-10 19:44:59 +00:00
Sergey Biryukov
78e8a3db65 Editor: Preserve the original template keys when preparing a list of page templates.
Previously, the original "404" template key was lost when "Default template" is merged into the available templates array, as the `array_merge()` function renumbers numeric keys. Later, when we merge templates on the client side, this caused duplicate "404" templates to appear in the dropdown.

By replacing the `array_merge()` call with `array_replace()`, we make sure to keep the original numeric keys.

Props Mamaduka, Toro_Unit, youknowriad.
Fixes #53898.
Built from https://develop.svn.wordpress.org/trunk@51595


git-svn-id: http://core.svn.wordpress.org/trunk@51206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-10 17:56:57 +00:00
Sergey Biryukov
74bef46884 Code Modernization: Silence the deprecation warning for missing return type in phpunit/tests/compat.php.
This fixes the "Deprecated: Return type of `CountableFake::count()` should be compatible with `Countable::count(): int`" warning on PHP 8.1.

PHP native interfaces now have declared return types and methods in classes implementing these interfaces need to either have the return type declared (in a covariant compatible manner with the PHP native interface method declaration), or need to silence the deprecation warning using the `#[ReturnTypeWillChange]` attribute.

Follow-up to [51517], [51529], [51530], [51531], [51532].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51205 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-10 17:35:57 +00:00
Sergey Biryukov
5202ae3852 Docs: Improve documentation for a few functions per the documentation standards.
This affects:
* `checked()`
* `selected()`
* `disabled()`
* `wp_readonly()`
* `readonly()`
* `__checked_selected_helper()`

Follow-up to [143], [560], [9053], [10662], [13658], [41728], [51586].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@51592


git-svn-id: http://core.svn.wordpress.org/trunk@51203 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-10 13:45:57 +00:00
Sergey Biryukov
f7dbd99922 Upgrade/Install: Update sodium_compat to v1.17.0.
The latest version of sodium_compat includes fixes for PHP 8.1 compatibility and a fix for PHP 5.6 compatibility.

A full list of changes in this update can be found on GitHub:
https://github.com/paragonie/sodium_compat/compare/v1.16.1...v1.17.0

Follow-up to [49741], [51002].

Props jrf.
Fixes #53907.
Built from https://develop.svn.wordpress.org/trunk@51591


git-svn-id: http://core.svn.wordpress.org/trunk@51202 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-10 13:04:57 +00:00
Sergey Biryukov
16b7e3d44c Docs: Add a @see reference to the xmlrpc_enabled filter in wp_xmlrpc_server::set_is_enabled().
Follow-up to [28065].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@51590


git-svn-id: http://core.svn.wordpress.org/trunk@51201 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-10 12:54:56 +00:00
Sergey Biryukov
31c5fc58f2 Docs: Add a @see reference to the wp_mail_content_type filter in wp_staticize_emoji_for_email().
Follow-up to [31860].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@51589


git-svn-id: http://core.svn.wordpress.org/trunk@51200 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-10 12:53:59 +00:00
Sergey Biryukov
8e5b18b6f3 Build/Test Tools: Enable running the tests on PHP 8.1.
PHP 8.1 is expected to be released at the end of November 2021.

Enabling the tests to run in CI on PHP 8.1 allows us to get WordPress ready in time.

As an interim measure, while working through the PHP 8.1 issues, separate conditional steps are added to run the tests on PHP 8.1 with the `continue-on-error` option. That allows the test builds to show as "successful" if all non-PHP 8.1 test runs pass.

Follow-up to [51517], [51543], [51545], [51574], [51582], [51586].

Props jrf.
Fixes #53891. See #53635.
Built from https://develop.svn.wordpress.org/trunk@51588


git-svn-id: http://core.svn.wordpress.org/trunk@51199 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-09 20:04:56 +00:00
Sergey Biryukov
48b30d2634 Code Modernization: Replace strftime() and gmstrftime() usage in unit tests.
Since PHP 8.1, the `strftime()` and `gmstrftime()` functions are deprecated:

> The `strftime()` and `gmstrftime()` functions exhibit similar issues as `strptime()`, in that the formats they support, as well as their behavior, is platform-dependent. Unlike `strptime()`, these functions are available on Windows, though with a different feature set than on Linux. Musl-based distributions like Alpine do not support timezone-related format specifiers correctly. These functions are also locale-based, and as such may exhibit thread-safety issues.
>
> `date()` or `DateTime::format()` provide portable alternatives, and `IntlDateFormatter::format()` provides a more sophisticated, localization-aware alternative.

Reference: [https://wiki.php.net/rfc/deprecations_php_8_1#strftime_and_gmstrftime PHP RFC: Deprecations for PHP 8.1: strftime() and gmstrftime()]

> The `strftime()` and `gmstrftime()` functions have been deprecated in favor of
> `date()/DateTime::format()` (for locale-independent formatting) or
> `IntlDateFormatter::format()` (for locale-dependent formatting).

Reference: [1cf4fb739f/UPGRADING (L379-L381) PHP 8.1 Upgrade Notes].

Aside from one instance in SimplePie, the `strftime()` and `gmstrftime()` functions are only used within the test suite of WordPress to create formatted timestamps.

As the function is used in test code, this leads to test warnings like this on PHP 8.1:
{{{
Deprecated: Function strftime() is deprecated in path/to/tests/phpunit/tests/canonical/postStatus.php on line 37
}}}

These calls can all be safely converted to use a pattern along the lines of:
{{{#!php
<?php
date_format( date_create( 'time phrase or timestamp' ), $format )
}}}

Other references:
* [https://www.php.net/manual/en/function.strftime.php PHP Manual: strftime()] (for the old format string characters)
* [https://www.php.net/manual/en/datetime.format.php PHP Manual: DateTime::format()] (for the new format string characters)
* [https://www.php.net/manual/en/datetime.construct.php PHP Manual: DateTime::__construct()] (see Example 2 for a Unix timestamp code sample)

Props jrf, SergeyBiryukov.
Fixes #53897.
Built from https://develop.svn.wordpress.org/trunk@51587


git-svn-id: http://core.svn.wordpress.org/trunk@51198 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-09 19:09:55 +00:00
Sergey Biryukov
52da9fb6af Code Modernization: Rename the readonly() function to wp_readonly().
Since PHP 8.1, `readonly` is a reserved keyword and cannot be used as a function name.

In order to avoid PHP parser errors, the `readonly()` function was extracted to a separate file and is now only included conditionally on PHP < 8.1.

This commit also:
* Moves the tests for the `__checked_selected_helper()` function and all the related functions to their own file.
* Switches to named data providers. This makes the output when using the `--testdox` option more descriptive and is helpful when trying to debug which data set from a data provider failed the test.
* Improves the tests in question to make them feature-complete and expand test coverage.

Props jrf, ayeshrajans, haosun, knutsp, swissspidy, SergeyBiryukov.
Fixes #53858.
Built from https://develop.svn.wordpress.org/trunk@51586


git-svn-id: http://core.svn.wordpress.org/trunk@51197 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-09 17:21:00 +00:00
Sergey Biryukov
68f7026cde Build/Test Tools: Declare two TestCase classes as abstract.
TestCases which are intended to be extended and not run directly, should be `abstract`.

Follow-up to [763/tests], [30277].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51196 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-09 14:53:14 +00:00
Sergey Biryukov
3ad7f6e9b2 Build/Test Tools: Remove Unicode character from PHPUnit version check message.
Not all CLI tools can handle Unicode characters or non-system specific line endings well, so this type of CLI messaging should always be written with the optimal cross-platform, cross-CLI tool end-user experience in mind.

Follow-up to [51581].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51195 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-09 13:06:07 +00:00
Sergey Biryukov
319f999ed5 Build/Test Tools: Add schema reference to PHPUnit config files.
The current config files validate against the PHPUnit XSD schema for config files for PHPUnit 5.7 – 9.2.

The schema was changed in PHPUnit 9.3, and the `filter` and `logging` settings were deprecated in favor of `coverage` and a different format for `logging`.

This commit explicitly sets the schema against which the files currently validate, for clarity.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51194 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-09 12:54:13 +00:00
Sergey Biryukov
988c8be693 Code Modernization: Set the MySQLi error reporting off for PHP 8.1.
Prior to PHP 8.1, the default error handling mode was `MYSQLI_REPORT_OFF`. An error in the extension, database, query, or the database connection returned `false` and emitted a PHP warning:
{{{
$mysqli = new mysqli("localhost", "non-existing-user", "", "");

Warning: mysqli::__construct(): (HY000/2002): No connection could be made because the target machine actively refused it in ... on line ...
}}}

From PHP 8.1 and later, the default error mode is set to `MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT`. An error in the extension, database, query, or the database connection throws an exception:
{{{
$mysqli = new mysqli("localhost", "non-existing-user", "", "");

Fatal error: Uncaught mysqli_sql_exception: Connection refused in ...:...
}}}

WordPress has its own error reporting and gracefully handles the database errors by inspecting the error codes. Setting the MySQLi error reporting to off avoids fatal errors due to uncaught exceptions and maintains the current behavior.

References:
* [https://php.watch/versions/8.1/mysqli-error-mode PHP 8.1: MySQLi: Default error mode set to exceptions]
* [https://wiki.php.net/rfc/mysqli_default_errmode PHP RFC: Change Default mysqli Error Mode]

Props ayeshrajans, jrf.
Fixes #52825.
Built from https://develop.svn.wordpress.org/trunk@51582


git-svn-id: http://core.svn.wordpress.org/trunk@51193 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-08 14:10:01 +00:00
Sergey Biryukov
adb77d34e1 Build/Test Tools: Fix message display in test bootstrap.
Any messages to the user which are echo-ed out in the test bootstrap will generally display on a command-line interface.

The *nix specific `"\n"` line ending will be ignored on Windows, making the messages less readable.

For new lines in CLI messages, `PHP_EOL` should be used instead.

This was already done in a few places in the script, but not consistently so. Fixed now.

Follow-up to [UT882], [UT890], [44723], [45020], [48592], [49535], [51560].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51192 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-07 14:47:02 +00:00
Sergey Biryukov
1b25f7ab0c Tests: Use more appropriate assertions in get_themes() tests.
This replaces instances of `assertTrue( is_dir( ... ) )` with `assertDirectoryExists()` to use native PHPUnit functionality.

The `assertDirectoryExists()` method was introduced in PHPUnit 5.6. As the minimum supported PHPUnit version has been raised to PHPUnit 5.7.21, it can now be used.

Follow-up to [51543], [51574], [51579].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51191 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-07 14:20:01 +00:00
Sergey Biryukov
76bd6651ab Tests: Use more appropriate assertions in get_themes() tests.
This replaces instances of `assertTrue( is_file( ... ) )` followed by `assertTrue( is_readable( ... ) )` with `assertFileIsReadable()` to use native PHPUnit functionality.

The `assertFileIsReadable()` method was introduced in PHPUnit 5.6. As the minimum supported PHPUnit version has been raised to PHPUnit 5.7.21, it can now be used.

Follow-up to [51543], [51574].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51190 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-07 14:17:01 +00:00
John Blackbourn
72e66e8910 Themes: Correct the documented types for theme mod values.
A theme mod value can be of any type, not just a string.

See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51189 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-07 13:55:04 +00:00
Sergey Biryukov
52137a090b Tests: Remove redundant @requires tags.
As the minimum supported PHPUnit version has been upped to PHPUnit 5.7.21, these `@requires` tags are now redundant.

Follow-up to [51226], [51234], [51559-51576].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51188 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-07 11:58:02 +00:00
Sergey Biryukov
5b97d53b27 Tests: Replace expectException() for PHP native errors with calls to the dedicated PHPUnit 8.4+ methods.
The old manner of testing these is soft deprecated as of PHPUnit 8.4, hard deprecated as of PHPUnit 9.0 and will be removed in PHPUnit 10.0.

Most calls like this were already replaced in [51563], however, this particular one could not be changed yet due to the mismatch between the PHPUnit version and the PHP version on which the tests were being run. This is fixed now.

References:
* https://github.com/sebastianbergmann/phpunit/blob/8.4.3/ChangeLog-8.4.md#840---2019-10-04
* https://github.com/sebastianbergmann/phpunit/issues/3775

Follow-up to [51559-51575].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51187 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-07 11:54:00 +00:00
Sergey Biryukov
07e0e7b939 Build/Test Tools: Remove the copied-in PHPUnit 9.x MockObject files.
As the version constraints for PHPUnit now allow the tests to be run on PHPUnit 8.x and 9.x, these files are no longer needed.

Follow-up to [48957], [49037], [51544], [51559-51574].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51186 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-07 11:45:04 +00:00
Sergey Biryukov
4a4f0fcdb9 Build/Test Tools: Loosen the PHPUnit restriction.
**composer.json**:

Remove the PHPUnit dependency in favor of allowing the PHPUnit Polyfills library to manage the supported PHPUnit version. This automatically now widens the supported PHPUnit versions to 5.7.21 to 9.5.8 (current).

Letting the PHPUnit Polyfills handle the version constraints for PHPUnit prevents potential version conflicts in the future, as well as allows WordPress to benefit straight away when a new PHPUnit version would be released and the PHPUnit Polyfills package adds support for that PHPUnit version.

**Test Bootstrap**

Update the supported version number for PHPUnit 5.x, as the minimum PHPUnit 5.x version supported by the PHPUnit Polyfills is PHPUnit 5.7.21, and remove the PHPUnit maximum.

**.gitignore and svn:ignore:**

Add the PHPUnit cache file to the list of files to be ignored.

Since PHPUnit 8, PHPUnit has a built-in caching feature which creates a `.phpunit.result.cache` file. This file should not be committed.

Follow-up to [40536], [40853], [44701], [51559-51573].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51185 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-07 11:43:01 +00:00
Sergey Biryukov
e169f95434 Build/Test Tools: Remove SpeedTrapListener.
Now that the tests can run PHPUnit cross-version and Composer will be used to install the test suite in CI, we could switch out the local copies of the [https://github.com/johnkary/phpunit-speedtrap PHPUnit speedtrap] package in favor of using the Composer package, which would prevent us having to make the WP local copies of the class compatible with later PHPUnit versions.

The SpeedTrap test listener was introduced to identify slow tests and take action on these to make them faster.

In practice, however, no notable action was ever taken based on the output of the test listener in all the years it was in place.

With that in mind, it was decided to remove the SpeedTrap test listeners without replacement.

If – at a future date – contributors would want to take action to speed up slow tests anyway, they can:
* Either add the package to their local install and use the output they receive locally to identify slow tests.
* Or use the PHPUnit native `@small` annotations in combination with the PHPUnit `PHP_Invoker` package as described in the PHPUnit documentation to [https://phpunit.readthedocs.io/en/stable/risky-tests.html#test-execution-timeout run tests with time limits].

Follow-up to [35214], [35226], [35767], [44701], [51559-51572].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51184 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-07 11:16:01 +00:00
Sergey Biryukov
84000fed11 Build/Test Tools: Handle removal of TestCase::getAnnotations().
The PHPUnit native `TestCase::getAnnotations()` method is used to check for WP flavored deprecation notices, however, this method was not covered by the backward compatibility promise for PHPUnit (and was annotated as excluded).

The method has been removed as part of an internal refactor in commit [68582043e1 sebastianbergmann/phpunit@6858204], which is included in PHPUnit 9.5.0.

For now, a workaround is put in place, but it is recommended that the WP `expectDeprecated()` method should be reevaluated in a future iteration.

Follow-up to [51559-51571].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51183 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-07 11:02:02 +00:00
Sergey Biryukov
5286e65fac Tests: Fix tests failing due to assertContains() using strict checking.
Since PHPUnit 8.0.2, the `assertContains()` method, when checking whether a value exists in an array, will do a strict type comparison of the values.

This caused a couple of tests to fail. Using the correct data type in the test fixes that.

References:
* https://github.com/sebastianbergmann/phpunit/blob/8.0.6/ChangeLog-8.0.md#802---2019-02-07
* https://github.com/sebastianbergmann/phpunit/issues/3511
* 6205f33595

Follow-up to [51559-51570].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51182 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-07 10:53:00 +00:00
Sergey Biryukov
e60dde514b Build/Test Tools: Alias the Getopt class conditionally, as the class no longer exists in PHPUnit 9.x.
Most of the aliasing in this `compat.php` file is redundant as PHPUnit 5.7.21+ contains a forward compatibility layer for these classes anyway (= PHPUnit provides both the namespaced and underscore named versions of these classes in PHPUnit 5.7.21+).

All the same, the file and the aliases are left in place for the time being, as plugins/themes using the WP test suite as the basis for their integration tests may rely on it, though WP itself should not really need it anymore, save for maybe one or two classes.

Follow-up to [51559-51569].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-07 10:48:00 +00:00
Sergey Biryukov
f11a7eb1fc Tests: Remove use of assertArraySubset() in Test_WP_Widget_Media::test_constructor().
The `assertArraySubset()` method has been deprecated in PHPUnit 8 and removed in PHPUnit 9.

This replaces the assertions with looping through the array and testing both the key and the value individually.

References:
* https://github.com/sebastianbergmann/phpunit/blob/8.0.6/ChangeLog-8.0.md#800---2019-02-01
* https://github.com/sebastianbergmann/phpunit/issues/3494

Note: There is a polyfill package available for the removed assertion: `dms/phpunit-arraysubset-asserts`, but as the assertion was only used in this one test method, adding this seems redundant.

Follow-up to [51559-51568].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51180 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-07 10:42:02 +00:00
Sergey Biryukov
5b28064545 Build/Test Tools: Implement use of the void solution.
> PHPUnit 8.0.0 introduced a `void` return type declaration to the "fixture" methods – `setUpBeforeClass()`, `setUp()`, `tearDown()` and `tearDownAfterClass()`. As the `void` return type was not introduced until PHP 7.1, this makes it more difficult to create cross-version compatible tests when using fixtures, due to signature mismatches.
>
> The `Yoast\PHPUnitPolyfills\TestCases\TestCase` overcomes the signature mismatch by having two versions. The correct one will be loaded depending on the PHPUnit version being used.
>
> When using this TestCase, if an individual test, or another TestCase which extends this TestCase, needs to overload any of the "fixture" methods, it should do so by using a snake_case variant of the original fixture method name, i.e. `set_up_before_class()`, `set_up()`, `assert_pre_conditions()`, `assert_post_conditions()`, `tear_down()`, and `tear_down_after_class()`.
>
> The snake_case methods will automatically be called by PHPUnit.
>
> > IMPORTANT: The snake_case methods should not call the PHPUnit parent, i.e. do not use `parent::setUp()` from within an overloaded `set_up()` method. If necessary, DO call `parent::set_up()`.

Reference: https://github.com/Yoast/PHPUnit-Polyfills#testcases

This commit renames all declared fixture methods, and calls to parent versions of those fixture methods, from camelCase to snake_case.

Follow-up to [51559-51567].

Props jrf, hellofromTonya, johnbillion, netweb, dd32, pputzer, SergeyBiryukov.
See #46149.
Built from https://develop.svn.wordpress.org/trunk@51568


git-svn-id: http://core.svn.wordpress.org/trunk@51179 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-07 10:31:02 +00:00
Sergey Biryukov
6d15c09bf9 Build/Test Tools: Use the PHPUnit Polyfill TestCase as void workaround.
> PHPUnit 8.0.0 introduced a `void` return type declaration to the "fixture" methods – `setUpBeforeClass()`, `setUp()`, `tearDown()` and `tearDownAfterClass()`. As the `void` return type was not introduced until PHP 7.1, this makes it more difficult to create cross-version compatible tests when using fixtures, due to signature mismatches.
>
> The `Yoast\PHPUnitPolyfills\TestCases\TestCase` overcomes the signature mismatch by having two versions. The correct one will be loaded depending on the PHPUnit version being used.
>
> When using this TestCase, if an individual test, or another TestCase which extends this TestCase, needs to overload any of the "fixture" methods, it should do so by using a snake_case variant of the original fixture method name, i.e. `set_up_before_class()`, `set_up()`, `assert_pre_conditions()`, `assert_post_conditions()`, `tear_down()`, and `tear_down_after_class()`.
>
> The snake_case methods will automatically be called by PHPUnit.
>
> > IMPORTANT: The snake_case methods should not call the PHPUnit parent, i.e. do not use `parent::setUp()` from within an overloaded `set_up()` method. If necessary, DO call `parent::set_up()`.

Reference: https://github.com/Yoast/PHPUnit-Polyfills#testcases

This commit:
* Lets the `PHPUnit_Adapter_TestCase` extend the `Yoast\PHPUnitPolyfills\TestCases\TestCase`, which makes this solution for the `void` return type available to the WordPress test suite.
* Removes the individual import and trait `use` statements for the Polyfill traits. These are no longer necessary as the `Yoast\PHPUnitPolyfills\TestCases\TestCase` already includes those.

Follow-up to [51559-51566].

Props jrf, hellofromTonya, johnbillion, netweb, SergeyBiryukov.
See #46149.
Built from https://develop.svn.wordpress.org/trunk@51567


git-svn-id: http://core.svn.wordpress.org/trunk@51178 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-07 10:22:02 +00:00
Sergey Biryukov
ab110d5206 Tests: Replace assertNotRegExp() with assertDoesNotMatchRegularExpression().
The `assertRegExp()` and `assertNotRegExp()` methods were hard deprecated in PHPUnit 9.1 and the functionality will be removed in PHPUnit 10.0.

The `assertMatchesRegularExpression()` and `assertDoesNotMatchRegularExpression()` methods were introduced as a replacement in PHPUnit 9.1.

These new PHPUnit methods are polyfilled by the PHPUnit Polyfills and switching to them will future-proof the tests some more.

References:
* https://github.com/sebastianbergmann/phpunit/blob/9.1.5/ChangeLog-9.1.md#910---2020-04-03
* https://github.com/sebastianbergmann/phpunit/issues/4085
* https://github.com/sebastianbergmann/phpunit/issues/4088

Follow-up to [51559-51565].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51177 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-06 21:56:57 +00:00
Sergey Biryukov
0aacd6abfd Tests: Replace assertRegExp() with assertMatchesRegularExpression().
The `assertRegExp()` and `assertNotRegExp()` methods were hard deprecated in PHPUnit 9.1 and the functionality will be removed in PHPUnit 10.0.

The `assertMatchesRegularExpression()` and `assertDoesNotMatchRegularExpression()` methods were introduced as a replacement in PHPUnit 9.1.

These new PHPUnit methods are polyfilled by the PHPUnit Polyfills and switching to them will future-proof the tests some more.

References:
* https://github.com/sebastianbergmann/phpunit/blob/9.1.5/ChangeLog-9.1.md#910---2020-04-03
* https://github.com/sebastianbergmann/phpunit/issues/4085
* https://github.com/sebastianbergmann/phpunit/issues/4088

Follow-up to [51559-51564].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51176 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-06 21:53:57 +00:00
Sergey Biryukov
549857fa3b Tests: Replace assertFileNotExists() with assertFileDoesNotExist().
The `assertFileNotExists()` method was hard deprecated in PHPUnit 9.1 and the functionality will be removed in PHPUnit 10.0.

The `assertFileDoesNotExist()` method was introduced as a replacement in PHPUnit 9.1.

This new PHPUnit method is polyfilled by the PHPUnit Polyfills and switching to it will future-proof the tests some more.

References:
* https://github.com/sebastianbergmann/phpunit/blob/9.1.5/ChangeLog-9.1.md#910---2020-04-03
* https://github.com/sebastianbergmann/phpunit/issues/4076

Follow-up to [51559-51563].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51175 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-06 21:46:55 +00:00
Sergey Biryukov
9a8caf2eba Tests: Replace expectException() for PHP native errors with calls to the dedicated PHPUnit 8.4+ methods.
The old manner of testing these is soft deprecated as of PHPUnit 8.4, hard deprecated as of PHPUnit 9.0 and will be removed in PHPUnit 10.0.

These dedicated methods introduced in PHPUnit 8.4 should be used as an alternative:

* `expectDeprecation()`
* `expectDeprecationMessage()`
* `expectDeprecationMessageMatches()`
* `expectNotice()`
* `expectNoticeMessage()`
* `expectNoticeMessageMatches()`
* `expectWarning()`
* `expectWarningMessage()`
* `expectWarningMessageMatches()`
* `expectError()`
* `expectErrorMessage()`
* `expectErrorMessageMatches()`

These new PHPUnit methods are all polyfilled by the PHPUnit Polyfills and switching to these will future-proof the tests some more.

References:
* https://github.com/sebastianbergmann/phpunit/blob/8.4.3/ChangeLog-8.4.md#840---2019-10-04
* https://github.com/sebastianbergmann/phpunit/issues/3775

Follow-up to [51559-51562].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51174 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-06 21:39:58 +00:00
Sergey Biryukov
23383ec51c Build/Test Tools: Simplify redundant PHPUnit shim for setExpectedException().
PHPUnit 6 deprecated the `setExpectedException()` method in favor of the `expectException()`, `expectExceptionMessage()`, and `expectExceptionCode()` methods.

`WP_UnitTestCase_Base::setExpectedException()` backfilled the old method. As the PHPUnit Polyfills have a polyfill for the ''new'' method, this backfill can now be simplified.

This backfill ''should'' be removed in a future iteration, but is, for now, left in place so as not to break backward compatibility for plugin/theme test suites which extend the WP native test suite for their integration tests.

Follow-up to [48996], [48997], [51559-51561].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51173 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-06 21:19:02 +00:00
Sergey Biryukov
46ef4c1f7b Build/Test Tools: Change the inheritance order of the abstract test classes.
As things were, the inheritance order of the abstract test classes was as follows:
{{{
WP_UnitTestCase (PHPUnit adapter layer)
    extends WP_UnitTestCase_Base (base test class)
        extends PHPUnit\Framework\TestCase (PHPUnit native class)
}}}

Concrete (child) test classes, as well as more specific abstract TestCases, are/were expected to extend the `WP_UnitTestCase`.

This order is not optimal as it means that the `WP_UnitTestCase_Base` class would not be able to benefit from any polyfills and/or shims in the PHPUnit adapter layer.

With that in mind, this commit changes the inheritance to:
{{{
WP_UnitTestCase (empty class, left in place to not break BC for plugin/theme integration tests)
    extends WP_UnitTestCase_Base (base test class)
        extends PHPUnit_Adapter_TestCase (PHPUnit adapter layer)
            extends PHPUnit\Framework\TestCase (PHPUnit native class)
}}}

The new order allows for the `WP_UnitTestCase_Base` to also benefit from the PHPUnit adapter layer.

For backward compatibility reasons the `WP_UnitTestCase`, which all test classes are (were) expected to extend, is left in place, though it is now an empty class and explicitly `abstract`.

Follow-up to [51559], [51560].

Props jrf, hellofromTonya, johnbillion, netweb, SergeyBiryukov.
See #46149.
Built from https://develop.svn.wordpress.org/trunk@51561


git-svn-id: http://core.svn.wordpress.org/trunk@51172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-06 00:44:57 +00:00
Sergey Biryukov
afea9cfbd6 Build/Test Tools: Unify the PHPUnit adapter TestCases.
This commit:
* Removes the PHPUnit 7 specific `TestCase`.
* Removes all existing polyfills from the PHPUnit 5.x `TestCase`.
* Imports all polyfill traits from the PHPUnit Polyfills package into the `WP_UnitTestCase` class and updates the DocBlock to reflect the actual function of the class.
 * Note: The list of polyfills needs to be verified and updated after each new release of the PHPUnit Polyfills package. Alternatively (recommended), one of the built-in `TestCase` classes from the PHPUnit Polyfills package can be used instead.

* Moves the `require` for the WP `abstract-testcase.php` to the `bootstrap.php` file.
* Adds a `require_once` for the PHPUnit Polyfills autoloader to the `bootstrap.php` file.
 * Note: while this isn't _strictly_ necessary when the tests are run via Composer, having the include in the bootstrap allows for the tests to also be run via a PHPUnit Phar, providing contributors with more flexibility.

Follow-up to [51559].

Props jrf, hellofromTonya, johnbillion, netweb, SergeyBiryukov.
See #46149.
Built from https://develop.svn.wordpress.org/trunk@51560


git-svn-id: http://core.svn.wordpress.org/trunk@51171 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-06 00:36:56 +00:00
Sergey Biryukov
b39d6ce7ad Build/Test Tools: Add Composer dependency on the PHPUnit Polyfills package.
The PHPUnit Polyfills package is an add-on for PHPUnit, which works around common issues for writing PHPUnit cross-version compatible tests.

Features:
* It offers a full set of polyfills for assertions and expectations introduced in PHPUnit since PHPUnit 4.8.
* It offers two generic TestCases which include these polyfills, but also solve the `void` return type issue for the fixtures methods.
* It offers a PHPUnit cross-version solution for the changes to the PHPUnit `TestListener` implementation.
* Supports PHPUnit 4.8 – current.
* Supports and is compatible with PHP 5.4 – current.

The package has no outside dependencies, other than PHPUnit, is actively maintained and endorsed by the maintainer of PHPUnit itself (the only package of its kind which has ever been endorsed).

Props jrf, hellofromTonya, johnbillion, netweb, SergeyBiryukov.
See #46149.
Built from https://develop.svn.wordpress.org/trunk@51559


git-svn-id: http://core.svn.wordpress.org/trunk@51170 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-06 00:34:58 +00:00
desrosj
fa93063ac1 Build/Test Tools: Add branch filtering for Slack notifications workflow.
Since branch filtering happens prior to the workflow run being created, filtering the branches that `workflow_run` will fire on for this workflow should cut down on the number of skipped “Slack Notifications” runs listed in the Actions section of the repository.

This also removes the check for a `skipped` outcome in the requesting workflow. Workflows for push events resulting from WordPress Core commits are never skipped.

See #52644.
Built from https://develop.svn.wordpress.org/trunk@51558


git-svn-id: http://core.svn.wordpress.org/trunk@51169 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-05 16:53:55 +00:00
Sergey Biryukov
04f4e911dc Coding Standards: Silence a WPCS warning in date_i18n().
This fixes a "Calling `current_time()` with a `$type` of `timestamp` or `U` is strongly discouraged as it will not return a Unix (UTC) timestamp" warning.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51168 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-05 14:49:57 +00:00
Sergey Biryukov
62a788e40e Twenty Thirteen: Correct indentation in image.php template.
Props jrf.
See #53359.
Built from https://develop.svn.wordpress.org/trunk@51556


git-svn-id: http://core.svn.wordpress.org/trunk@51167 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-05 14:38:57 +00:00
desrosj
3560a816d5 Build/Test Tools: Correctly check for the trigger event when running the Slack notifications workflow.
This updates the conditional check for the Slack notifications workflow to check the event of the original workflow and not the one requested through the `workflow_run:completed` event.

The run triggering the event is accessible at `github.event.workflow_run`.

Props Clorith.
See #52644.
Built from https://develop.svn.wordpress.org/trunk@51555


git-svn-id: http://core.svn.wordpress.org/trunk@51166 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-05 14:37:56 +00:00
Sergey Biryukov
ee4be502a7 Twenty Thirteen: Remove wrapping HTML tag from translatable string.
This fixes a "Strings should not be wrapped in HTML" WPCS warning.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51165 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-05 14:36:57 +00:00
Sergey Biryukov
64b193980a Bundled Themes: Remove redundant semicolons after closing curly brackets.
Includes a few minor indentation fixes.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51164 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-05 13:25:58 +00:00
Sergey Biryukov
815e31f611 Coding Standards: Remove redundant semicolons after closing curly brackets.
Props jrf.
See #53359.
Built from https://develop.svn.wordpress.org/trunk@51552


git-svn-id: http://core.svn.wordpress.org/trunk@51163 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-05 13:15:55 +00:00
Sergey Biryukov
d289b7f602 Coding Standards: Fix incorrect alignment in two comment blocks.
Tabs should only be used for indentation and not for mid-line alignment.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51162 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-05 13:11:56 +00:00
Sergey Biryukov
72acd346a2 Coding Standards: Fix incorrect comment indent in safecss_filter_attr().
Props jrf.
See #53359.
Built from https://develop.svn.wordpress.org/trunk@51550


git-svn-id: http://core.svn.wordpress.org/trunk@51161 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-05 12:59:58 +00:00
Peter Wilson
73be6fd8ef Coding Standards: Use strict comparisons in wp-admin/upload.php.
See #53359.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51160 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-05 03:37:56 +00:00
Peter Wilson
c1d05d5085 Coding Standards: Use strict comparisons in wp-admin/options-discussion.php.
See #53359.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51159 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-05 03:30:57 +00:00
Sergey Biryukov
318fc1fcc9 Build/Test Tools: Switch to always running the tests via Composer.
Previously the tests were run via a PHPUnit Phar file for PHP 5.6–7.4, with PHP 8.0 using a Composer-installed version of PHPUnit.

Running the tests via a Phar without the need for a `composer install` is (marginally) faster in overall build time, however, this commit is part of a larger chain of changes which will make the test suite PHPUnit cross-version compatible.

With an eye on those upcoming changes, which will allow us to run the tests on the most appropriate PHPUnit version for each supported PHP version, it is opportune to switch to using a Composer-installed version of PHPUnit for all PHP versions supported by WordPress. Previously this was not possible without additional conditional `update` commands being run, due to the `composer.lock` file being in place and being locked at PHPUnit 7.5.20.

Switching over to using the Composer-installed PHPUnit version, with that PHPUnit version adjusting based on the PHP version, allows for some minor simplifications in the GitHub Actions script.

This means we need additional measures to make sure that the Composer cache file does not go too far out of date as that would significantly slow down the builds.

By adding a "Last Monday" date to the cache key, in combination with the pre-existing OS, PHP version and the hash of the `composer.json` file, we can guarantee that:
1. There will be a cache created for each OS/PHP combination.
2. These caches will be replaced whenever a change is made to the `composer.json` file.
3. These caches will be replaced every Monday of each week ensuring that the cache file does not go too far out of date.

Note: The NPM script `test:php` is now no longer needed during the builds. However, to prevent breaking the workflow of contributors who may be used to having the command available, the command remains available.

In a future iteration we may be able to replace the caching of the Composer dependencies with the Composer cache action as offered on the GitHub marketplace, which would further simplify the script.

Follow-up to [42960], [46290], [47881], [48957], [49037], [51543], [51544].

Props jrf, desrosj.
Fixes #47381.
Built from https://develop.svn.wordpress.org/trunk@51545


git-svn-id: http://core.svn.wordpress.org/trunk@51156 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-04 19:49:56 +00:00
Sergey Biryukov
3db37d3459 Build/Test Tools: Use a custom autoloader for the PHPUnit 9.x mock object classes.
This prevents the classes from being loaded automatically via the `autoload-dev` directives when a Composer-installed PHPUnit 5.x or 6.x version is used, as that would break the test run.

It is expected that this autoloader will be removed soon, as it should no longer be needed when the PHPUnit version constraints are widened.

Notes:
* The autoloader file will be loaded from the Test bootstrap.
* The autoloader will always be registered and directed to queue itself _before_ the Composer autoload file (which will already have been registered).
* The autoloader will only actually load the WP copies of the files/classes when PHP 8.0 in combination with PHPUnit 7.x is detected. In all other cases, the autoloader will bow out, which effectively then defers to the Composer autoload file to load the files as shipped with the installed PHPUnit version.

Follow-up to [48957], [49037], [51543].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51155 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-04 19:26:00 +00:00
Sergey Biryukov
6e4d0d8f48 Build/Test Tools: Remove the Composer lock file from version control.
This makes it easier to run unit tests against multiple different PHP versions.

There is currently no reason to have a `composer.lock` file as:

* External runtime dependencies are not managed via Composer.
* Managed updates of the non-runtime dependencies can be done by locking the version used in the `composer.json` file to a precise version instead of using a `composer.lock` file.
* Having the `composer.lock` file in place makes it a lot more difficult to run the tests against all supported PHP versions.

With these considerations in mind, the lock file is now removed from version control and added to `.gitignore` and `svn:ignore`.

Version constraints for the current dev dependencies are adjusted accordingly:

* PHPUnit now explicitly declares in its version constraints that PHPUnit 5.x, 6.x, and 7.x are supported. The minimum supported version for PHPUnit 5.x has been raised from 5.4 to 5.7, which in practice was already the version used for running the tests on PHP 5.6.
* PHPCompatibilityWP is effectively updated to version 2.1.2 with the positive impact that a few new constants polyfilled in WP 5.8 are now accounted for (excluded from being flagged).
* PHP_CodeSniffer is declared as an explicit dependency to ensure that updates to it will always be explicitly managed instead of inherited.
* The DealerDirect Composer plugin is effectively updated to version 0.7.1 without impact.

Follow-up to [42960], [46290], [47881], [48957].

Props jrf, johnbillion, desrosj, ayeshrajans, aristath, hellofromTonya, SergeyBiryukov.
See #47381.
Built from https://develop.svn.wordpress.org/trunk@51543


git-svn-id: http://core.svn.wordpress.org/trunk@51154 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-04 18:57:00 +00:00
Sergey Biryukov
8f994d84de Media: Add / character to <img> tag in wp_print_media_templates().
While this has no effect on void elements in HTML5, it fixes a minor inconsistency with the rest of core.

Follow-up to [47493], [48834], [50556], [51473], [51541].

Props shital-patel, akabarikalpesh.
Fixes #53870.
Built from https://develop.svn.wordpress.org/trunk@51542


git-svn-id: http://core.svn.wordpress.org/trunk@51153 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-04 14:25:58 +00:00
Sergey Biryukov
0be77d4ebf Bundled Themes: Add / character to <img> tags.
While this has no effect on void elements in HTML5, it fixes a minor inconsistency with the rest of core.

Follow-up to [47493], [48834], [50556], [51473].

Props shital-patel, akabarikalpesh.
See #53870.
Built from https://develop.svn.wordpress.org/trunk@51541


git-svn-id: http://core.svn.wordpress.org/trunk@51152 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-04 14:24:02 +00:00
Peter Wilson
67119713fc Editor: Prevent block-editor JavaScript loading in other editors.
Add a check to `wp_add_iframed_editor_assets_html()` confirming the edit post screen is using the block-editor before including block-editor specific JavaScript. For the classic and other editors the function returns early without any output.

Props swissspidy, desrosj.
Fixes #53696.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51151 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-04 05:10:56 +00:00
Peter Wilson
7829821c62 Menus: Hide bulk-select on new menu page.
Prevent the bulk-select option from displaying when adding a new menu. This also prevents the option from displaying when an administrator first visits the menu page and no menus are set.

Props dlh, sabernhardt.
Fixes #53654.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51150 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-04 05:00:59 +00:00
jorgefilipecosta
eff1c81de6 Block Editor: Add missing border setting on button block.
This commit fixes a regression on WordPress 5.8 that made the border radius setting on the buttons block disappear.

Props Mamaduka, daisyo, priethor, desrosj, mikeschroder.
Fixes #53702.
Built from https://develop.svn.wordpress.org/trunk@51538


git-svn-id: http://core.svn.wordpress.org/trunk@51149 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-03 18:14:58 +00:00
desrosj
cf0f278ebe Build/Test Tools: Revert changes only included for testing purposes.
Follow up to [51535-51536].

See #52644.
Built from https://develop.svn.wordpress.org/trunk@51537


git-svn-id: http://core.svn.wordpress.org/trunk@51148 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-03 15:15:57 +00:00
desrosj
f45ed61786 Build/Test Tools: Correct invalid JSON in Slack payload.
The outer `”` marks are not required and produce invalid JSON.

See #52644.
Built from https://develop.svn.wordpress.org/trunk@51536


git-svn-id: http://core.svn.wordpress.org/trunk@51147 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-03 15:08:56 +00:00
desrosj
a748075471 Build/Test Tools: Expand Slack notifications for GitHub Actions.
This expands Slack notifications to include success, cancelled, and “fixed” GitHub Action workflow run outcomes in addition to failures.

A “fixed” outcome occurs when the previous run for a workflow failed and the current one succeeds. This matches the behavior that was native to TravisCI by setting `on_success` for notifications to `change`.

The message details and where each outcome is posted is controlled by Slack workflows.

The Slack notification logic has also been pulled into a separate workflow to prevent repeating code in every workflow.

See #52644.
Built from https://develop.svn.wordpress.org/trunk@51535


git-svn-id: http://core.svn.wordpress.org/trunk@51146 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-03 13:46:56 +00:00
Sergey Biryukov
def9fc3741 Coding Standards: Correct DateTimeZone class name in WP_Customize_Date_Time_Control::get_timezone_info().
Follow-up to [41626].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@51534


git-svn-id: http://core.svn.wordpress.org/trunk@51145 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-03 12:18:57 +00:00
Sergey Biryukov
5400c50367 Code Modernization: Pass correct default value to new DateTime() in wp_default_packages_inline_scripts().
This fixes a "Deprecated: `DateTime::__construct()`: Passing null to parameter #1 (`$datetime`) of type string is deprecated" warning on PHP 8.1.

Follow-up to [49083].

See #53635.
Built from https://develop.svn.wordpress.org/trunk@51533


git-svn-id: http://core.svn.wordpress.org/trunk@51144 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-03 12:04:58 +00:00
Sergey Biryukov
fedcc33d27 Code Modernization: Silence the deprecation warnings for missing return type in WP_Block_List.
This fixes the "Deprecated: Return type of `WP_Block_List::[METHODNAME]()` should be compatible with `ArrayAccess::[METHODNAME](): type`" warnings on PHP 8.1.

PHP native interfaces now have declared return types and methods in classes implementing these interfaces need to either have the return type declared (in a covariant compatible manner with the PHP native interface method declaration), or need to silence the deprecation warning using the `#[ReturnTypeWillChange]` attribute.

Follow-up to [51517], [51529], [51530], [51531].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51143 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-03 11:12:55 +00:00
Sergey Biryukov
68ba315d9a Code Modernization: Silence the deprecation warnings for missing return type in WP_REST_Request.
This fixes the "Deprecated: Return type of `WP_REST_Request::[METHODNAME]($offset)` should be compatible with `ArrayAccess::[METHODNAME](): type`" warnings on PHP 8.1.

PHP native interfaces now have declared return types and methods in classes implementing these interfaces need to either have the return type declared (in a covariant compatible manner with the PHP native interface method declaration), or need to silence the deprecation warning using the `#[ReturnTypeWillChange]` attribute.

Follow-up to [51517], [51529], [51530].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51142 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-03 11:08:56 +00:00
Sergey Biryukov
85c1413c2b Code Modernization: Silence the deprecation warnings for missing return type in WP_Hook.
This fixes the "Deprecated: Return type of `WP_Hook::[METHODNAME]()` should be compatible with `ArrayAccess::[METHODNAME](): type`" warnings on PHP 8.1.

PHP native interfaces now have declared return types and methods in classes implementing these interfaces need to either have the return type declared (in a covariant compatible manner with the PHP native interface method declaration), or need to silence the deprecation warning using the `#[ReturnTypeWillChange]` attribute.

Follow-up to [51517], [51529].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51141 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-03 11:02:00 +00:00
Sergey Biryukov
3c14324dc6 Code Modernization: Silence the deprecation warnings for missing return type in WP_Theme.
This fixes the "Deprecated: Return type of `WP_Theme::[METHODNAME]($offset)` should be compatible with `ArrayAccess::[METHODNAME](): type`" warnings on PHP 8.1.

PHP native interfaces now have declared return types and methods in classes implementing these interfaces need to either have the return type declared (in a covariant compatible manner with the PHP native interface method declaration), or need to silence the deprecation warning using the `#[ReturnTypeWillChange]` attribute.

Follow-up to [51517].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51140 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-02 22:31:56 +00:00
Sergey Biryukov
9a4280c75f Upgrade/Install: Store correct result when bulk updating plugins or themes.
This ensures that when multiple plugins or themes are updated and one succeeds and another fails, the error is reported accordingly.

Previously, both updates would end up treated as a success, due to `$this->result` containing the result of the previous operation and not the current one.

Follow-up to [12097].

Props pwtyler, afragen.
Fixes #53002.
Built from https://develop.svn.wordpress.org/trunk@51528


git-svn-id: http://core.svn.wordpress.org/trunk@51139 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-02 20:55:56 +00:00
Sergey Biryukov
b186e19855 Docs: Fix typo in the WP_Upgrader::install_package() description.
Follow-up to [30758].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@51527


git-svn-id: http://core.svn.wordpress.org/trunk@51138 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-02 18:27:57 +00:00
Sergey Biryukov
2e707307d9 Coding Standards: Fix typo in the JS function name for handling the password reset button.
Follow-up to [50129].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@51526


git-svn-id: http://core.svn.wordpress.org/trunk@51137 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-02 16:48:57 +00:00
Sergey Biryukov
47fc56d650 Upgrade/Install: Avoid creating nonce during installation.
This avoids a "Table `wp_options` doesn't exist" database error when trying to create a nonce for password reset button.

When installing and using database-saved salts, `wp_create_nonce()` causes database errors as `wp_salt()` attempts to insert into the not-yet-created options table. Since authentication is not available during installation, we can safely skip creating a nonce.

Follow-up to [39684], [50129].

Props schlessera, swissspidy, sanketchodavadiya, hellofromTonya, SergeyBiryukov.
Fixes #53830.
Built from https://develop.svn.wordpress.org/trunk@51525


git-svn-id: http://core.svn.wordpress.org/trunk@51136 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-02 16:39:00 +00:00
Sergey Biryukov
9e33977bc9 Themes: Make sure get_theme_mods() always returns an array.
This avoids a "Cannot access offset of type string on string" fatal error in `set_theme_mod()` on PHP 8 if the `theme_mods_$theme_slug` option has an incorrect value, e.g. an empty string instead of an array.

With this change, `set_theme_mod()` should be able to resolve the issue by saving a correct value.

Follow-up to [15736], [15739], [30672], [32629], [32632].

Props xknown.
See #51423.
Built from https://develop.svn.wordpress.org/trunk@51524


git-svn-id: http://core.svn.wordpress.org/trunk@51135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-01 14:55:56 +00:00
Sergey Biryukov
963dd5f06d Docs: Document the $wpdb global in WP_Debug_Data::get_mysql_var().
Follow-up to [51522].

See #53845.
Built from https://develop.svn.wordpress.org/trunk@51523


git-svn-id: http://core.svn.wordpress.org/trunk@51134 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-01 14:04:56 +00:00
Sergey Biryukov
2a0191b901 Site Health: Add some more MySQL information to the Site Health Info screen.
This adds three values to the debug info in the Database section:

* Max allowed packet size
* Max connections number
* Query cache size

Props zodiac1978, donmhico, mukesh27, SergeyBiryukov.
Fixes #53845.
Built from https://develop.svn.wordpress.org/trunk@51522


git-svn-id: http://core.svn.wordpress.org/trunk@51133 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-08-01 14:02:00 +00:00
Sergey Biryukov
aa0ed0fcdd Upgrade/Install: Skip any node_modules directories when removing Genericons example.html files on update.
This can significantly reduce the time required to complete the process in a development environment.

Follow-up to [32386].

Props bobbingwide, afragen, desrosj, SergeyBiryukov.
Fixes #52765.
Built from https://develop.svn.wordpress.org/trunk@51521


git-svn-id: http://core.svn.wordpress.org/trunk@51132 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-31 10:32:56 +00:00
Sergey Biryukov
4889679ca5 Taxonomy: Pass correct default value for $post_id to wp_terms_checklist() in the posts list table.
This matches the documented type of the `$post_id` argument and is consistent with other instances of `wp_terms_checklist()` calls.

Per the function documentation, the default value is integer `0`, not `null`.

Follow-up to [13535].

Props tareiking, donmhico, jrf.
Fixes #43639.
Built from https://develop.svn.wordpress.org/trunk@51520


git-svn-id: http://core.svn.wordpress.org/trunk@51131 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-31 09:50:57 +00:00
John Blackbourn
8935467410 Site Health: Standardise site health check status message punctuation.
Fixes #53594

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


git-svn-id: http://core.svn.wordpress.org/trunk@51130 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-30 19:38:57 +00:00
John Blackbourn
2cb4ebefe2 Docs: Replace $this in hook param docs with more appropriate names.
`$this` is a pseudo-variable that cannot be used as the name of a function parameter, so renaming these helps prevent errors when implementing hook callback functions.

Fixes #53457

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


git-svn-id: http://core.svn.wordpress.org/trunk@51129 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-30 19:35:58 +00:00
Sergey Biryukov
166dc3ac8e Code Modernization: Fix "JsonSerializable_Object::jsonSerialize() should be compatible with JsonSerializable::jsonSerialize(): mixed" error on PHP 8.1.
This relates to the [https://wiki.php.net/rfc/internal_method_return_types Return types for internal methods RFC] in PHP 8.1 and in particular, the change made in [https://github.com/php/php-src/pull/7051 PHP PR #7051], which adds a `mixed` return type to the `JsonSerializable::jsonSerialize()` interface method.

WordPress only contains one (test) class which implements the `JsonSerializable` interface and this commit fixes the issue for that class.

As of PHP 8.1, the `jsonSerialize()` method in classes which implement the `JsonSerializable` interface are expected to have a return type declared. The return type should be `mixed` or a more specific type. This complies with the Liskov principle of covariance, which allows the return type of a child overloaded method to be more specific than that of the parent.

The problem with this is that:
1. The `mixed` return type was only introduced in PHP 8.0.
2. Return types in general were only introduced in PHP 7.0.

WordPress still has a minimum PHP version of 5.6, so adding the return type is not feasible for the time being.

The solution chosen for now is to add an attribute to silence the deprecation warning. While attributes are a PHP 8.0+ feature, due to the choice of the `#[]` syntax, in PHP < 8.0, attributes will just be ignored and treated as comments, so there is no drawback to using the attribute.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51128 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-30 14:47:57 +00:00
John Blackbourn
a4bdae8122 Docs: Add missing documentation for the minute parameter of WP_Query.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51125 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-30 10:53:58 +00:00
John Blackbourn
ab9ed33f1d Docs: Correct the documented allowed range for the minute and second parameters of WP_Query.
These are correctly documented and validated in `WP_Date_Query` as 0-59.

See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51124 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-30 10:23:57 +00:00
desrosj
9d6ea69d92 Build/Test Tools: Revert the test and coding standards changes in [51511].
These were temporary for testing Slack messages when GitHub Action workflows fail.

See #52644.
Built from https://develop.svn.wordpress.org/trunk@51512


git-svn-id: http://core.svn.wordpress.org/trunk@51123 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-29 20:03:57 +00:00
desrosj
b5d09ecd99 Build/Test Tools: Post a message to #core in Slack when a workflow fails.
This adds an additional step to each GitHub Action workflow file that posts a message to #core in Slack every time a workflow run fails.

A minor test and spacing change is included in this commit in order to that messages are posted correctly and will be reverted after testing.

See #52644.
Built from https://develop.svn.wordpress.org/trunk@51511


git-svn-id: http://core.svn.wordpress.org/trunk@51122 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-29 19:48:58 +00:00
Sergey Biryukov
ec25d0aad3 Themes: Add "Template Editing" to the list of WordPress theme features.
Follow-up to [meta11158].

Props poena, desrosj.
Fixes #53556. See #meta5802.
Built from https://develop.svn.wordpress.org/trunk@51510


git-svn-id: http://core.svn.wordpress.org/trunk@51121 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-29 14:48:00 +00:00
gziolo
327852393a Build: Split packages and blocks to their webpack configs
It aligns with the changes proposed added in Gutenberg: https://github.com/WordPress/gutenberg/pull/33293.

The idea here is to split the growing webpack config into two parts: blocks and  packages.

We need to add handling for JavaScript files that are going to be used with blocks on the frontend. They didn't work quite well with the current setup for entry points created for packages.

As part of the effort, it adds support for `viewScript` in `block.json` metadata file that is later translated to `$view_script` in `WP_Block_Type` class and exposed as `view_script` from the REST API endpoint for block types.

Props youknowriad, desrosj, aristath.
Fixes #53690.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51112 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-28 10:06:59 +00:00
Sergey Biryukov
a207dadc10 Networks and Sites: Replace two remaining occurrences of "blog" with "site" in user-facing strings.
Follow-up to [36386], [36416], [36417], [46213].

Props audrasjb.
Fixes #53775.
Built from https://develop.svn.wordpress.org/trunk@51500


git-svn-id: http://core.svn.wordpress.org/trunk@51111 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-28 10:02:00 +00:00
desrosj
28d78c0c37 Coding Standards: Apply some alignment fixes from composer format.
Follow up to [51475].

See #53729.
Built from https://develop.svn.wordpress.org/trunk@51499


git-svn-id: http://core.svn.wordpress.org/trunk@51110 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-27 19:01:59 +00:00
desrosj
b055ff21bd Build/Test Tools: Remove the check for changes to version-controlled files in the Test Old Branch workflow.
This workflow does not perform a `git checkout` and is only used to dispatch workflows for old branches, so this check is not needed here.

Fixes #53799.
Built from https://develop.svn.wordpress.org/trunk@51498


git-svn-id: http://core.svn.wordpress.org/trunk@51109 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-27 14:11:58 +00:00
desrosj
8f90cf9878 Upgrade/Install: Add files for 5.8 to the $_old_files list that were missed.
Follow up to [51133], [51459].

Props WFMattR, audrasjb, ocean90, johnbillion, pbiron.
Fixes #53702.
Built from https://develop.svn.wordpress.org/trunk@51497


git-svn-id: http://core.svn.wordpress.org/trunk@51108 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-27 13:57:57 +00:00
Sergey Biryukov
0f9e2d2c66 Bundled Themes: Remove extra trailing spaces from translatable strings in block patterns.
Follow-up to [49583], [51045].

Props audrasjb, mukesh27.
Fixes #53774.
Built from https://develop.svn.wordpress.org/trunk@51496


git-svn-id: http://core.svn.wordpress.org/trunk@51107 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-27 11:27:58 +00:00
Sergey Biryukov
1e6a658e2f Docs: Clarify the @return value for WP_Filesystem_Base::getnumchmodfromh().
Follow-up to [9117], [51494].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@51495


git-svn-id: http://core.svn.wordpress.org/trunk@51106 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-27 11:01:57 +00:00
Sergey Biryukov
e86e6f8771 Docs: Correct @return type for WP_Filesystem_Base::getnumchmodfromh().
Follow-up to [9117].

Props ankitmaru, johnbillion.
Fixes #53793.
Built from https://develop.svn.wordpress.org/trunk@51494


git-svn-id: http://core.svn.wordpress.org/trunk@51105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-27 09:29:01 +00:00
Sergey Biryukov
0234409d58 Tests: Rename classes in phpunit/tests/widgets/ per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491], [51492].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51493


git-svn-id: http://core.svn.wordpress.org/trunk@51104 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-26 19:26:56 +00:00
Sergey Biryukov
5a12666dab Tests: Rename classes in phpunit/tests/sitemaps/ per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969], [51491].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51492


git-svn-id: http://core.svn.wordpress.org/trunk@51103 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-26 19:10:57 +00:00
Sergey Biryukov
142e0c4bd1 Tests: Rename classes in phpunit/tests/blocks/ per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968], [50969].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51491


git-svn-id: http://core.svn.wordpress.org/trunk@51102 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-26 18:46:57 +00:00
Sergey Biryukov
5a4203d04a Tests: Move and fix incorrectly placed tests for block supported styles.
The `Block_Supported_Styles_Test` class is not a `TestCase` to be extended, but an actual concrete test class. In order to run as expected, it should be placed under `phpunit/tests/blocks/` along with the other block tests.

Additionally:
* Add missing visibility keywords to test methods.
* Update the expected results to the currently used format for the tests to pass.
* Remove two outdated tests. The functionality being tested there is no longer available in this manner, so these tests are redundant.

Follow-up to [49226], [49310].

Props jrf, aristath, youknowriad.
See #53363.
Built from https://develop.svn.wordpress.org/trunk@51490


git-svn-id: http://core.svn.wordpress.org/trunk@51101 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-26 17:41:01 +00:00
Peter Wilson
08e06d74af Bundled Themes: Version Bump 2010, 2011 and 2012.
Version bump three bundled themes to avoid file not found and fatal errors introduced for child themes during the 5.8 release cycle.

* Twenty Ten: Version 3.5 (fatal error & 404)
* Twenty Eleven: Version 3.9 (404)
* Twenty Twelve: Version 3.5 (404)

These updates will be released mid 5.8.1 cycle due to the severity of the issues.

Follow up to [51482,51483].

Props dd32, peterwilsoncc.
Fixes #53777.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51097 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-26 03:15:00 +00:00
Sergey Biryukov
b218b7504c Media: Check the posts_per_page value in wp_ajax_query_attachments() before using it as a divisor.
This avoids a "Division by zero" PHP warning if a plugin changes the `posts_per_page` value to zero.

Follow-up to [51145].

Props 2linctools, kapilpaul, audrasjb.
Fixes #53773.
Built from https://develop.svn.wordpress.org/trunk@51485


git-svn-id: http://core.svn.wordpress.org/trunk@51096 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-25 09:56:57 +00:00
Sergey Biryukov
b67f94503e Media: Remove unused code from wp-admin/includes/media.php.
Folow-up to [7043], [7062].

Props rudlinkon, hellofromTonya.
Fixes #53764.
Built from https://develop.svn.wordpress.org/trunk@51484


git-svn-id: http://core.svn.wordpress.org/trunk@51095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-24 13:03:56 +00:00
Sergey Biryukov
f053aed3ce Bundled Themes: Use correct path for loading images in block patterns.
By using `get_template_directory_uri()` instead of `get_stylesheet_directory_uri()`, we make sure to include the images from the parent theme.

This avoids displaying missing images in block patterns when using a child theme of Twenty Ten, Twenty Eleven, or Twenty Twelve.

Follow-up to [51033], [51103], [51106].

Props audrasjb.
Fixes #53769.
Built from https://develop.svn.wordpress.org/trunk@51483


git-svn-id: http://core.svn.wordpress.org/trunk@51094 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-24 12:42:00 +00:00
Sergey Biryukov
5ffbad0b42 Twenty Ten: Use correct path for loading block patterns.
By using `get_template_directory()` instead of `get_stylesheet_directory()`, we make sure to include the `block-patterns.php` file from the parent theme.

This avoids a PHP fatal error when using a child theme of Twenty Ten.

Follow-up to [51106].

Props ryelle, sabernhardt, loranrendel.
Fixes #53752.
Built from https://develop.svn.wordpress.org/trunk@51482


git-svn-id: http://core.svn.wordpress.org/trunk@51093 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-23 13:13:58 +00:00
Sergey Biryukov
f753d70a82 Tests: Use better assertions in WP_UnitTestCase_Base::assertEqualFields():
* Check if the object attribute exists before checking its value.
* Mention the field name in error messages in case of failure.

Follow-up to [51478], [51479], [51480].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-22 18:50:57 +00:00
Sergey Biryukov
b38d2f9949 Tests: Modernize the WP_UnitTestCase_Base::assertEqualFields() method:
* Use `assertSame()` instead of `fail()` to display a proper message in case of failure.
* Add an optional `$message` parameter for consistency with other assertions.

Follow-up to [51478], [51479].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51480


git-svn-id: http://core.svn.wordpress.org/trunk@51091 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-22 17:40:57 +00:00
Sergey Biryukov
79e24f3c28 Tests: Correct placement of the $message parameter in assertDiscardWhitespace().
Follow-up to [51478].

Props johnbillion.
See #53363.
Built from https://develop.svn.wordpress.org/trunk@51479


git-svn-id: http://core.svn.wordpress.org/trunk@51090 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-22 17:26:57 +00:00
Sergey Biryukov
fa44974190 Tests: Add a $message parameter for custom assertions in WP_UnitTestCase_Base.
All assertions in PHPUnit have a `$message` parameter. Setting this parameter allows to distinguish which assertion is failing when a test runs multiple assertions, making debugging of the tests easier.

This optional parameter is now added for the assertion methods in the `WP_UnitTestCase_Base` class that were missing it.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51089 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-22 17:15:57 +00:00
John Blackbourn
0434d4d30b Docs: Miscellaneous docblock corrections and improvements.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@51088 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-22 16:54:58 +00:00
Sergey Biryukov
d19c7680e1 Tests: Correct class name for WP_Filesystem_Base::find_folder() tests.
A concrete test class should be suffixed with `Test`, not `UnitTestCase(s)`.

Follow-up to [25053].

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


git-svn-id: http://core.svn.wordpress.org/trunk@51087 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-22 16:45:58 +00:00
Sergey Biryukov
8a90b8691f Docs: Add a comment about the $title global usage in various admin files.
This should make it clear that the variable is used as part of the HTML `<title>` tag on admin screens.

Props ravipatel, hellofromTonya, sabernhardt, audrasjb, SergeyBiryukov.
Fixes #53729.
Built from https://develop.svn.wordpress.org/trunk@51475


git-svn-id: http://core.svn.wordpress.org/trunk@51086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-22 13:53:00 +00:00
Sergey Biryukov
8a975839f1 Docs: Correct a comment about WebP constants in wp-includes/compat.php.
Follow-up to [50810], [50814].

Props GaryJ, rtm909.
Fixes #53680.
Built from https://develop.svn.wordpress.org/trunk@51474


git-svn-id: http://core.svn.wordpress.org/trunk@51085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-22 13:07:57 +00:00
Sergey Biryukov
2871ef401b Help/About: Add / character to <img> and <source> tags.
While this has no effect on void elements in HTML5, it fixes a minor inconsistency with the rest of core.

Follow-up to [47493], [48834], [50556], [51418].

Props radixweb, ankitmaru, TobiasBg, sabernhardt, audrasjb.
Fixes #53716.
Built from https://develop.svn.wordpress.org/trunk@51473


git-svn-id: http://core.svn.wordpress.org/trunk@51084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-22 12:58:58 +00:00
gziolo
c7ff035183 I18n: Fix broken loop in WP_Theme_JSON_Resolver
Related issue in Gutenberg: https://github.com/WordPress/gutenberg/issues/33552

The loop in WP_Theme_JSON_Resolver to extract translatable paths was broken, as it contained an immediate and unconditional return. This caused the loop to immediately exit again after the first iteration, thus never actually looping.

Follow-up to [50959].

Props schlessera.
 

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


git-svn-id: http://core.svn.wordpress.org/trunk@51083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-22 10:06:57 +00:00
gziolo
60c39d7805 Editor: Conditionally load registered styles for block variations
In WordPress 5.8 we added the ability to only load styles for blocks when these blocks are rendered. However, these optimizations left out block-styles that get added using the register_block_style() function/API.

Props aristath.
Fixes #53616.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51082 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-22 08:38:04 +00:00
Sergey Biryukov
352fe2a88f Build/Test Tools: Update PHP_CodeSniffer to version 3.6.0.
The latest releases contain various bugfixes, as well as (nearly complete) support for PHP 8.0.

Relevant changelogs:
* https://github.com/squizlabs/PHP_CodeSniffer/releases/tag/3.5.6
* https://github.com/squizlabs/PHP_CodeSniffer/releases/tag/3.5.7
* https://github.com/squizlabs/PHP_CodeSniffer/releases/tag/3.6.0

For a full list of changes in this update, see the PHP_CodeSniffer GitHub:
https://github.com/squizlabs/PHP_CodeSniffer/compare/3.5.5...3.6.0

Props jrf.
Fixes #53477.
Built from https://develop.svn.wordpress.org/trunk@51470


git-svn-id: http://core.svn.wordpress.org/trunk@51081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-21 14:32:03 +00:00
desrosj
32307b45b0 External Libraries: Correct the underscore version used when registering.
The correct version is `1.13.1`.

Follow up to [50650], [50778].

Props david.binda.
Fixes #53713.
Built from https://develop.svn.wordpress.org/trunk@51469


git-svn-id: http://core.svn.wordpress.org/trunk@51080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-21 12:33:59 +00:00
desrosj
bb6af43b34 External Libraries: Correct the jquery-form version used when registering.
The correct version is `4.3.0`.

Follow up to [50546].

Props david.binda.
Fixes #53714.
Built from https://develop.svn.wordpress.org/trunk@51468


git-svn-id: http://core.svn.wordpress.org/trunk@51079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-21 12:20:57 +00:00
desrosj
6574121d8a External Libraries: Correct the hoverIntent version used when registering.
Follow up to [50521].

Props david.binda.
Fixes #53715.
Built from https://develop.svn.wordpress.org/trunk@51467


git-svn-id: http://core.svn.wordpress.org/trunk@51078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-21 12:18:06 +00:00
John Blackbourn
f5713b8d71 Application Passwords: Improve various user-facing and developer-facing terminology.
Fixes #53503, #53691

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


git-svn-id: http://core.svn.wordpress.org/trunk@51074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-19 21:14:57 +00:00
Sergey Biryukov
77f6357eac Tests: Replace assertContains() with assertStringContainsString() when used with strings.
Using the `assertContains()` and `assertNotContains()` methods with string haystacks was deprecated in PHPUnit 8 and removed in PHPUnit 9.

While WordPress test suite currently only supports PHPUnit up to 7.5.x, this allows us to switch to newer assertions ahead of adding full support for PHPUnit 8+.

These methods introduced in PHPUnit 7.5 should be used as an alternative:

* `assertStringContainsString()`
* `assertStringContainsStringIgnoringCase`
* `assertStringNotContainsString()`
* `assertStringNotContainsStringIgnoringCase`

As WordPress currently uses PHPUnit 5.7.x to run tests on PHP 5.6, polyfills for these methods were added to the `WP_UnitTestCase` class for PHPUnit < 7.5.

Follow-up to [51331], [51451], [51461].

Props jrf, dd32, SergeyBiryukov.
See #53363, #46149.
Built from https://develop.svn.wordpress.org/trunk@51462


git-svn-id: http://core.svn.wordpress.org/trunk@51073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-19 14:01:57 +00:00
Sergey Biryukov
1074ae9e4f Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertFalse( stripos( ... ) )` with `assertStringNotContainsString()` or `assertStringNotContainsStringIgnoringCase()` to use native PHPUnit functionality.

Going forward, these methods introduced in PHPUnit 7.5 should be used for similar assertions:

* `assertStringContainsString()`
* `assertStringContainsStringIgnoringCase()`
* `assertStringNotContainsString()`
* `assertStringNotContainsStringIgnoringCase()`

As WordPress currently uses PHPUnit 5.7.x to run tests on PHP 5.6, polyfills for these methods are now added to the `WP_UnitTestCase` class for PHPUnit < 7.5.

Follow-up to [51335], [51337], [51367], [51397], [51403], [51404], [51436], [51438], [51448], [51449], [51451], [51453], [51454].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51461


git-svn-id: http://core.svn.wordpress.org/trunk@51072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-19 13:30:57 +00:00
desrosj
14f024a34a Upgrade/Install: Add additional files to $_old_files for 5.8.
Follow up to [51134].

Fixes #53367.
Built from https://develop.svn.wordpress.org/trunk@51459


git-svn-id: http://core.svn.wordpress.org/trunk@51070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-19 00:59:57 +00:00
desrosj
50db2d585f Build/Test Tools: Update the caniuse browser data and regenerate CSS.
This includes three minor updates to generated CSS files:

- A single `-webkit-` prefix is removed for `min-width`, which was required for Safari <= 10.1 (0.06% total global usage). WordPress only supports the last two versions.
- 2 instances where the `-o-` prefix are added for `tab-size`. This appears to be for Opera Mobile, which has creeped back over the 1% global usage.

Props peterwilsoncc, jorbin.
Fixes #53686.
Built from https://develop.svn.wordpress.org/trunk@51456


git-svn-id: http://core.svn.wordpress.org/trunk@51067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-19 00:41:57 +00:00
desrosj
29e534376c Bundled Themes: Bump bundled theme versions for WordPress 5.8.
This bumps the version for all bundle themes in preparation for release with WordPress 5.8. The new versions are as follows:

- Twenty Twenty-One: 1.4
- Twenty Twenty: 1.8
- Twenty Nineteen: 2.1
- Twenty Seventeen: 2.8
- Twenty Sixteen: 2.5
- Twenty Fifteen: 3.0
- Twenty Fourteen: 3.2
- Twenty Thirteen: 3.4
- Twenty Twelve: 3.4
- Twenty Eleven: 3.8
- Twenty Ten: 3.4

Props mukesh27, kapilpaul.
Fixes #53277.
Built from https://develop.svn.wordpress.org/trunk@51455


git-svn-id: http://core.svn.wordpress.org/trunk@51066 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-18 23:05:00 +00:00
Sergey Biryukov
a86d4cbd85 Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertTrue( ... > 0 )` with `assertGreaterThan()` to use native PHPUnit functionality.

Follow-up to [51335], [51337], [51367], [51397], [51403], [51404], [51436], [51438], [51448], [51449], [51451], [51453].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51454


git-svn-id: http://core.svn.wordpress.org/trunk@51065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-18 14:11:57 +00:00
Sergey Biryukov
232597b633 Tests: Use more appropriate assertions in rest_sanitize_request_arg() tests.
This replaces instances of `assertSame( true, ... )` with `assertTrue()` to use native PHPUnit functionality.

Follow-up to [38832].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51453


git-svn-id: http://core.svn.wordpress.org/trunk@51064 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-18 14:01:58 +00:00
Sergey Biryukov
ff737b2d76 Tests: Require the WP_REST_Test_Controller class in WP_REST_Controller tests.
This avoids a "Class not found" PHP fatal error when running these tests separately.

Follow-up to [38832].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51452


git-svn-id: http://core.svn.wordpress.org/trunk@51063 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-18 13:47:00 +00:00
Sergey Biryukov
e0c355fcaa Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertTrue( strpos( ... ) > 0 )` with `assertStringContainsString()` to use native PHPUnit functionality.

Going forward, these methods introduced in PHPUnit 7.5 should be used for similar assertions:

* `assertStringContainsString()`
* `assertStringNotContainsString()`

As WordPress currently uses PHPUnit 5.7.x to run tests on PHP 5.6, polyfills for these methods are now added to the `WP_UnitTestCase` class for PHPUnit < 7.5.

Follow-up to [51335], [51337], [51367], [51397], [51403], [51404], [51436], [51438], [51448], [51449].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51451


git-svn-id: http://core.svn.wordpress.org/trunk@51062 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-17 10:37:58 +00:00
Sergey Biryukov
69a57fe80e Tests: Correct the test for autosaving a post with Ajax.
`wp_autosave()` only updates drafts and auto-drafts created by the current user if the post is not locked.

As a result of previous Ajax test refactoring, setting the current user and creating a test post ended up in different methods, with the user being set after the post is already created.

This resulted in the test post being created with the `post_author` field set to zero, and the current user check in `wp_autosave()` failed. Instead of updating the original post as the test intended, it created a new autosave.

The test only passed accidentally due to `assertGreaterThanOrEqual()` not performing a strict type check.

Follow-up to [26995], [35311].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51450


git-svn-id: http://core.svn.wordpress.org/trunk@51061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-17 10:24:59 +00:00
Sergey Biryukov
7bcca73ed7 Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertSame( 0, strpos( ... ) )` with `assertStringStartsWith()` to use native PHPUnit functionality.

Follow-up to [51335], [51337], [51367], [51397], [51403], [51404], [51436], [51438], [51448].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51449


git-svn-id: http://core.svn.wordpress.org/trunk@51060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-16 19:15:00 +00:00
Sergey Biryukov
4a8667c576 Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertTrue( is_string( ... ) )` with `assertIsString()` to use native PHPUnit functionality.

Follow-up to [51335], [51337], [51367], [51397], [51403], [51404], [51436], [51438].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51448


git-svn-id: http://core.svn.wordpress.org/trunk@51059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-16 09:52:00 +00:00
youknowriad
e76d4e1bcd Block Editor: Backport fixes targetted for WordPress 5.8 RC4.
This includes:

 - Suggestion List: Check if a node exists to scroll into view.
 - Autocomplete: reset state for empty text.
 - Adds auxiliary class names for editor styles in the widgets editor.
 - Extract snackbars into a separate component.
 - Rich text: run input rules after composition end.
 - iframe: load inline styles.
 - Multi select: select all: restore ref callback.
 - Writing flow: allow select all from empty selection.
 - Post Excerpt: Fix excerpt_more filter conflict and remove wordCount attribute.
 - Add the percent unit to the default units in Core.

Props desrosj.
See #53397.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-15 18:55:29 +00:00
desrosj
904862da90 Media: Document edge cases with the new image_editor_output_format filter.
More testing has revealed that the `image_editor_output_format` filter has some interesting edge cases that developers should be aware of when electing to use this filter (see #53667 and #53668).

Because this is a new filter that was intended to be used for experimenting with different ways to handle generating image sizes and has not yet been adopted in the wild, expanding the inline documentation is an acceptable temporary solution while these edge cases are explored further and addressed.

Props mikeschroder, antpb, desrosj, adamsilverstein, ianmjones.
See #5366, #53668, #35725.
Built from https://develop.svn.wordpress.org/trunk@51442


git-svn-id: http://core.svn.wordpress.org/trunk@51053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-15 17:39:59 +00:00
joedolson
f0e5f17c2c Media: Fix JS error in Media Library when infinite scroll enabled.
Wrap call to this.updateLoadMoreView() is wrapped in a check that infinite scroll is disabled to prevent JS errors.

Props wildworks.
Fixes #53672.
Built from https://develop.svn.wordpress.org/trunk@51440


git-svn-id: http://core.svn.wordpress.org/trunk@51051 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-15 17:00:59 +00:00
Sergey Biryukov
1c4ec82ce7 Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertTrue( is_numeric( ... ) )` with `assertIsNumeric()` to use native PHPUnit functionality.

Follow-up to [51335], [51337], [51367], [51397], [51403], [51404], [51436].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51438


git-svn-id: http://core.svn.wordpress.org/trunk@51049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-15 14:45:56 +00:00
Sergey Biryukov
d3d8d166c8 Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertTrue( is_a( ... ) )` with `assertInstanceOf()` to use native PHPUnit functionality.

Follow-up to [51335], [51337], [51367], [51397], [51403], [51404].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51436


git-svn-id: http://core.svn.wordpress.org/trunk@51047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-15 09:08:01 +00:00
Andrew Ozz
15f9f7c6b9 Media: When resizing WebP images set the compression to "lossy" by default. Fixes a bug where the compression was set to "lossless" when the uploaded WebP images have extended file format (VP8X).
Props adamsilverstein, mikeschroder, mmxxi, linux4me2.
Fixes #53653.
Built from https://develop.svn.wordpress.org/trunk@51435


git-svn-id: http://core.svn.wordpress.org/trunk@51046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-15 00:43:00 +00:00
desrosj
88cedeac5c Bundled Themes: Revert the [51372] update to block patterns in bundled themes.
Upon further examination, this change was not great for backwards compatibility, resulting in block validation errors when running on older versions of WordPress.

While there are currently many `console.info()` notices caused by older format block syntax being updated to the current version included in WordPress 5.8, the blocks do not break.

Block patterns do not currently have a versioning mechanism, or a means to indicate which versions of WordPress are supported.

See #53617.
Built from https://develop.svn.wordpress.org/trunk@51434


git-svn-id: http://core.svn.wordpress.org/trunk@51045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-14 20:02:59 +00:00
desrosj
88309aa27e Widgets: Prevent widgets unintentionally being moved to the inactive sidebar.
This fixes a bug where widgets are unintentionally moved to the `wp_inactive_widgets` sidebar when batch updates occur through the REST API.

When batch requests are processed, only `$_wp_sidebars_widgets is updated by previous calls to `WP_REST_Widgets_Controller::create_item()`. `$sidebars_widgets` is not aware of the new widget’s intended location, and `retrieve_widgets()` mistakenly flags the widget as inactive.

Calling `wp_get_sidebars_widgets()` before `retrieve_widgets()` ensures both global variables match and is intended as a temporary fix until the root cause of the problem can be fixed.

Props zieladam, htmgarcia, timothyblynjacobs.
Fixes #53657.
Built from https://develop.svn.wordpress.org/trunk@51432


git-svn-id: http://core.svn.wordpress.org/trunk@51043 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-14 16:45:58 +00:00
desrosj
440fd76242 Privacy: Ensure the copy button actually copies the suggested privacy policy text.
Follow up to [50609].

Props walbo, SergeyBiryukov.
Fixes #53652. See #52891.
Built from https://develop.svn.wordpress.org/trunk@51431


git-svn-id: http://core.svn.wordpress.org/trunk@51042 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-14 16:17:59 +00:00
Sergey Biryukov
a727138559 Docs: Synchronize the $post_id argument description for some post and attachment functions.
See #53399.
Built from https://develop.svn.wordpress.org/trunk@51430


git-svn-id: http://core.svn.wordpress.org/trunk@51041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-14 08:14:01 +00:00
desrosj
b8c451cdec Editor: Second round of package updates ahead of RC3.
Props ellatrix, peterwilsoncc, get_dave, mcsf, talldanwp, youknowriad, desrosj.
Built from https://develop.svn.wordpress.org/trunk@51426


git-svn-id: http://core.svn.wordpress.org/trunk@51037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-13 23:58:30 +00:00
Sergey Biryukov
10f7a91fa7 Docs: Correct documentation for wp_get_post_parent_id().
The `$post` parameter is required and does not have a default value.

Follow-up to [42397].

Props denisco.
See #53399.
Built from https://develop.svn.wordpress.org/trunk@51425


git-svn-id: http://core.svn.wordpress.org/trunk@51036 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-13 18:34:57 +00:00
desrosj
46f0cfe3ca Coding Standards: Use the correct formatting for multi-line comments.
Follow up to [51414].
Built from https://develop.svn.wordpress.org/trunk@51423


git-svn-id: http://core.svn.wordpress.org/trunk@51034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-13 18:02:57 +00:00
youknowriad
e270f4f0f3 Block Editor: Include the fixes targetted for WordPress 5.8 RC3.
This includes the following fixes:
 - Safari: see if compositing layer size is more reasonable when position fixed divs are not inserted into content.
 - Site Logo Block: update Site Logo block UI and option syncing.
 - Fix moving inner blocks in the Widgets Customizer.
 - Allow themes to provide empty values for color.duotone and spacing.units
 - Update getTermsInfo() to workaround parsing issue for translatable strings.
 - Specify what settings can be part of settings.layout.
 - Update conditions to hide duotone panel.
 - Prevent entering invalid values in the Query Loop block config.
 - Prevent color panel from showing as empty.
 - Avoid calling gutenberg_ functions within code shipped through WordPress Core.

Props desrosj.
See #53397.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51032 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-13 16:41:28 +00:00
Sergey Biryukov
8b2e5e7843 Tests: Reset $current_screen global between tests to avoid cross-test interdependencies.
This provides a consistent global starting state for tests that interact with admin screens.

Individual tests no longer need to invoke `set_current_screen( 'front' )` (or an alternative implementation) as a reset.

Follow-up to [29251], [29860], [31046], [36721], [38678], [48908], [50433].

Props hellofromTonya, johnbillion.
Fixes #53431.
Built from https://develop.svn.wordpress.org/trunk@51419


git-svn-id: http://core.svn.wordpress.org/trunk@51030 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-13 16:14:58 +00:00
ryelle
f1e1a53f5a Help/About: Update the About page for 5.8.
Use a larger image for theme.json on retina screens, and update the spacing of sections on the page.

Props javiarce.
See #52775.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-13 15:39:57 +00:00
Mike Schroder
b95e0b391c Customizer: Don’t always set normalizedTransitionendEventName to null.
Reverts [51389].

Unprops mikeschroder.
See #53562.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-13 14:04:57 +00:00
Sergey Biryukov
8ed1859c35 Tests: Clean up skipping conditions and requirements for various tests.
This improves the consistency of test skipping and ensures that:

* The `@requires` annotations use the right condition and format, and are on the right level (class vs. function).
* Inline conditions with a `markTestSkipped()` call are only used when annotations cannot be used.
* All `markTestSkipped()` calls contain a verbose explanation of why the test is being skipped.

Props jrf, hellofromTonya.
Fixes #53009.
Built from https://develop.svn.wordpress.org/trunk@51415


git-svn-id: http://core.svn.wordpress.org/trunk@51026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-13 10:45:02 +00:00
Peter Wilson
34119e2c95 Widgets: Validate HTML before saving block widgets.
Props talldanwp, noisysocks, kevin940726, peterwilsoncc.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-13 05:59:01 +00:00
ryelle
a5cfc54fec Help/About: Update the About section for 5.8.
Update the image links to use the CDN. Use regular text color for headings. Fix two string issues. Remove unnecessary `wp-components` script & style.

Props nao, audrasjb, karmatosed, desrosj, javiarce, milana_cap.
See #52775.


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


git-svn-id: http://core.svn.wordpress.org/trunk@51024 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-13 00:12:56 +00:00
desrosj
f2b3c983f6 Docs: Various documentation fixes following [51129].
- Typo corrections in filter descriptions.
- DocBlocks are now now wrapped to the next line after 80 characters, and not extending beyond 120 total characters wide.
- Remove unnecessary repeated references to the suggested replacement hooks.
- Adjustments to the indentation for consistency with other emails in Core, allowing the `phpcs:ignore` comment to be removed.

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


git-svn-id: http://core.svn.wordpress.org/trunk@51021 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-13 00:02:57 +00:00
desrosj
b60650f5bd Widgets: Replace wp.editor references in the legacy text widget.
This changes the references to `wp.editor` in the text widget’s JavaScript to `wp.oldEditor`, which is the new location for the old `editor` script that was previously available at `window.wp.editor`. 

Follow up to [51387-51388,51390].

Props spacedmonkey, zieladam.
Fixes #53437.
Built from https://develop.svn.wordpress.org/trunk@51409


git-svn-id: http://core.svn.wordpress.org/trunk@51020 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-12 23:57:57 +00:00
desrosj
a3a7ccf107 Widgets: Use wp_sidebar_description() to retrieve a sidebar’s description.
This switches `WP_REST_Sidebars_Controller` to use `wp_sidebar_description()` for retrieving the `description` of a given sidebar instead of referencing the value in the `$wp_registered_sidebars` global variable directly.

`wp_sidebar_description()` uses `wp_kses()` to only allow the default list of `$allowed_tags` to be present in a sidebar’s `description`.

Props timothyblynjacobs, desrosj.
Fixes #53646.
Built from https://develop.svn.wordpress.org/trunk@51408


git-svn-id: http://core.svn.wordpress.org/trunk@51019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-12 19:03:57 +00:00
Sergey Biryukov
2276bef421 Coding Standards: Fix WPCS issue in [51404].
This fixes an "Expected 1 spaces before closing parenthesis; 0 found" error.

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51405


git-svn-id: http://core.svn.wordpress.org/trunk@51016 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-12 10:53:59 +00:00
Sergey Biryukov
79b4f21761 Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertTrue( in_array( ... ) )` with `assertContains()` to use native PHPUnit functionality.

Follow-up to [51335], [51337], [51367], [51397], [51403].

Props hellofromTonya, jrf, SergeyBiryukov.
Fixes #53123. See #53363.
Built from https://develop.svn.wordpress.org/trunk@51404


git-svn-id: http://core.svn.wordpress.org/trunk@51015 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-12 10:37:00 +00:00
Sergey Biryukov
fb44d80643 Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertTrue( empty( ... ) )` with `assertEmpty()` to use native PHPUnit functionality.

Follow-up to [51335], [51337], [51367], [51397].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51403


git-svn-id: http://core.svn.wordpress.org/trunk@51014 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-11 12:42:59 +00:00
Andrew Ozz
8a8c4796db TinyMCE: ensure initialization runs in all cases on 'interactive' and 'complete' readyState. Fixes a rare bug when the init code is inserted in the DOM after the page has finished loading.
Props Collizo4sky, azaozz.
Fixes #53632.
Built from https://develop.svn.wordpress.org/trunk@51402


git-svn-id: http://core.svn.wordpress.org/trunk@51013 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-10 23:58:57 +00:00
Sergey Biryukov
f45d515ff8 Twenty Fifteen: Use strict comparison in inc/custom-header.php.
Props kapilpaul.
See #53359.
Built from https://develop.svn.wordpress.org/trunk@51401


git-svn-id: http://core.svn.wordpress.org/trunk@51012 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-10 18:43:57 +00:00
Sergey Biryukov
84f725010b Bundled Themes: Correct comment formatting in inc/block-patterns.php.
Follow-up to [51045], [51103].

Props kapilpaul.
See #53359, #52627.
Built from https://develop.svn.wordpress.org/trunk@51400


git-svn-id: http://core.svn.wordpress.org/trunk@51011 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-10 18:40:57 +00:00
Sergey Biryukov
c205a7e583 Coding Standards: Rename the $ID variable to $user_id in wp_insert_user() and wp_update_user().
This fixes a "Variable `$ID` is not in valid snake_case format" WPCS warning.

Follow-up to [2872].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@51399


git-svn-id: http://core.svn.wordpress.org/trunk@51010 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-10 12:21:58 +00:00
Sergey Biryukov
514f23aef8 Users: Return earlier from wp_update_user() in case of error.
This ensures that if the `wp_insert_user()` call resulted in a `WP_Error` object, it is returned right away without any further actions.

Follow-up to [32820].

Fixes #53627.
Built from https://develop.svn.wordpress.org/trunk@51398


git-svn-id: http://core.svn.wordpress.org/trunk@51009 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-10 12:00:58 +00:00
Sergey Biryukov
d4ca0e0790 Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertTrue( isset( ... ) )` with `assertArrayHasKey()` to use native PHPUnit functionality.

Follow-up to [51335], [51337], [51367].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51397


git-svn-id: http://core.svn.wordpress.org/trunk@51008 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-10 11:16:58 +00:00
Sergey Biryukov
c51c4ab729 Code Modernization: Only check collation in wpdb methods if the query is not empty.
This avoids a deprecation notice on PHP 8.1 caused by passing `null` instead of a string to `ltrim()` in `wpdb::check_safe_collation()`, and maintains the current behaviour.

Follow-up to [30345], [32162], [33455].

See #53635.
Built from https://develop.svn.wordpress.org/trunk@51396


git-svn-id: http://core.svn.wordpress.org/trunk@51007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-10 11:15:59 +00:00
Sergey Biryukov
e304c93a58 Coding Standards: Add missing semicolon to endforeach keywords in media templates.
Follow-up to [27411], [27440].

Props vishitshah, mukesh27, nielslange, sabernhardt.
Fixes #46103.
Built from https://develop.svn.wordpress.org/trunk@51395


git-svn-id: http://core.svn.wordpress.org/trunk@51006 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-10 10:40:58 +00:00
Sergey Biryukov
7922a90974 I18N: Translate _doing_it_wrong() messages in wp_check_widget_editor_deps().
This makes them consistent with other similar messages in core.

Follow-up to [51387], [51388], [51390].

See #53437, #53569.
Built from https://develop.svn.wordpress.org/trunk@51391


git-svn-id: http://core.svn.wordpress.org/trunk@51002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-09 10:57:59 +00:00
Sergey Biryukov
eb9d31bb11 Docs: Some documentation improvements for wp_check_widget_editor_deps():
* Add missing short description for the function.
* Correct function names in `_doing_it_wrong()` calls.
* Document the usage of `$wp_scripts` and `$wp_styles` globals.
* Update syntax for multi-line comment per the documentation standards.

Follow-up to [51387], [51388].

See #53437, #53569.
Built from https://develop.svn.wordpress.org/trunk@51390


git-svn-id: http://core.svn.wordpress.org/trunk@51001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-09 10:50:56 +00:00
Mike Schroder
8222719bc9 Customizer: Skip animations when they have no duration.
In addition to skipping animations when a related style doesn't Exist, now checks to see if animation styles are Empty as well.

This resolves a case where the Gutenberg End to End tests were failing, due to running with animations disabled.

This change should also help some users who are intentionally overriding styles to remove animations.

See https://github.com/WordPress/gutenberg/issues/32024 for the original Gutenberg issue.

Props zieladam, isabel_brison, kevin940726, desrosj, mikeschroder.
Fixes #53562.
See #53542.
Built from https://develop.svn.wordpress.org/trunk@51389


git-svn-id: http://core.svn.wordpress.org/trunk@51000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-09 08:13:58 +00:00
noisysocks
846529de97 Widgets: Warn when wp-editor script or wp-edit-post style is enqueued in widgets editor
It is common that plugins erroneously have `wp-editor` or `wp-edit-post` as a
dependency in a script that is loaded in the new widgets editor. This is a smell
since both `@wordpress/editor` and `@wordpress/edit-post` assume the existence
of a global "post" object which the widgets editor does not have.

[51387] fixes the user-facing errors typically caused by this mistake, but we
can go a step further and warn developers about this by calling
`_doing_it_wrong()` when we detect that the `wp-editor` script or `wp-edit-post`
style is enqueued alongside `wp-edit-widgets` or `wp-customize-widgets`.

See #53437.
Fixes #53569.
Props zieladam, spacedmonkey, TimothyBlynJacobs, andraganescu, dlh.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-09 01:18:57 +00:00
noisysocks
c57e6f00fe Editor: Merge conflicting wp.editor objects into single, non-conflicting object
The `wp-editor` script (`@wordpress/editor` npm package) is exposed as
`window.wp.editor` in WP Admin.  This causes problems, though, as many older
scripts expect to see the older `editor` script available at `window.wp.editor`.

The solution is to export all the members of the older `window.wp.editor` module
in the newer module to maintain backwards compatibility.

See #53437.
Props zieladam, spacedmonkey, TimothyBlynJacobs, andraganescu.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-09 01:10:57 +00:00
jorgefilipecosta
d05e5232b7 Block Editor: Fix for theme.json: color.duotone and spacing.units should allow empty sets.
This commit fixes an issue with the color.duotone & spacing.units in which empty values didn't override previous origins, resulting in that a theme couldn't provide an empty set for this via its theme.json.

Props nosolosw, youknowriad, aristath.
See #53175.
Built from https://develop.svn.wordpress.org/trunk@51383


git-svn-id: http://core.svn.wordpress.org/trunk@50994 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-08 19:31:57 +00:00
Sergey Biryukov
2d18007ac5 Coding Standards: Remove wrapping HTML tags from translatable strings.
This fixes a "Strings should not be wrapped in HTML" WPCS warning in help tabs for Export Personal Data and Erase Personal Data screens.

Follow-up to [50147].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@51381


git-svn-id: http://core.svn.wordpress.org/trunk@50992 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-08 17:07:58 +00:00
Dominik Schilling
2f170f54ea Script Loader: Update jQuery version to 3.6.0 following the update in [50520].
Props audrasjb.
See #52707.
Built from https://develop.svn.wordpress.org/trunk@51380


git-svn-id: http://core.svn.wordpress.org/trunk@50991 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-08 07:19:57 +00:00
Aaron Jorbin
381a720ea9 Fix merge info.
[51378] contained merge info it shouldn't and accidentally a line of code from one of those commits that another one had changed.

See #53604.
Unprops jorbin.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50990 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-07 22:47:56 +00:00
Aaron Jorbin
f4acd73b70 Posts: Fix Spelling in inline docs.
A warpper is the traditional home of a neditor. They generally are optimized for supporting the good quality content that a neditor requires to survive. Some warppers feel like they have been around forever but have laid a foundation for newer warppers. A specific Russian warppers is known for having a wide footprint and touching almost everything. Warppers were originally only found subversioned underground, but they have been able to GIT above ground in the last few years.

The number of warpers in the world is small, but without them the neditor would never survive.

See [23105], [51375], #53604.
Props SergeyBiryukov.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50989 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-07 22:39:57 +00:00
TimothyBlynJacobs
3f7c228c90 REST API: Ensure a sidebar's widgets property is a list.
When a widget is removed from a sidebar, if it was removed from the middle of the list, the widgets property would become an object with numeric keys.

The sidebars controller now forces the widgets property to be a list.

Props walbo.
Fixes #53612.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50988 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-07 19:35:57 +00:00
desrosj
501e37bf2b Posts: Allow the list of wrapper blocks to be filtered.
This introduces the `excerpt_allowed_wrapper_blocks` filter for controlling which blocks should be considered wrapper blocks.

Wrapper blocks and their nested contents are not stripped by `excerpt_remove_blocks()`, allowing their contents to appear in generated excerpts.

Follow up to [51348].

Props aristath, jorbin.
See #53604.
Built from https://develop.svn.wordpress.org/trunk@51375


git-svn-id: http://core.svn.wordpress.org/trunk@50986 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-07 19:10:57 +00:00
desrosj
b16abdec23 Bundled Themes: Update block patterns to match the latest versions of core/* blocks.
When using the post editor with a bundled theme active, there will be a number of `console.info` notices printed to the browser’s console.

These notices are caused by block patterns containing outdated and deprecated versions of `core/*` blocks. Before rendering the blocks, they need to be updated, and this process outputs information to the console.

Props ntsekouras.
Fixes #53617.
Built from https://develop.svn.wordpress.org/trunk@51372


git-svn-id: http://core.svn.wordpress.org/trunk@50983 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-07 17:31:00 +00:00
desrosj
cf711280e0 Tests: Add missed file update in [51370].
See #53497.
Built from https://develop.svn.wordpress.org/trunk@51371


git-svn-id: http://core.svn.wordpress.org/trunk@50982 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-07 15:55:58 +00:00
desrosj
13695f4abd Themes: Remove mention of “FSE” in Core.
“FSE” themes are block themes.

Fixes #53497.
Built from https://develop.svn.wordpress.org/trunk@51370


git-svn-id: http://core.svn.wordpress.org/trunk@50981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-07 15:49:57 +00:00
desrosj
0a4c5d0f01 Tests: Expand tests for get_block_editor_settings().
This adds unit tests to ensure `get_block_editor_settings()` properly maps some previously experimental features to their correct locations in the array of contextualized block editor settings returned by the function.

Follow up to [51149], [51213].

Props felipeelia.
Fixes #53458.
Built from https://develop.svn.wordpress.org/trunk@51369


git-svn-id: http://core.svn.wordpress.org/trunk@50980 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-07 14:13:57 +00:00
Sergey Biryukov
a1418c50bd Coding Standards: Fix WPCS issues in [51367].
This fixes an "Expected 1 space after comma in argument list; 2 found" error.

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51368


git-svn-id: http://core.svn.wordpress.org/trunk@50979 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-07 10:51:58 +00:00
Sergey Biryukov
4c165a015e Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertSame( [number], count( ... ) )` with `assertCount()` to use native PHPUnit functionality.

Follow-up to [51335], [51337].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51367


git-svn-id: http://core.svn.wordpress.org/trunk@50978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-07 10:34:00 +00:00
Peter Wilson
d73dcb8378 Block Editor: Update packages with latest fixes for 5.8 RC2
Includes the following fixes:

- Query Block: Type validation of `WP_Query` parameters.

Props ntsekouras, stevehenty, peterwilsoncc, desrosj.
Fixes #53397.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50971 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-06 23:57:21 +00:00
ryelle
39ff1d6709 Help/About: Update placeholder links on About page.
Props SergeyBiryukov, audrasjb.
See #52775.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50968 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-06 22:04:58 +00:00
iandunn
8b025acd61 Multisite: Log error/warnings/notices from ms-files.php.
Previously errors were not displayed or logged, but the original intention was only to prevent them from being displayed. Hiding them from logs makes problems like #53492 much harder to debug.

This makes the handling of errors in `ms-files` consistent with the REST API, `admin-ajax`, and XML-RPC.

Props iandunn, johnjamesjacoby.
Fixes #53493.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50967 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-06 20:21:57 +00:00
ryelle
72f034f636 Help/About: Update the About section for 5.8.
Add the images for About, Freedoms, and Privacy. Update the styles on all About section pages to match the About page style. Fix string issues, missing link wrapper, duplicate copy.

Props chanthaboune, kellychoffman, javiarce, ryokuhi, alanjacobmathew, desrosj.
See #52775.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50965 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-06 18:38:57 +00:00
John Blackbourn
1940e5d03e Build/Test Tools: Add assertions to ensure version-controlled files are not modified during CI, and fix the grunt clean command.
Some tests and some commands that run during the build steps modify files that are under version control. This adds assertions to ensure that these files don't remain in a modified state after the test runs on CI.

This also fixes the `grunt clean` command which erroneously deletes `script-loader-packages.php`. This file is re-populated during the build, but deleting it during the clean is undesirable.

Fixes #53606

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


git-svn-id: http://core.svn.wordpress.org/trunk@50964 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-06 18:37:57 +00:00
John Blackbourn
5f67ba0406 Docs: Correct the @since tag for the user_erasure_fulfillment_email_headers filter.
See #44314, #53461

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


git-svn-id: http://core.svn.wordpress.org/trunk@50962 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-06 18:18:02 +00:00
desrosj
5ce4f59f07 Themes: Remove inline comment that is not relevant in WordPress Core.
This removes an inline comment block that was added when importing the `WP_Theme_JSON` class in [50959]. The comment is relevant to the code only when viewed within the context of the Gutenberg plugin.

Props nosolosw, jorbin.
Fixes #53576.
Built from https://develop.svn.wordpress.org/trunk@51352


git-svn-id: http://core.svn.wordpress.org/trunk@50961 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-06 18:14:57 +00:00
desrosj
faa69b408c Tests: Update the wp-api-generated.js fixture.
Follow up to [51241].

Props johnbillion.
See #53606.
Built from https://develop.svn.wordpress.org/trunk@51351


git-svn-id: http://core.svn.wordpress.org/trunk@50960 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-06 15:59:59 +00:00
desrosj
1dcad8f5bb REST API: Add the $request parameter to methods checking permissions.
This adds the `$request` parameter to the `permissions_check()` methods within `WP_REST_Widgets_Controller` and adds `$request` as an allowed parameter to the `permissions_check()` method within `WP_REST_Templates_Controller`.

Even when this parameter is not used by default, it should be implemented to support the class being extended and the method overidden.

Props johnbillion, timothyblynjacobs.
Fixes #53593.
Built from https://develop.svn.wordpress.org/trunk@51349


git-svn-id: http://core.svn.wordpress.org/trunk@50958 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-06 15:43:00 +00:00
desrosj
98579e4495 Posts: Prevent an empty excerpt when groups and nested column blocks are present.
This improves the logic within `excerpt_remove_blocks()` to better handle `innerBlocks`. This prevents an empty excerpt from being returned when `core/columns`, `core/column`, and `core/group` blocks are present.

This issue has been surfaced in the Query Loop block, where excerpts can be set to display. 

Props aristath.
Fixes #53604.
Built from https://develop.svn.wordpress.org/trunk@51348


git-svn-id: http://core.svn.wordpress.org/trunk@50957 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-06 15:32:57 +00:00
youknowriad
5ab81a5f38 Block Editor: Update packages with latest fixes for 5.8 RC2
Includes the following fixes:

 - [Block Library]: Less warnings when blocks try to render themselves.
 - Reset z-index on focused widget form
 - Refactor appender margin.
 - Fix slash inserter for widgets screen.
 - Widget screens: set html block as freeform content handler.
 - Widget Block: widget_id is undefined when a widget is placed.
 - Add <CopyHandler> to WidgetAreasBlockEditorProvider
 - Add width: 100% to components-base-control inside wp-block-legacy-widget
 - [Widgets editor] Replace the "technical" error notice a more user-friendly one
 - Fix legacy widget height overflow 
 - Fix "Select all" behavior in the editor 
 - Increase specificity of the NoPreview CSS rules to avoid conflicts with theme styles
 - Fix move to widget area checkmark
 - Replace legacy widget icon with its new version
 - [Block Library - Query Loop]: Set default block variations not to inherit from global query

See #53397.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50953 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-06 14:38:40 +00:00
desrosj
833382b2c9 Bundled Themes: Correct customzier typo.
This was found in Twenty Twenty-One and Twenty Nineteen.

Props audrasjb, spytzo, sabernhardt.
Fixes #53598.
Built from https://develop.svn.wordpress.org/trunk@51343


git-svn-id: http://core.svn.wordpress.org/trunk@50952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-06 14:02:57 +00:00
desrosj
038904da7c I18N: Correct recurring lenghts typo.
Props mikaelmayer.
Fixes #53600.
Built from https://develop.svn.wordpress.org/trunk@51342


git-svn-id: http://core.svn.wordpress.org/trunk@50951 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-06 13:52:57 +00:00
desrosj
6f2b454864 Build/Test Tools: Use caching built into actions/setup-node.
This updates the `actions/setup-node` action to version 2.2.2 and takes advantage of the cache feature now built in. This removes the need for an additional step using `actions/cache` to cache NPM dependencies.

The cache key used will be `${{ runner.os }}-npm-${{ hashFiles('') }}`, which matches the recommendation in the `actions/cache` documentation and the key currently in use in the WordPress workflows.

Props gziolo.
Fixes #53584.
Built from https://develop.svn.wordpress.org/trunk@51341


git-svn-id: http://core.svn.wordpress.org/trunk@50950 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-06 13:13:59 +00:00
Sergey Biryukov
0d2ce875d7 Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertTrue( is_object( ... ) )` with `assertIsObject()` to use native PHPUnit functionality.

Follow-up to [51331], [51335].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51337


git-svn-id: http://core.svn.wordpress.org/trunk@50946 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-06 12:32:57 +00:00
Sergey Biryukov
5bef1b8001 Tests: Use more appropriate assertions in various tests.
This replaces instances of `assertTrue( is_array( ... ) )` with `assertIsArray()` to use native PHPUnit functionality.

Follow-up to [51331].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51335


git-svn-id: http://core.svn.wordpress.org/trunk@50944 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-06 12:26:56 +00:00
Sergey Biryukov
7a836ad413 Tests: Move loading compatibility layers for PHPUnit 6+ and 7.5+ closer together.
Follow-up to [40536], [44701], [50986].

See #53363.
Built from https://develop.svn.wordpress.org/trunk@51333


git-svn-id: http://core.svn.wordpress.org/trunk@50942 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-06 11:35:00 +00:00
Aaron Jorbin
228f2d9d39 Update the IRC link from Freenode to Libera.chat.
Update follows the update to https://make.wordpress.org/support/handbook/appendix/other-support-locations/introduction-to-irc/.

Fixes #53590.
Props empatogen, audrasjb.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50941 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-05 19:31:59 +00:00
Sergey Biryukov
94c6df96bc Build/Test Tools: Replace assertInternalType() usage in unit tests.
The `assertInternalType()` and `assertNotInternalType()` methods are deprecated in PHPUnit 8 and removed in PHPUnit 9.

While WordPress test suite currently only supports PHPUnit up to 7.5.x, this allows us to switch to newer assertions ahead of adding full support for PHPUnit 8+.

These methods introduced in PHPUnit 7.5 should be used as an alternative:

* `assertIsArray()`
* `assertIsBool()`
* `assertIsFloat()`
* `assertIsInt()`
* `assertIsNumeric()`
* `assertIsObject()`
* `assertIsResource()`
* `assertIsString()`
* `assertIsScalar()`
* `assertIsCallable()`
* `assertIsIterable()`
* `assertIsNotArray()`
* `assertIsNotBool()`
* `assertIsNotFloat()`
* `assertIsNotInt()`
* `assertIsNotNumeric()`
* `assertIsNotObject()`
* `assertIsNotResource()`
* `assertIsNotString()`
* `assertIsNotScalar()`
* `assertIsNotCallable()`
* `assertIsNotIterable()`

As WordPress currently uses PHPUnit 5.7.x to run tests on PHP 5.6, polyfills for these methods are now added to the `WP_UnitTestCase` class for PHPUnit < 7.5.

Props pbearne, jrf, dd32, SergeyBiryukov.
Fixes #53491. See #46149.
Built from https://develop.svn.wordpress.org/trunk@51331


git-svn-id: http://core.svn.wordpress.org/trunk@50940 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-05 17:22:57 +00:00
John Blackbourn
2e6a782a5f Docs: Miscellaneous docblock improvements.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@50939 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-05 15:48:00 +00:00
Sergey Biryukov
0dadbcab6b Docs: Correct description for the upgrader_pre_install filter.
Props ilovecats7.
Fixes #53546.
Built from https://develop.svn.wordpress.org/trunk@51329


git-svn-id: http://core.svn.wordpress.org/trunk@50938 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-04 10:06:57 +00:00
Sergey Biryukov
ca92ebece3 Docs: Add @since tags for WP_Theme class properties.
Document WordPress versions Twenty Twelve and later bundled themes were introduced in.

See #53399.
Built from https://develop.svn.wordpress.org/trunk@51328


git-svn-id: http://core.svn.wordpress.org/trunk@50937 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-04 09:58:58 +00:00
John Blackbourn
efaf4a8938 Docs: Add and correct examples of common names for various dynamic hooks.
See #53581

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


git-svn-id: http://core.svn.wordpress.org/trunk@50936 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-03 21:42:59 +00:00
John Blackbourn
6b78871b4a Docs: Document common names for dynamic hooks relating to metadata.
See #53581

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


git-svn-id: http://core.svn.wordpress.org/trunk@50935 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-03 21:32:58 +00:00
Sergey Biryukov
39cb388519 Docs: Correct @see references for hooks in the get_option() description.
Follow-up to [51050].

See #52628, #53461.
Built from https://develop.svn.wordpress.org/trunk@51324


git-svn-id: http://core.svn.wordpress.org/trunk@50933 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-03 11:31:58 +00:00
Sergey Biryukov
9c0611e9c0 Bundled Themes: Correct @since tags for block patterns.
Follow-up to [49347], [49348], [49583], [49584], [49763], [51103].

See #52628, #53461.
Built from https://develop.svn.wordpress.org/trunk@51323


git-svn-id: http://core.svn.wordpress.org/trunk@50932 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-03 09:41:58 +00:00
Sergey Biryukov
af7a04318d Twenty Twenty: Add missing documentation for some filters.
Add missing `@since` tags for some functions.

Correct alignment of some `@param` tags.

Follow-up to [46271], [46278], [51304].

See #52628, #53461.
Built from https://develop.svn.wordpress.org/trunk@51322


git-svn-id: http://core.svn.wordpress.org/trunk@50931 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-03 09:14:58 +00:00
Aaron Jorbin
bf92ee343c Remove unnecessary function_exists check in get_the_block_template_html
WordPress can be confident that WordPress functions exist.

I forgot this function existed.
And I thought that it would fatal, but it didn't
And it was so nice
So peaceful and quiet
I forgot this function existed
It isn't love, it isn't hate, it's just indifference

Introduced in [51003].

Props walbo.
Fixes #53578. See #53176.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50930 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-02 21:52:57 +00:00
desrosj
3e271ba7a7 Editor: Ensure global styles are loaded in the footer when loading core assets individually.
This fixes the logic in `wp_enqueue_global_styles()` to ensure that global styles are loaded in the footer when a site opts-in to loading Core block assets individually.

This fixes a bug where styles defined in `themes.json` are not respected.

Props walbo, nosolosw, mcsf, aristath, desrosj.
Fixes #53494.
Built from https://develop.svn.wordpress.org/trunk@51309


git-svn-id: http://core.svn.wordpress.org/trunk@50918 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-02 18:47:58 +00:00
desrosj
bc5908011b Editor: Ensure the Query block pattern category is translatable.
Because the `__()` translation function was used here, the Query block pattern category string is not translatable. `_x()` is the correct function here as that passes the second parameter as context and not text domain.

Follow up to [50948].

Props walbo.
Fixes #53577.
Built from https://develop.svn.wordpress.org/trunk@51307


git-svn-id: http://core.svn.wordpress.org/trunk@50916 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-02 14:35:58 +00:00
desrosj
433448f1d8 Editor: Remove the experimental experimental-link-color feature.
This has been plugin only so far and should remain so.

Follow up to [50959].

Props nosolosw.
Fixes #53175.
Built from https://develop.svn.wordpress.org/trunk@51306


git-svn-id: http://core.svn.wordpress.org/trunk@50915 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-02 13:02:58 +00:00
Sergey Biryukov
d0c596c992 Twenty Twenty-One: Add missing documentation for some filters.
Add missing `@since` tags for some functions.

Follow-up to [49216], [49220], [49854], [51294].

See #52628, #53461.
Built from https://develop.svn.wordpress.org/trunk@51304


git-svn-id: http://core.svn.wordpress.org/trunk@50913 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-02 08:57:57 +00:00
Sergey Biryukov
7ec8606aeb Docs: Correct description for the $image parameter of the wp_save_image_file filter.
Follow-up to [27357], [48798], [51302].

See #53399.
Built from https://develop.svn.wordpress.org/trunk@51303


git-svn-id: http://core.svn.wordpress.org/trunk@50912 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-02 07:11:58 +00:00
John Blackbourn
ec4eb88e0f Docs: Further type corrections and improvements for various docblocks.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@50911 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-01 22:02:57 +00:00
John Blackbourn
e4cfebe92e Docs: Undo the accidental revert of [51299] made in [51300].
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@50910 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-01 21:29:56 +00:00
John Blackbourn
ea60cd8191 Docs: Descriptive improvements and corrections for various docblocks.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@50909 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-01 21:12:58 +00:00
John Blackbourn
9146628ae1 Docs: Miscellaneous formatting corrections for docblocks.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@50908 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-01 21:10:56 +00:00
John Blackbourn
79685db062 Docs: Corrections and improvements to types used in docblocks for symbols, properties, and filters.
See #53399

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


git-svn-id: http://core.svn.wordpress.org/trunk@50907 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-01 21:02:57 +00:00
John Blackbourn
00a0c0f3d5 Docs: Fix the documentation for the $tests parameter of the site_status_tests filter.
Tests are contained within `direct` and `async` properties of this array, not directly in the array itself. This also clarifies the properties that differ between direct and async tests.

See #53399, #46573

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


git-svn-id: http://core.svn.wordpress.org/trunk@50906 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-01 20:37:57 +00:00
desrosj
a54727d936 Twenty Twenty-One: Ensure the dropdown arrow displays for <select> elements when focused.
Props isabel_brison, zieladam, poena.
Fixes #53560.
Built from https://develop.svn.wordpress.org/trunk@51296


git-svn-id: http://core.svn.wordpress.org/trunk@50905 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-01 19:55:58 +00:00
Sergey Biryukov
61b5311c57 Twenty Twenty-One: Improve documentation per the documentation standards:
* Remove unnecessary `@access` tags that were previously removed from core.
* Remove an empty line between `@param` and `@return` tags.
* Correct alignment of `@param` tags.

Follow-up to [41161], [41162], [41168], [49216], [49220].

See #52628, #53461.
Built from https://develop.svn.wordpress.org/trunk@51294


git-svn-id: http://core.svn.wordpress.org/trunk@50903 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-01 12:59:57 +00:00
Sergey Biryukov
4871e33916 Docs: Correct documentation for rest_{$post_type}_query and rest_{$taxonomy}_query filters.
Synchronize documentation for related `rest_{$object_type}_query` filters for consistency.

Props dlh.
Fixes #53568.
Built from https://develop.svn.wordpress.org/trunk@51293


git-svn-id: http://core.svn.wordpress.org/trunk@50902 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-01 09:12:59 +00:00
Sergey Biryukov
d999568ae4 Docs: Improve documentation for optional parameters in WP_Theme_JSON methods per the documentation standards.
Additionally:
* Remove an empty line between `@param` and `@return` tags.
* Correct alignment of `@param` tags.

Follow-up to [50959], [50973], [51149], [51284], [51289].

See #52628, #53461.
Built from https://develop.svn.wordpress.org/trunk@51292


git-svn-id: http://core.svn.wordpress.org/trunk@50901 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-30 19:00:58 +00:00
Sergey Biryukov
1b749d971a Docs: Remove an empty line between @param and @return tags in some newly added REST API methods, per the documentation standards.
Follow-up to [48242], [49925], [51003], [51021].

See #52628, #53461.
Built from https://develop.svn.wordpress.org/trunk@51289


git-svn-id: http://core.svn.wordpress.org/trunk@50898 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-30 18:43:58 +00:00
desrosj
9e3049477c Script Loader: Revert [51267].
This was missed in [51268] when reverting [51259-51260,51265].

Props pbiron.
See #53397.
Built from https://develop.svn.wordpress.org/trunk@51288


git-svn-id: http://core.svn.wordpress.org/trunk@50897 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-30 18:26:03 +00:00
Sergey Biryukov
df662d1e24 Coding Standards: Add missing visibility keywords to WP_Theme, WP_Theme_JSON, and WP_Theme_JSON_Resolver tests.
Follow-up to [50959], [50960], [50967].

See #52627.
Built from https://develop.svn.wordpress.org/trunk@51287


git-svn-id: http://core.svn.wordpress.org/trunk@50896 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-30 18:22:57 +00:00
Sergey Biryukov
8f4593b124 Docs: List the expected type first instead of WP_Error in some REST API methods added in 5.8.
Follow-up to [46696], [49929], [50995], [51021].

See #52628, #53461.
Built from https://develop.svn.wordpress.org/trunk@51286


git-svn-id: http://core.svn.wordpress.org/trunk@50895 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-30 17:59:58 +00:00
Sergey Biryukov
e7b6a4dce8 Coding Standards: Remove redundant type casting to array in WP_Query::get_posts().
This brings some consistency with other instances of using `get_post_stati()` in core.

`get_post_stati()` always returns an array, so the type casting is not needed.

Follow-up to [13172].

See #53359.
Built from https://develop.svn.wordpress.org/trunk@51285


git-svn-id: http://core.svn.wordpress.org/trunk@50894 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-30 17:44:58 +00:00
Sergey Biryukov
a58c86abd8 Docs: Improve documentation for optional parameters in WP_Theme_JSON_Resolver methods per the documentation standards.
Move `add_action()` call to `wp-includes/default-filters.php`.

Follow-up to [50959], [51221].

See #52628, #53461.
Built from https://develop.svn.wordpress.org/trunk@51284


git-svn-id: http://core.svn.wordpress.org/trunk@50893 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-30 17:20:58 +00:00
Sergey Biryukov
40ff2751bc Docs: Add missing @since tags for some WP_Theme_JSON methods.
Docs: Update syntax for multi-line comments per the documentation standards.

Follow-up to [50959], [50967], [50973], [51051], [51089], [51149].

See #52628, #53461.
Built from https://develop.svn.wordpress.org/trunk@51283


git-svn-id: http://core.svn.wordpress.org/trunk@50892 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-30 16:23:57 +00:00
Sergey Biryukov
b10b4a2586 Docs: Adjust wp_dashboard_browser_nag() DocBlock per the documentation standards.
Follow-up to [51117], [51119], [51120].

See #52628, #53461.
Built from https://develop.svn.wordpress.org/trunk@51282


git-svn-id: http://core.svn.wordpress.org/trunk@50891 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-30 16:07:57 +00:00
Sergey Biryukov
7884c33821 Docs: Add @ticket references to some WP_Theme_JSON tests.
Follow-up to [50973], [51054].

See #52628, #53461.
Built from https://develop.svn.wordpress.org/trunk@51281


git-svn-id: http://core.svn.wordpress.org/trunk@50890 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-30 15:59:58 +00:00
Sergey Biryukov
598c337f4b Docs: Add missing @since tags for some REST API methods added in 5.8.
Follow-up to [50995], [51021].

See #52628, #53461.
Built from https://develop.svn.wordpress.org/trunk@51280


git-svn-id: http://core.svn.wordpress.org/trunk@50889 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-30 13:58:59 +00:00
Sergey Biryukov
a2f00a677c Docs: Document the globals used in WP_REST_Widget_Types_Controller and WP_REST_Widgets_Controller.
Follow-up to [50995].

See #52628, #53461.
Built from https://develop.svn.wordpress.org/trunk@51279


git-svn-id: http://core.svn.wordpress.org/trunk@50888 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-30 12:55:57 +00:00
Sergey Biryukov
d72eb14abf Docs: Document the globals used in some REST API methods.
See #53399.
Built from https://develop.svn.wordpress.org/trunk@51278


git-svn-id: http://core.svn.wordpress.org/trunk@50887 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-30 12:34:56 +00:00
Sergey Biryukov
ffafbefc36 REST API: Allow multiple widgets to be deleted in a single batch request.
This resets the `WP_Widget::$updated` flag when deleting a widget, to avoid blocking all future updates in a request.

Props noisysocks, andraganescu.
Fixes #53557.
Built from https://develop.svn.wordpress.org/trunk@51277


git-svn-id: http://core.svn.wordpress.org/trunk@50886 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-30 10:41:58 +00:00
Peter Wilson
4c598d36b1 Query: Check each post-type's capabilities when querying multiple post-types.
When querying multiple post types, check the `read_private_posts` capability for each post type when determining which post statuses to return. This ensures private posts appear in search results and archives for users permitted to read them.

Props leogermani, hellofromTonya, jeffpaul, peterwilsoncc.
Fixes #48556.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50885 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-30 05:00:56 +00:00
desrosj
7344160c11 Security: Add 5.8 to the list of versions receiving security updates.
Built from https://develop.svn.wordpress.org/trunk@51274


git-svn-id: http://core.svn.wordpress.org/trunk@50883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-30 04:02:57 +00:00
desrosj
a610e9675b Build/Test Tools: Add the 5.8 branch to the workflow for testing branches.
Built from https://develop.svn.wordpress.org/trunk@51273


git-svn-id: http://core.svn.wordpress.org/trunk@50882 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-30 03:58:58 +00:00
desrosj
4f26a88360 Post branching 5.8 version bump.
`trunk` is now `5.9-alpha`.
Built from https://develop.svn.wordpress.org/trunk@51272


git-svn-id: http://core.svn.wordpress.org/trunk@50881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-30 03:55:56 +00:00
desrosj
2c1f2bf1e4 Post WordPress 5.8 RC1 version bump.
Built from https://develop.svn.wordpress.org/trunk@51270


git-svn-id: http://core.svn.wordpress.org/trunk@50879 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-30 03:44:58 +00:00
desrosj
77d0f6114f WordPress 5.8 RC1.
Built from https://develop.svn.wordpress.org/trunk@51269


git-svn-id: http://core.svn.wordpress.org/trunk@50878 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-30 03:16:56 +00:00
desrosj
8c3e1e9aa8 Build/Test Tools: Revert [51259-51256,51265].
[51259] introduced a PHP notice that was not actually fixed by [51265]. Reverting these changes in order to investigate further.

See #53397.
Built from https://develop.svn.wordpress.org/trunk@51268


git-svn-id: http://core.svn.wordpress.org/trunk@50877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-30 02:14:56 +00:00
desrosj
e7387a9ace Script Loader: Fix PHP notice caused by the viewScript for the core/file block.
This fixes a PHP notice caused by the `viewScript` for the `core/file` block having `.min.js` instead of just `.js`.

`register_block_script_handle()` was incorrectly looking for `view.min.asset.php`, which does not exist, and caused the `_doing_it_wrong()` notice.

This adds a check for `.min.js` in the `viewScript` field of `block.json` and corrects it to `.js` in order to match the expected pattern of `view.asset.php` until a more permanent fix can be created.

Follow up to [51259].

Props ipstenu, pbiron, peterwilsoncc.
See #53397.
Built from https://develop.svn.wordpress.org/trunk@51267


git-svn-id: http://core.svn.wordpress.org/trunk@50876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-30 01:46:57 +00:00
Peter Wilson
1b7cd950ca Upgrade/Install: Notify users of deactivated plugins during upgrade.
This adds a one-off notice to the dashboard in the event WordPress has automatically deactivated a plugin due to incompatibility with the new version of WordPress.

Introduces the new private function `deactivated_plugins_notice()` to display the notice in the dashboard. Introduces the new auto-loaded option `wp_force_deactivated_plugins` to store a list of automatically deactivated plugins; the option is used on both a site and network level.

Follow up to [51180].

Props desrosj, jorbin, azaozz, SergeyBiryukov, peterwilsoncc.
See #53432.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50875 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-30 00:21:58 +00:00
desrosj
8fa45ab8f8 Script Loader: Add file block assets to the svn-ignore list.
These are automatically generated and should not be committed.

Follow up to [51259].

Props gziolo, youknowriad.
See #53397.
Built from https://develop.svn.wordpress.org/trunk@51265


git-svn-id: http://core.svn.wordpress.org/trunk@50874 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-29 19:10:57 +00:00
ryelle
aea10c0c44 Help/About: WordPress 5.8 About Page.
This is the start of the WordPress 5.8 about page, introducing new content and a first pass of the new style.

Props chanthaboune, cbringmann, webcommsat, marybaum, melchoyce, shaunandrews, desrosj, ryelle, oglekler, yvettesonneveld, nalininonstopnewsuk, meher, femkreations, alanjacobmathew, courane01, annezazu, matveb, milana_cap, javiarce, ryokuhi, audrasjb.
See #52775.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50873 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-29 19:06:57 +00:00
Aaron Jorbin
ad14ee34eb Docs: Further Improve documentation for wp_should_load_separate_core_block_assets().
In [51256], the documentation was improved, this further improves it. As scripts are not yet a part of what this function does, they are not mentioned explicitly. Assets is used so that the docs don't need a lot of improvements when scripts do come into play..

Props desrosj, SergeyBiryukov, Jorbin.
See #53505.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50872 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-29 18:45:56 +00:00
desrosj
6fc65b33d5 Script Loader: Use the provided block version when registering styles.
This updates `register_block_style_handle()` to use the `version` value provided in the `$metadata` parameter for non-Core blocks (when present). This removes the requirement to use `filemtime()` to generate a unique version.

When `version` is not defined within `$metadata`, the script version will fallback to using the current version of WordPress.

The block version should be considered similar to the one specified by plugin developers within the header of the main plugin file.

Props hellofromTonya, gziolo, jorbin, desrosj, walbo, aristath.
Fixes #53507.
Built from https://develop.svn.wordpress.org/trunk@51262


git-svn-id: http://core.svn.wordpress.org/trunk@50871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-29 18:24:56 +00:00
youknowriad
2f27f24191 Block Editor: Include the latest fixes targetted for 5.8 RC1.
It includes:

 - Add a label for screen reader in categories block gutenberg#33060
 - Remove "is-dark-theme" rules from mixins. gutenberg#33058
 - Adjust widget form margins in the new widget editor gutenberg#33040
 - [Block Library - Query Loop]: Select first Query Loop found from pattern selection gutenberg#32737

See #53397.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50870 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-29 15:53:43 +00:00
desrosj
d5cf36000b Docs: Correct @since annotation for WP_Block_Type->view_script.
Follow up to [51259].

Props swissspidy.
See #53397.
Built from https://develop.svn.wordpress.org/trunk@51260


git-svn-id: http://core.svn.wordpress.org/trunk@50869 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-29 15:47:58 +00:00
youknowriad
8e08c569c5 Build: Split packages and blocks to their webpack configs.
This also adds support for the viewScript for blocks fixing 
the PDF preview for file blocks.

Props desrosj, gziolo.
See #53397.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-29 15:09:58 +00:00
desrosj
fe87833764 Build/Test Tools: Add the artifacts directory to svn-ignore and .gitignore.
When E2E tests fail, test snapshots with more details about the failure are placed in this folder.

Props isabel_brison.
Fixes #53549.
Built from https://develop.svn.wordpress.org/trunk@51258


git-svn-id: http://core.svn.wordpress.org/trunk@50867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-29 14:45:57 +00:00
Sergey Biryukov
c804143db6 Twenty Seventeen: Avoid JS errors when displaying legacy widgets.
Make sure the `$sidebar` variable is defined and has at least one entry in the array, before adding the `.below-entry-meta` class to elements below the entry meta.

Previously, the theme expected sidebar markup to exist on the page if sidebars are defined, but that markup is missing since only the widget itself and headers/footers of the page are loaded in the iframe used to display legacy widgets (widgets added prior to WordPress 5.8).

Props Clorith, Boniu91, desrosj.
Fixes #53512.
Built from https://develop.svn.wordpress.org/trunk@51257


git-svn-id: http://core.svn.wordpress.org/trunk@50866 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-29 12:57:56 +00:00
Sergey Biryukov
600d611e0d Docs: Improve documentation for wp_should_load_separate_core_block_assets().
This should clarify the purpose of the function and what effect it has on block styles loading.

Props aristath, desrosj, jorbin, SergeyBiryukov.
See #53505.
Built from https://develop.svn.wordpress.org/trunk@51256


git-svn-id: http://core.svn.wordpress.org/trunk@50865 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-29 11:12:02 +00:00
desrosj
186d7c75ea Coding Standards: Apply an alignment fix after composer format.
Follow up to [51254].

See #53375.
Built from https://develop.svn.wordpress.org/trunk@51255


git-svn-id: http://core.svn.wordpress.org/trunk@50864 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-29 00:39:58 +00:00
desrosj
516bc482bd Editor: Prevent block stylesheets from loading when they do not exist.
This fixes an issue where block stylesheets were being loaded even if they did not exist, causing 404 errors. The issue presented itself when the site was choosing to load block assets individually through the `should_load_separate_core_block_assets` filter hook.

This also fixes an issue where non-Core blocks would only be registered if they actually had asset files. This prevents developers from adding additional information to a style handle, such as inline styles through `wp_add_inline_style()`.

Props walbo, jorbin, aristath, desrosj, hellofromTonya.
Fixes #53375.
Built from https://develop.svn.wordpress.org/trunk@51254


git-svn-id: http://core.svn.wordpress.org/trunk@50863 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-29 00:08:57 +00:00
desrosj
fe2bd634e4 Twenty Twenty-One: Ensure Duotone images are displayed correctly in Dark Mode.
This reduces the specificity of the CSS selector applying a dimming effect to images so that the new Duotone feature is properly applied to images.

Props walbo.
Fixes #53531.
Built from https://develop.svn.wordpress.org/trunk@51253


git-svn-id: http://core.svn.wordpress.org/trunk@50862 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-28 23:40:59 +00:00
Clorith
87a427d3f0 Site Health: Improve readability of site titles.
This splits up the site title for the Site Health tabs to make it more obvious what page a user is viewing, and which tab under that page. It also removes a possible source of warnings if a user tries accessing a tab that does not exist.

The introduction of this check for existing tabs also improves the accuracy of the active-tab indicator, ensuring the indicator shows up for the default tab, when no other tab has been selected.

Follow-up to [50764].

Props audrasjb, swissspidy.
Fixes #53535.
Built from https://develop.svn.wordpress.org/trunk@51252


git-svn-id: http://core.svn.wordpress.org/trunk@50861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-28 23:07:57 +00:00
desrosj
ccdb1766ae Themes: Remove mention of “FSE” in Core.
Props aristath, jorbin.
Fixes #53497.
Built from https://develop.svn.wordpress.org/trunk@51251


git-svn-id: http://core.svn.wordpress.org/trunk@50860 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-28 19:11:57 +00:00
youknowriad
687fcda03f Block Editor: Package updates including fixes from Gutenberg for WordPress 5.8 RC1.
This includes the fixes from https://github.com/WordPress/gutenberg/pull/33036

See #53397.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-28 16:01:36 +00:00
Sergey Biryukov
6311baa859 Docs: Update documentation for WP_Widget_Block per the documentation standards.
Remove unused `$post` global reference.

Follow-up to [50995], [51058], [51063], [51221].

See #52628, #53461.
Built from https://develop.svn.wordpress.org/trunk@51249


git-svn-id: http://core.svn.wordpress.org/trunk@50858 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-28 08:35:57 +00:00
noisysocks
7131a90b0a Widgets REST API: Fix non-multi widgets not appearing in wp_inactive_widgets
Registered widgets that do not extend WP_Widget should appear in the
wp_inactive_widgets sidebar by default. Having the widgets REST API call
retrieve_widgets() before serving any request ensures that this will happen.

This is a similar fix to [51235].

Fixes #53534.
Props zieladam, timothyblynjacobs.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-28 04:34:57 +00:00
Clorith
c26143ea2e Site Health: Add a unique wrapper for dashboard widget content.
This wraps the inner-content of the Site Health dashboard widget to give a unique target for CSS selectors, restoring the ability to collapse the widget.

The initial implementation targeted the `.inside` class used by all widgets to apply styling to the widget content, but this prevented the widget from being collapsed, as it added grid-styles which other widgets do not use, overriding the usual behavior when toggling widget visibility.

Follow-up to [50833].

Props alanjacobmathew, walbo.
Fixes #53521.
Built from https://develop.svn.wordpress.org/trunk@51247


git-svn-id: http://core.svn.wordpress.org/trunk@50856 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-27 15:56:58 +00:00
Sergey Biryukov
d18f86031a General: Ensure svn:eol-style is consistently set for all recently added files.
Follow-up to [49135], [49226], [49320], [49478], [49574], [51198].

Fixes #53528.
Built from https://develop.svn.wordpress.org/trunk@51246


git-svn-id: http://core.svn.wordpress.org/trunk@50855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-27 12:46:01 +00:00
Sergey Biryukov
2797ef60da Block Editor: Remove empty blocks/query-loop directory.
The Query Loop block was renamed to Post Template.

Follow-up to [51101].

See #52991.
Built from https://develop.svn.wordpress.org/trunk@51245


git-svn-id: http://core.svn.wordpress.org/trunk@50854 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-27 11:29:00 +00:00
Sergey Biryukov
bf3ebaf60f Docs: Document api_version and variations properties in WP_Block_Type::__construct().
Add `@since` tags for all properties added in WordPress 5.5, 5.6, and 5.8.

Follow-up to [47875], [48117], [49224], [50297], [50419], [50527].

Props mbabker.
Fixes #53518.
Built from https://develop.svn.wordpress.org/trunk@51244


git-svn-id: http://core.svn.wordpress.org/trunk@50853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-26 11:13:56 +00:00
Aaron Jorbin
792955066f Post WordPress 5.8 Beta 4 version bump.
Built from https://develop.svn.wordpress.org/trunk@51243


git-svn-id: http://core.svn.wordpress.org/trunk@50852 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-25 17:10:58 +00:00
Aaron Jorbin
084092a935 WordPress 5.8 Beta 4.
Built from https://develop.svn.wordpress.org/trunk@51242


git-svn-id: http://core.svn.wordpress.org/trunk@50851 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-25 16:49:57 +00:00
youknowriad
be0d5b2534 Block Editor: Update the packages with a number of fixes targeted for Beta 4.
It includes fixes from these two backport PRs: 

 - https://github.com/WordPress/gutenberg/pull/32992
 - https://github.com/WordPress/gutenberg/pull/32956

Props gziolo, ryelle, ntsekouras, desrosj, jorgefilipecosta.
See #53397

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


git-svn-id: http://core.svn.wordpress.org/trunk@50850 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-25 15:52:22 +00:00
youknowriad
578cda50a2 Block Editor: Do not load a default font family for themes with theme.json.
This matches the behavior that has been in place in the gutenberg plugin.
The idea is that this makes the editor match the frontend by default for these themes.
If they use a custom font, they'll have to provide it for the editor as editor styles.

Props nosolosw.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-25 15:32:58 +00:00
desrosj
49a6a14915 REST API: Include the sidebar ID when saving a widget.
This ensures backwards compatibility for code expecting this field to be present.

Props strategio, noisysocks, spacedmonkey.
See #53452.
Built from https://develop.svn.wordpress.org/trunk@51239


git-svn-id: http://core.svn.wordpress.org/trunk@50848 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-25 15:25:59 +00:00
desrosj
5e2b659090 Widgets: Avoid a TypeError when adding a widget in the Customizer.
This fixes a bug where `action` is set to `null` when adding a widget in the Customizer.

Fixes #53488. See #53421, #53419.
Built from https://develop.svn.wordpress.org/trunk@51238


git-svn-id: http://core.svn.wordpress.org/trunk@50847 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-25 14:50:58 +00:00
desrosj
eeb8c63240 Docs: Various filter docblock improvements.
Follow up to [50776], [50956], [50983].

See #52920.
Built from https://develop.svn.wordpress.org/trunk@51237


git-svn-id: http://core.svn.wordpress.org/trunk@50846 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-25 14:40:57 +00:00
desrosj
fe473ccdee Twenty Twenty-One: Use the theme version when enqueueing theme assets.
This avoids having to interact with the filesystem and ensures browser and proxy caches are only cleared when the file is actually updated.

Props peterwilsoncc, ryelle, aristath, SergeyBiryukov.
Fixes #53502.
Built from https://develop.svn.wordpress.org/trunk@51236


git-svn-id: http://core.svn.wordpress.org/trunk@50845 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-25 13:37:57 +00:00
TimothyBlynJacobs
dc710243a3 REST API: Retrieve latest widgets before loading sidebars.
This fixes issues where sidebars would be unexpectedly missing from the new widgets screen. Running retrieve_widgets syncs sidebars that were registered after the last theme switch.

Props walbo, hellofromTonya, noisysocks.
Fixes #53489.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50844 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-25 13:18:58 +00:00
Sergey Biryukov
4b17d6b3e9 Tests: Correct PHPUnit version requirement in tests using ::createPartialMock().
The method was introduced in PHPUnit 5.5, not 6.0.

Follow-up to [48945], [48947] [51226].

See #52625.
Built from https://develop.svn.wordpress.org/trunk@51234


git-svn-id: http://core.svn.wordpress.org/trunk@50843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-25 10:40:00 +00:00
ryelle
1a7033e75f Twenty Twenty-One: Add spacing around Query block when there is a background color.
Props scruffian, desrosj, poena.
See #53398.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50842 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-25 01:48:57 +00:00
desrosj
767be550d7 Widgets: Fix an “Invalid value” warning when adding a new widget in the Customizer.
This fixes a regression introduced in [50996] where sites that have been opted-out of the block-based widget editor experienced an “Invalid value.” error when adding a new widget to a sidebar in the Customizer.

This was caused by the early return value was changed to `null` from `$value` when set to an empty `array`, resulting in the widget being evaluated as invalid elsewhere.

Props jamesros161, caseymilne, naoki0h, ixkaito, zieladam, noisysocks, hellofromTonya.
Fixes #53479.
Built from https://develop.svn.wordpress.org/trunk@51232


git-svn-id: http://core.svn.wordpress.org/trunk@50841 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-25 00:08:58 +00:00
desrosj
2f063a72f2 Twenty Twenty: Remove extra margin within the Query Loop block.
Props ryelle, Clorith.
See #53482.
Built from https://develop.svn.wordpress.org/trunk@51231


git-svn-id: http://core.svn.wordpress.org/trunk@50840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-24 23:22:58 +00:00
Sergey Biryukov
4381bf2ef6 Coding Standards: Fix WPCS issues in [51227].
This fixes a "Tabs must be used to indent lines; spaces are not allowed" error.

See #53475.
Built from https://develop.svn.wordpress.org/trunk@51230


git-svn-id: http://core.svn.wordpress.org/trunk@50839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-24 20:55:58 +00:00
desrosj
fd27b43fba Coding Standards: Apply an alignment fix from running composer format.
Follow up to [51216].
See #53481.
Built from https://develop.svn.wordpress.org/trunk@51229


git-svn-id: http://core.svn.wordpress.org/trunk@50838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-24 19:25:58 +00:00
desrosj
90790365ba Widgets: Add missing label and description to Customizer controls.
This fixes a bug where the “Move To” dialogue was empty when a theme has multiple widget areas.

Props kevin940726, noisysocks, hellofromTonya.
Fixes #53487.
Built from https://develop.svn.wordpress.org/trunk@51228


git-svn-id: http://core.svn.wordpress.org/trunk@50837 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-24 19:20:58 +00:00
Andrew Ozz
936a38255b Media: Prevent uploading and show an error message when the server doesn't support editing of WebP images, take II. Add new, better error message for it.
Props antpb, joedolson, iandunn, azaozz.
Fixes #53475.
Built from https://develop.svn.wordpress.org/trunk@51227


git-svn-id: http://core.svn.wordpress.org/trunk@50836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-24 19:12:00 +00:00
Sergey Biryukov
09fda454d0 Tests: Require PHPUnit >= 6 in tests using ::createPartialMock().
This avoids a "Call to undefined method" fatal error when running the tests with PHPUnit 5.4.x, which WordPress still supports as the minimum version.

Follow-up to [48945], [48947].

See #52625.
Built from https://develop.svn.wordpress.org/trunk@51226


git-svn-id: http://core.svn.wordpress.org/trunk@50835 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-24 10:05:59 +00:00
Sergey Biryukov
3d601880d2 Tests: Use assertSame() in _wp_to_kebab_case() tests.
This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.

Follow-up to [51079], [51198].

See #52482, #52625, #53397.
Built from https://develop.svn.wordpress.org/trunk@51225


git-svn-id: http://core.svn.wordpress.org/trunk@50834 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-24 06:52:58 +00:00
joedolson
c17e2baa80 Media: Correct undefined variable in wp_ajax_query_attachments.
Fix a misnamed variable introduced in [51145]. Change `$query_args` to correctly defined variable `$query`.

Follow-up to [51145].

props desrosj, audrasjb.
Fixes #50105.
Built from https://develop.svn.wordpress.org/trunk@51224


git-svn-id: http://core.svn.wordpress.org/trunk@50833 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-23 22:47:59 +00:00
iandunn
3801e9818a Media: Revert r51211 to restore ms-files.php assets.
r51211 accidentally introduced a fatal error for Multisite instances with `ms_files_rewriting` enabled. Reverting removes the error, and the original purpose of the commit can be solved in another way.

Props otto42, barry, ryelle, azaozz.
Fixes #53492. See #53475.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50832 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-23 22:20:59 +00:00
desrosj
5acf559613 Docs: Remove inaccurate @since tag.
Follow up to [50829,50831,51145,51147].

Props johnbillion.
Fixes #53461. See #50105.
Built from https://develop.svn.wordpress.org/trunk@51222


git-svn-id: http://core.svn.wordpress.org/trunk@50831 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-23 19:09:56 +00:00
desrosj
fccc020d29 Docs: Various docblock corrections for code added in 5.8.
Props johnbillion.
See #53461.
Built from https://develop.svn.wordpress.org/trunk@51221


git-svn-id: http://core.svn.wordpress.org/trunk@50830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-23 19:05:57 +00:00
Sergey Biryukov
a048ac3ccd Tests: Replace assertEquals() with assertSameSets() in text widget tests.
This ensures that not only the array values being compared are equal, but also that their type is the same.

Going forward, stricter type checking by using `assertSame()`, `assertSameSets()`, or `assertSameSetsWithIndex()` should generally be preferred, to make the tests more reliable.

Follow-up to [40631], [41132], [48939], [51137].

See #52482, #52625.
Built from https://develop.svn.wordpress.org/trunk@51220


git-svn-id: http://core.svn.wordpress.org/trunk@50829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-23 16:00:59 +00:00
noisysocks
6ec11e6b55 Widgets: Remove unnecessary gutenberg_ functions
Removes temporary gutenberg_ functions which were required by the Legacy Widget
block until the Legacy Widget block was updated in [51149].

Follows [50996].
Fixes #53441.
Props spacedmonkey.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-23 03:47:58 +00:00
desrosj
74c1893ae0 Post WordPress 5.8 Beta 3 version bump.
Built from https://develop.svn.wordpress.org/trunk@51218


git-svn-id: http://core.svn.wordpress.org/trunk@50827 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-23 02:15:59 +00:00
desrosj
986fecb9ff WordPress 5.8 Beta 3.
Built from https://develop.svn.wordpress.org/trunk@51217


git-svn-id: http://core.svn.wordpress.org/trunk@50826 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-23 01:45:57 +00:00
noisysocks
0bf96b88d3 Widgets: Fix widget preview not working if widget registered via a instance
The register_widget function can be called with a class name or a class
instance. Once called with a class instance, the class instance is converted to
hash as used key in array.

Props spacedmonkey, zieladam.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-23 01:34:58 +00:00
desrosj
b588426f96 Docs: Fix typo in widgets-block-editor feature documentation.
Follow up to [51214].
Unprops desrosj.
See #53424.
Built from https://develop.svn.wordpress.org/trunk@51215


git-svn-id: http://core.svn.wordpress.org/trunk@50824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-23 01:10:57 +00:00
desrosj
94c655c892 Widgets: Add support for the Widgets Editor on after_setup_theme instead of widgets_init.
This better aligns with developer expectations, as `add_theme_support()` and `remove_theme_support()` are meant to be called within functions attached to the `after_setup_theme` hook.

This also adds the `widgets-block-editor` feature to the docblock for `add_theme_support()`. 

Props kevin940726, caseymilne, jamesros161, noisysocks, Mamaduka, audrasjb, zieladam, hellofromTonya, desrosj.
Fixes #53424.
Built from https://develop.svn.wordpress.org/trunk@51214


git-svn-id: http://core.svn.wordpress.org/trunk@50823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-23 01:08:58 +00:00
desrosj
821327ca70 Editor: Correct variable names in get_block_editor_settings().
Incorrect variable names were leading to unreachable conditional statements.

Follow up to [51149].

Props johnbillion, mukesh27.
See #53458.
Built from https://develop.svn.wordpress.org/trunk@51213


git-svn-id: http://core.svn.wordpress.org/trunk@50822 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-23 00:26:58 +00:00
desrosj
c54b44e75a Build/Test Tools: Add the regenerator-runtime script as a dependency to wp-polyfill.
In [51146], the `core-js` package replaced the deprecated `@babel//polyfill` one. The `core-js` package builds `wp-polyfill` from a configuration provided by `@wordpress/babel-preset-default` instead of copying a one size fits all polyfill.

That change caused an issue where plugins and themes relying on the `regenerator-runtime` script being included in the `wp-polyfill.js` file encountering fatal JavaScript errors.

This adds the `regenerator-runtime` package to Core and registers it as a dependency for `wp-polyfill`. While Core does not require `regenerator-runtime`, it will allow for a smoother transition to using `core-js`.

This dependency will be removed in a future version of WordPress, so developers are encouraged to add `regenerator-runtime` as a dependency for any custom script that requires it.

Follow up to [51146].

Props gziolo, herregroen, jeherve, hellofromtonya, peterwilsoncc.
Fixes #52941.
Built from https://develop.svn.wordpress.org/trunk@51212


git-svn-id: http://core.svn.wordpress.org/trunk@50821 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-23 00:06:13 +00:00
Andrew Ozz
e93093f7ed Media: Prevent uploading and show an error message when the server doesn't support editing of WebP files and image sub-sizes cannot be created.
Props adamsilverstein, desrosj, azaozz
Fixes #53475
Built from https://develop.svn.wordpress.org/trunk@51211


git-svn-id: http://core.svn.wordpress.org/trunk@50820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-22 23:12:57 +00:00
desrosj
48e31b23f5 Docs: Shorten the copyright notice for the WP_REST_Sidebars_Controller class.
The class has been heavily modified from the original source, so the copyright can be modified to simply reference the original author’s work. The carry forward of the copyright and original code is implied.

Follow up to [50993-50995,51007,51020,51029].

Props SergeyBiryukov, cbringmann, chanthaboune, desrosj.
Fixes #41683.
Built from https://develop.svn.wordpress.org/trunk@51210


git-svn-id: http://core.svn.wordpress.org/trunk@50819 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-22 23:05:58 +00:00
ryelle
0638de4c60 Twenty Nineteen: Update margins on full- and wide-aligned blocks in the editor.
Previously, full width blocks would cause a horizontal scrollbar, and nesting full width blocks would cause the content to be pulled off the screen. Now wide and full width blocks can be nested without any visual issues.

Props aleperez92, Boniu91, onemaggie, hellofromTonya.
Fixes #53428.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-22 22:15:57 +00:00
iandunn
479e9847ed Block Editor: Move caching to endpoint for unique responses.
Now that the pattern API request includes the locale and version, the cache key needs to contain a hash of the query args.

Props ocean90, dd32, timothyblynjacobs
Fixes #53435

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


git-svn-id: http://core.svn.wordpress.org/trunk@50817 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-22 21:24:58 +00:00
Felix Arntz
c94c954d02 Media: Add lazy-loading support to block-based widgets.
This changeset adds the `wp_filter_content_tags()` function as a filter to `widget_block_content`.

Props spacedmonkey, walbo, daisyo.
Fixes #53463, #53464.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-22 21:23:57 +00:00
iandunn
0f249041f9 Block Editor: Send locale, version with remote pattern requests.
This information is needed by the w.org API for translation and caching.

Props dd32, ryelle, tellyworth
See #53435

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


git-svn-id: http://core.svn.wordpress.org/trunk@50815 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-22 21:21:57 +00:00
ryelle
0a2b52dfeb Bundled Themes: Improve display of blocks in widget areas.
Fixes minor styling issues, mostly font size and spacing, in blocks used in widget areas. Changes made to Twenty Ten, Twenty Thirteen, Twenty Fourteen, Twenty Sixteen, Twenty Seventeen, and Twenty Twenty-One.

Props noisysocks, sumaiyasiddika, danieldudzic, scruffian, jffng.
Fixes #53422.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50814 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-22 20:14:59 +00:00
Sergey Biryukov
68af562077 Code Modernization: Use a consistent check for parent items in WP_Walker.
This affects the `::walk()`, `::paged_walk()`, and `::get_number_of_root_elements()` methods.

PHP 8 changes the way string to number comparisons are performed: https://wiki.php.net/rfc/string_to_number_comparison

In particular, checking if an empty string is equal to zero in PHP 8 evaluates to `false`, not `true`.

For the `WP_Walker` class, this resulted in an incorrect handling of parent items in a few methods.

By explicitly checking for an `empty()` value instead, we make sure the check works as expected in PHP 8 and earlier versions.

Follow-up to [35876], [48960], [49043], [49076].

Props sunxiyuan, aristath, SergeyBiryukov.
Fixes #53474.
Built from https://develop.svn.wordpress.org/trunk@51204


git-svn-id: http://core.svn.wordpress.org/trunk@50813 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-22 19:09:00 +00:00
desrosj
8ea2e04925 Editor: Allow custom-units to be an array.
The changes in [50959] introduced an issue where `custom_units` was always being coerced into a boolean value. This should support `array` values.

Props kraftner, youknowriad, nosolosw, jorgefilipecosta.
Fixes #53472.
Built from https://develop.svn.wordpress.org/trunk@51203


git-svn-id: http://core.svn.wordpress.org/trunk@50812 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-22 17:16:58 +00:00
desrosj
b32d8c1bf6 Widgets: Stop loading wp-editor and the Block Directory assets on the widgets screen.
When using the text widget, a `wp.editor.initialize is not a function` notice is encountered. This happens when `wp-editor` is loaded as a dependency, which assigns `wp.oldEditor = wp.editor` and then redefines `wp.editor`.

`wp-editor` is only used for the Classic block, which is not supported in the new widgets editor. [51198-51199] updated `@wordpress/block-library` to remove `wp-editor` as a dependency, but it’s still listed as a dependency of the `wp-block-directory` script handle.

Since the Block directory is not supported within the widgets editor, the related assets can safely be blocked from enqueueing.

Props noisysocks, gziolo, Mamaduka, mkaz.
Fixes #53437. See #53397.
Built from https://develop.svn.wordpress.org/trunk@51202


git-svn-id: http://core.svn.wordpress.org/trunk@50811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-22 16:56:56 +00:00
ryelle
8a11188d0f Twenty Twenty-One: Add margins around content in Post Template block.
Props desrosj, joen.
See #53389, #53398.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50810 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-22 16:55:58 +00:00
desrosj
5259b18f50 Widgets: Add editor styles to the widgets block editor.
This updates the widgets screen to load the editor styles in the same way as the post editor. This combined with the package updates in [51198] and [51199] ensures that the blocks added to sidebars more accurately reflect what will be displayed on the front end of the site.

Props isabel_brison, noisysocks, andraganescu, audrasjb, jorbin, caseymilne, desrosj.
Fixes #53344. See #53388.
Built from https://develop.svn.wordpress.org/trunk@51200


git-svn-id: http://core.svn.wordpress.org/trunk@50809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-22 13:33:58 +00:00
jorgefilipecosta
ab25191895 Block Editor: Package updates for Beta 3.
The commit updates the WordPress packages for beta 3.

Props nosolosw, noisysocks, youknowriad.
See #53397.
Built from https://develop.svn.wordpress.org/trunk@51199


git-svn-id: http://core.svn.wordpress.org/trunk@50808 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-22 10:00:50 +00:00
jorgefilipecosta
6db7930147 Ports theme.json changes for beta 3.
- Add _wp_to_kebab_case function
- Add CSS Custom Properties within preset classes.

Props nosolosw.
See #53397.
Built from https://develop.svn.wordpress.org/trunk@51198


git-svn-id: http://core.svn.wordpress.org/trunk@50807 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-22 09:51:00 +00:00
Peter Wilson
0d8727bec8 Themes: Improve Gutenberg check before activating an FSE theme.
Account for sites enabling Gutenberg as an mu-plugin when determining whether full-site-editing themes can be enabled. This replaces the check the plugin is active with a check whether the function `gutenberg_is_fse_theme()` is defined.

Follow up to [51193].

Props noisysocks, peterwilsoncc, SergeyBiryukov.
See #53410.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-22 05:56:57 +00:00
Sergey Biryukov
e84cfe850d Tests: Use more appropriate assertions in a few tests.
Follow-up to [34804], [41376], [50959], [51124].

See #52625.
Built from https://develop.svn.wordpress.org/trunk@51196


git-svn-id: http://core.svn.wordpress.org/trunk@50805 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-22 04:35:59 +00:00
antpb
b2c449b1ec Media: Improve upload page media item layout on smaller screens.
This allows smaller screens to wrap error messages and other uploader media item elements in a more readable way.

Props joedolson sabernhardt, Presskopp.
See #51754.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-22 04:26:58 +00:00
desrosj
84ee1c9de5 Themes: Remove unexpected border around the Theme Details button.
After [51083], the Theme Details button is now displaying a border unintentionally. This removes it.

Props ryelle.
Fixes #53473.
Built from https://develop.svn.wordpress.org/trunk@51194


git-svn-id: http://core.svn.wordpress.org/trunk@50803 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-22 04:03:57 +00:00
desrosj
94841ace05 Themes: Prevent a Full Site Editing theme from being activated when Gutenberg is not active.
When a theme that uses the Full Site Editing feature is activated and the Gutenberg plugin is not present, the site will currently show a text notice on the front end. The user is not made aware of this unless they visit the front end of their site.

This adds a check that will prevent a theme from being activated when the `full-site-editing` tag is present in the theme’s `style.css` header and the Gutenberg plugin is not active to prevent this scenario.

These checks can be removed once Full Site Editing is completely merged into Core.

Props desrosj, marybaum, chanthaboune.
See #53410.
Built from https://develop.svn.wordpress.org/trunk@51193


git-svn-id: http://core.svn.wordpress.org/trunk@50802 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-22 02:59:56 +00:00
desrosj
52e1e2cc2f Twenty Thirteen: Improve the display of the Query Loop block.
This fixes an issue where Query Loop blocks were displayed with list bullets and extra `padding-left`.

Props AlePerez92, scruffian, ryelle.
Fixes #53438.
Built from https://develop.svn.wordpress.org/trunk@51192


git-svn-id: http://core.svn.wordpress.org/trunk@50801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-21 23:39:56 +00:00
joedolson
d5c9c310e7 Media: Update total attachment count when media added or removed.
Add handlers to increment the total attachments count for the media collection when an item is added or removed.

props adamsilverstein.
Fixes #53171.
Built from https://develop.svn.wordpress.org/trunk@51191


git-svn-id: http://core.svn.wordpress.org/trunk@50800 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-21 20:46:02 +00:00
Sergey Biryukov
dc51282844 Users: Escape get_author_posts_url() link in wp_list_authors().
This is consistent with `get_the_author_posts_link()`.

Props chintan1896.
Fixes #50698.
Built from https://develop.svn.wordpress.org/trunk@51190


git-svn-id: http://core.svn.wordpress.org/trunk@50799 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-21 06:06:57 +00:00
Sergey Biryukov
19f8ac491d Administration: Consistently escape network_admin_url() links.
Follow-up to [51177].

Props chintan1896, mukesh27.
Fixes #53459.
Built from https://develop.svn.wordpress.org/trunk@51189


git-svn-id: http://core.svn.wordpress.org/trunk@50798 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-21 04:30:56 +00:00
Sergey Biryukov
ca5f990078 Docs: Correct @since version in the wp-includes/version.php file header.
There was no public release of WordPress 1.1.

Follow-up to [803], [43662].

See #52628.
Built from https://develop.svn.wordpress.org/trunk@51188


git-svn-id: http://core.svn.wordpress.org/trunk@50797 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-21 04:29:56 +00:00
joedolson
daa1cbbbfe Media: Adapt response shape depending on type of query.
Restore inheriting the backbone fetch in the media library and adapt the AJAX response according to the action performed in the media query.

In [51145], the response shape was restored to the original shape, and a custom fetch was added to handle assigning the totalAttachments information in the collection. The custom fetch triggered a new set of bugs relating to zero-sized collections and loading individual images. 

props adamsilverstein, ryelle, peterwilsoncc, Presskopp, desrosj.
Fixes #53421, #53419.
Built from https://develop.svn.wordpress.org/trunk@51187


git-svn-id: http://core.svn.wordpress.org/trunk@50796 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-20 23:27:01 +00:00
Sergey Biryukov
21bb743811 Tests: Use more appropriate assertions in clean_dirsize_cache() tests.
Follow-up to [49212], [49616], [49628], [49630].

See #52625.
Built from https://develop.svn.wordpress.org/trunk@51186


git-svn-id: http://core.svn.wordpress.org/trunk@50795 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-20 00:25:59 +00:00
Sergey Biryukov
0e5a98eec5 Docs: Correct DocBlock formatting for Core_Upgrader::upgrade().
Document the `$auto_update_settings` parameter of the `after_core_auto_updates_settings` action.

Follow-up to [49254].

See #52628.
Built from https://develop.svn.wordpress.org/trunk@51185


git-svn-id: http://core.svn.wordpress.org/trunk@50794 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-19 21:37:57 +00:00
Sergey Biryukov
6c01c2a864 Docs: Add a reference to WP_Site_Query::__construct() for information on accepted arguments in get_sites().
Synchronize the documentation between two places, use `WP_Site_Query::__construct()` as the canonical source.

Follow-up to [37616].

Props birgire, felipeelia, audrasjb.
Fixes #42156.
Built from https://develop.svn.wordpress.org/trunk@51184


git-svn-id: http://core.svn.wordpress.org/trunk@50793 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-19 20:57:01 +00:00
Sergey Biryukov
5f30098a1d REST API: Decode single and double quote entities in widget names and descriptions.
Follow-up to [51174], [51175].

Props ocean90, ramonopoly.
Fixes #53407.
Built from https://develop.svn.wordpress.org/trunk@51183


git-svn-id: http://core.svn.wordpress.org/trunk@50792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-18 15:52:56 +00:00
Sergey Biryukov
e127bcde70 Themes: Make sure get_file_data() recognizes headers prefixed by <?php tag.
This allows for using headers in the format of `<?php // Template Name: Something ?>`, which previously could not be recognized correctly.

Props dd32, m_uysl, thomas-vitale, boblinthorst.
Fixes #33387.
Built from https://develop.svn.wordpress.org/trunk@51182


git-svn-id: http://core.svn.wordpress.org/trunk@50791 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-18 14:03:58 +00:00
Sergey Biryukov
87c740b086 Tests: Correct svn:eol-style property for test data with CR line endings.
Follow-up to [703/tests], [704/tests], [46586].

See #52625.
Built from https://develop.svn.wordpress.org/trunk@51181


git-svn-id: http://core.svn.wordpress.org/trunk@50790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-18 13:58:58 +00:00
Sergey Biryukov
4ccc58801d Upgrade/Install: Deactivate the Gutenberg plugin if its version is 10.7 or lower.
This avoids a fatal error due to `WP_Block_Template` class redeclaration when updating to WordPress 5.8 with an older version of Gutenberg activated.

Follow-up to [35582] for the REST API plugin.

Props hellofromTonya, oglekler, azaozz, desrosj, pbiron, jorbin, youknowriad, TimothyBlynJacobs, Clorith, markparnell.
See #53432.
Built from https://develop.svn.wordpress.org/trunk@51180


git-svn-id: http://core.svn.wordpress.org/trunk@50789 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-18 12:14:01 +00:00
desrosj
7369505689 Build/Test Tools: Use Git when fetching the WordPress Importer for use in tests.
This switches to using Git in the local Docker environment install script to check out a copy of the WordPress Importer plugin for use in unit tests.

Previously, SVN was used and the commands were not correctly run within the Docker container. The container does not actually have SVN installed, and the script was only working when the machine running the command had SVN present.

Props czapla, alexstine, jnylen0, francina, desrosj.
Fixes #52909.
Built from https://develop.svn.wordpress.org/trunk@51179


git-svn-id: http://core.svn.wordpress.org/trunk@50788 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-17 17:58:57 +00:00
Sergey Biryukov
7d3b5dfb17 Coding Standards: Bring some consistency to HTML formatting in wp-admin/comment.php.
See #52627.
Built from https://develop.svn.wordpress.org/trunk@51178


git-svn-id: http://core.svn.wordpress.org/trunk@50787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-17 14:49:58 +00:00
Sergey Biryukov
6a163e199a Administration: Consistently escape admin_url() links.
Props chintan1896, mukesh27.
Fixes #53426.
Built from https://develop.svn.wordpress.org/trunk@51177


git-svn-id: http://core.svn.wordpress.org/trunk@50786 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-17 14:37:00 +00:00
Sergey Biryukov
1a5a8c23b8 Editor: Include Cover block in the list of block types registered using metadata files.
This ensures that block stylesheets are rendered properly when `should_load_separate_core_block_assets` filter is turned on.

Follow-up to [50824], [50836].

Props walbo.
Fixes #53440.
Built from https://develop.svn.wordpress.org/trunk@51176


git-svn-id: http://core.svn.wordpress.org/trunk@50785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-17 11:57:56 +00:00
Sergey Biryukov
29ba355256 Coding Standards: Fix WPCS issue in [51174].
See #53407.
Built from https://develop.svn.wordpress.org/trunk@51175


git-svn-id: http://core.svn.wordpress.org/trunk@50784 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-17 11:33:58 +00:00
Sergey Biryukov
9f1145b8ae REST API: Decode HTML entities in widget names and descriptions in widget types controller.
Follow-up to [50995].

Props ramonopoly, noisysocks, spacedmonkey, justinahinon, audrasjb, SergeyBiryukov.
Fixes #53407.
Built from https://develop.svn.wordpress.org/trunk@51174


git-svn-id: http://core.svn.wordpress.org/trunk@50783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-17 11:30:00 +00:00
desrosj
fcd47d289e Build/Test Tools: Ignore sourceMaps for non WordPress Core files.
If a custom plugin or theme exists in the `build/wp-content` directory with a sourcemap, the build` script is currently returning a warning and failing.

This improves the `verify:source-maps` task in Grunt to ignore directories and files that do not belong to WordPress Core.

Props ryelle, afragen, johnbillion.
Fixes #52689.
Built from https://develop.svn.wordpress.org/trunk@51173


git-svn-id: http://core.svn.wordpress.org/trunk@50782 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-16 22:57:59 +00:00
Sergey Biryukov
f6bff0572f Tests: Make some optional parameters required in unit tests for previous/next attachment links.
This resolves a "Deprecated: Required parameter follows optional parameter" notice on PHP 8.

Follow-up to [48794], [51122].

See #45708, #52625.
Built from https://develop.svn.wordpress.org/trunk@51172


git-svn-id: http://core.svn.wordpress.org/trunk@50781 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-16 17:31:59 +00:00
Sergey Biryukov
07737d2d8d External Libraries: Upgrade PHPMailer to version 6.5.0.
Release notes: https://github.com/PHPMailer/PHPMailer/releases/tag/v6.5.0

For a full list of changes in this update, see the PHPMailer GitHub:
https://github.com/PHPMailer/PHPMailer/compare/v6.4.1...v6.5.0

Props ayeshrajans, Synchro.
Fixes #53430.
Built from https://develop.svn.wordpress.org/trunk@51169


git-svn-id: http://core.svn.wordpress.org/trunk@50778 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-16 17:02:59 +00:00
Sergey Biryukov
b27fbee0f3 Docs: Update syntax for some multi-line comments per the documentation standards.
Follow-up to [51003], [51149].

See #52628.
Built from https://develop.svn.wordpress.org/trunk@51168


git-svn-id: http://core.svn.wordpress.org/trunk@50777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-16 09:42:56 +00:00
Sergey Biryukov
5ffd5d6e9b Editor: Check if supports metadata key is defined before migrating typography keys.
This avoids an "Undefined index" PHP notice on blocks without a `supports` key in `block.json`.

Follow-up to [51089], [51153], [51159]. 

Props walbo.
Fixes #53416.
Built from https://develop.svn.wordpress.org/trunk@51167


git-svn-id: http://core.svn.wordpress.org/trunk@50776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-15 21:37:58 +00:00
Sergey Biryukov
d32aa67e80 Docs: Update syntax for multi-line comment in wp_generate_attachment_metadata() per the documentation standards.
Follow-up to [23766], [25968], [35554], [51162].

Props hellofromTonya.
Fixes #52603.
Built from https://develop.svn.wordpress.org/trunk@51166


git-svn-id: http://core.svn.wordpress.org/trunk@50775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-15 19:10:58 +00:00
desrosj
282a246085 Post WordPress 5.8 Beta 2 version bump.
Built from https://develop.svn.wordpress.org/trunk@51165


git-svn-id: http://core.svn.wordpress.org/trunk@50774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-15 18:05:58 +00:00
desrosj
5ff9de5830 WordPress 5.8 Beta 2.
Built from https://develop.svn.wordpress.org/trunk@51164


git-svn-id: http://core.svn.wordpress.org/trunk@50773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-15 17:40:57 +00:00
Sergey Biryukov
8bb6b05d78 Quick/Bulk Edit: Ensure that $post_ids variable is initialized ahead of usage.
This brings some consistency between similar fragments of `wp-admin/edit.php` and `wp-admin/upload.php`.

Follow-up to [51111], [51161].

See #39589, #53411.
Built from https://develop.svn.wordpress.org/trunk@51163


git-svn-id: http://core.svn.wordpress.org/trunk@50772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-15 17:04:56 +00:00
Sergey Biryukov
4803207ba1 Media: Make sure wp_generate_attachment_metadata() always returns an array.
This matches the documentation for the filter of the same name.

Previously, the function could return `false` for an audio or video attachment that does not exist in the local filesystem.

Props Chouby, SergeyBiryukov.
Fixes #52603.
Built from https://develop.svn.wordpress.org/trunk@51162


git-svn-id: http://core.svn.wordpress.org/trunk@50771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-15 16:52:56 +00:00
davidbaumwald
870a494015 Media: Ensure $post_ids is evaluated properly when processing bulk actions.
After [51111], the `$post_ids` variable is now initialized as an empty array when processing a bulk action.  As such, the original check using `isset` on `$post_ids` will always evaluate to `true`.  This change swaps the `isset` checks for `empty` to check array length instead.

Props david.binda, hellofromTonya.
Fixes #53411.
Built from https://develop.svn.wordpress.org/trunk@51161


git-svn-id: http://core.svn.wordpress.org/trunk@50770 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-15 16:51:59 +00:00
Sergey Biryukov
84d822fc46 I18N: Remove redundant default text domain parameter in some __() calls.
Follow-up to [43919], [44262], [48141], [50259].

See #52627.
Built from https://develop.svn.wordpress.org/trunk@51160


git-svn-id: http://core.svn.wordpress.org/trunk@50769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-15 16:16:57 +00:00
Sergey Biryukov
200a5058e0 Docs: Add missing documentation for wp_migrate_old_typography_shape().
Follow-up to [51089].

See #52991, #52628.
Built from https://develop.svn.wordpress.org/trunk@51159


git-svn-id: http://core.svn.wordpress.org/trunk@50768 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-15 16:04:58 +00:00
Sergey Biryukov
0def70a94c Coding Standards: Use consistent formatting for _wp_posts_page_notice() and _wp_block_editor_posts_page_notice().
Remove redundant casting to `int` for post ID, which is always an integer.

Follow-up to [51116].

See #45537, #52627.
Built from https://develop.svn.wordpress.org/trunk@51158


git-svn-id: http://core.svn.wordpress.org/trunk@50767 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-15 15:50:58 +00:00
Sergey Biryukov
4811dad603 I18N: Use consistent pattern for placeholder references in translator comments for some bundled theme strings.
Follow-up to [42827], [44562], [50234].

See #52628.
Built from https://develop.svn.wordpress.org/trunk@51157


git-svn-id: http://core.svn.wordpress.org/trunk@50766 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-15 15:38:57 +00:00
youknowriad
b018c55899 Block Editor: Second batch of fixes for 5.8 beta 2
This includes:

 - Fix regression emptying post content block in template mode.
 - Legacy Widget: Don't display "No preview" when widget has image tags.

See #53397. 

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


git-svn-id: http://core.svn.wordpress.org/trunk@50765 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-15 15:30:24 +00:00
Sergey Biryukov
aed608b98c Coding Standards: Remove a one-time $message variable in WordPress version requirement notices for bundled themes.
This makes the formatting of these messages more consistent.

Follow-up to [23816], [51154].

See #52627.
Built from https://develop.svn.wordpress.org/trunk@51155


git-svn-id: http://core.svn.wordpress.org/trunk@50764 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-15 15:24:58 +00:00
Sergey Biryukov
e05ffb46a5 Coding Standards: Remove a one-time $message variable in some _doing_it_wrong() calls.
This brings some consistency with most other calls.

Follow-up to [23378], [25605], [34745], [36219], [44108], [46111], [48156].

See #52627.
Built from https://develop.svn.wordpress.org/trunk@51154


git-svn-id: http://core.svn.wordpress.org/trunk@50763 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-15 15:22:58 +00:00
Sergey Biryukov
4d3ddd056f Editor, I18N: Remove code from a translatable string in wp_migrate_old_typography_shape().
Replace a `trigger_error()` call with `_doing_it_wrong()` for consistency with how similar messages are displayed elsewhere in core.

Follow-up to [51089].

See #52991.
Built from https://develop.svn.wordpress.org/trunk@51153


git-svn-id: http://core.svn.wordpress.org/trunk@50762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-15 14:02:59 +00:00
Sergey Biryukov
408db6120e Docs: Document the VALID_ORIGINS constant in WP_Theme_JSON.
Follow-up to [51149].

See #52628.
Built from https://develop.svn.wordpress.org/trunk@51152


git-svn-id: http://core.svn.wordpress.org/trunk@50761 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-15 11:25:08 +00:00
Sergey Biryukov
6276e68c6c Docs: Document the usage of $wp_embed global in WP_oEmbed_Controller::get_proxy_item().
Follow-up to [48135].

Fixes #52628.
Built from https://develop.svn.wordpress.org/trunk@51151


git-svn-id: http://core.svn.wordpress.org/trunk@50760 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-15 10:24:57 +00:00
Sergey Biryukov
aba17cd9ea Docs: Document the usage of $_wp_current_template_content global in a few block template functions.
Follow-up to [51003], [51149].

See #52628.
Built from https://develop.svn.wordpress.org/trunk@51150


git-svn-id: http://core.svn.wordpress.org/trunk@50759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-15 10:21:57 +00:00
youknowriad
c114304471 Block Editor: Update the WordPress packages with the fixes for 5.8 beta 2.
This includes:

**Various**

 - Fix multi selection for nested blocks https://github.com/WordPress/gutenberg/pull/32536
 - Consistently show the drop indicator while dragging blocks https://github.com/WordPress/gutenberg/pull/31896
 - Fix horizontal drop indicator https://github.com/WordPress/gutenberg/pull/32589
 - Fix Safari flickering issue https://github.com/WordPress/gutenberg/pull/32581
 - Silence useSelect zombie bug errors https://github.com/WordPress/gutenberg/pull/32088

**Template Editor**

 - Clarify the template creation modal https://github.com/WordPress/gutenberg/pull/32427
 - Only add skip links for block templates https://github.com/WordPress/gutenberg/pull/32451

**Widgets Editor**

 - Add block breadcrumb https://github.com/WordPress/gutenberg/pull/32498 https://github.com/WordPress/gutenberg/pull/32528 https://github.com/WordPress/gutenberg/pull/32569
 - Saved deleted and restored widgets. https://github.com/WordPress/gutenberg/pull/32534
 - Fix unsaved changes detection https://github.com/WordPress/gutenberg/pull/32573
 - Fix button spacing in the header https://github.com/WordPress/gutenberg/pull/32585
 - Avoid extra undo levels https://github.com/WordPress/gutenberg/pull/32572
 - Move Legacy Widget block to the `@wordpress/widgets` package https://github.com/WordPress/gutenberg/pull/32501
 - Fix Social Links color inheritance https://github.com/WordPress/gutenberg/pull/32625
 - Use Button appender https://github.com/WordPress/gutenberg/pull/32580

**Global Styles (theme.json)**
 
 - Separate the presets per origin in the block editor settings https://github.com/WordPress/gutenberg/pull/32358 https://github.com/WordPress/gutenberg/pull/32622
 - Use CSS Custom Properties for the preset styles https://github.com/WordPress/gutenberg/pull/32627

**Performance**

 - Remove is-typing classname to improve typing performance https://github.com/WordPress/gutenberg/pull/32567

Props nosolosw, jorgefilipecosta, aristath, ntsekouras, peterwilsoncc, mcsf.
See #53397.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-15 08:52:30 +00:00
desrosj
f0ac297720 Editor: Replace a Gutenberg specific function with the Core equivalent.
This replaces a stray instance of `gutenberg_experimental_set()` with the WordPress Core version of this function, `_wp_array_set()`.

A stray `gutenberg` text domain is also removed from a `__()` call.

Props walbo, chaion07, JeffPaul.
Fixes #53369.
Built from https://develop.svn.wordpress.org/trunk@51148


git-svn-id: http://core.svn.wordpress.org/trunk@50757 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-14 23:44:58 +00:00
desrosj
e0e19035dc Coding Standards: Apply some alignment fixes.
Follow up to [51145].
See #50105.
Built from https://develop.svn.wordpress.org/trunk@51147


git-svn-id: http://core.svn.wordpress.org/trunk@50756 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-14 23:43:02 +00:00
desrosj
8fad82a2d6 Build/Test Tools: Replace the deprecated @babel/polyfill.
This replaces the dependency of the deprecated `@babel/polyfill` package with the `core-js` package through `@wordpress/babel-preset-default`.

Previously, the file consisted of a generalized group of polyfills, and not all of them were required. This change allows the contents of this file to be built according to the exact needs as dictated by the `@wordpress/babel-preset-default` package, which takes into account the current browser support.

Props gziolo, youknowriad. 
Fixes #52941.
Built from https://develop.svn.wordpress.org/trunk@51146


git-svn-id: http://core.svn.wordpress.org/trunk@50755 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-14 23:18:11 +00:00
joedolson
fe1cb3ff0d Media: Restore AJAX response data shape in media library.
Restore the original shape of the AJAX response data in the media library after removing infinite scroll, and pass total number of attachments in the response headers `X-WP-Total` and `X-WP-TotalPages`. 

Improve backwards compatibility for plugins intercepting the ajax response. Headers match the structure and count calculation used in REST API responses.

Fix an issue with hiding the spinner after the load is completed and ensure that the load more view is created when changing tabs in the media library modal.

Follow up to [50829].

props adamsilverstein, spacedmonkey, joedolson.
Fixes #50105.
Built from https://develop.svn.wordpress.org/trunk@51145


git-svn-id: http://core.svn.wordpress.org/trunk@50754 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-14 20:50:57 +00:00
Aaron Jorbin
5d9ca9dc68 Block Editor: Prevent duplicate queries
When passing args to `WP_Query::__construct` method (in this case, but creating a `new WP_Query`, this one internally executes the `WP_Query::get_posts` method and stores the result in the `WP_Query::posts` property. When calling the `WP_Query::get_posts` again, the same SQL query gets executed, and the result is again stored in the `WP_Query::posts` property.

This was introduced in [51003].

Props david.binda, jorbin.
Fixes #53280. See #53176.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-14 20:39:57 +00:00
desrosj
b7489425cb Site Health: Display a list of file formats supported by the GD library.
This adds the list of file formats supported by the GD library to the Media Handling section in Site Health.

This will help site owners debug any issues they encounter as support for newer, more modern image formats is added (such as WebP in [50810]).

Follow up to [50817].
Props adamsilverstein, jorbin. 
Fixes #53022.
Built from https://develop.svn.wordpress.org/trunk@51143


git-svn-id: http://core.svn.wordpress.org/trunk@50752 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-14 18:59:59 +00:00
Sergey Biryukov
05e98e28f3 Docs: Update documentation for some WP_Customize_Widgets methods per the documentation standards.
* Add missing `@since` tags for the `$id_base` parameter of ::sanitize_widget_instance()` and `::sanitize_widget_js_instance()`.
* Document the usage of `$wp_widget_factory` global in `::sanitize_widget_instance()`.
* Use multi-line comment syntax for a comment in `::enqueue_scripts()`.

Follow-up to [50996], [51141].

See #52628.
Built from https://develop.svn.wordpress.org/trunk@51142


git-svn-id: http://core.svn.wordpress.org/trunk@50751 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-14 15:16:58 +00:00
Sergey Biryukov
2e0e705d4c Docs: Document the usage of $wp_widget_factory global in WP_Customize_Widgets::sanitize_widget_instance().
Follow-up to [50996].

Props jontyravi, audrasjb.
Fixes #53394.
Built from https://develop.svn.wordpress.org/trunk@51141


git-svn-id: http://core.svn.wordpress.org/trunk@50750 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-14 11:02:57 +00:00
Sergey Biryukov
9f91305af2 Tests: Fix typo in a retrieve_widgets() test name.
Correct parameter description for `data_wp_widget_get_field_name()`.

Follow-up to [34780], [41555].

See #52625.
Built from https://develop.svn.wordpress.org/trunk@51140


git-svn-id: http://core.svn.wordpress.org/trunk@50749 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-13 16:28:58 +00:00
Sergey Biryukov
39e041b877 Tests: Fix typo in a get_bookmarks() test name.
Follow-up to [44546].

See #52625.
Built from https://develop.svn.wordpress.org/trunk@51139


git-svn-id: http://core.svn.wordpress.org/trunk@50748 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-12 15:49:02 +00:00
Sergey Biryukov
41e3cb04ad Docs: Correct DocBlock formatting for some revision tests.
Follow-up to [50949], [51124].

See #52628.
Built from https://develop.svn.wordpress.org/trunk@51138


git-svn-id: http://core.svn.wordpress.org/trunk@50747 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-11 12:36:00 +00:00
Sergey Biryukov
3c2c27c637 Tests: Use assertSameSets() in some newly introduced tests.
This ensures that not only the array values being compared are equal, but also that their type is the same.

Going forward, stricter type checking by using `assertSameSets()` or `assertSameSetsWithIndex()` should generally be preferred, to make the tests more reliable.

Follow-up to [48939], [49925], [50157], [50959], [50960], [50995], [51079].

See #52625.
Built from https://develop.svn.wordpress.org/trunk@51137


git-svn-id: http://core.svn.wordpress.org/trunk@50746 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-10 19:20:01 +00:00
Peter Wilson
8df65cdbe9 Widgets: Improve unit tests for RSS Widget.
Prevent unit tests from making HTTP requests to wordpress.org. Specify URLs as https rather than http.

Follow up to [51107].

Props hellofromTonya.
Fixes #53278.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50745 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-09 23:51:56 +00:00
Sergey Biryukov
adf23b3ed5 Tests: Ignore EOL differences in some tests using multiline string assertions.
Unix vs. Windows EOL style mismatches can cause misleading failures in tests using the heredoc syntax (`<<<`) or multiline strings as the expected result.

Follow-up to [48466], [50995], [51079].

See #52625.
Built from https://develop.svn.wordpress.org/trunk@51135


git-svn-id: http://core.svn.wordpress.org/trunk@50744 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-09 19:42:58 +00:00
desrosj
8c4cff0708 Upgrade/Install: Built files should not be included in the $_old_files list.
Follow up to [51133].
Unprops desrosj.
See #53367.
Built from https://develop.svn.wordpress.org/trunk@51134


git-svn-id: http://core.svn.wordpress.org/trunk@50743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-09 16:22:03 +00:00
desrosj
f7c74d3994 Upgrade/Install: Update the $_old_files list for 5.8.
Follow up to [50761], [50794], [51021].
Props kapilpaul, desrosj.
See #52991, #52846, #53246.
Fixes #53367.
Built from https://develop.svn.wordpress.org/trunk@51133


git-svn-id: http://core.svn.wordpress.org/trunk@50742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-09 15:54:57 +00:00
desrosj
f9aaec8f73 Post WordPress 5.8 Beta 1 version bump.
Built from https://develop.svn.wordpress.org/trunk@51132


git-svn-id: http://core.svn.wordpress.org/trunk@50741 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-09 02:40:58 +00:00
desrosj
3ee24bd3bf WordPress 5.8 Beta 1.
Built from https://develop.svn.wordpress.org/trunk@51131


git-svn-id: http://core.svn.wordpress.org/trunk@50740 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-09 02:02:58 +00:00
desrosj
15ee62321a Build/Test Tools: Silence jQuery Migrate console warnings when running E2E tests.
These warnings will still be visible in the browser console. The majority of the warnings are coming from jQuery UI, which is still waiting for a new update to be released that is jQuery >= 3.0 friendly.

This change makes the E2E test results more readable without having to tread through the large number of warnings.

Props isabel_brison.
Fixes #52860.
Built from https://develop.svn.wordpress.org/trunk@51130


git-svn-id: http://core.svn.wordpress.org/trunk@50739 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-09 01:36:57 +00:00
antpb
06cddbd3b3 Privacy: Improve naming of user confimed action email filters.
The filters `user_confirmed_action_email_content`, `user_erasure_complete_email_subject`, and `user_erasure_complete_email_headers` have been deprecated.

They have been replaced with `user_erasure_fulfillment_email_content`, `user_erasure_fulfillment_email_subject`, and `user_erasure_fulfillment_email_headers`.

Props desrosj, garrett-eclipse, birgire, DrewAPicture, lifeforceinst, ocean90, pbiron, pento, coffee2code, TZ-Media, SergeyBiryukov, johnbillion, audrasjb, davidbaumwald, hellofromTonya, helen, xkon, antpb, peterwilsoncc, lukecarbis.
Fixes #44314.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-09 01:35:58 +00:00
desrosj
af81b98b92 Tests: Introduce some E2E tests for the Quick Draft dashboard widget.
Props isabel_brison, johnbillion.
Fixes #523905.
Built from https://develop.svn.wordpress.org/trunk@51128


git-svn-id: http://core.svn.wordpress.org/trunk@50737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-09 00:20:56 +00:00
whyisjake
2e36162a20 Widgets: Don't decode HTML entities ahead of the widget constructor.
This reverts the changes from [51114]. 

See #53138.

Unprops whyisjake. 

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


git-svn-id: http://core.svn.wordpress.org/trunk@50736 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 23:40:00 +00:00
desrosj
37652569e4 Login and Registration: Improve the unknown username error message
The new message is more clear and makes the next step more clear to the user. 

Props dd32, SergeyBiryukov, audrasjb, desrosj, dlh, marybaum, chanthaboune, jeffpaul.
Fixes #52915.
Built from https://develop.svn.wordpress.org/trunk@51126


git-svn-id: http://core.svn.wordpress.org/trunk@50735 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 23:34:58 +00:00
whyisjake
32ecbd061e Permalinks: Revert the changes stemming from pagination limits.
In [51118], an attempt was made to add pagination limits. The added tests need to be updated to ensure that they pass with the new changes.

Reverts [51118].

See #50233.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50734 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 23:32:56 +00:00
whyisjake
011a598fa1 Revisions: Check and return errors for insertions to revisions.
Fixes #30009.

Props rmccue, adamsilverstein, coreymckrill, whyisjake.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 23:24:57 +00:00
antpb
38e4f333c0 Media: Allow multi-uploads in Galleries.
Previously, when more than one media item was uploaded using a gallery, failures occurred on the second upload.

Props glendaviesnz, Mista-Flo, hellofromTonya.
Fixes #53169.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50732 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 23:14:55 +00:00
whyisjake
cc26b6f068 Media: Add new functions to return the previous/next attachment links.
New functions:

* get_adjacent_image_link()
* get_next_image_link()
* get_previous_image_link()

Fixes #45708.

Props flixos90, DrewAPicture, mor10, antpb, hellofromTonya, whyisjake.



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


git-svn-id: http://core.svn.wordpress.org/trunk@50731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 23:13:57 +00:00
antpb
bb041c2503 Feeds: Avoid notices in get_post_comments_feed_link().
When an feed request is made to a non-existent page, surpress the notice.

Props dd32, SergeyBiryukov, mukesh27, hellofromTonya.
Fixes #52814.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 23:00:59 +00:00
desrosj
bdbda4c306 Coding Standards: Use single quotes when there are no variables within the string.
Follow up to [51117].

See #48743.
Built from https://develop.svn.wordpress.org/trunk@51120


git-svn-id: http://core.svn.wordpress.org/trunk@50729 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 22:55:58 +00:00
desrosj
892e5dd68e Administration: Adjust Internet Explorer message to be a bit more clear.
This moves “Internet Explorer” to the beginning of the sentence introduced in [51117] to make the reason the user is seeing this message more clear.

Props chanthaboune, jeffpaul, desrosj.
Fixes #48743.
Built from https://develop.svn.wordpress.org/trunk@51119


git-svn-id: http://core.svn.wordpress.org/trunk@50728 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 22:54:57 +00:00
whyisjake
b672d77e87 Permalinks: Limit pagination for posts with comments.
Additionally, redirect pages back to the source page if comments don't exist.

Props devrekli, carike, sumanm, mukesh27, chaion07, audrasjb, whyisjake, SergeyBiryukov.

Fixes #50233.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50727 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 22:51:01 +00:00
antpb
a8321ed2d5 Administration: Introduce dashboard notice to discourage use of out of date browser.
If a browser matches Internet Explorer, the dashboard will display a notice recommending a more modern browser.

Props youknowriad, sabernhardt, afercia, SergeyBiryukov, davidbaumwald, netweb, johnbillion, jeherve.
See #48743.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50726 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 22:47:58 +00:00
whyisjake
71f37fe636 Editor: Ensure that the block editor can be used on the page post type.
Additionally, add a notice for when you are editing the "latest posts" page.

Fixes #45537.

Props cameronjonesweb, swissspidy, hannahmalcolm, Fantasy1125, ArnaudBan, grantmkin, youknowriad, knutsp, SergeyBiryukov, audrasjb, whyisjake. 

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


git-svn-id: http://core.svn.wordpress.org/trunk@50725 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 22:38:58 +00:00
whyisjake
1b7df89e93 Administration: Escape the values of data-colname.
Adds a `esc_attr` wrapper to `strip_all_tags`.

See [33016].

Fixes #40401.

Props rellect, SergeyBiryukov, hareesh-pillai, audrasjb.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 22:21:57 +00:00
whyisjake
81c4c4138c Widgets: Ensure that HTML entities are converted in widget descriptions.
Fixes #53138.

Props justinahinon, audrasjb.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50723 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 22:17:57 +00:00
desrosj
b60a512de4 Emoji: Update the Twemoji library to version 13.1.0.
This version introduces support for the latest Emoji added in version Emoji 13.1, which includes “face in clouds”, “face exhaling”, and of course, “face with spiral eyes”.

A new corresponding folder has been pushed to WordPress.org in [dotorg:17419].

Rages deep within, ❤️‍🔥.

Props kraftbj., desrosj.
Fixes #52852.
Built from https://develop.svn.wordpress.org/trunk@51113


git-svn-id: http://core.svn.wordpress.org/trunk@50722 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 22:15:12 +00:00
whyisjake
fc410fab37 Build/Test Tools: Ensure that we are using https:// urls.
Fix from automated install.

See [51111], #39589.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50721 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 22:12:56 +00:00
whyisjake
2d6e474c85 Media: Ensure that post_id variable is initiated ahead of usage.
This prevents warnings when using custom bulk actions in the media library.

Props gitlost, achbed, Boniu91, wpgurudev, hellofromTonya.

Fixes #39589.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50720 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 22:08:09 +00:00
ryelle
8ace500967 Twenty Thirteen: Add "No Shadow" style to button block.
This creates a new block style without a shadow, and fixes colors on outline buttons.

Props melchoyce, kjellr, scruffian.
Fixes #51223.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50719 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 20:37:58 +00:00
ryelle
91c19c69c2 Block Editor: Ignore generated CSS files in Page List and Post Template blocks.
Add SVN ignore property to match existing rule in `.gitignore`.

Follow up to [51101], [51105].
See #52991, #53309.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50718 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 20:09:57 +00:00
ryelle
57fa6fde4e Login and Registration: Wrap long site titles to a new line.
Props sumitsingh, geekpress, sabernhardt.
Fixes #52776.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50717 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 19:46:58 +00:00
Aaron Jorbin
e2104af75e Widgets: Prevent infinite loop in PHP8+ if the URL for the widget instance is incorrectly defined
This checks to make sure $link isn't empty before attempting to manipulate it.  A simple test to demonstrate this can be seen at https://3v4l.org/PgSZg. Unit tests for both what already works and what is fixed by this change.

Props hellofromTonya, dd32, peterwilsoncc.
Fixes #53278.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50716 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 19:35:57 +00:00
ryelle
ba5e7a0fb9 Bundled Themes: Introduce block patterns for Twenty Ten.
Props beafialho, kjellr, melchoyce, danieldudzic, onemaggie.
Fixes #51107.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 18:53:59 +00:00
youknowriad
f47e79bc7d Block Editor: Include the page list block server-side code.
On a previous package update, this block's server-side code has been missed.
This was causing the block to not render properly.

Props Chouby, desrosj, mcsf.
Fixes #53309.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 18:13:01 +00:00
youknowriad
3cd3ac227a Block Editor: Fix typo in the typography block support.
The function wp_typography_get_css_variable_inline_style has been renamed when backported to Core.
But its usage was untouched causing potential php errors on the frontend.

See #52991.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 18:06:59 +00:00
ryelle
ecc13d3de2 Bundled Themes: Introduce block patterns for Twenty Eleven.
Props beafialho, kjellr, melchoyce, audrasjb.
Fixes #51106.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 18:03:59 +00:00
youknowriad
62be41c079 Block Editor: Allow themes to add inline styles for all blocks when using lazy styles loading.
Props aristath.
Fixes #53358.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50711 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 17:36:58 +00:00
youknowriad
1a7f28b3cd Block Editor: Package updates for WordPress 5.8 beta 1 (batch2).
This includes the following fixes:

 - Fix inspector opening when clicking outside the widget areas
 - Assume light theme when a transparent background is used
 - Make Post blocks non editable inside Query block
 - Rename QueryLoop to PostTemplate block

Props ntsekouras.
See #52991.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50710 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 17:33:22 +00:00
desrosj
a44c69354d Twenty Twenty: Regenerate the RTL editor stylesheet.
This applies the change made in [51095] to the RTL stylesheet.

See #50120.
Built from https://develop.svn.wordpress.org/trunk@51100


git-svn-id: http://core.svn.wordpress.org/trunk@50709 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 17:28:57 +00:00
desrosj
2f76f3279b Build/Test Tools: Update devDependencies for bundled themes.
This applies several minor updates bring `devDependencies` to their latest versions in Twenty Twenty-One, Twenty Twenty, and Twenty Nineteen.

Several other packages are also having their versions bumped as a result of running `npm audit fix`.

See #52624.
Built from https://develop.svn.wordpress.org/trunk@51099


git-svn-id: http://core.svn.wordpress.org/trunk@50708 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 17:25:57 +00:00
ryelle
bb21c738ee Twenty Nineteen: Set a default color for button links in the editor.
Props mikejolley, poena, boniu91.
Fixes #52555.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50707 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 17:21:59 +00:00
desrosj
7af8858ec7 Build/Test Tools: Update several devDependencies.
This updates `qunit`, `sass`, and `uglify-js` to thei latest versions.

Several other packages are also having their versions bumped as a result of running `npm audit fix`.

See #52624.
Built from https://develop.svn.wordpress.org/trunk@51097


git-svn-id: http://core.svn.wordpress.org/trunk@50706 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 17:15:15 +00:00
ryelle
ebb9bdc7ca Twenty Nineteen: Fix pullquote styling in editor when block has alignment.
Props devnel, sabernhardt.
Fixes #53112.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50705 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 16:50:57 +00:00
ryelle
f512feabe0 Twenty Twenty: Ensure custom primary color is applied to text in the editor.
Update the specificity of the custom CSS to match the editor styles. This overrides the default primary color with the selected custom color, matching the frontend display.

Props sabernhardt, notlaura.
Fixes #50120.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50704 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 15:06:58 +00:00
desrosj
bac6a83417 Script Loader: Fix 404 errors for the jquery-masonry script when SCRIPT_DEBUG is true.
The unminified version of `jquery-masonry` has never been included in Core. This hard codes the `.min` into the file source to prevent these errors.

Props pondermatic, isabel_brison, SergeyBiryukov, azaozz, desrosj.
Fixes #47353.
Built from https://develop.svn.wordpress.org/trunk@51094


git-svn-id: http://core.svn.wordpress.org/trunk@50703 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 14:59:59 +00:00
desrosj
ef4b42b03b Coding Standards: Apply an alignment fix.
Follow up to [51021].

See #53246.
Built from https://develop.svn.wordpress.org/trunk@51093


git-svn-id: http://core.svn.wordpress.org/trunk@50702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 13:22:57 +00:00
Sergey Biryukov
08f5a1b098 Upgrade/Install: Remove parsing of readme.txt files for plugin or theme requirements.
This affects:
* `validate_plugin_requirements()`
* `validate_theme_requirements()`

Historically, the `Requires PHP` header was introduced in #meta2952 for the Plugin Directory first, so at the time it made sense to have it defined in the same place as `Requires at least`, which only existed in `readme.txt`. 

Since parsing of PHP and WordPress requirements was later added to WordPress core, the core should retrieve all the necessary data from the main plugin or theme file and not from `readme.txt`, which only contains the data meant for the Plugin or Theme Directory.

The recommended place for `Requires PHP` and `Requires at least` headers is as follows:
* The plugin's main PHP file
* The theme's `style.css` file

The place for the `Tested up to` header remains in `readme.txt` for the time being, as it's not used by WordPress core.

Follow-up to [44978], [45546], [47573], [47574], [meta5841], [meta9050].

Props afragen, Otto42, joyously, williampatton, audrasjb.
Fixes #48520. See #48515, #meta2952, #meta4514, #meta4621.
Built from https://develop.svn.wordpress.org/trunk@51092


git-svn-id: http://core.svn.wordpress.org/trunk@50701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 10:13:00 +00:00
youknowriad
55f3de101b Block Editor: Add the Site Logo block's server implementation.
Props aristath, timothyblynjacobs, ocean90.
Fixes #53247.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50700 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 08:27:58 +00:00
youknowriad
446dd1768a Block Editor: Add a type property to allow Core to identify the source of the editor styles.
Gutenberg plugin need to override the editor styles provided by core selectively,
this added property allows it to do so without committing to a public API.

Props nosolosw, jorgefilipecosta.
See #53175.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 08:15:57 +00:00
youknowriad
1516d05128 Block Editor: Package updates for 5.8 beta 1.
This includes the following fixes:


Widgets Editor:
  - Load widgets.php https://github.com/WordPress/gutenberg/pull/32299
 - Fix Legacy Widget Preview https://github.com/WordPress/gutenberg/pull/32300
 - Fix error when saving empty Legacy Widget block https://github.com/WordPress/gutenberg/pull/32359

Widget blocks in the customizer: 
 - Fix deselection blocks when the inspector is open https://github.com/WordPress/gutenberg/pull/32361
 - Display wide widgets as popovers https://github.com/WordPress/gutenberg/pull/31736

Global Styles:
 - Align classNames generation between client and server https://github.com/WordPress/gutenberg/pull/32352
 - Group typography block supports https://github.com/WordPress/gutenberg/pull/32252 https://github.com/WordPress/gutenberg/pull/32444 https://github.com/WordPress/gutenberg/pull/32459
 - Make theme.json syntax errors more visible to the users https://github.com/WordPress/gutenberg/pull/32404


Template Editor:
  - Update the appearance of the template details https://github.com/WordPress/gutenberg/pull/32042
  - Fix layout definition https://github.com/WordPress/gutenberg/pull/32425
  - Fix grouping post content block https://github.com/WordPress/gutenberg/pull/32453

Miscellaneous:
 - Prevent saving when the post is locked https://github.com/WordPress/gutenberg/pull/32341
 - Fix allowed block patterns selector https://github.com/WordPress/gutenberg/pull/32376
 - Fix wrong results in the Post Author picker https://github.com/WordPress/gutenberg/pull/32344
 - Fix notices position in top toolbar mode https://github.com/WordPress/gutenberg/pull/32238
 - Allow non-latin characters in post slugs https://github.com/WordPress/gutenberg/pull/32232
 - Fix Random collapse of the color settings panel https://github.com/WordPress/gutenberg/pull/32388
 - Fix theme logo theme mode not being removed on theme removal https://github.com/WordPress/gutenberg/pull/32370
 - Fix block alignment styles in the editor https://github.com/WordPress/gutenberg/pull/32454
 - Fix some block toolbar overlaps https://github.com/WordPress/gutenberg/pull/32424
 - Fix content loss when switching list types https://github.com/WordPress/gutenberg/pull/32432


Performance:
 - Improve the performance of buttons block https://github.com/WordPress/gutenberg/pull/32356
 - Improve the performance of the container blocks https://github.com/WordPress/gutenberg/pull/32380

Props noisysocks, nosolosw, jorgefilipecosta.
See #52991.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 08:09:53 +00:00
noisysocks
bbc2d09a9f Make new WordPress installations use blocks in widget areas instead of widgets
Modifies `wp_install_defaults()` so that when you install a new WordPress site you
have block in your widget areas, not widgets.

Fixes #53324.
Props isabel_brison, hellofromtonya, andraganescu.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50697 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 01:55:57 +00:00
Aaron Jorbin
f3dc033350 Boostrap/Load: Add filter to allow disabling of object cache
In [37626] a filter was added to allow disabling the advanced cache dropin, but no similar filter was added for the object cache dropin. This corrects that oversight.

Fixes #53322.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-08 01:45:57 +00:00
joedolson
e53ace6056 Application Passwords: Allow enter key to submit profile form.
Fix the enter key in profile form fields moving focus to the application password input instead of submitting the profile update for. Replace the submit button type used for application passwords with `button type="button"` and ensure that the enter key's native behavior isn't overwritten.

props audrasjb, alexstine, promz, sabernhardt.
Fixes #52849.
Built from https://develop.svn.wordpress.org/trunk@51086


git-svn-id: http://core.svn.wordpress.org/trunk@50695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-07 23:49:58 +00:00
Andrew Ozz
34cfd7e4ad TinyMCE: Don't attempt to initialize the same instance twice. Follow up to [51082].
See #52133, #52050.
Built from https://develop.svn.wordpress.org/trunk@51085


git-svn-id: http://core.svn.wordpress.org/trunk@50694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-07 23:21:57 +00:00
joedolson
82f31a97cb Coding Standards: Extraneous white space at end of line.
Fixes a minor coding standards issue.

Follow up to [51082].

See #51189.
Built from https://develop.svn.wordpress.org/trunk@51084


git-svn-id: http://core.svn.wordpress.org/trunk@50693 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-07 23:15:58 +00:00
joedolson
637282bb0f Themes: Fix accessibility issues with controls in themes screen.
Add accessible names to several theme controls so provide better context for screen reader users. Change theme details element into a button that can receive focus. Ensure focus is set back on existing theme when theme details modal is closed.

props alexstine, poena.
Fixes #52649.
Built from https://develop.svn.wordpress.org/trunk@51083


git-svn-id: http://core.svn.wordpress.org/trunk@50692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-07 23:10:57 +00:00
Andrew Ozz
47fb9c7f3d TinyMCE: Fix initialization when the editor is in a postbox by delaying it until document.readyState === 'complete'.
Props metalandcoffee, desrosj, patkemper, herrvigg, spikeuk1, dway, mkdgs, azaozz.
Fixes #52133, #52050.
Built from https://develop.svn.wordpress.org/trunk@51082


git-svn-id: http://core.svn.wordpress.org/trunk@50691 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-07 23:07:57 +00:00
joedolson
50fd820621 Comments: Return valid comment reply link if comments are paginated.
Fix the link returned by `get_comment_reply_link()` so the link points to the correct page of comments when links are paginated. While this link is normally overridden by the comment-reply script, if that script is disabled, the link would point to a location that did not exist when comments were paginated.

props MrPauloEn, paaggeli, alexstine, engahmeds3ed.
Fixes #51189.
Built from https://develop.svn.wordpress.org/trunk@51081


git-svn-id: http://core.svn.wordpress.org/trunk@50690 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-07 21:49:59 +00:00
Sergey Biryukov
aeebd14fe2 Comments: Escape comment author's email in the Edit Comment form.
Technically, this is redundant, as the `comment_author`, `comment_author_email`, and `comment_author_url` fields are already escaped via `get_comment_to_edit()` before the form is displayed. 

However, this brings some consistency with the `comment_author` and `comment_author_url` fields being escaped in the same form.

Follow-up to [11721].

Props utsav72640.
Fixes #53349.
Built from https://develop.svn.wordpress.org/trunk@51080


git-svn-id: http://core.svn.wordpress.org/trunk@50689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-07 18:47:02 +00:00
Sergey Biryukov
3642c401b6 Tests: Use assertSame() in some newly introduced tests.
This ensures that not only the return values match the expected results, but also that their type is the same.

Going forward, stricter type checking by using `assertSame()` should generally be preferred to `assertEquals()` where appropriate, to make the tests more reliable.

Follow-up to [50380], [50959], [50960], [50973], [50993], [51003], [51051], [51054].

See #52482.
Built from https://develop.svn.wordpress.org/trunk@51079


git-svn-id: http://core.svn.wordpress.org/trunk@50688 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-07 11:18:00 +00:00
Sergey Biryukov
6304c9ba7f External Libraries: Update the Requests library to version 1.8.1.
This is a minor update, with the most important change being that the version constant in the `Requests` class is now correct.

Release notes: https://github.com/WordPress/Requests/releases/tag/v1.8.1

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

Follow-up to [50842].

Props kapilpaul, jrf, schlessera, mbabker.
Fixes #53334.
Built from https://develop.svn.wordpress.org/trunk@51078


git-svn-id: http://core.svn.wordpress.org/trunk@50687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-06 14:05:56 +00:00
Dominik Schilling
ce4da03303 Users: Add user’s locale to password reset link to ensure login screen matches the language of the email.
Props walbo.
See #34281, #52605.
Fixes #53321.
Built from https://develop.svn.wordpress.org/trunk@51077


git-svn-id: http://core.svn.wordpress.org/trunk@50686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-06 12:41:01 +00:00
Aaron Jorbin
5fac9d83a9 Booststrap/Load: Only reference recovery mode email when it can be sent.
The recovery mode email is sent from within the WP_Recovery_Mode::handle_error() method, but that method is only called by the fatal error handler if WP_Recovery_Mode has been initialized. This adjusts the message to only say the email has been sent if it can be sent.

Props reynhartono, stevegrunwell for initial plan.
Fixes #52560.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-05 15:46:57 +00:00
Sergey Biryukov
00ac778b90 Coding Standards: Use strict comparison in wp-admin/options-media.php.
See #52627.
Built from https://develop.svn.wordpress.org/trunk@51075


git-svn-id: http://core.svn.wordpress.org/trunk@50684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-05 13:57:59 +00:00
Sergey Biryukov
47231831f7 REST API: Restore the $creating parameter of rest_after_save_widget action.
This is consistent with other similar REST API actions.

Partially reverts [51071], except for DocBlock formatting fixes.

Props TimothyBlynJacobs.
See #53317.
Built from https://develop.svn.wordpress.org/trunk@51074


git-svn-id: http://core.svn.wordpress.org/trunk@50683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-04 23:13:59 +00:00
ryelle
13d9212bf4 List Tables: Update spacing in action items on small screens.
Switch the display to flex. The action items use their intrinsic space, rather than a fixed grid, which prevents too much space between items on larger mobile screens.

Props arunsathiya, sabernhardt, danfarrow, notlaura, aliveic, y_kolev
Fixes #48546, #47895.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-04 18:14:56 +00:00
ryelle
eaea2f3b45 Twenty Twenty-One: Check for navigation element before using it.
This prevents a javascript error in case the primary navigation has been removed, for example in a child theme.

Props sushmak.
Fixes #52773.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50681 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-04 17:08:00 +00:00
Sergey Biryukov
36cf03ca52 REST API: Rename the $creating parameter of rest_after_save_widget action to $update.
This brings some consistency with similar actions for posts, e.g. `save_post` or `wp_insert_post`.

Follow-up to [51068], [51069].

See #53317.
Built from https://develop.svn.wordpress.org/trunk@51071


git-svn-id: http://core.svn.wordpress.org/trunk@50680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-04 10:48:56 +00:00
Sergey Biryukov
4e2a6681a0 Coding Standards: Simplify the logic in WP_Widget::get_field_name() and ::get_field_id().
Includes minor code layout fixes for better readability.

Follow-up to [41292], [50953], [50961].

Props 5ubliminal, solarissmoke, tamlyn, jdgrimes, jorbin, stevenkword, drebbits.web, westonruter, jipmoors, justinahinon, helen, lukecarbis, Mte90, hellofromTonya, SergeyBiryukov.
See #16773, #52627.
Built from https://develop.svn.wordpress.org/trunk@51070


git-svn-id: http://core.svn.wordpress.org/trunk@50679 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-04 10:47:58 +00:00
noisysocks
cd4b3a357d Fix failing block editor test
Removes the Meta and Nav Menu widgets from the set of widgets expected by the
test for get_default_block_editor_settings().

Follows [51067].
See #53301.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50678 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-04 05:26:59 +00:00
noisysocks
222541d7c3 REST API: Delete fresh_site option when updating widgets via REST API
Adds new hooks (rest_save_sidebar, rest_delete_widget, rest_after_save_widget)
to the widgets REST API and uses them to delete the fresh_site option when
updating widgets via the REST API. This ensures that starter content isn't
loaded in the Customizer after a user makes changes.

Fixes #53317.
Props kevin940726, garrett-eclipse, andraganescu, hellofromtonya.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50677 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-04 00:45:56 +00:00
noisysocks
6531090038 Enable Meta and Nav Menu widgets in Legacy Widget block
Allows users to insert a Meta or Nav Menu widget using the Legacy Widget block,
as there is not yet a block equivalent for the Meta and Nav Menu widgets.

Fixes #53301.
Props celloexpressions, andraganescu.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50676 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-04 00:40:57 +00:00
Sergey Biryukov
f637014b61 Site Health: Remove unnecessary function_exists() checks from WP_Site_Health::get_tests().
By the time the tests run, both `wp_is_site_protected_by_basic_auth()` and `rest_url()` functions are available, so there is no need to check for their existence.

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

Props Clorith, costdev, SergeyBiryukov.
Fixes #52642.
Built from https://develop.svn.wordpress.org/trunk@51066


git-svn-id: http://core.svn.wordpress.org/trunk@50675 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-03 11:14:56 +00:00
John Blackbourn
3024b85221 Editor: Correct some docblocks added in [50836].
See #50328, #52620.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50674 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-03 00:22:58 +00:00
Sergey Biryukov
8e5b3d5a97 Plugins: Make sure Hello Dolly translations are deleted when the plugin is deleted.
Follow-up to [19965], [29856].

Props costdev, Otshelnik-Fm, JeffPaul, SergeyBiryukov.
Fixes #52817.
Built from https://develop.svn.wordpress.org/trunk@51064


git-svn-id: http://core.svn.wordpress.org/trunk@50673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-02 15:12:58 +00:00
Sergey Biryukov
fde119d446 Docs: Correct type for the $widget parameter of the widget_block_content filter.
Follow-up to [51058].

See #51566.
Built from https://develop.svn.wordpress.org/trunk@51063


git-svn-id: http://core.svn.wordpress.org/trunk@50672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-02 10:57:57 +00:00
Peter Wilson
eeb4f7fcc6 Block Editor: Update script versions.
Follow up to [51051].
See #52991.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50671 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-02 02:28:59 +00:00
noisysocks
138fa081a7 Widgets: Add missing actions to widgets block editor
Adds the `'sidebar_admin-setup'`, `'sidebar_admin_page'`, and
`current_theme_supports( 'widgets' )` check to the widgets block editor so that
the block editor screen is more compatible with the classic screen.

Fixes #53288.
Props isabel_brison.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50670 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-02 01:57:57 +00:00
noisysocks
5162c8e6a8 REST API: Add 'delete_widget' action to delete widget endpoint
Triggers the 'delete_widget' action to the delete widget endpoint in the REST
API. This aligns with the behaviour in the widgets WP Admin screen.

Fixes #53289.
Props isabel_brison, TimothyBlynJacobs.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50669 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-02 01:40:57 +00:00
noisysocks
2fd3f23408 REST API: Fix delete widget endpoint
Makes the `DELETE /wp/v2/widgets/:id?force=1` endpoint actually delete the
widget from the `"widget-$id_base"` option and not just remove it from
`'sidebars_widgets'`.

Fixes #53313.
Props TimothyBlynJacobs.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50668 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-02 01:22:57 +00:00
noisysocks
38cea1e659 Widget block: Add widget_block_content filter
Adds a new 'widget_block_content' filter to the widget block and hooks
`run_shortcode`, `autoembed`, `do_blocks`, and `do_shortcode` into it by
default. This is simlar to `widget_text_content.`

Fixes #51566.
Props talldanwp.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50667 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-02 01:18:57 +00:00
Clorith
918610fb88 Site Health: Conditionally run Authorization header test.
The test to confirm if Authorization headers can be used and recognized by WordPress needs to include a username and password combination that WordPress can compare against during the testing phase. The inclusion of credentials here would unfortunately also invalidate any existing basic auth session for the site, for example if the user had added this as an extra layer of security on their back-end.

This test is now skipped if the `wp_is_site_protected_by_basic_auth()` function detects that basic auth is being used, since the act of using basic auth to access the site confirms that this feature is working as expected in the first place.

Props WebDragon, TimothyBlynJacobs, costdev.
Fixes #52642.
Built from https://develop.svn.wordpress.org/trunk@51057


git-svn-id: http://core.svn.wordpress.org/trunk@50666 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-02 00:51:57 +00:00
Sergey Biryukov
033c742a4e Block Editor: Load the WP_Theme_JSON_Resolver class in wp-admin/load-styles.php.
This ensures correct load order when style concatenation is used, e.g. when `SCRIPT_DEBUG` is off.

Additionally, make sure the `WP_CONTENT_DIR` constant is defined for use in `get_theme_root()` via `get_stylesheet_directory()`.

Follow-up to [50992], [51001], [51013].

Props nosolosw.
See #53175.
Built from https://develop.svn.wordpress.org/trunk@51056


git-svn-id: http://core.svn.wordpress.org/trunk@50665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-01 23:09:58 +00:00
Sergey Biryukov
b964d532e2 Docs: Add a @since note to wp_parse_id_list() and wp_parse_slug_list() about using wp_parse_list().
Follow-up to [44546], [49941].

Props joyously, dlh, pbiron.
See #52628.
Built from https://develop.svn.wordpress.org/trunk@51055


git-svn-id: http://core.svn.wordpress.org/trunk@50664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-01 21:21:57 +00:00
Sergey Biryukov
21cf927961 Tests: Remove the ::append_to_selector() method from Tests_Theme_wpThemeJson.
The method exists in the `WP_Theme_JSON` class and appears to be erroneously duplicated in the test class.

Add a unit test that was meant to be included instead, as per https://github.com/WordPress/gutenberg/pull/32190.

Follow-up to [51051].

See #52991.
Built from https://develop.svn.wordpress.org/trunk@51054


git-svn-id: http://core.svn.wordpress.org/trunk@50663 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-01 11:31:57 +00:00
Sergey Biryukov
44c185e0cf Coding Standards: Simplify a condition in wp-admin/admin-footer.php.
Props jamil95, mukesh27.
Fixes #53306.
Built from https://develop.svn.wordpress.org/trunk@51053


git-svn-id: http://core.svn.wordpress.org/trunk@50662 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-01 11:30:57 +00:00
youknowriad
c1fa1f8b21 Block Editor: Update the Gutenberg branch used to launch Gutenberg e2e tests.
In core, you can run `tests/gutenberg/run.js` script to run the Gutenberg e2e tests
against Core with the plugin being disabled. This test ensures that the integration
of the block editor with Core is working properly.

This commit updates the Gutenberg base branch to be used for the tests to be wp/trunk
which corresponds to the latest packages that are included in Core.

See #52991.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-01 09:22:58 +00:00
youknowriad
e335b68afc Block Editor: Update packages and backport the latest Gutenberg fixes.
This includes the following fixes:

- Generate babel polyfill dynamically https://github.com/WordPress/gutenberg/pull/31279
- Improve the List View component https://github.com/WordPress/gutenberg/pull/31290 https://github.com/WordPress/gutenberg/pull/32063
- Template mode:
    - Fix embed dimensions https://github.com/WordPress/gutenberg/pull/32057
    - Update the welcome guide https://github.com/WordPress/gutenberg/pull/32055 https://github.com/WordPress/gutenberg/pull/32026
    - Don’t display the notice at the same time as the welcome guide https://github.com/WordPress/gutenberg/pull/32076
    - Remove MetaBoxes https://github.com/WordPress/gutenberg/pull/32315
    - Update the title area https://github.com/WordPress/gutenberg/pull/32037 
- Widgets Screen:
    - Fix unsaved changes https://github.com/WordPress/gutenberg/pull/31757
    - Fix toolbar alignment https://github.com/WordPress/gutenberg/pull/31991
    - Fix block toolbar position after scroll https://github.com/WordPress/gutenberg/pull/32212
    - Fix the visible widget area header https://github.com/WordPress/gutenberg/pull/32262
    - Fix legacy widgets preview https://github.com/WordPress/gutenberg/pull/32260
    - 
- Block Widgets in the customizer: 
    - Fix customizer title overlapping block toolbar https://github.com/WordPress/gutenberg/pull/32140
    - Fix styling issues https://github.com/WordPress/gutenberg/pull/32072
    - Fix escape key events https://github.com/WordPress/gutenberg/pull/32175
    - Add preferences menu group label https://github.com/WordPress/gutenberg/pull/32259
    - Fix creating and replacing legacy widgets https://github.com/WordPress/gutenberg/pull/32005
    - Fix the welcome guide’s image https://github.com/WordPress/gutenberg/pull/32264 https://github.com/WordPress/gutenberg/pull/32302 
- Fix Cover to Image transform duotone error https://github.com/WordPress/gutenberg/pull/32006
- Remove filter_var usage from blocks https://github.com/WordPress/gutenberg/pull/32046 
- Fix image width for aligned Post Featured Image block https://github.com/WordPress/gutenberg/pull/32070
- Prevent excessive Image block re-rendering https://github.com/WordPress/gutenberg/pull/32102
- Remove gutenberg domain from core blocks https://github.com/WordPress/gutenberg/pull/32152
- Use the block editor context class for the the different settings filters https://github.com/WordPress/gutenberg/pull/32159
- Fix Latest Posts block grid view https://github.com/WordPress/gutenberg/pull/32160
- Fix preset classes generation per block https://github.com/WordPress/gutenberg/pull/32190
- Fix logic to enable custom colors and gradients https://github.com/WordPress/gutenberg/pull/32200
- Update the Site Logo logic to use a dedicated site option https://github.com/WordPress/gutenberg/pull/32229
- Limit the Latest Posts block’s featured image width https://github.com/WordPress/gutenberg/pull/32245
- Remove opacity animation in the canvas. https://github.com/WordPress/gutenberg/pull/32266
- Make the focus style valid CSS https://github.com/WordPress/gutenberg/pull/32305
- Fix theme.json styles for the core/list block https://github.com/WordPress/gutenberg/pull/32343
- Fix PHP notice when calling render_block https://github.com/WordPress/gutenberg/pull/32135

Props nosolosw, noisysocks.
See #52991.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-01 08:10:04 +00:00
Andrew Ozz
6acd4d4c16 Docs: Improve documentation for get_option(). Clean up, clarify the returned types and the exceptions, and add few examples.
Props ReneHermi, johnbillion, azaozz
See #51278

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


git-svn-id: http://core.svn.wordpress.org/trunk@50659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-06-01 00:00:58 +00:00
TimothyBlynJacobs
f3504cd945 REST API: Remove duplicates in the widget types endpoint.
Props noisysocks, spacedmonkey, imath, isabel_brison.
Fixes #53305.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-31 20:57:58 +00:00
Sergey Biryukov
d2ef664134 Docs: Improve documentation for the wp_resource_hints filter.
Clarify that as of WordPress 4.7, the `$urls` parameter can accept arrays of specific HTML attributes as its child elements, in addition to URLs.

Follow-up to [37920], [38826].

Props vanyukov, Rahmohn, desrosj, peterwilsoncc, SergeyBiryukov.
Fixes #52842.
Built from https://develop.svn.wordpress.org/trunk@51048


git-svn-id: http://core.svn.wordpress.org/trunk@50657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-31 15:39:59 +00:00
Sergey Biryukov
5232f2be96 Coding Standards: Use strict comparison in wp-includes/class-wp-customize-nav-menus.php.
See #52627.
Built from https://develop.svn.wordpress.org/trunk@51047


git-svn-id: http://core.svn.wordpress.org/trunk@50656 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-30 19:18:01 +00:00
Sergey Biryukov
fedbeb2f3c Docs: Document that has_block() does not check reusable blocks.
Since the function only checks the raw, non-parsed post content, reusable blocks are just a `core/block` type and nothing more at that point.

In order to also check reusable blocks, the content needs to be parsed using `parse_blocks()` first.

Props vyskoczilova, peterwilsoncc.
Fixes #53140.
Built from https://develop.svn.wordpress.org/trunk@51046


git-svn-id: http://core.svn.wordpress.org/trunk@50655 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-29 18:43:00 +00:00
ryelle
086edc3d12 Bundled Themes: Introduce block patterns for Twenty Fourteen.
Props beafialho, kjellr, melchoyce, onemaggie, poena, jffng, jeffikus.
Fixes #51103.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50654 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-28 18:17:59 +00:00
Sergey Biryukov
972d2bc117 Docs: Improve documentation for wp_list_filter() and wp_filter_object_list().
This should make the purpose and behavior of these functions more obvious without reading the code.

Props ribaricplusplus.
Fixes #52808.
Built from https://develop.svn.wordpress.org/trunk@51044


git-svn-id: http://core.svn.wordpress.org/trunk@50653 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-28 18:04:57 +00:00
ryelle
1cef3d1812 Bundled Themes: Introduce block patterns for Twenty Fifteen.
Props melchoyce, kjellr, onemaggie.
Fixes #51102.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-28 17:21:05 +00:00
Sergey Biryukov
1b68f58b6d Bundled Themes: Update the "Tested up to" value.
"Tested up to" is not displayed on the theme directory or within the WordPress dashboard, but should be updated to be accurate for anyone reading the theme's source code.

Props akabarikalpesh, francina, mukesh27.
Fixes #53276.
Built from https://develop.svn.wordpress.org/trunk@51042


git-svn-id: http://core.svn.wordpress.org/trunk@50651 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-27 20:44:57 +00:00
desrosj
4a7c797d92 General: Correct the inline code examples for _wp_array_get() and `_wp_array_set().
Props thomasplevy, SergeyBiryukov.
Fixes #53264.
Built from https://develop.svn.wordpress.org/trunk@51041


git-svn-id: http://core.svn.wordpress.org/trunk@50650 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-27 19:36:59 +00:00
desrosj
2abc73b4cd Build/Test Tools: Update the several dependencies.
This updates the following dependencies:

- `chalk` from `4.1.0` to `4.1.1`.
- `dotenv` from `8.2.0` to `10.0.0`.
- `grunt` from `1.4.0` to `1.4.1`.
- `sass` from `1.32.12` to `1.34.0`.
- `sinon` from `10.0.0` to `11.1.1`.
- `uglify-js` from `3.13.6` to `3.13.8`.

See #52624.
Built from https://develop.svn.wordpress.org/trunk@51040


git-svn-id: http://core.svn.wordpress.org/trunk@50649 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-27 19:33:19 +00:00
Sergey Biryukov
7573bd8e8d Docs: Use a duplicate hook reference for widgets_admin_page in wp-admin/widgets-form-blocks.php.
Follow-up to [51038].

See #51506.
Built from https://develop.svn.wordpress.org/trunk@51039


git-svn-id: http://core.svn.wordpress.org/trunk@50648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-27 09:07:01 +00:00
noisysocks
341944a352 Widgets: Perform 'widgets_admin_page' action in block widget editor
Perform the 'widgets_admin_page' action just prior to outputting markup for the
widgets block editor so as to maximise backwards compatibility with the old
screen.

Follows [51037].
See #51506.
Props isabel_brison.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50647 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-27 01:52:57 +00:00
noisysocks
37bef4c2c5 Widgets: Remove unnecessary enqueue of 'format-library' assets
It is not necessary to enqueue 'format-library' assets here as this is done when
triggering the 'enqueue_block_editor_assets' action.

Follows [51028].
See #51506.
Props isabel_brison.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-27 01:50:57 +00:00
Peter Wilson
abde9678b4 Build tools: Use hashed module IDs for minified files.
Further improves webpack configuration for editor files to use hashed module IDs in the compressed (`*.min.js`) production files.

Follow up to [50940].

Props gziolo, peterwilsoncc.
Fixes #53192.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50644 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-27 00:17:06 +00:00
ryelle
4995a09ba2 Twenty Thirteen: Fix missing translations in block patterns, add image credits.
Props audrasjb, melchoyce.
Follow-up to [51012].
Fixes #51104.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50643 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-26 16:55:57 +00:00
ryelle
3faec7852e Bundled Themes: Introduce block patterns for Twenty Twelve.
Props beafialho, kjellr, melchoyce, onemaggie.
Fixes #51105.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50642 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-26 16:39:58 +00:00
Sergey Biryukov
a30afc155e General: Avoid a PHP warning when checking the mbstring.func_overload PHP value.
This avoids "A non-numeric value encountered" warning when `mbstring.func_overload` is set to something other than a numeric string, e.g. an empty string instead of the default `'0'` value.

Props djbu.
Fixes #53282.
Built from https://develop.svn.wordpress.org/trunk@51032


git-svn-id: http://core.svn.wordpress.org/trunk@50641 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-26 16:05:59 +00:00
jorgefilipecosta
60d7dcdc61 Block Editor: Fix logic to enable custom colors, gradients, and font sizes.
The logic to enable or disabled colors, gradients, and font sizes missed a negative operator, so when things should be enabled they weren't and they should be disabled they were enabled. This commit fixes the logic.

Props ntsekouras.
See #53175.
Built from https://develop.svn.wordpress.org/trunk@51031


git-svn-id: http://core.svn.wordpress.org/trunk@50640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-26 14:25:59 +00:00
Sergey Biryukov
b1666e78fb Media: Replace basename() usage on media upload screen with wp_basename() for better multibyte filenames support.
Includes minor code layout fixes for better readability.

Follow-up to [44785], [51023].

See #51754.
Built from https://develop.svn.wordpress.org/trunk@51030


git-svn-id: http://core.svn.wordpress.org/trunk@50639 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-26 14:24:57 +00:00
Peter Wilson
bd192a0fbc REST API: Re-introduce WP_Test_REST_Widgets_Controller tests.
Returns the test suite with the addition of defining a URL in the RSS widget within `WP_Test_REST_Widgets_Controller::test_get_items()` to work around an infinite loop in `WP_Widget_RSS` on PHP 8 if the URL is unset or empty.

Reverts [51020].

Props peterwilsoncc, TimothyBlynJacobs.
See #41683.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50638 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-26 06:15:58 +00:00
Peter Wilson
1e5fccc2d2 Widgets: Ignore CSS files in legacy widgets block.
Add SVN ignore property to match existing rule in `.gitignore`.

Follow up to [50997].
See #51506.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50637 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-26 03:00:57 +00:00
Peter Wilson
885bdb2556 Posts, Post Types: Improve post_exists() query.
Add `$status` parameter to `post_exists()` to allow developers to specify a post type, date and status to ensure they hit the `wp_posts` table's `type_status_date` index when determining if a post exists.

Props apokalyptik, boonebgorges, brettshumaker, DrewAPicture, MikeHansenMe, peterwilsoncc, whyisjake.
Fixes #34012.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-26 02:17:56 +00:00
TimothyBlynJacobs
cc26123e20 REST API: Add support for modifying the term relation when querying posts.
By default, a post most contain any of the requested terms to be included in the response. This commit adds a new `operator` property that can be set to `AND` to require a post to contain all of the requested terms.

For example, `/wp/v2/posts?tags[terms]=1,2,3&tags[operator]=AND` will return posts that have tags with the ids of 1, 2, and 3.

Props dlh, earnjam, Clorith, jnylen0, sebbb.
Fixes #41287.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50635 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-26 02:16:59 +00:00
ryelle
6e4b41c848 Site Health, Privacy: Combine shared CSS for Site Health & Privacy Settings
The styles for the Privacy settings page were based on the Site Health section. These were duplicated into `edit.css` in #49264. This change merges the selectors from Site Health into the Privacy section, to reduce that duplicate code.

Props xkon, notlaura, clorith.
See #52429.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-26 01:53:57 +00:00
desrosj
59b2dbb855 General: Pass the scheme to the *_url filters.
This adds an additional `$scheme` parameter to the following URL related filters:
- `admin_url`.
- `includes_url`.
- `network_admin_url`.
- `user_admin_url`.

Props johnbillion, SergeyBiryukov, desrosj.
Fixes #52813.
Built from https://develop.svn.wordpress.org/trunk@51024


git-svn-id: http://core.svn.wordpress.org/trunk@50633 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-26 01:47:59 +00:00
antpb
e2e8120fa6 Media: Add button in media upload page for copying the media url.
Adds a button to the media upload page to make copying the url possible on the same page when a media item upload is successful.

Props anotia, ryokuhi, Mista-Flo, lukecarbis, antpb, claytoncollie, shaunandrews, joedolson.
Fixes #51754.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-26 01:40:58 +00:00
Sergey Biryukov
d7086ba67a Themes: Display the number of available theme updates in the admin menu.
This brings some consistency with the similar update counter for plugins.

Props mukesh27, zodiac1978, pixolin, Boniu91, francina, sannevndrmeulen, joyously, SergeyBiryukov.
Fixes #43697.
Built from https://develop.svn.wordpress.org/trunk@51022


git-svn-id: http://core.svn.wordpress.org/trunk@50631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-26 01:17:57 +00:00
ryelle
56ca42b5d9 Block Editor: Add support for the pattern directory.
Add an endpoint for fetching block patterns from WordPress.org, and load the block patterns from this new API. Remove the block patterns that have already been moved to WordPress.org/patterns.

Props ryelle, iandunn, youknowriad, timothyblynjacobs.
Fixes #53246.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-26 01:11:59 +00:00
Peter Wilson
072e83aac4 REST API: Remove WP_Test_REST_Widgets_Controller tests.
This test suite is causing a loop in PHP8, remove tests to investigate.

Props SergeyBiryukov, desrosj.
See #41683.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50629 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-26 00:29:58 +00:00
desrosj
f8947ceb0b Formatting: Introduce the document_title filter.
In `wp_get_document_title(), the returned value is currently passed directly through `wptexturize()`, `convert_chars()`, and `capital_P_dangit()`, and is done so after the `document_title_parts` filter is run.

This makes it impossible to fully control the output of `wp_get_document_title()` and is inconsistent with how other similar text is processed with these functions.

This commit introduces the `document_title` filter, which is run immediately before returning the results of the `wp_get_document_title()` function and moves the three formatting functions mentioned above to the new filter hook. This allows developers to further modify the title after being prepared by WordPress, or to modify the functions hooked to this filter as they wish.

Props dragunoff, jeremyfelt, paaggeli, audrasjb.
Fixes #51643.
Built from https://develop.svn.wordpress.org/trunk@51019


git-svn-id: http://core.svn.wordpress.org/trunk@50628 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 23:43:57 +00:00
Sergey Biryukov
9c0dc03f90 Posts, Post Types: Speed cached get_pages() calls.
This improves performance for sites with persistent cache backend having a lot of pages requested via the `get_pages() function, by taking advantage of `wp_cache_get_multiple()` instead of fetching each individual page from the backend cache server one by one.

It also matches the behaviour of `get_pages()` when the pages are retrieved from the database.

Props david.binda, hellofromTonya.
Fixes #51469.
Built from https://develop.svn.wordpress.org/trunk@51018


git-svn-id: http://core.svn.wordpress.org/trunk@50627 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 23:41:57 +00:00
desrosj
66603b4bd7 External Libraries: Update two polyfill libraries to their latest versions.
This updates the following polyfill libraries bundled with WordPress to their latest versions:
- `formdata-polyfill` from `3.0.20` to `4.0.0`.
- `polyfill-library` from `3.104.0` to `3.105.0`.

Fixes #52854.
Built from https://develop.svn.wordpress.org/trunk@51017


git-svn-id: http://core.svn.wordpress.org/trunk@50626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 23:28:15 +00:00
Sergey Biryukov
6da4818d8c Build/Test Tools: Use the Composer-installed version of PHPUnit for Grunt tasks.
This makes it easier to run `phpunit` Grunt tasks without having to figure out how and which PHPUnit version needs to be installed.

It also more closely matches the `format:php` task.

Follow-up to [47881].

Props ocean90.
Fixes #53015.
Built from https://develop.svn.wordpress.org/trunk@51016


git-svn-id: http://core.svn.wordpress.org/trunk@50625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 23:15:58 +00:00
Sergey Biryukov
b8ee0a22a5 Posts, Post Types: Remove some unused strings from built-in post type declarations.
The `customize_changeset`, `wp_block`, and `wp_template` post types are not displayed in the admin menu or in the admin bar.

If they do get added, the labels can just fall back to `name` and `singular_name` until separate strings are required for more flexible translations.

Follow-up to [38810], [44146], [51003].

See #53176.
Built from https://develop.svn.wordpress.org/trunk@51015


git-svn-id: http://core.svn.wordpress.org/trunk@50624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 22:49:57 +00:00
Sergey Biryukov
74eec0c180 Block Editor: Declare the wp_template post type as built-in.
Remove redundant `show_in_admin_bar` property, which defaults to the value of `show_in_menu`.

Follow-up to [51003].

See #53176.
Built from https://develop.svn.wordpress.org/trunk@51014


git-svn-id: http://core.svn.wordpress.org/trunk@50623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 22:29:05 +00:00
Sergey Biryukov
3c3a18a957 Block Editor: Only load the WP_Theme_JSON_Resolver class once.
Since the class is now loaded via `wp-includes/script-loader.php`, which is required earlier in `wp-settings.php`, loading it again in `wp-settings.php` is redundant.

Follow-up to [50992], [51001].

See #53175.
Built from https://develop.svn.wordpress.org/trunk@51013


git-svn-id: http://core.svn.wordpress.org/trunk@50622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 21:40:57 +00:00
ryelle
d8b8ceb4d3 Bundled Themes: Introduce block patterns for Twenty Thirteen.
Props joen, melchoyce, kjellr, onemaggie.
Fixes #51104.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50621 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 20:26:59 +00:00
Sergey Biryukov
8f8f433b3c Administration: Improve the message about installing the Link Manager plugin to use legacy Links screen.
This provides direct links to install and activate the plugin, if the user has the capabilities to do so, instead of just linking to plugin search results.

It also matches more closely the message about installing the Classic Editor plugin for meta boxes incompatible with the block editor.

Follow-up to [22855], [44280], [45657].

Props tw2113, peterwilsoncc, SergeyBiryukov.
Fixes #52669.
Built from https://develop.svn.wordpress.org/trunk@51011


git-svn-id: http://core.svn.wordpress.org/trunk@50620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 20:14:59 +00:00
Sergey Biryukov
b722ba6ca5 Coding Standards: Further update the code for bulk menu items deletion to better follow WordPress coding standards.
Follow-up to [51006], [51009].

See #21603.
Built from https://develop.svn.wordpress.org/trunk@51010


git-svn-id: http://core.svn.wordpress.org/trunk@50619 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 19:14:57 +00:00
joedolson
a4bf256f7c Coding Standards: Apply some minor coding standards fixes.
Follow up to [51006].

See #21603.
Built from https://develop.svn.wordpress.org/trunk@51009


git-svn-id: http://core.svn.wordpress.org/trunk@50618 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 18:53:58 +00:00
desrosj
e6ea717277 External Libraries: Update the phpass library to version 0.5.
This updates the phpass library from version `0.3` to the latest version of `0.5`. This is a minor update that includes some adjustments to be more friendly with newer versions of PHP.

The changes made in [30466] have also been applied to the new version of the library. This should now be the only WordPress specific modification do this library.

Props ayeshrajans, dd32, otto42, desrosj.
Fixes #51549.
Built from https://develop.svn.wordpress.org/trunk@51008


git-svn-id: http://core.svn.wordpress.org/trunk@50617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 18:47:59 +00:00
desrosj
836b5ad7c7 Coding Standards: Apply some minor coding standards adjustments.
Follow up to [50977], [50987], and [50995].

See #41683, #53156, #53175.
Built from https://develop.svn.wordpress.org/trunk@51007


git-svn-id: http://core.svn.wordpress.org/trunk@50616 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 17:43:57 +00:00
joedolson
212f532d4c Menus: Add bulk delete for menu items.
Adds an option to bulk delete menu items from the core Navigation Menus screen, offering a considerable usability benefit when making significant changes to navigation menus.

Uses the bulk select pattern found in post and media lists for consistency with other core management screens, rather than the rapid delete pattern found in menus in the customizer.

Props wphound, welcher, melchoyce, maxpertici, audrasjb
Fixes #21603.
Built from https://develop.svn.wordpress.org/trunk@51006


git-svn-id: http://core.svn.wordpress.org/trunk@50615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 17:42:58 +00:00
desrosj
a07a6490ab Users: Pass on the user data received by wp_insert_user() to related hooks.
This adds a new parameter to the action and filter hooks found in `wp_insert_user()` to pass the raw user data received through `$userdata` to hooked functions.

This will allow hooked functions to perform more contextual adjustments to new users, and makes supplying custom user meta fields possible.

Props johnbillion, audrasjb.
Fixes #53110.
Built from https://develop.svn.wordpress.org/trunk@51005


git-svn-id: http://core.svn.wordpress.org/trunk@50614 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 17:39:57 +00:00
ryelle
b797aa3b53 Toolbar: Prevent username from wrapping when avatars are disabled.
In IE11, the floated icon causes the "Howdy, username" to wrap to a second line, preventing access to help tabs and possibly affecting the frontend. Changing the display fixes the layout, and prevents the wrap.

Props bhwebworks, 5um17, sabernhardt, boniu91, audrasjb.
Fixes #26933.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 17:10:58 +00:00
youknowriad
4ae0e4220f Block Editor: Introduce block templates for classic themes.
With this patch, users will be able to create custom block based templates
and assign them to specific pages/posts.

Themes can also opt-out of this feature

Props bernhard-reiter, carlomanf.
Fixes #53176.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 14:20:57 +00:00
Sergey Biryukov
30d411f482 Upgrade/Install: Update sodium_compat to v1.16.1.
The latest version of sodium_compat includes polyfills for new features slated to land in PHP 8.1:
https://paragonie.com/blog/2021/05/ristretto255-for-php-community

It also fixes a race condition with the autoloader that caused an "undefined constant" error on some systems:
https://github.com/paragonie/sodium_compat/issues/122

A full list of changes in this update can be found on GitHub:
https://github.com/paragonie/sodium_compat/compare/v1.14.0...v1.16.1

Follow-up to [49741].

Props paragoninitiativeenterprises, oxyrealm.
Fixes #53274.
Built from https://develop.svn.wordpress.org/trunk@51002


git-svn-id: http://core.svn.wordpress.org/trunk@50611 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 13:55:58 +00:00
youknowriad
f6af848c72 Block Editor: Load theme resolver class in script loader.
script-loader.php is sometimes called directly and in these situations, the Theme_JSON_Resolver class was not defined.

Props nosolosw, noisysocks.
Fixes #53175.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50610 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 13:42:58 +00:00
Sergey Biryukov
cc95428f75 REST API: Update “object” strings to use the appropriate nouns.
This updates route arguments and schema descriptions to use more specific object types for clarity.

Follow-up to [39342].

Props lephleg, jnylen0.
Fixes #40720.
Built from https://develop.svn.wordpress.org/trunk@51000


git-svn-id: http://core.svn.wordpress.org/trunk@50609 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 13:12:58 +00:00
Sergey Biryukov
670ec9cfa7 Comments: Include a "View Post" link on the Comments screen for a single post.
This makes it easier to view the post on the front end of the site when moderating comments, without having to open the editor first.

Props trejder, audrasjb, vladytimy, lukecarbis, ayeshrajans, chaion07, paaljoachim, hareesh-pillai, SergeyBiryukov.
Fixes #52353.
Built from https://develop.svn.wordpress.org/trunk@50999


git-svn-id: http://core.svn.wordpress.org/trunk@50608 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 12:26:58 +00:00
Sergey Biryukov
c649d69a9a Coding Standards: Move assignment out of condition in phpunit/includes/speed-trap-listener.php.
Follow-up to [45588] for `phpunit/includes/phpunit7/speed-trap-listener.php`.

See #52625.
Built from https://develop.svn.wordpress.org/trunk@50998


git-svn-id: http://core.svn.wordpress.org/trunk@50607 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 11:55:59 +00:00
noisysocks
8775b69cd0 Adds the widgets block editor to widgets.php and customize.php
Moves the widgets block editor from Gutenberg into WordPress Core.

- Adds @wordpress/edit-widgets, @wordpress/customize-widgets and
  @wordpress/widgets.
- Modifies wp-admin/widgets.php to branch between the old editor and new editor
  depending on wp_use_widgets_block_editor().
- Modifies WP_Customize_Widgets to branch between the old editor control and new
  editor control depending on wp_use_widgets_block_editor().

Follows [50996] which was missing these files.
See #51506.
Props isabel_brison, TimothyBlynJacobs, andraganescu, kevin940726, talldanwp.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50606 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 08:52:58 +00:00
noisysocks
81f62198c3 Adds the widgets block editor to widgets.php and customize.php
Moves the widgets block editor from Gutenberg into WordPress Core.

- Adds @wordpress/edit-widgets, @wordpress/customize-widgets and
  @wordpress/widgets.
- Modifies wp-admin/widgets.php to branch between the old editor and new editor
  depending on wp_use_widgets_block_editor().
- Modifies WP_Customize_Widgets to branch between the old editor control and new
  editor control depending on wp_use_widgets_block_editor().

Fixes #51506.
Props isabel_brison, TimothyBlynJacobs, andraganescu, kevin940726, talldanwp.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50605 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 08:40:25 +00:00
noisysocks
1314542c50 REST API: Add widget endpoints
Adds the sidebars, widgets and widget-types REST API endpoints from the
Gutenberg plugin.

Fixes #41683.
Props TimothyBlynJacobs, spacedmonkey, zieladam, jorgefilipecosta, youknowriad, kevin940726.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 08:27:57 +00:00
noisysocks
ed195fbd89 REST API: Revert widget endpoints
Reverts [50993] as it has missing props.

Reverts [50993].
See #41683.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50603 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 08:22:56 +00:00
noisysocks
2a4e1e0c04 REST API: Add widget endpoints
Adds the sidebars, widgets and widget-types REST API endpoints from the
Gutenberg plugin.

Fixes #41683.
Props TimothyBlynJacobs.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 07:52:55 +00:00
youknowriad
2b7ad8ad4f Block Editor: Load the classic layout stylesheet conditionallty.
Historically, the block editor has been opinionated about the size of the canvas and the alignments.
Themes with theme.json will have to define a "layout" in their settings and the classic stylesheet won't be loaded anymore for this.

Props nosolosw.
See #53175.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 07:40:56 +00:00
youknowriad
dd68caaf6d Block Editor: Add the layout block support.
The layout block allows containers to define the size of their inner blocks
and the allowed allignments.
It's only enabled for themes with theme.json files.

Props nosolosw.
See #53175.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 07:36:58 +00:00
Aaron Jorbin
b6b98b8e2d Formatting: Add 'main' tag to kses
`main` is a valid HTML element that is especially valuable for KSES to support in light of full site editing.

Related: https://github.com/WordPress/gutenberg/pull/28576 for the addition of `main` to the group block.

Fixes #53156.
Props glendaviesnz.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50596 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 01:43:55 +00:00
Sergey Biryukov
5386157101 Tests: Minimize the chances of signature conflicts for assertEqualsWithDelta().
The PHPUnit 7.5+ method `assertEqualsWithDelta()` was polyfilled for PHPUnit < 7.5, but also overloaded for PHPUnit 7.5 itself, which was not necessary and created a higher chance of signature conflicts, especially when the WP test suite is used as a basis for integration tests with plugins/themes.

This change removes the unnecessary overloading for PHPUnit 7.5+ and simplifies the overloaded method for PHPUnit < 7.5, including removing the `IsEqual()` class alias declaration, no longer needed.

Follow-up to [48952].

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


git-svn-id: http://core.svn.wordpress.org/trunk@50595 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 01:09:00 +00:00
Peter Wilson
277e288c44 Build: Use deterministic module ids in webpack for media.
Used `hashed` IDs rather the `named` IDs to reduce file size and remove references to non-existent paths in the final build.

Follow-up for [50940,50984].
Props gziolo, peterwilsoncc.
See #53192.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50594 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-25 00:12:57 +00:00
gziolo
2597902bc0 Build: Use deterministic module ids in webpack for media
Follow-up for [50940].
Props peterwilsoncc.
See #53192. 


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


git-svn-id: http://core.svn.wordpress.org/trunk@50593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 21:35:56 +00:00
gziolo
cfa7f89ba0 Editor: Use the block editor context in filters that used the editor name
Follow-up for [50956].
Props azaozz, chrisvanpatten, timothyblynjacobs, youknowriad.
Fixes #52920.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 21:21:57 +00:00
Sergey Biryukov
492bfa670e Tests: Improve PHPUnit version retrieval.
Always test for newer class names first and fall back to the older.

This improves compatibility when running PHPUnit via a phar while there is also a Composer-installed version of PHPUnit on the system.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50591 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 21:04:56 +00:00
desrosj
0d1e4e553c General: Avoid unnecessary calls to update_user_option().
The `update_user_option()` function is a way to update a user meta value after adding a blog’s prefix to the beginning of the meta key. But when the fourth parameter is `true`, the behavior is exactly the same as calling `update_user_meta()` directly.

This replaces all instances of `update_user_option()` when the fourth parameter is `true` in Core with a direct call to `update_user_meta()` to prevent an unnecessary call to `update_user_option()`.

Props johnjamesjacoby, zkancs, obenland, desrosj.
Fixes #43339.
Built from https://develop.svn.wordpress.org/trunk@50981


git-svn-id: http://core.svn.wordpress.org/trunk@50590 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 19:59:57 +00:00
desrosj
50c526f82b Editor: Hide the quicktags toolbar when JavaScript is disabled.
This adds the `hide-if-no-js` class to the quicktags toolbar in the Classic Editor. This prevents an empty space from showing when JavaScript is disabled.

Props DeusTron, sabernhardt, Boniu91, poena.
Fixes #40570.
Built from https://develop.svn.wordpress.org/trunk@50980


git-svn-id: http://core.svn.wordpress.org/trunk@50589 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 19:44:57 +00:00
Sergey Biryukov
c4182fd00f Site Health: Make sure the submit_button() function is available in request_filesystem_credentials().
This avoids a fatal error when the function is called via REST API from `WP_Site_Health_Auto_Updates::test_check_wp_filesystem_method()`.

Props lakrisgubben, mukesh27, Clorith, SergeyBiryukov.
Fixes #53206.
Built from https://develop.svn.wordpress.org/trunk@50979


git-svn-id: http://core.svn.wordpress.org/trunk@50588 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 19:24:57 +00:00
Sergey Biryukov
209074f5e1 Themes: Add an indication of whether a theme is a child theme on network admin Themes screen.
This shows the parent theme name in a child theme's metadata section in the list table, in a similar way it is displayed in the theme details modal on the single site Themes screen.

Props dpik, Mista-Flo, seanchayes, poena, johnbillion, jeremyfelt, bradt, jacklenox, helen, Travel_girl, karmatosed, Presskopp, joyously, SergeyBiryukov.
Fixes #30240.
Built from https://develop.svn.wordpress.org/trunk@50978


git-svn-id: http://core.svn.wordpress.org/trunk@50587 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 19:04:56 +00:00
jorgefilipecosta
9b67649f40 Block Editor: Update color merging algorithm.
The npm packages in use were published a few hours ago, which include some changes to how we manage colors. This commit adds the corresponding PHP changes.

Props nosolosw.
See #53175.
Built from https://develop.svn.wordpress.org/trunk@50977


git-svn-id: http://core.svn.wordpress.org/trunk@50586 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 18:57:55 +00:00
desrosj
0a75462702 Twenty Twenty: Hide some elements for print that are not useful in that context.
This adds the comment count, previous/next posts navigation, and category link list to the list of elements hidden from the print context.

Props kjellr, hareesh-pillai, poena.
Fixes #50433.
Built from https://develop.svn.wordpress.org/trunk@50976


git-svn-id: http://core.svn.wordpress.org/trunk@50585 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 18:41:55 +00:00
desrosj
5132f704d4 Twenty Twenty-One: Re-add px unit to the admin bar height custom property.
The `px` unit added in [50388] to prevent invalid values when using `calc` functions was inadvertently removed in [50972].

This re-adds the unit to ensure the issue reported in #52564 remains fixed. The same stylelint rule adjustment made in [50388] to `.stylelintrc-css.json` has also been copied over to `stylelintrc.json` file,  which is the configuration file used when linting `.scss` files.

Props ocean90.
See #52624, #52564.
Built from https://develop.svn.wordpress.org/trunk@50975


git-svn-id: http://core.svn.wordpress.org/trunk@50584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 18:33:59 +00:00
desrosj
cb5943f263 Bundled Themes: Update devDependencies for default themes.
This updates several `devDependencies` to their latest versions for the Twenty Twenty and Twenty Nineteen themes.

See #52624.
Built from https://develop.svn.wordpress.org/trunk@50974


git-svn-id: http://core.svn.wordpress.org/trunk@50583 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 18:10:00 +00:00
jorgefilipecosta
18200cc30c Block Editor: Add Global Styles support using theme.json file.
This is the second piece of landing the theme.json processing in WordPress core. 
It includes the mechanism that outputs the CSS styles of a theme.json file.

Props nosolosw, youknowriad.
See #53175.
Built from https://develop.svn.wordpress.org/trunk@50973


git-svn-id: http://core.svn.wordpress.org/trunk@50582 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 17:39:57 +00:00
desrosj
a537de7b00 Twenty Twenty-One: Update devDependencies.
This updates several `devDependencies` to their latest versions.

The deprecated `stylelint-config-wordpress` package has also been replaced with the `@wordpress/stylelint-config` package.

This commit also includes several minor adjustments to `.scss` files to decrease the number of coding standards warnings produced when running `lint:scss`.

See #52624.
Built from https://develop.svn.wordpress.org/trunk@50972


git-svn-id: http://core.svn.wordpress.org/trunk@50581 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 15:37:55 +00:00
Sergey Biryukov
f092c961c0 Editor: Remove gutenberg text domain from Query and Social Links block patterns.
Follow-up to [50948].

Props ntsekouras.
Fixes #53265. See #53248.
Built from https://develop.svn.wordpress.org/trunk@50971


git-svn-id: http://core.svn.wordpress.org/trunk@50580 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 13:53:56 +00:00
Sergey Biryukov
bd5322c635 Tests: Remove trailing commas in function calls in _wp_array_get() tests.
This fixes parse errors on PHP 7.2 and lower versions.

Follow-up to [49143], [49144], [49580], [50964].

See #51461, #51720, #52625.
Built from https://develop.svn.wordpress.org/trunk@50970


git-svn-id: http://core.svn.wordpress.org/trunk@50579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 13:47:56 +00:00
Sergey Biryukov
09177b1965 Tests: Rename classes in phpunit/tests/privacy/ per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967], [50968].

See #52625.
Built from https://develop.svn.wordpress.org/trunk@50969


git-svn-id: http://core.svn.wordpress.org/trunk@50578 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 13:38:58 +00:00
Sergey Biryukov
f6114ba4b4 Tests: Rename some classes in phpunit/tests/theme/ per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780], [48911], [49327], [50291], [50292], [50342], [50452], [50453], [50456], [50967].

See #52625.
Built from https://develop.svn.wordpress.org/trunk@50968


git-svn-id: http://core.svn.wordpress.org/trunk@50577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 13:32:56 +00:00
Sergey Biryukov
19ea4bd412 Docs: Some documentation and test improvements for WP_Theme_JSON and WP_Theme_JSON_Resolver classes:
* Add missing `@since` tags.
* Update some DocBlocks per the documentation standards.
* Rename test files and classes per the naming conventions.
* Fix some code alignment issues reported by WPCS.

Follow-up to [50959], [50960].

See #52991, #53175.
Built from https://develop.svn.wordpress.org/trunk@50967


git-svn-id: http://core.svn.wordpress.org/trunk@50576 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 13:25:56 +00:00
Sergey Biryukov
645fffca13 Tests: Correct description for the Tests_Functions_wpArraySet class.
Follow-up to [50958], [50962], [50964], [50965].

See #53175, #52625.
Built from https://develop.svn.wordpress.org/trunk@50966


git-svn-id: http://core.svn.wordpress.org/trunk@50575 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 12:28:54 +00:00
Sergey Biryukov
8f47c944d8 General: Some documentation and test improvements for the _wp_array_set():
* Update the function DocBlock per the documentation standards.
* Move the unit tests to a more appropriate place.
* Rename and reorder the tests for consistency with `_wp_array_get()` tests.

Follow-up to [50958], [50962], [50964].

See #53175, #52625.
Built from https://develop.svn.wordpress.org/trunk@50965


git-svn-id: http://core.svn.wordpress.org/trunk@50574 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 12:25:55 +00:00
Sergey Biryukov
935ab6ecca Tests: Add missing tests for the _wp_array_get() function.
Follow-up to [49143], [49144], [49580].

Props jorgefilipecosta, johnbillion.
See #51461, #51720, #52625.
Built from https://develop.svn.wordpress.org/trunk@50964


git-svn-id: http://core.svn.wordpress.org/trunk@50573 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 11:07:55 +00:00
gziolo
a380cdd21a Editor: Remove unused param in get_default_block_editor_settings
Follow-up for [50776].

Props nosolosw.
See #52920.



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


git-svn-id: http://core.svn.wordpress.org/trunk@50572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 10:23:56 +00:00
gziolo
75f4e848f5 Editor: Rename the unit test file for _wp_array_set function
Follow-up [50958].
See #53175. 


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


git-svn-id: http://core.svn.wordpress.org/trunk@50571 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 09:59:56 +00:00
Sergey Biryukov
aabce962ae Widgets: Make sure WP_Widget constructor creates a correct classname value for a namespaced widget class.
This reverts the changes to `id_base` from [50953] due to backward compatibility concerns, and instead focuses on the `id` and `class` attributes specifically.

With this change, any backslashes in the `id` or `class` attributes for a namespaced widget class are converted to underscores, making it easier to style the output or target the widget with JavaScript.

Follow-up to [50953].

Fixes #44098.
Built from https://develop.svn.wordpress.org/trunk@50961


git-svn-id: http://core.svn.wordpress.org/trunk@50570 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 09:51:56 +00:00
gziolo
3143af5910 Editor: Fix failing unit test for i18n support in theme.json
As part of the change, I also did some code reorganization to match with how other test fixtures are handled.

Follow-up [50959].

See #52991.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50569 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 09:50:59 +00:00
youknowriad
4e1dc7a28c Block Editor: Add Global Settings support using theme.json file.
This is the first piece of landing the theme.json processing in WordPress core. 
It allows themes to configure the different editor settings, allow cusomizations and define presets in theme.json file.
 
Props jorgefilipecosta, nosolosw.
See #53175.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50568 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 08:37:55 +00:00
youknowriad
6c0578055c General: Add _wp_array_set function.
This adds the _wp_array_set function, which is the counterpart of the existing _wp_array_get.
This utility is to be used by the Global Settings work.

Props nosolosw, jorgefilipecosta.
See #53175.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 08:30:56 +00:00
gziolo
3989828e0b Editor: Add missing class WP_Block_Editor_Context
Follow-up for [50956].
See #52920.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50566 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 07:38:58 +00:00
gziolo
4ae98860b9 Editor: Extract block_editor_rest_api_preload method for use with different editor screens
It is going to be used on the new widgets editor screen. This patch also introduced a new class WP_Block_Editor_Context that is going to be used with revised block editor filters to let extenders to keep their existing behavior. It should also allow to provide more settings through the context class as new screens get introduced like the navigation editor.

Props azaozz, chrisvanpatten, timothyblynjacobs, youknowriad.
Fixes #52920.



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


git-svn-id: http://core.svn.wordpress.org/trunk@50565 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 07:32:55 +00:00
gziolo
f8286bbd4d Editor: Add missing unit tests for block_has_support
Follow-up for [50761].
Props ntsekouras.
Fixes #53257. See #52991.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50564 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 06:26:58 +00:00
Peter Wilson
5ce6da1a31 XML-RPC: Set HTTP status code in accordance with the spec.
When the XML-RPC endpoint is enabled, always return a HTTP `200 OK` status code in accordance with the XML-RPC specification. Continue to return an HTTP `405 Method Not Allowed` status code when the endpoint is disabled.

Props ariskataoka, johnbillion.
Fixes #52958.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-24 02:18:58 +00:00
Sergey Biryukov
7670b7dca8 Widgets: Make sure WP_Widget constructor creates a correct id_base value for a namespaced widget class.
The `id_base` value is used for the widget's `id` and `class` attributes and also for the option name which stores the widget settings (unless the widget specifies a custom `option_name` value).

With this change, any backslashes in the `id_base` for a namespaced widget class are converted to hyphens, making it easier to style the output or target the widget with JavaScript.

This also avoids a `preg_match(): Compilation failed` PHP warning from `next_widget_id_number()` on the Widgets screen, previously caused by unescaped backslashes.

Props Mte90, hermpheus, rogerlos, welcher, SergeyBiryukov.
Fixes #44098.
Built from https://develop.svn.wordpress.org/trunk@50953


git-svn-id: http://core.svn.wordpress.org/trunk@50562 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-23 08:51:58 +00:00
Sergey Biryukov
1e02e0f049 Docs: Use 3-digit, x.x.x-style semantic versioning for two _doing_it_wrong() calls.
Follow-up to [37985], [38420], [39021].

See #52628.
Built from https://develop.svn.wordpress.org/trunk@50952


git-svn-id: http://core.svn.wordpress.org/trunk@50561 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-22 13:09:56 +00:00
Sergey Biryukov
5ffa346fd0 Media: Some documentation and test improvements for the image_editor_output_format filter:
* Update the filter DocBlock per the documentation standards.
* Use a shorter variable name for consistency with the surrounding code.
* Delete the test file before performing assertions to avoid leftovers in case the test fails.

Follow-up to [50943].

See #52867.
Built from https://develop.svn.wordpress.org/trunk@50951


git-svn-id: http://core.svn.wordpress.org/trunk@50560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-22 13:00:02 +00:00
youknowriad
e0d91e047b Block Editor: Removed useless block editor render context value.
The "query" context value was meant to be used by the Query block.
But the block has been refactored to avoid relying on context for this.

Props ntsekouras.
Fixes #53250.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-21 15:57:56 +00:00
Adam Silverstein
5ddc1fb946 Revisions: add a new filter for revisions to keep by post type.
Add a new `wp_{$post_type}_revisions_to_keep` filter that makes it convenient to filter the number of revisions created for a specific post type.

Overrides both the value of WP_POST_REVISIONS and the `wp_revisions_to_keep` filter.

Props dlh.
Fixes #51550.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-21 15:29:55 +00:00
youknowriad
b2e311b85d Block Patterns: Include the Query and Social Icons block patterns from Gutenberg 10.7.0.
These block patterns are considered "core" block patterns and removed
when a them opts out of the core-block-patterns theme support flag.

Props ntsekouras.
Fixes #53248.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-21 11:13:57 +00:00
Sergey Biryukov
977e81b1a1 Text Changes: Improve the wording of some error messages.
Props dartiss, williampatton, johnbillion, SergeyBiryukov.
Fixes #50382.
Built from https://develop.svn.wordpress.org/trunk@50947


git-svn-id: http://core.svn.wordpress.org/trunk@50556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-21 10:49:57 +00:00
Sergey Biryukov
cbcd3ffef3 Boostrap/Load: Further update the language in wp-config-sample.php.
This restores "That's all, stop editing!" line to its previous format, to avoid breaking external integrations looking for that format specifically.

Follow up to [50915], [50917], [50918].

Props swissspidy, schlessera.
Fixes #37199.
Built from https://develop.svn.wordpress.org/trunk@50946


git-svn-id: http://core.svn.wordpress.org/trunk@50555 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-21 10:40:56 +00:00
youknowriad
a225c5cdc6 Block Editor: Updated the WordPress packages from Gutenberg 10.7.0 RC.
This also includes:

 - The removal of the Post Author block.
 - Renaming build_query_vars_from_query_block function.
 - Update the block supports.

Props gziolo.
See #52991. 
-This line, and those below, will be ignored--

M    package-lock.json
M    package.json
M    src/wp-includes/assets/script-loader-packages.php
M    src/wp-includes/block-supports/colors.php
AM   src/wp-includes/block-supports/elements.php
D    src/wp-includes/block-supports/padding.php
AM   src/wp-includes/block-supports/spacing.php
M    src/wp-includes/block-supports/typography.php
M    src/wp-includes/blocks/column/block.json
M    src/wp-includes/blocks/index.php
D    src/wp-includes/blocks/post-author
D    src/wp-includes/blocks/post-author.php
M    src/wp-includes/blocks/post-content.php
M    src/wp-includes/blocks/post-featured-image.php
M    src/wp-includes/blocks/query/block.json
M    src/wp-includes/blocks/query-loop/block.json
M    src/wp-includes/blocks/query-loop.php
M    src/wp-includes/blocks/query-pagination/block.json
M    src/wp-includes/blocks/query-pagination-next.php
M    src/wp-includes/blocks/query-pagination-numbers.php
M    src/wp-includes/blocks/site-tagline/block.json
M    src/wp-includes/blocks/site-title/block.json
M    src/wp-includes/blocks.php
M    src/wp-settings.php
M    tests/phpunit/tests/blocks/block.php
M    tools/webpack/packages.js

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


git-svn-id: http://core.svn.wordpress.org/trunk@50554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-21 10:14:23 +00:00
gziolo
40eb9c9f9c Editor: Add missing unit tests for construct_wp_query_args
Follow-up for [50929].
Props ntsekouras, jorbin.
Fixes #53240. See #52991.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50553 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-21 06:29:57 +00:00
antpb
8284a1f6ae Media: Introduces image_editor_output_format filter for setting default MIME type of sub size image output.
This change introduces the `image_editor_output_format` filter, which fires as sub size images are generated allowing to define a default image MIME type for those items.

Props adamsilverstein, williampatton, spacedmonkey, mikeschroder, hellofromTonya, justinahinon, Boniu91, antpb, SergeyBiryukov.
Fixes #52867.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50552 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-20 22:15:56 +00:00
ryelle
48660b62b6 Administration: List Tables: Wrap long search terms onto a new line.
Props sumitsingh, audrasjb, justinahinon, sahilmepani, hareesh-pillai.
Fixes #52749.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-20 19:09:59 +00:00
gziolo
c7acbeda19 Editor: Update lodash to the latest version 4.17.21
It aligns with the version that Gutenberg uses.

Props peterwilsoncc.
See #52991.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50550 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-20 13:02:17 +00:00
gziolo
6e4458c935 Build: Use hashed/deterministic moduleIDs in webpack config
Props peterwilsoncc, desrosj.
Fixes #53192.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50549 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-20 12:20:04 +00:00
Clorith
c47c99900c Site Health: Skip REST tests during scheduled events.
This change fixes a false positive that would appear during scheduled events, by only running the REST test when a user visits the Site Health page, meaning an active session is available.

The test checking if the REST API is available, includes a parameter for `context=edit` to make sure the block editor can function properly. This means a user session with editor capabilities is required for the test to pass, which is not the case during a scheduled event.

Props szaqal21, TimothyBlynJacobs, hermpheus.
Fixes #52112.
Built from https://develop.svn.wordpress.org/trunk@50939


git-svn-id: http://core.svn.wordpress.org/trunk@50548 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-20 11:09:56 +00:00
Peter Wilson
fabf5334a5 Menus: Do not auto-set locations for new menus.
Do not auto-set new menus to all vacant locations on the Appearance > Menus screen in the dashboard.

Follow up to [48051].

Props Chouby, audrasjb, davidbaumwald, mukesh27.
Fixes #52949.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50547 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-20 04:52:56 +00:00
Sergey Biryukov
cf90ff2427 General: Ensure consistent type for integer properties of a bookmark object.
Previously, these properties could be unexpectedly converted to strings in some contexts.

This applies to the following function:

* `sanitize_bookmark_field()`

and the following properties:

* `$bookmark::link_id`
* `$bookmark::link_rating`

Follow-up to [50935].

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


git-svn-id: http://core.svn.wordpress.org/trunk@50545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-20 00:04:56 +00:00
Sergey Biryukov
893beee31e General: Ensure consistent type for integer properties of WP_Post, WP_Term, and WP_User.
Previously, these properties could be unexpectedly converted to strings in some contexts.

This applies to the following functions:

* `sanitize_post_field()`
* `sanitize_term_field()`
* `sanitize_user_field()`

and the following properties:

* `WP_Post::ID`
* `WP_Post::post_parent`
* `WP_Post::menu_order`
* `WP_Term::term_id`
* `WP_Term::term_taxonomy_id`
* `WP_Term::parent`
* `WP_Term::count`
* `WP_Term::term_group`
* `WP_User::ID`

Props grantmkin, SergeyBiryukov.
Fixes #53235. See #52995.
Built from https://develop.svn.wordpress.org/trunk@50935


git-svn-id: http://core.svn.wordpress.org/trunk@50544 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-19 22:11:56 +00:00
desrosj
4a20a75fa1 Script Loader: Stop loading polyfills specific to Internet Explorer
This change removes the inline JavaScript attached to the `wp-polyfill` script responsible for loading polyfill libraries included specifically for Internet Explorer support.

Support for the final version of IE supported in WordPress Core (IE11) was removed in [50784] and will on longer be supported when the next version of WordPress is released.

These scripts are still registered and available to be enqueued, but WordPress will no longer load them by default.

For more information, see https://wordpress.org/news/2021/05/dropping-support-for-internet-explorer-11/.

Props youknowriad, gziolo, sergiomdgomes, desrosj.
Fixes #53078.
Built from https://develop.svn.wordpress.org/trunk@50934


git-svn-id: http://core.svn.wordpress.org/trunk@50543 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-19 20:00:57 +00:00
davidbaumwald
77cf4ea88d Twenty Twenty: Correct label attribute references to aria_label in get_search_form.
In the bundled Twenty Twenty theme, a `label` argument was passed to `get_search_form` but used as the `aria_label` on the form.  This change updates the argument name to `aria_label` and maintains backwards compatibility for usage of the original `label` argument.

Props poena, sabernhardt, ipulc2, kishanjasani, mukesh27.
Fixes #51877.
Built from https://develop.svn.wordpress.org/trunk@50933


git-svn-id: http://core.svn.wordpress.org/trunk@50542 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-19 18:39:56 +00:00
Sergey Biryukov
96beaa51d3 App Passwords: Use "sites" terminology instead of "blogs" in application passwords help text.
Follow-up to [49270].

Props jeremy80, johnbillion, audrasjb.
Fixes #53225.
Built from https://develop.svn.wordpress.org/trunk@50932


git-svn-id: http://core.svn.wordpress.org/trunk@50541 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-19 18:17:56 +00:00
davidbaumwald
f47a74a428 I18N: Combine escaping and translation functions.
There are a few instances where two separate functions are used for both escaping and translating output.  This change combines the two functions into the appropriate Core helper function.

Props dimadin, SergeyBiryukov.
Fixes #53153.
Built from https://develop.svn.wordpress.org/trunk@50931


git-svn-id: http://core.svn.wordpress.org/trunk@50540 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-19 18:10:59 +00:00
desrosj
77c434e130 Build/Test Tools: Use the new concurrency setting for GitHub Actions.
The new `concurrency` setting can be used to ensure only a single workflow run or job is in progress. When used in combination with the `cancel-in-progress` setting, incomplete workflow runs can be cancelled automatically to prevent running workflows unnecessarily.

The workflows that take longer to run previously had this built into a step and utilized a 3rd-party action. Now that this is natively supported by GitHub Actions, using that is preferred.

This option is currently in beta, but is stable enough to use in our workflows for the time being.

Props ocean90.
Fixes #53080.
Built from https://develop.svn.wordpress.org/trunk@50930


git-svn-id: http://core.svn.wordpress.org/trunk@50539 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-19 17:37:59 +00:00
gziolo
c3ea09ebb8 Editor: Update WordPress packages published for Gutenberg 10.6
It contains several changes in addition to regular update to WordPress packages:
- All newly exposed blocks are now registered on the server.
- Dutone block support was added.
- Border block support was updated.
- New shared function `construct_wp_query_args` was added for the family of Query blocks - it might need some further work.

Props youknowriad.
See #52991.



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


git-svn-id: http://core.svn.wordpress.org/trunk@50538 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-19 15:09:27 +00:00
gziolo
087934feea Docs: Include @since in register_block_type definition
See #53233.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50537 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-19 14:00:01 +00:00
gziolo
2ca2feff15 Editor: Extend register_block_type to accept the path file or folder with block.json
Rather than using two distinct methods to register block types in WordPress core, let's make `register_block_type` the canonical method to deal with all use cases. In practice, the patch proposed extends its usage to work as a proxy to `register_block_type_from_metadata`. It should remove some confusion that we observed and let us be more explicit what's the latest recommendation.

Props matveb, mcsf.
Fixes #53233.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50536 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-19 13:52:00 +00:00
Sergey Biryukov
2b6cc00455 Tests: Use assertInstanceOf() instead of assertTrue() in some tests.
See #52625.
Built from https://develop.svn.wordpress.org/trunk@50926


git-svn-id: http://core.svn.wordpress.org/trunk@50535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-18 21:06:02 +00:00
Sergey Biryukov
f4631a98f5 Twenty Nineteen: Update theme information in the package.json file.
This removes references to the archived Git repository and updates the URLs to point to the theme's WordPress.org Theme Directory URL and Trac.

Follow-up to [50924].

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


git-svn-id: http://core.svn.wordpress.org/trunk@50534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-18 12:49:01 +00:00
Sergey Biryukov
5343283f66 Twenty Twenty: Update theme information in the package.json file.
This removes references to the archived Git repository and updates the URLs to point to the theme's WordPress.org Theme Directory URL and Trac.

Props arkrs, desrosj, mukesh27.
Fixes #53196.
Built from https://develop.svn.wordpress.org/trunk@50924


git-svn-id: http://core.svn.wordpress.org/trunk@50533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-18 12:47:05 +00:00
Sergey Biryukov
b8487747b8 KSES: Allow calc() and var() values to be used in inline CSS.
Props aristath, displaynone, joyously, olafklejnstrupjensen, sabernhardt, jamesbonham, poena.
Fixes #46197, #46498.
Built from https://develop.svn.wordpress.org/trunk@50923


git-svn-id: http://core.svn.wordpress.org/trunk@50532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-17 21:04:59 +00:00
Sergey Biryukov
ac943f171a KSES: Remove duplicate object-position property.
As part of some recent changes, the property was added to the list of safe CSS properties twice.

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

See #52991.
Built from https://develop.svn.wordpress.org/trunk@50922


git-svn-id: http://core.svn.wordpress.org/trunk@50531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-17 20:48:01 +00:00
Sergey Biryukov
9fbc705dc0 Plugins: Add support for Update URI header.
This allows third-party plugins to avoid accidentally being overwritten with an update of a plugin of a similar name from the WordPress.org Plugin Directory.

Additionally, introduce the `update_plugins_{$hostname}` filter, which third-party plugins can use to offer updates for a given hostname.

If set, the `Update URI` header field should be a URI and have a unique hostname.

Some examples include:

* `https://wordpress.org/plugins/example-plugin/`
* `https://example.com/my-plugin/`
* `my-custom-plugin-name`

`Update URI: false` also works, and unless there is code handling the `false` hostname, the plugin will never get an update notification.

If the header is present, the WordPress.org API will currently only return updates for the plugin if it matches the following format:

* `https://wordpress.org/plugins/{$slug}/`
* `w.org/plugin/{$slug}`

If the header has any other value, the API will not return a result and will ignore the plugin for update purposes.

Props dd32, DavidAnderson, meloniq, markjaquith, DrewAPicture, mweichert, design_dolphin, filosofo, sean212, nhuja, JeroenReumkens, infolu, dingdang, joyously, earnjam, williampatton, grapplerulrich, markparnell, apedog, afragen, miqrogroove, rmccue, crazycoders, jdgrimes, damonganto, joostdevalk, jorbin, georgestephanis, khromov, GeekStreetWP, jb510, Rarst, juliobox, Ipstenu, mikejolley, Otto42, gMagicScott, TJNowell, GaryJ, knutsp, mordauk, nvartolomei, aspexi, chriscct7, benoitchantre, ryno267, lev0, gregorlove, dougwollison, SergeyBiryukov.
See #14179, #23318, #32101.
Built from https://develop.svn.wordpress.org/trunk@50921


git-svn-id: http://core.svn.wordpress.org/trunk@50530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-17 17:04:01 +00:00
gziolo
ff46fda58d Editor: Remove editor type specific filters for block editor configuration
Aligns with changes introduced in the Gutenberg plugin. The planned follow-up replace the editor name string with a context object to bring back an optional reference to the actual post.

Props youknowriad.
See #52920.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50529 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-17 15:08:00 +00:00
gziolo
b6ba5d33bc Editor: Rename should_load_separate_core_block_assets for consistency
Changes introduced:
- The `wp_should_load_separate_core_block_assets` function.
- The `should_load_separate_core_block_assets` filter.

Props hellofromTonya, SergeyBiryukov.
Fixes #50328.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-17 14:28:04 +00:00
Sergey Biryukov
51fe01e66d Docs: Update documentation in wp-config-sample.php per the documentation standards.
See #52628.
Built from https://develop.svn.wordpress.org/trunk@50918


git-svn-id: http://core.svn.wordpress.org/trunk@50527 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-16 08:45:03 +00:00
Aaron Jorbin
5a0c9a9801 Boostrap/Load: Have language in wp-config-sample.php better match install instructions.
Help prevent errors from users who are less familiar with php from adding code in side the comment block and thus having their code not work. Therefore, this comment is now a single line.

Follow up to [50915].

Fixes #37199.
Props SergeyBiryukov.



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


git-svn-id: http://core.svn.wordpress.org/trunk@50526 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-15 22:00:01 +00:00
Sergey Biryukov
63ea8284a3 Docs: Miscellaneous DocBlock corrections.
See #52628.
Built from https://develop.svn.wordpress.org/trunk@50916


git-svn-id: http://core.svn.wordpress.org/trunk@50525 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-15 17:38:05 +00:00
Aaron Jorbin
bf11362dab Boostrap/Load: Strengthen language in wp-config-sample.php
Make it clearer where custom pieces belong in wp-config.php

Props kraftbj, jorbin.
Fixes #37199.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50524 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-14 19:35:00 +00:00
Aaron Jorbin
e37057bd6b Bootstrap/Load: Improve docs for error reporting
Make it clearer that wp_debug_mode will change this based on the WP_DEBUG constant and also make it clearer where this list comes from.

Props sasagar, schlessera, jorbin.
Fixes #41902.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50523 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-14 19:28:00 +00:00
Sergey Biryukov
c0fa1f1e10 Docs: Update documentation in phpunit/includes/abstract-testcase.php per the documentation standards.
Follow-up to [44902].

See #52628.
Built from https://develop.svn.wordpress.org/trunk@50913


git-svn-id: http://core.svn.wordpress.org/trunk@50522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-14 19:09:06 +00:00
Sergey Biryukov
982c389125 Docs: Clarify the @since note for unlink-homepage-logo in get_custom_logo().
This should make it clearer that the value applies to the `custom-logo` theme feature.

Follow-up to [48039], [48283], [48749], [48757], [48758], [48832].

Props joyously.
See #51075, #52628.
Built from https://develop.svn.wordpress.org/trunk@50912


git-svn-id: http://core.svn.wordpress.org/trunk@50521 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-13 12:54:04 +00:00
ryelle
a6e6e4f935 Toolbar: Reset box-shadow on links.
This prevents any theme-added `box-shadow` styles from applying to the toolbar items.

Props sabernhardt, florianbrinkmann.
Fixes #40594.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50456 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-12 21:22:00 +00:00
ryelle
750697e837 Login, Users: Use a monospace font to display passwords.
When typing a password, the input field should use a monospace font. It's easier to distinguish letters in monospace fonts, which makes it easier to accurately read passwords.

Props robdxw, utz119, hedgefield, hareesh-pillai.
Fixes #40275.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50455 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-12 19:59:02 +00:00
Clorith
d55ae83ddc Site Health: Remove status text indentation.
This removes the left-side margin from the status text in the Site Health dashboard widget, which caused the text to be slightly indented, and not centered under the status indicator circle.

Follow-up to [50833].

See #52966.
Built from https://develop.svn.wordpress.org/trunk@50845


git-svn-id: http://core.svn.wordpress.org/trunk@50454 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-12 14:21:01 +00:00
Sergey Biryukov
6f2d4403c8 Post Thumbnails: Display the "Remove featured image" link in the classic editor in red color.
This matches the color of the "Move to Trash" link and other similar links for destructive actions in the admin.

Props monikarao, hareesh-pillai, sabernhardt, hellofromTonya.
Fixes #45198.
Built from https://develop.svn.wordpress.org/trunk@50844


git-svn-id: http://core.svn.wordpress.org/trunk@50453 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-12 10:14:03 +00:00
desrosj
f812323f13 Build/Test Tools: Update the several dependencies.
This updates the following dependencies:

- `grunt` from `1.3.0` to `1.4.0`.
- `grunt-legacy-util` from `2.0.0` to `2.0.1`.
- `sass` from `1.32.11` to `1.32.12`.
- `sinon-test` from `3.0.0` to `3.1.0`.
- `uglify-js` from `3.13.4` to `3.13.6`.

See #52624.
Built from https://develop.svn.wordpress.org/trunk@50843


git-svn-id: http://core.svn.wordpress.org/trunk@50452 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-11 20:12:15 +00:00
desrosj
f221b3eb54 External Libraries: Update the Requests library to version 1.8.0.
While some of the changes in the `1.8.0` release have already been copied to WordPress Core in earlier releases (see [38727], [46258], [47902] and [49382]), this release contains additional improvements, including:

- A significant performance fix when using cURL.
- Improved compliance with RFC2616.

The library has also been moved under the WordPress project’s GitHub organization and can now be found at https://github.com/WordPress/Requests.

Props jrf, dd32, rmccue, justinahinon, netweb, schlessera, TimothyBJacobs, soulseekah, ozh, skithund, carlalexander, travisnorthcutt, desrosj.
Fixes #53101.
Built from https://develop.svn.wordpress.org/trunk@50842


git-svn-id: http://core.svn.wordpress.org/trunk@50451 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-11 19:42:02 +00:00
davidbaumwald
2e762721b1 Bundled Theme: Update twenty_twenty_one_password_form function to actually use a $post parameter.
The `twentytwentyone` filtered `the_password_form` with a `twenty_twenty_one_password_form` callback that, by default, passed only one parameter that was assumed to be the post or post ID.  However, the first parameter for `the_password_form` is the filtered output value.  This fix updates both the filter reference and callback to use two parameters: `$output` and `$post`. 

Props burhandodhy, mukesh27.
Fixes #53091.
Built from https://develop.svn.wordpress.org/trunk@50841


git-svn-id: http://core.svn.wordpress.org/trunk@50450 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-11 18:26:01 +00:00
davidbaumwald
9cd6547f13 Docs: Update help key documentation link in REST API response.
Props dd32, mukesh27, audrasjb, SergeyBiryukov.
Fixes #53162.
Built from https://develop.svn.wordpress.org/trunk@50840


git-svn-id: http://core.svn.wordpress.org/trunk@50449 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-11 18:05:02 +00:00
Sergey Biryukov
86491779ec Coding Standards: Adds spacing so define() statements displayed when creating a network.
This ensures that the code intended to be copied to `wp-config.php` conforms to WordPress Coding Standards.

Props paulschreiber, johnjamesjacoby.
Fixes #53182.
Built from https://develop.svn.wordpress.org/trunk@50839


git-svn-id: http://core.svn.wordpress.org/trunk@50448 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-11 17:10:02 +00:00
Sergey Biryukov
bc175dca8c Editor: Some documentation and test improvements for loading separate assets for core blocks:
* Move `should_load_separate_core_block_assets()` to a more appropriate place.
* Update DocBlocks and inline comments per the documentation standards.
* Document the `$wp_styles` global in `wp_maybe_inline_styles()`.
* List the expected result first in unit test assertions.
* Remove a duplicate unit test.
* Add missing `@covers` tags.

Follow-up to [50836], [50837].

See #50328, #52620, #53180.
Built from https://develop.svn.wordpress.org/trunk@50838


git-svn-id: http://core.svn.wordpress.org/trunk@50447 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-11 16:28:02 +00:00
gziolo
7f804f8436 Editor: Fix regression introduced with loading separate block assets
Related to [50836]. load-styles.php doesn't load the should_load_separate_core_block_assets function and that causes an error 500 - which in turn makes the dashboard appear unstyled.

Props aristath.
Fixes #53180.



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


git-svn-id: http://core.svn.wordpress.org/trunk@50446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-11 14:16:01 +00:00
gziolo
8df663cbfa Editor: Enqueue script and style assets only for blocks present on the page
Adds styles for individual core blocks to make it possible to render only styles for those blocks that are rendered on the page (frontend). This is optinal functionality for start that can be controlled with the new `separate_core_block_assets` filter.

In addition to that, styles can be inlined when `path` is passed when registering an individual styles. This functionality can be changed with the new `styles_inline_size_limit` filter. The maximum size of inlined styles in bytes defaults to 20 000.

Props aristath, aduth, westonruter, mcsf.
Fixes #50328, #52620.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50445 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-11 09:43:08 +00:00
desrosj
9ec439903d Posts, Post Types: Enable revisions for the wp_block post type.
This allows site owners to take advantage of revisions while broader improvements to block management and reusable blocks are explored.

Props matveb, audrasjb, desrosj.
Fixes #53072.
Built from https://develop.svn.wordpress.org/trunk@50835


git-svn-id: http://core.svn.wordpress.org/trunk@50444 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-10 18:38:59 +00:00
desrosj
41de9e3fd3 Network and Sites: Display site icons in the My Sites menu.
This updates the My Sites dropdown menu on multisite installs to display the site icon for each site. When a site icon is not selected, the default WordPress logo will continue showing.

Props rmccue, joemcgill, afercia, audrasjb, desrosj.
Fixes 46657.
Built from https://develop.svn.wordpress.org/trunk@50834


git-svn-id: http://core.svn.wordpress.org/trunk@50443 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-10 18:24:01 +00:00
Sergey Biryukov
c8e4bb5d70 Site Health: Improve the appearance of Site Health Status dashboard widget.
This better utilizes the available screen space on wider screens.

Props mblach, hedgefield, Clorith.
Fixes #52966.
Built from https://develop.svn.wordpress.org/trunk@50833


git-svn-id: http://core.svn.wordpress.org/trunk@50442 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-10 14:56:00 +00:00
Sergey Biryukov
0a8cfcd0d7 Coding Standards: Use strict comparison in wp-admin/includes/screen.php.
See #52627.
Built from https://develop.svn.wordpress.org/trunk@50832


git-svn-id: http://core.svn.wordpress.org/trunk@50441 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-09 20:27:02 +00:00
Sergey Biryukov
f30138fd8a Docs: Correct @since tags for new properties and functions related to infinite scrolling in Media Library.
Follow-up to [50829].

See #50105, #40330, #52628.
Built from https://develop.svn.wordpress.org/trunk@50831


git-svn-id: http://core.svn.wordpress.org/trunk@50440 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-08 11:22:03 +00:00
joedolson
34e71f3d94 Permalinks: Add labels for permalink configuration fields.
If the current server configuration doesn't allow WordPress to edit permalink settings, the textarea with new rules to use was not labeled. Add labels and aria-describedby pointing to the field description.
 
Props sabernhardt
Fixes #53142.
Built from https://develop.svn.wordpress.org/trunk@50830


git-svn-id: http://core.svn.wordpress.org/trunk@50439 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-07 23:51:04 +00:00
joedolson
9b6710c43c Media: Remove infinite scroll from media library and modal.
Replace infinitely autoloading behavior on scroll with a user-controlled load more button. Fix a long standing accessibility issue in the media library. Infinite scroll poses a wide range of problems for accessibility, usability, and performance.

This change modifies the library to load 40 items in the initial view, with a load more button to load the next 40 items and a button to move focus from the load more region to the first of the most recently added items.

The text for communicating the jump target was broadly discussed, agreeing that the text incorporated here would most concisely and clearly convey the purpose of the button, and any further detail is learnable from use.
 
Props afercia, adamsilverstein, joedolson, audrasjb, francina 
Fixes #50105. See #40330. 
Built from https://develop.svn.wordpress.org/trunk@50829


git-svn-id: http://core.svn.wordpress.org/trunk@50438 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-07 23:19:03 +00:00
John Blackbourn
bdaca9bffc Docs: Miscellaneous docblock updates.
See #52628

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


git-svn-id: http://core.svn.wordpress.org/trunk@50437 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-07 20:16:00 +00:00
desrosj
03dc655612 Docs: Use correct @since tag notation.
This corrects the version number specified by the `@since` tag for the `delete_theme` and `deleted_theme` action hooks introduced in [50826] to contain a full, 3 digit version.

Props ocean90.
See #16401.
Built from https://develop.svn.wordpress.org/trunk@50827


git-svn-id: http://core.svn.wordpress.org/trunk@50436 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-07 18:26:02 +00:00
desrosj
102d9569c2 Themes: Introduce the delete_theme and deleted_theme action hooks.
This change introduces the `delete_theme` and `deleted_theme` action hooks, which fire immediately before and after an attempt to delete a theme, respectively.

Props scottconnerly, ptahdunbar, pbiron, vetyst, desrosj.
Fixes #16401.
Built from https://develop.svn.wordpress.org/trunk@50826


git-svn-id: http://core.svn.wordpress.org/trunk@50435 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-07 16:09:59 +00:00
Sergey Biryukov
0082070074 Plugins: Escape the currently installed version number on Add Plugins screen.
The number is displayed in the plugin details modal if a newer version is already installed.

Props m0ze, bmcculley, ayeshrajans.
Fixes #53020.
Built from https://develop.svn.wordpress.org/trunk@50825


git-svn-id: http://core.svn.wordpress.org/trunk@50434 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-07 13:49:58 +00:00
gziolo
b8871304cf Editor: Update WordPress packages from Gutenberg 10.5
Applies changes between the Gutenberg plugin v10.4 and v10.5. It contains the latest version of WordPress packages and PHP changes applied to non-experimental features.

Props youknowriad.
See #52991.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-07 11:48:27 +00:00
Sergey Biryukov
8cfc803e28 Docs: Correct the aria-current array key in the documentation for two widget filters.
This applies to `nav_menu_link_attributes` and `page_menu_link_attributes` filters.

Follow-up to [42808], [44416].

Props jnylen0, chetan200891, alexstine.
See #43522, #52628.
Built from https://develop.svn.wordpress.org/trunk@50823


git-svn-id: http://core.svn.wordpress.org/trunk@50432 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-07 09:46:58 +00:00
Sergey Biryukov
5354201954 Media: Avoid an infinite loop between wp_getimagesize() and wp_get_image_mime().
As a result of the recent changes, both functions were calling each other if the `exif` PHP extension is not available.

The issue is now resolved by calling the `getimagesize()` PHP function directly, instead of the `wp_getimagesize()` wrapper.

Follow-up to [50146], [50810], [50814], [50815], [50818-50821].

See #35725.
Built from https://develop.svn.wordpress.org/trunk@50822


git-svn-id: http://core.svn.wordpress.org/trunk@50431 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-07 09:33:01 +00:00
Sergey Biryukov
c6028577a4 Media: Remove an extra variable and a redundant check in WP_Image_Editor_Imagick::set_quality().
`wp_get_webp_info()` returns either a string or `false` for the `type` key, so we can just check for the string directly.

Follow-up to [50810], [50814], [50815], [50818-50820].

See #35725.
Built from https://develop.svn.wordpress.org/trunk@50821


git-svn-id: http://core.svn.wordpress.org/trunk@50430 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-06 15:04:57 +00:00
Sergey Biryukov
bff31c970e Docs: Correct documentation for wp_get_webp_info() return results.
Follow-up to [50810], [50814], [50815], [50818], [50819].

See #35725.
Built from https://develop.svn.wordpress.org/trunk@50820


git-svn-id: http://core.svn.wordpress.org/trunk@50429 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-06 13:58:57 +00:00
Sergey Biryukov
7b2335eb40 Media: Remove _wp_webp_is_lossy() for now.
The function was only used in a single place in core.

Follow-up to [50810], [50814], [50815], [50818].

Props johnjamesjacoby.
See #35725.
Built from https://develop.svn.wordpress.org/trunk@50819


git-svn-id: http://core.svn.wordpress.org/trunk@50428 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-06 11:10:57 +00:00
Sergey Biryukov
8b18915601 Media: Correct an early return condition in wp_get_webp_info().
Previously, this would only have evaluated to `true` if `wp_get_image_mime()` returned `false`.

Follow-up to [50810], [50814], [50815].

See #35725.
Built from https://develop.svn.wordpress.org/trunk@50818


git-svn-id: http://core.svn.wordpress.org/trunk@50427 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-06 10:21:01 +00:00
desrosj
af4b043a69 Site Health: Include more ImageMagick/Imagick information in the Media Handling section.
This adds additional information to the Media Handling section of the Site Health Info page. When ImageMagick is used as the site’s image editor, a full list of file formats supported will now be shown. This will help site owners debug any issues they encounter as support for newer, more modern image formats is added (such as WebP in [50810]).

Additionally, the version of Imagick installed. This will help site owners debug issues with generating images on the PHP side.

Some variables have also been renamed to more accurately represent what is being stored.

Props Clorith, desrosj.
Fixes #53022.
Built from https://develop.svn.wordpress.org/trunk@50817


git-svn-id: http://core.svn.wordpress.org/trunk@50426 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-05 19:21:59 +00:00
davidbaumwald
f415fa5ea2 Comments: Remove fourth parameter on remove_filter call.
In `class-walker-comment.php`, a `remove_filter` call on `comment_text` passed a fourth parameter which was not needed.  This change removes the extra argument.

Props diddledan, SergeyBiryukov.
Fixes #53113.
Built from https://develop.svn.wordpress.org/trunk@50816


git-svn-id: http://core.svn.wordpress.org/trunk@50425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-05 18:54:57 +00:00
Sergey Biryukov
16c42e467d Media: Move retrieving WebP image size information into wp_getimagesize().
Remove `_wp_get_image_size()`.

Follow-up to [50146], [50810], [50814].

Props johnjamesjacoby.
See #35725.
Built from https://develop.svn.wordpress.org/trunk@50815


git-svn-id: http://core.svn.wordpress.org/trunk@50424 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-05 18:47:57 +00:00
Sergey Biryukov
0778849c12 Media: Some documentation and test improvements for WebP support:
* Document that WebP constants are only defined in PHP 7.1+.
* Correct the `$filename` parameter type in `wp_get_webp_info()`.
* Use a consistent message when skipping tests due to the lack of WebP support.
* Remove unnecessary `else` branches after `markTestSkipped()`.
* Replace `assertEquals()` with more appropriate assertions.

Follow-up to [50810].

See #35725.
Built from https://develop.svn.wordpress.org/trunk@50814


git-svn-id: http://core.svn.wordpress.org/trunk@50423 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-05 17:08:01 +00:00
Sergey Biryukov
e21dfba663 Themes: Remove the "Featured" tab on Add Themes screen.
Themes displayed in this tab were actually random, and have not been selected to be featured to new WordPress users.

The tab had already been removed from the Theme Directory, and with this change, the options in the admin area and in the directory will match again.

The "Popular" tab is now displayed instead as the default view.

Props poena, kjellr, celloexpressions.
Fixes #49487. See #meta5044.
Built from https://develop.svn.wordpress.org/trunk@50813


git-svn-id: http://core.svn.wordpress.org/trunk@50422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-05 15:54:59 +00:00
desrosj
960952fd9b Formatting: Verify emails with + characters are valid.
This adds an assertion to confirm that `is_email()` considers email addresses with a `+` valid.

Props SergeyBiryukov, ayeshrajans.
Fixes #53130.
Built from https://develop.svn.wordpress.org/trunk@50812


git-svn-id: http://core.svn.wordpress.org/trunk@50421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-04 16:06:59 +00:00
Sergey Biryukov
adae6bc86d Docs: Further synchronize documentation for some Plugin API functions.
Follow-up to [50807].

See #50531.
Built from https://develop.svn.wordpress.org/trunk@50811


git-svn-id: http://core.svn.wordpress.org/trunk@50420 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-04 15:01:58 +00:00
Adam Silverstein
524030edfa Images: enable WebP support.
Add support for uploading, editing and saving WebP images when supported by the server.

Add 'image/webp' to supported mime types. Correctly identify WebP images and sizes even when PHP doesn't support WebP. Resize uploaded WebP files (when supported) and use for front end markup.

Props markoheijne, blobfolio, Clorith, joemcgill, atjn, desrosj, spacedmonkey, marylauc, mikeschroder, hellofromtonya, flixos90.
Fixes #35725.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-04 14:44:58 +00:00
desrosj
e7e4b84263 General: Use correct escaping function for form action attributes.
Props chintan1896, audrasjb.
Fixes #53150.
Built from https://develop.svn.wordpress.org/trunk@50809


git-svn-id: http://core.svn.wordpress.org/trunk@50418 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-04 13:47:58 +00:00
desrosj
5ced9a5afe General: Use correct escaping function for the plugin icon URL.
Props chintan1896, audrasjb.
Fixes #53151.
Built from https://develop.svn.wordpress.org/trunk@50808


git-svn-id: http://core.svn.wordpress.org/trunk@50417 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-04 13:38:58 +00:00
Sergey Biryukov
ef28363c7b Plugins: Standardize the terminology used for actions, filters, and callback functions.
Use `$hook_name` when referring to a filter or action hook name, and `$callback` when referring to a callback function.

This brings more consistency to parameter names in Plugin API functions.

Includes minor code layout fixes for better readability and reordering some functions in a more logical order.

Props johnbillion, jrf, SergeyBiryukov.
Fixes #50531.
Built from https://develop.svn.wordpress.org/trunk@50807


git-svn-id: http://core.svn.wordpress.org/trunk@50416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-04 10:48:03 +00:00
Sergey Biryukov
6f2fa9ef42 Twenty Twenty-One: Fix "Opening PHP tag must be on a line by itself" WPCS issue.
Follow-up to [50802].

See #52938.
Built from https://develop.svn.wordpress.org/trunk@50806


git-svn-id: http://core.svn.wordpress.org/trunk@50415 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-03 14:35:02 +00:00
Sergey Biryukov
8641429845 Coding Standards: Fix a whitespace at end of line issue in wp-admin/includes/class-wp-comments-list-table.php.
Includes minor code layout fixes for better readability.

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50805


git-svn-id: http://core.svn.wordpress.org/trunk@50414 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-03 14:10:00 +00:00
Sergey Biryukov
4f2c63bbf6 Coding Standards: Use strict comparison in wp-admin/includes/class-wp-posts-list-table.php.
Includes minor code layout fixes for better readability.

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50804


git-svn-id: http://core.svn.wordpress.org/trunk@50413 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-03 13:57:04 +00:00
Sergey Biryukov
29cd5d902d Upgrade/Install: Display plugin and theme update counts on WordPress Updates screen.
This restores the information that was previously included in a title attribute tooltip on pending updates link in the toolbar.

Follow-up to [50801].

Props sabernhardt, audrasjb, mukesh27, davidbaumwald.
Fixes #53031.
Built from https://develop.svn.wordpress.org/trunk@50803


git-svn-id: http://core.svn.wordpress.org/trunk@50412 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-02 16:54:06 +00:00
Sergey Biryukov
85d526c5d0 Twenty Twenty-One: Display page title as the H1 heading when a static page is selected as the "Posts page".
This ensures that the heading represents the content of the page. Previously, the site title was displayed instead.

Props sabernhardt, justinahinon, rianrietveld, mukesh27, francina, audrasjb, Boniu91.
Fixes #52938.
Built from https://develop.svn.wordpress.org/trunk@50802


git-svn-id: http://core.svn.wordpress.org/trunk@50411 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-05-01 18:14:05 +00:00
joedolson
6c9dfaede8 Toolbar: Remove title attribute on pending updates link.
Remove the title attribute from the link, wrap the link icon and numeric indicator with the `aria-hidden` attribute, and add a `.screen-reader-text` span so screen readers hear a link that has relevant context without requiring translators to deal with appended strings. Removes the individual counts of theme and plugin updates from the attribute, as those were already buggy and didn't include translation counts.

Props afercia, Mte90, sabernhardt, audrasjb
Fixes #26562. See #53031.
Built from https://develop.svn.wordpress.org/trunk@50801


git-svn-id: http://core.svn.wordpress.org/trunk@50410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-30 22:55:06 +00:00
Sergey Biryukov
267061c959 External Libraries: Upgrade PHPMailer to version 6.4.1.
Release notes: https://github.com/PHPMailer/PHPMailer/releases/tag/v6.4.1

For a full list of changes in this update, see the PHPMailer GitHub:
https://github.com/PHPMailer/PHPMailer/compare/v6.4.0...v6.4.1

Props ayeshrajans.
Fixes #53114.
Built from https://develop.svn.wordpress.org/trunk@50799


git-svn-id: http://core.svn.wordpress.org/trunk@50408 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-29 20:30:06 +00:00
gziolo
f6f8094b1d Editor: Fix typo in image default size setting
Related change in Gutneberg: https://github.com/WordPress/gutenberg/pull/31324

Props mamaduka.
See #52920.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-29 10:12:05 +00:00
davidbaumwald
589e89231a Coding Standards: Update $out in WP_Widget_Pages with a more meaningful name.
Rename an `$out` variable to `$output` for consistency with other widget classes..

Props mukesh27.
Fixes #53059.
Built from https://develop.svn.wordpress.org/trunk@50797


git-svn-id: http://core.svn.wordpress.org/trunk@50406 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-28 20:55:03 +00:00
desrosj
4a73e53df4 Build/Test Tools: Correctly test grunt clean when built to run from src.
Because the `--` separator was missing, the `--dev` flag was not being passed to the script, thus not testing properly.

See #52625.
Built from https://develop.svn.wordpress.org/trunk@50796


git-svn-id: http://core.svn.wordpress.org/trunk@50405 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-28 19:07:06 +00:00
Sergey Biryukov
754714ba43 Coding Standards: Fix a precision alignment issue in wp-admin/includes/template.php.
Follow-up to [49223].

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50795


git-svn-id: http://core.svn.wordpress.org/trunk@50404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-28 18:55:05 +00:00
youknowriad
4f7ace4f9c Block Editor: Update the bundled block patterns.
This updates the block patterns included by default on WordPress
to give them more personality and to make use of the design tools
that has been added to the editor.

Props onemaggie, melchoyce, kjellr, beafialho, gziolo.
Fixes #52846.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-28 10:38:05 +00:00
Sergey Biryukov
8cd601c8ba REST API: Check the results of get_metadata() in WP_REST_Meta_Fields methods.
This avoids PHP warnings in case the function returns boolean `false` instead of an array.

Props david.binda.
Fixes #53099.
Built from https://develop.svn.wordpress.org/trunk@50793


git-svn-id: http://core.svn.wordpress.org/trunk@50402 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-27 18:36:04 +00:00
Sergey Biryukov
cbfa060298 Docs: Document the usage of $current_user global in get_user_by().
Follow-up to [50790].

Props paaggeli, mukesh27.
Fixes #53088.
Built from https://develop.svn.wordpress.org/trunk@50792


git-svn-id: http://core.svn.wordpress.org/trunk@50401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-27 17:49:06 +00:00
Sergey Biryukov
b2117d7299 Posts, Post Types: Pass the post object to the_password_form filter.
Props silb3r.
Fixes #29008.
Built from https://develop.svn.wordpress.org/trunk@50791


git-svn-id: http://core.svn.wordpress.org/trunk@50400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-26 15:38:05 +00:00
Peter Wilson
de519f9dfe Users: Share current user instance across functions.
Share the `WP_User` instance for the current user between the functions `get_userdata()` and `wp_get_current_user()`. Both functions return the `$current_user` global for the current user.

Force refresh the `$current_user` global within `clean_user_cache()` by immediately re-calling `wp_set_current_user()` with the current user's ID. This ensures any changes to the current user's permissions or other settings are reflected in the global. As a side-effect this immediately rewarms the current user's cache.

Props chaion07, chriscct7, donmhico, hellofromtonya, lukecarbis, peterwilsoncc, rmccue, TimothyBlynJacobs.
Fixes #28020.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50399 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-26 01:03:59 +00:00
Peter Wilson
868ad5a313 Build/Tests tools: Improve get_bookmark() test coverage.
Props hellofromtonya, peterwilsoncc.
See #52988.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50398 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-26 01:00:05 +00:00
Sergey Biryukov
1ad7538792 Plugins: When loading a plugin in a "sandbox" on activation, do it once.
This avoids a fatal error if the plugin is already included, e.g. in unit tests.

Follow-up to [50787].

See #31104.
Built from https://develop.svn.wordpress.org/trunk@50788


git-svn-id: http://core.svn.wordpress.org/trunk@50397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-25 13:21:05 +00:00
Sergey Biryukov
fe549286d5 Plugins: When loading a plugin in a "sandbox" on activation, do it in a separate function.
This avoids accidentally overriding some variables in the scope of `activate_plugin()`, e.g. `$silent` or `$network_wide`.

Plugins expecting to have access to `$network_wide` directly on inclusion should receive it as an argument of the activation hook callback instead, on any of these actions:

* `activate_plugin`
* `activate_{$plugin}`
* `activated_plugin`

Follow-up to [28644].

Props Mike_Cowobo, dd32, DrewAPicture, mensmaximus, SergeyBiryukov.
Fixes #31104.
Built from https://develop.svn.wordpress.org/trunk@50787


git-svn-id: http://core.svn.wordpress.org/trunk@50396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-24 18:04:04 +00:00
Aaron Jorbin
926cd0afee Bootstrap/Load: Add Function for reliable timing data
Adds timer_float which can be used to get the time elapsed so far during the PHP script. Should make it easier to display the page generation time in the footer of admin.

WordPress should expose timing data as a float in the most accurate manner possible. timer_stop() has two problems: it uses an initial timestamp generated later than it needs to be and its formatted return value can not reliably be used as a number (some locales swap commas and periods, for example).

Props andy, matt, jorbin.
Fixes #39163.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50395 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-23 19:49:05 +00:00
Sergey Biryukov
75d7c7e8d9 Coding Standards: Use strict comparison in wp-admin/includes/update-core.php.
Includes minor code layout fixes for better readability.

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50785


git-svn-id: http://core.svn.wordpress.org/trunk@50394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-23 14:51:05 +00:00
desrosj
64b4c21c1f Build/Test Tools: Remove Internet Explorer 11 from the browserslist.
This officially removes support for Internet Explorer 11 in the CSS files run through the build process in Core.

Individual tickets should be opened for removing each manually maintained area of the code base targeting IE11.

The resulting changes to CSS files are included in this commit.

Fixes #53077.
Built from https://develop.svn.wordpress.org/trunk@50784


git-svn-id: http://core.svn.wordpress.org/trunk@50393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-22 22:58:05 +00:00
Sergey Biryukov
8ef335a566 Coding Standards: Remove loose comparison in wp-admin/includes/plugin-install.php.
This more closely represents how the active installations count is displayed in the Plugin Directory.

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50783


git-svn-id: http://core.svn.wordpress.org/trunk@50392 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-22 19:18:05 +00:00
desrosj
2d7eb07747 Build/Test Tools: Update the caniuse-lite database.
This updates the `caniuse-lite` database to the most recent version (`1.0.30001214`) by running `npx browserslist@latest --update-db`.

The resulting changes after running `grunt precommit:css` are also included in this commit.

See #52624.
Built from https://develop.svn.wordpress.org/trunk@50782


git-svn-id: http://core.svn.wordpress.org/trunk@50391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-22 00:56:05 +00:00
Sergey Biryukov
aa3d0715ab Docs: Add a @since note to wp_mail() about using is_email() for validation.
Follow-up to [48645].

See #52628.
Built from https://develop.svn.wordpress.org/trunk@50781


git-svn-id: http://core.svn.wordpress.org/trunk@50390 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-21 19:47:01 +00:00
Sergey Biryukov
784b1fb1b1 Coding Standards: Use strict comparison in wp-admin/includes/class-wp-terms-list-table.php.
Includes minor code layout fixes for better readability.

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50780


git-svn-id: http://core.svn.wordpress.org/trunk@50389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-21 18:53:00 +00:00
davidbaumwald
5500f370fd Coding Standards: Fix minor, inline spacing issue in wp-admin/setup-config.php.
See #52627.



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


git-svn-id: http://core.svn.wordpress.org/trunk@50388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-21 18:31:07 +00:00
davidbaumwald
e0d4745393 External Libraries: Update Underscore to version 1.13.1.
A full set of changes can be found on GitHub: https://github.com/jashkenas/underscore/compare/1.12.1...1.13.1.

Follow-up to [50650].

Props hareesh-pillai.
See #45785.
Built from https://develop.svn.wordpress.org/trunk@50778


git-svn-id: http://core.svn.wordpress.org/trunk@50387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-21 17:55:19 +00:00
gziolo
267f9d7479 Editor: Shape block editor filters to work better with the Gutenberg plugin
This should allow to use new filters in the Gutenberg plugin and therefore it prevents deprecation warnings when in the debug mode.

See #52920.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-21 09:32:06 +00:00
gziolo
f4f125b869 Editor: Abstract block editor configuration
There are several WordPress hooks defined on the server that depend on $post object that isn’t present on the new screens like edit site, edit widgets, or edit navigation. This patch deprecates existing filters and introduces replacements that are context-aware.

Props azaozz, andraganescu, jeremyfelt, nosolosw, youknowriad.
See #52920.




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


git-svn-id: http://core.svn.wordpress.org/trunk@50385 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-21 05:12:05 +00:00
Peter Wilson
6ce6abd8c0 Upgrade/Install: Prevent possible type errors during installation.
Prevent a `TypeError` from occurring during installation if `wp-config.php` is not writable. In PHP 8.0 this can cause a fatal error, in earlier versions of PHP a warning would be thrown.

Account for a change in type returned by `fopen()` coming in a future version of PHP. Minor coding standards fixes in the `/wp-admin/setup-config.php` file.

Props xknown, hellofromTonya, jrf, peterwilsoncc.
See #51423.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-21 01:33:03 +00:00
desrosj
0a27442af5 Build/Test Tools: Update several dependencies.
This updates the following dependencies:

- `cssnano` from version `4.1.10` to `4.1.11`.
- `grunt-webpack` from `4.0.2` to `4.0.3`.
- `qunit` from `12.14.1` to `12.15.0`.
- `sass` from `1.32.8` to `1.32.11`.
- `uglify-js` from `3.13.3` to `3.13.4`.

See #52624.
Built from https://develop.svn.wordpress.org/trunk@50774


git-svn-id: http://core.svn.wordpress.org/trunk@50383 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-20 20:02:47 +00:00
desrosj
9d2315b409 External Libraries: Update Moment.js to the latest version.
This updates the `moment` script from version `2.27.0` to `2.29.1`.

Props shital-patel, hareesh-pillai.
Fixes #52853.
Built from https://develop.svn.wordpress.org/trunk@50773


git-svn-id: http://core.svn.wordpress.org/trunk@50382 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-20 19:15:21 +00:00
Sergey Biryukov
253e1e0413 Code Modernization: Bring consistency to preparing some fields on Network Settings screen:
* `illegal_names`
* `limited_email_domains`
* `banned_email_domains`

If any of these options have a falsey value, treat it as an empty string. This addresses a PHP 8.1+ deprecation notice when passing a `null` value to `str_replace()`.

Additionally, avoid unnecessary type casting for better performance.

Props hellofromTonya, jrf, SergeyBiryukov.
See #51423.
Built from https://develop.svn.wordpress.org/trunk@50772


git-svn-id: http://core.svn.wordpress.org/trunk@50381 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-20 14:49:08 +00:00
Peter Wilson
02894474ba Build/Test Tools: Add seeking support to stream test library.
Introduces seeking to the `WP_Test_Stream` stream wrapper. This allows the testing of `wp_getimagesize()` and `wp_read_image_metadata()` among others. Includes tests for the latter.

Props hellofromTonya.
Fixes #52922.
See #52826.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50380 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-20 03:03:07 +00:00
Sergey Biryukov
596b9ed6ce Coding Standards: Use strict comparison in wp-admin/includes/class-wp-media-list-table.php.
Includes minor code layout fixes for better readability.

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50770


git-svn-id: http://core.svn.wordpress.org/trunk@50379 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-19 11:41:07 +00:00
Sergey Biryukov
0cbb526928 Docs: Correct comment format in wp-admin/edit-tags.php, remove extra space.
Props immeet94.
Fixes #46428.
Built from https://develop.svn.wordpress.org/trunk@50769


git-svn-id: http://core.svn.wordpress.org/trunk@50378 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-18 14:29:03 +00:00
Sergey Biryukov
81ad8ccdf6 Coding Standards: Fix WPCS issues in wp-admin/includes/class-wp-comments-list-table.php.
* Rename method argument in `WP_Comments_List_Table::floated_admin_avatar()` per the naming conventions.
* Use strict comparison in `WP_Comments_List_Table::handle_row_actions()`.

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50768


git-svn-id: http://core.svn.wordpress.org/trunk@50377 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-18 13:55:07 +00:00
Sergey Biryukov
ed067531ec Coding Standards: Use strict comparison in wp-admin/includes/class-walker-nav-menu-edit.php.
See #52627.
Built from https://develop.svn.wordpress.org/trunk@50767


git-svn-id: http://core.svn.wordpress.org/trunk@50376 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-17 12:22:03 +00:00
Clorith
f7536fd387 Site Health: Remove Ajax requests from dashboard widget.
The Site Health dashboard widget uses the same JavaScript file as the Site Health pages to generate its progress indicator.

This file was also set up to store the current Site Health check results if the current tab being shown isn't the debug information one, this had the side effect of the dashboard being seen as not the debug screen as well.

This now has a conditional making sure it's the status screen it self being displayed, before trying to do any Ajax requests.

Props arena.
Fixes #49814.
Built from https://develop.svn.wordpress.org/trunk@50766


git-svn-id: http://core.svn.wordpress.org/trunk@50375 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-17 11:29:02 +00:00
Clorith
954842868f Site Health: Correct array key for the default tab
Use `reset` to get the label from the first tab entry as the default if no tab is defined.
This ensures even if the tab order is changed, or tabs are removed, no warnings will be thrown.

Follow-up to [50764].

See #47225.
Built from https://develop.svn.wordpress.org/trunk@50765


git-svn-id: http://core.svn.wordpress.org/trunk@50374 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-17 10:55:03 +00:00
Clorith
eea98a5426 Site Health: Support custom sub-menus and pages.
Allow developers to extend the Site Health screen with their own custom navigation tabs and pages.

This implements a new filter, `site_health_navigation_tabs`, which takes an associated array of tab identifiers/slugs, and tab labels, allowing developers to add their own subpage to the Site Health interface as new tabs.

To output a custom page, or add to an existing page, the `site_health_tab_content` action is triggered whenever the `tab` query argument is present and not empty. This action includes the current tab as its argument, which a developer would match against to only output content when relevant.

Props ramiy for initial patch.
Fixes #47225.
Built from https://develop.svn.wordpress.org/trunk@50764


git-svn-id: http://core.svn.wordpress.org/trunk@50373 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-17 01:14:01 +00:00
desrosj
b4fac1593d Build/Test Tools: Make adjustments to how often old branches are tested.
This adjusts the workflow responsible for testing old branches to only test old branches once per month. This more closely resembles the testing practices previously in place on TravisCI.

The latest, supported branch will continue to be tested twice per month.

This also makes adjustments so that the workflow is run whenever changes are made to it. This will help verify changes without having to wait until the next scheduled run.

Fixes #52653.
Built from https://develop.svn.wordpress.org/trunk@50763


git-svn-id: http://core.svn.wordpress.org/trunk@50372 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-16 17:26:06 +00:00
Sergey Biryukov
afb02cb315 Coding Standards: Use strict comparison in wp-admin/includes/class-wp-automatic-updater.php.
Includes minor code layout fixes for better readability.

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50762


git-svn-id: http://core.svn.wordpress.org/trunk@50371 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-16 12:01:15 +00:00
gziolo
ad48a15387 Editor: Update WordPress packages to use with WordPress 5.8
In the response to the discussion during the Dev Chat, I'm doing a first pass to keep WordPress packages up to date in the WordPress 5.8 release cycle.

See https://github.com/WordPress/wordpress-develop/pull/1176 for more details.

Props youknowriad, aristath, andraganescu.
See #52991.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50370 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-15 15:19:43 +00:00
gziolo
660443bbc7 Editor: Backport changes for WordPress packages added in 5.7.1
Props peterwilsoncc.
See #52912.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50369 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-15 11:03:35 +00:00
Sergey Biryukov
ac9f1a4685 Coding Standards: Give a variable in WP_Automatic_Updater::after_core_update() a more meaningful name.
Follow-up to [25841], [25873], [25882].

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50759


git-svn-id: http://core.svn.wordpress.org/trunk@50368 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-15 10:31:08 +00:00
desrosj
e445660ee3 REST API: Allow authors to read their own password protected posts.
Allow authenticated users to read the contents of password protected posts if they have the `edit_post` meta capability for the post.

Props xknown, zieladam, peterwilsoncc, swissspidy, timothyblynjacobs.
Built from https://develop.svn.wordpress.org/trunk@50717


git-svn-id: http://core.svn.wordpress.org/trunk@50326 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-14 23:24:04 +00:00
desrosj
ac930e0e5f External libraries: Include upstream GetID3 fix for PHP 8.
Props jrf, xknown.
Built from https://develop.svn.wordpress.org/trunk@50714


git-svn-id: http://core.svn.wordpress.org/trunk@50323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-14 23:10:04 +00:00
davidbaumwald
b7280388d6 Privacy: Ensure "Export Personal Data" does not generate invalid JSON.
Previously, when exporting personal data, if the JSON encoding of the data failed, the invalid JSON was still written to `export.json`.  This change captures the JSON encoding failure and adds a notice to the UI.  

Props hellofromTonya, jrf, SergeyBiryukov.
Fixes #52892.
Built from https://develop.svn.wordpress.org/trunk@50713


git-svn-id: http://core.svn.wordpress.org/trunk@50322 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-14 21:28:08 +00:00
desrosj
294c370d72 Upgrade/Install: Correct the alignment of error messages for the language installer.
This makes the CSS selector used to right align certain form related elements more specific. This prevents any error messages from being right aligned.

Props sabernhardt, audrasjb.
Fixes #52989.
Built from https://develop.svn.wordpress.org/trunk@50712


git-svn-id: http://core.svn.wordpress.org/trunk@50321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-14 14:11:05 +00:00
Sergey Biryukov
0cd72ec474 Site Health: Correct test result status for the HTTPS test.
The supported status values for Site Health tests are `good`, `recommended`, and `critical`.

Follow-up to [50660].

Props TimothyBlynJacobs.
Fixes #52783.
Built from https://develop.svn.wordpress.org/trunk@50710


git-svn-id: http://core.svn.wordpress.org/trunk@50319 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-14 13:02:08 +00:00
Peter Wilson
793da8732f Bundled Themes: Bump versions for WordPress 5.7.1.
Twenty Twenty-One: Bump version to 1.3
Twenty Seventeen: Bump version to 2.7

Props desrosj, mukesh27, peterwilsoncc.
Fixes #52859.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50317 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-13 23:49:06 +00:00
Sergey Biryukov
a274a14bdd Coding Standards: Use strict comparison in wp-admin/includes/class-custom-image-header.php.
Includes minor code layout fixes for better readability.

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50707


git-svn-id: http://core.svn.wordpress.org/trunk@50316 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-13 19:05:04 +00:00
Sergey Biryukov
35de0a48fb Coding Standards: Use strict comparison in wp-admin/includes/class-custom-background.php.
Includes minor code layout fixes for better readability.

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50706


git-svn-id: http://core.svn.wordpress.org/trunk@50315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-13 18:01:04 +00:00
davidbaumwald
d6a1170c70 I18N: Add context to strings when updating a plugin or theme with a ZIP package.
After [48390], plugins and themes can be updated with an uploaded ZIP file.  Strings were added for comparing the "current" and "uploaded" versions of a plugin or theme, but lacked context for each as to the object being referenced.  This change adds a `plugin` or `theme` context to each of these strings for disambiguation.

Props dimadin, SergeyBiryukov.
Fixes #53017.
Built from https://develop.svn.wordpress.org/trunk@50705


git-svn-id: http://core.svn.wordpress.org/trunk@50314 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-13 17:38:05 +00:00
Dominik Schilling
2e6178bf3d Build/Test Tools: Remove an extra space in the job name for PHPUnit tests.
See #52625.
Built from https://develop.svn.wordpress.org/trunk@50704


git-svn-id: http://core.svn.wordpress.org/trunk@50313 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-13 16:12:06 +00:00
gziolo
b31964a44b Blocks: Add is_default handling to server side block styles registry
Ensures that register_block_style lets developer pass `is_default` flag to mark one of the block style variations as the default one.

Props mukesh27, xavivars.
Fixes #53006.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50312 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-13 08:04:13 +00:00
davidbaumwald
989ec57389 Feeds: Rename "Summary" to "Excerpt" in Reading Settings.
On the "Reading Settings" page, the post excerpt was referred to as a "Summary".  For consistency with the rest of Core, this change updates "summary" to "excerpt" both in the setting and the relevant help tab.

Props SergeyBiryukov, ravipatel, mukesh27.
Fixes #52987.
Built from https://develop.svn.wordpress.org/trunk@50702


git-svn-id: http://core.svn.wordpress.org/trunk@50311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-12 22:34:04 +00:00
Sergey Biryukov
8e059f3657 Coding Standards: Rewrite a fragment in request_filesystem_credentials() for clarity and to avoid repetition.
Follow-up to [8540], [8865].

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50701


git-svn-id: http://core.svn.wordpress.org/trunk@50310 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-12 18:34:05 +00:00
Sergey Biryukov
82042a0377 Coding Standards: Use strict comparison in wp-admin/includes/file.php.
Includes minor code layout fixes for better readability.

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50700


git-svn-id: http://core.svn.wordpress.org/trunk@50309 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-12 18:19:09 +00:00
Sergey Biryukov
c569c157f0 Coding Standards: Simplify the check for parent terms in export_wp().
This is more consistent with similar checks elsewhere in core.

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50699


git-svn-id: http://core.svn.wordpress.org/trunk@50308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-11 13:44:13 +00:00
Dominik Schilling
f3034f1b1c Customize: Set playsinline attribute for custom header videos.
With the `playsinline` attribute the video can also autoplay on mobile browsers without asking the user to open it up fullscreen.
Also, change all video element properties to use boolean values.

Props klevyke, ocean90.
Fixes #50111.
Built from https://develop.svn.wordpress.org/trunk@50698


git-svn-id: http://core.svn.wordpress.org/trunk@50307 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-10 12:40:05 +00:00
Dominik Schilling
8780574d11 Build/Test Tools: Remove remaining Travis CI references.
* Remove `travis:` tasks in Gruntfile.js.
* Remove status badge in README.md that comes from Travis CI via shields.io.
* Remove Travis CI related skipping in the `WP_UnitTestCase_Base::skipOnAutomatedBranches()` test method and related Docker environment variables.

Props johnbillion, SergeyBiryukov, ocean90.
See #52161.
Fixes #52666.
Built from https://develop.svn.wordpress.org/trunk@50697


git-svn-id: http://core.svn.wordpress.org/trunk@50306 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-10 12:07:04 +00:00
Sergey Biryukov
2a7238f658 Coding Standards: Give a variable in wp-admin/themes.php a more meaningful name.
Follow-up to [20029].

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50696


git-svn-id: http://core.svn.wordpress.org/trunk@50305 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-10 12:01:10 +00:00
Rachel Baker
3d04a220be REST API: Move the rest_jsonp_enabled filter before setting the Content-Type header.
Fixes an issue where if JSONP was disabled the `Content-Type` HTTP header was still set to `application/javascript`.  

Props dd32, TimothyBlynJacobs.
Fixes #52691.
Built from https://develop.svn.wordpress.org/trunk@50695


git-svn-id: http://core.svn.wordpress.org/trunk@50304 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-09 21:28:08 +00:00
Sergey Biryukov
68b73d3696 Themes: Remove unused code fragment from wp-admin/themes.php.
Follow-up to [25666], [26141].

Props mukesh27, rkradadiya.
Fixes #53005.
Built from https://develop.svn.wordpress.org/trunk@50694


git-svn-id: http://core.svn.wordpress.org/trunk@50303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-09 11:49:05 +00:00
Sergey Biryukov
bdacea193a Editor: Use a consistent way to retrieve post ID on Edit Post screens.
Props mukesh27, ravipatel, davidbaumwald.
Fixes #52995.
Built from https://develop.svn.wordpress.org/trunk@50693


git-svn-id: http://core.svn.wordpress.org/trunk@50302 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-09 11:31:09 +00:00
Sergey Biryukov
57da3e7813 Coding Standards: Remove unnecessary unset() calls in WP_Importer methods.
Variables created within the scope of a function are discarded automatically when PHP leaves the scope of the function, i.e. on `return`, so doing a call to `unset()` straight before a `return` statement is redundant.

Props jrf, ravipatel, rachelbaker, mukesh27.
Fixes #52996.
Built from https://develop.svn.wordpress.org/trunk@50692


git-svn-id: http://core.svn.wordpress.org/trunk@50301 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-08 11:12:08 +00:00
Sergey Biryukov
7d65ff4f7a Coding Standards: Use strict comparison in wp-admin/includes/dashboard.php.
Includes minor code layout fixes for better readability.

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50689


git-svn-id: http://core.svn.wordpress.org/trunk@50298 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-07 18:34:07 +00:00
ryelle
d2d09b9a7a Accessibility: Administration: Update various background colors for increased contrast.
This ensures that contrast between text color and background meets the WCAG 2.0 AA recommended value. The following locations were changed:

- Network List Tables: Use lighter background colors for site status indicator.
- Nav Menus: Use a lighter background color for invalid menu items.
- Pointers: Use a darker background for pointer header.
- Themes: Use darker background on filter button hover.
- Customizer: Use darker background for selected widget.

Follow-up to [50025], [50571].
Props kebbet, melchoyce, peterwilsoncc.
Fixes #52760.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50296 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-07 16:38:09 +00:00
gziolo
e6eb25fda4 Editor: Ensure @wordpress/inteface package is listed as a dependency
Discovered when backporting changes for WordPress 5.7.1 release.

See #52991.



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


git-svn-id: http://core.svn.wordpress.org/trunk@50295 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-07 11:39:19 +00:00
gziolo
e60fe4f2f3 Build Tools: Update development dependencies from WP packages
This patch updates only development dependencies for WordPress packages to align better with the Gutenberg plugin.

See #52991.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50294 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-07 11:15:58 +00:00
Peter Wilson
f992857b31 Build tools: Revert package-lock.json change in [50682].
See #52768.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50292 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-07 01:34:05 +00:00
Peter Wilson
312da2b826 Media: Do not lazy load hidden images or embeds.
Improve the check for sourceless or dimensionless media when determining if the lazy loading attribute should be added to iframes and images. Never include the lazy loading attribute on embeds of WordPress posts as the iframe is initially hidden.

Including `loading="lazy"` on initially hidden iframes and images can prevent the media from loading in some browsers.

Props adamsilverstein, fabianpimminger, flixos90, johnbillion, jonkastonka, joyously, peterwilsoncc, SergeyBiryukov, SirStuey, swissspidy.
Fixes #52768.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50291 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-07 01:01:05 +00:00
Sergey Biryukov
21bcc7c836 Login and Registration: Check if $_GET['login'] is set before using it in wp-login.php.
This avoids an "Undefined index" PHP notice displayed as part of password reset process if `$_GET['key']` is set, but `$_GET['login']` is not.

Props satrancali.
Fixes #52980.
Built from https://develop.svn.wordpress.org/trunk@50677


git-svn-id: http://core.svn.wordpress.org/trunk@50286 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-06 18:39:10 +00:00
desrosj
c1e7f92d6a Build/Test Tools: Prevent PHPUnit tests on push for forks/private mirrors.
The reorganization of the PHPUnit workflow in [50441] unintentionally caused the tests to be run for every `push` event, even for forks and private mirrors.

Previously, the second job required the first one to pass, and the conditional check on the first prevented both from running. Because the first job is no longer required for the second, both jobs must have the appropriate conditional check.

Fixes #52983.
Built from https://develop.svn.wordpress.org/trunk@50670


git-svn-id: http://core.svn.wordpress.org/trunk@50282 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-06 15:14:10 +00:00
desrosj
94dae2b608 Bundled Themes: Update the “Tested up to” value.
“Tested up to” is not displayed on the theme directory or within the WordPress dashboard, but should be updated to be accurate for anyone reading the theme’s source code.

Follow up to [50508].

Fixes #52859.
Built from https://develop.svn.wordpress.org/trunk@50669


git-svn-id: http://core.svn.wordpress.org/trunk@50281 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-06 14:43:08 +00:00
desrosj
2b73649b52 Build/Test Tools: Update some dependencies.
This updates `elliptic` to version `6.5.4` through `npm audit fix`.

`uglify-js` is also updated to version `3.13.3`, and `grunt-contrib-uglify` to version `5.0.1`.

See #52624.
Built from https://develop.svn.wordpress.org/trunk@50668


git-svn-id: http://core.svn.wordpress.org/trunk@50280 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-06 14:31:21 +00:00
desrosj
cfe859c1f3 Twenty Twenty-One: Rebuild IE specific editor stylesheet.
This was not updated to include the changes from [50493].

Fixes #52981. See #52702.
Built from https://develop.svn.wordpress.org/trunk@50667


git-svn-id: http://core.svn.wordpress.org/trunk@50279 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-06 14:12:05 +00:00
desrosj
caa5abc6c1 Build/Test Tools: Update dependencies in default themes.
This updates several dependencies in the Twenty Nineteen, Twenty Twenty, and Twenty Twenty-One default themes.

See #52624.
Built from https://develop.svn.wordpress.org/trunk@50666


git-svn-id: http://core.svn.wordpress.org/trunk@50278 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-06 14:07:07 +00:00
Sergey Biryukov
53c0882200 Coding Standards: Use strict comparison in wp-admin/includes/credits.php.
See #52627.
Built from https://develop.svn.wordpress.org/trunk@50665


git-svn-id: http://core.svn.wordpress.org/trunk@50277 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-06 13:47:02 +00:00
Sergey Biryukov
48cd688076 Coding Standards: Use strict comparison in wp-admin/includes/comment.php.
See #52627.
Built from https://develop.svn.wordpress.org/trunk@50664


git-svn-id: http://core.svn.wordpress.org/trunk@50276 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-06 13:45:09 +00:00
Peter Wilson
72a04aa045 Options, Meta APIs: Update default color scheme swatch to match CSS changes.
Update the default/fresh theme color swatch displayed on user profile pages to match CSS changes made during the 5.7 release cycle.

Props audrasjb, desrosj, ninetyninew, ryelle.
Fixes #52750.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-06 05:44:07 +00:00
Peter Wilson
7442fe63a0 Site Health: Reduce false reports of HTTPS failures.
Reduce severity of failing HTTPS tests from critical to warning. Stop reporting failures if the site is being accessed over HTTPS but `wp_is_https_supported()` indicates a lack of support.

Props annalamprou, AnotherDave, ayeshrajans, bobbingwide, Clorith, dragongate, eatsleepcode, gab81, geoffrey1963, Ipstenu, k3nsai, mmuyskens, nicegamer7, peterwilsoncc, pwallner, SergeyBiryukov, TimothyBlynJacobs, Toru.
Fixes #52783.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50271 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-06 03:24:08 +00:00
Sergey Biryukov
b8f35c130c Coding Standards: Give some variables in WP_Importer a more meaningful name.
See #52627.
Built from https://develop.svn.wordpress.org/trunk@50658


git-svn-id: http://core.svn.wordpress.org/trunk@50270 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-05 10:50:03 +00:00
Sergey Biryukov
a338f84f32 Coding Standards: Use strict comparison in wp-admin/includes/class-wp-filesystem-*.php.
See #52627.
Built from https://develop.svn.wordpress.org/trunk@50657


git-svn-id: http://core.svn.wordpress.org/trunk@50269 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-05 10:38:07 +00:00
Sergey Biryukov
10a084a067 Coding Standards: Move some translator comments to the correct place.
Follow-up to [46273], [50060], [50117].

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50654


git-svn-id: http://core.svn.wordpress.org/trunk@50266 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-04 18:30:05 +00:00
Sergey Biryukov
b6e32b9d4f REST API: Correct enum validation for numeric values.
When validating `enum` values as `integer` or `number`, consider a number with a zero fractional part to be equivalent to an integer of the same value.

In `rest_are_values_equal()`, when comparing two values of type `int` or `float` (in any combination), first cast both of them to `float` and then compare.

This matches some test cases from the official JSON Schema test suite.

Follow-up to [50010].

Props yakimun, stefanjoebstl, TimothyBlynJacobs, rachelbaker.
Fixes #52932.
Built from https://develop.svn.wordpress.org/trunk@50653


git-svn-id: http://core.svn.wordpress.org/trunk@50265 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-04 18:07:04 +00:00
Sergey Biryukov
907bfe74cd Coding Standards: Use strict comparison in wp-admin/includes/class-core-upgrader.php.
See #52627.
Built from https://develop.svn.wordpress.org/trunk@50652


git-svn-id: http://core.svn.wordpress.org/trunk@50264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-04 16:49:09 +00:00
Sergey Biryukov
b70c00d6ac Build/Test Tools: Rename some Grunt tasks to use hyphens instead of camelCase.
This makes the task names more consistent with other tasks.

Follow-up to [41043], [48096], [50650].

See #52625.
Built from https://develop.svn.wordpress.org/trunk@50651


git-svn-id: http://core.svn.wordpress.org/trunk@50263 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-03 12:46:10 +00:00
davidbaumwald
3912ca99fd External Libraries: Update Underscore to version 1.12.1.
Full set of changes at https://github.com/jashkenas/underscore/compare/1.8.3...1.12.1.  
The new version includes a `sourceMappingURL` that causes a build failure, so this change 
also introduces a task to remove this from the source during the build.

Props mukesh27, hareesh-pillai, desrosj, SergeyBiryukov, TimoTijhof.
Fixes #45785.
Built from https://develop.svn.wordpress.org/trunk@50650


git-svn-id: http://core.svn.wordpress.org/trunk@50262 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-02 19:42:21 +00:00
desrosj
75923de5ef Build/Test Tools: Prevent the workflow for testing old branches from running on forks.
This adds a conditional statement to ensure the workflow that tests old branches only runs on the official `wordpress-develop` mirror. This prevents it from running on forks and private mirrors.

See #52653.
Built from https://develop.svn.wordpress.org/trunk@50648


git-svn-id: http://core.svn.wordpress.org/trunk@50260 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-02 16:22:04 +00:00
davidbaumwald
cc0ce2c91d Editor: Update the default writing prompt to match the block editor.
Recently merged, https://github.com/WordPress/gutenberg/pull/29611, changed the default writing prompt text.  WordPress core offers the `write_your_story` filter with a default value using the same text.  This change updates the default text to match the recent change in the block editor.

Props Joen, SergeyBiryukov.
Fixes #52948.
Built from https://develop.svn.wordpress.org/trunk@50647


git-svn-id: http://core.svn.wordpress.org/trunk@50259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-02 16:08:04 +00:00
davidbaumwald
133c4e2e50 Docs: Clarify return results for a non-existing ID in metadata functions.
[48658] documented that various metadata functions return false for an invalid ID. However, that does not clarify what an invalid ID is: a non-numeric, zero, or negative value. This change adds the clarification in all relevant metadata function docblocks.

Props icopydoc, SergeyBiryukov, davidkryzaniak, audrasjb.
Fixes #51797.
Built from https://develop.svn.wordpress.org/trunk@50641


git-svn-id: http://core.svn.wordpress.org/trunk@50253 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-02 15:49:05 +00:00
Sergey Biryukov
526dfa8b12 KSES: Add object-position to the list of safe CSS properties.
This resolves an issue with the Cover block, where the `object-position` property is removed from the content when a non-admin user saves the post, leading to block recovery loop.

Props Mamaduka, aristath.
Fixes #52961.
Built from https://develop.svn.wordpress.org/trunk@50634


git-svn-id: http://core.svn.wordpress.org/trunk@50246 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-02 12:41:09 +00:00
davidbaumwald
5767dbd5ff Build/Test Tools: Cleanup link-manager.zip after REST API tests are finished.
Introduced in [48242], the `link-manager` plugin is copied from `DIR_TESTDATA/plugins` to `DIR_TESTDATA` during the REST API unit tests, but was not cleaned up afterward.  This created a "dirty" local working copy.  This change `unlink`s the copied plugin from `DIR_TESTDATA` after unit tests are completed.

Props johnbillion, TimothyBlynJacobs, desrosj, rachelbaker.
Fixes #52579.
Built from https://develop.svn.wordpress.org/trunk@50633


git-svn-id: http://core.svn.wordpress.org/trunk@50245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-01 20:41:07 +00:00
davidbaumwald
739dfb756f Coding Standards: Remove some extra whitespace in get_item_schema.
Introduced in [50527].

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50632


git-svn-id: http://core.svn.wordpress.org/trunk@50244 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-01 15:54:04 +00:00
davidbaumwald
ab6c10948f Coding Standards: Removing unnecessary parentheses from require_once in wp-admin/options-privacy.php.
In [47198], parentheses were removed from `include` and `require` statements, as they are language constructs, not function calls.  However, [50161] introduced a new `require_once` instance in `wp-admin/options-privacy.php`.  This change removes the unnecessary parentheses.

See #53627.
Built from https://develop.svn.wordpress.org/trunk@50631


git-svn-id: http://core.svn.wordpress.org/trunk@50243 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-01 15:36:08 +00:00
Sergey Biryukov
3697386083 Editor: Consolidate enqueueing block editor assets in wp-includes/default-filters.php.
Follow-up to [44157], [46111], [48537], [50620].

See #52920.
Built from https://develop.svn.wordpress.org/trunk@50629


git-svn-id: http://core.svn.wordpress.org/trunk@50241 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-01 11:46:09 +00:00
Dominik Schilling
07b7afd60a External Libraries: Upgrade PHPMailer from 6.3.0 to 6.4.0.
6.4.0 reverts a change that made the `mail()` and sendmail transports set the envelope sender if one isn't explicitly provided, as it was causing problems in specific PHP/server configurations.

Release post: https://github.com/PHPMailer/PHPMailer/releases/tag/v6.4.0
Changelog: https://github.com/PHPMailer/PHPMailer/compare/v6.3.0...v6.4.0

Props Synchro, tigertech, ayeshrajans, galbaras, audrasjb, SergeyBiryukov, desrosj, ocean90.
Fixes #52822.
Built from https://develop.svn.wordpress.org/trunk@50628


git-svn-id: http://core.svn.wordpress.org/trunk@50240 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-31 21:30:03 +00:00
Aaron Jorbin
f4678dff60 Build/Test & External Libraries : Fix jQuery deprecation.
jQuery.isArray is deprecated. Array.isArray is safe and used in other parts of the code base.

See: #51812

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


git-svn-id: http://core.svn.wordpress.org/trunk@50239 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-31 20:29:06 +00:00
Sergey Biryukov
4d1595b6d4 Docs: Document the import_id parameter of wp_insert_post().
Follow-up to [9100].

Props donmhico.
Fixes #52943.
Built from https://develop.svn.wordpress.org/trunk@50621


git-svn-id: http://core.svn.wordpress.org/trunk@50234 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-31 13:05:06 +00:00
gziolo
6d42a21103 Editor: Enqueue assets for format library for the block editor
Ensures that `wp-format-library` assets are always loaded for the block editor. Otherwise, they have to be loaded individually for every screen that needs it. It's similar to how `wp-block-directory` assets are handled.

Props ellatrix.
See #52920.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50233 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-31 05:52:10 +00:00
desrosj
5c451da5e9 External Libraries: Update polyfill versions in the script loader.
Follow up to [50615, 50617].

See #52854.
Built from https://develop.svn.wordpress.org/trunk@50619


git-svn-id: http://core.svn.wordpress.org/trunk@50232 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-30 17:57:05 +00:00
Sergey Biryukov
f701ad4999 Coding Standards: Remove some extra whitespace in _wp_translate_postdata().
See #52627.
Built from https://develop.svn.wordpress.org/trunk@50618


git-svn-id: http://core.svn.wordpress.org/trunk@50231 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-30 15:19:03 +00:00
desrosj
85c90c4e01 External Libraries: Update the path to polyfill-library files in Webpack.
Follow up to [50615].

Props gziolo.
Fixes #52854.
Built from https://develop.svn.wordpress.org/trunk@50617


git-svn-id: http://core.svn.wordpress.org/trunk@50230 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-30 14:49:04 +00:00
Sergey Biryukov
1a9eb60625 Docs: Add documentation for the ::setup_export_contents_test method used in personal data export tests.
Follow-up to [50613].

Props hellofromTonya.
See #51423.
Built from https://develop.svn.wordpress.org/trunk@50616


git-svn-id: http://core.svn.wordpress.org/trunk@50229 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-30 14:24:03 +00:00
desrosj
7eee8521b0 External Libraries: Update several polyfill libraries.
This updates the following polyfill libraries:

- `formdata-polyfill` from `3.0.13` to `3.0.20`.
- `objectFitPolyfill` from `2.3.4` to `2.3.5`.
- `polyfill-library` from `3.42.0` to `3.104.0`.

Props gziolo, desrosj.
Fixes #52854.
Built from https://develop.svn.wordpress.org/trunk@50615


git-svn-id: http://core.svn.wordpress.org/trunk@50228 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-30 14:16:33 +00:00
davidbaumwald
67d6f5f6c6 Docs: Fix indentation for wp_term_query->construct method parameters.
The `fields` and `orderby` properties in `WP_Term_Query` are arrays and each accepts a variety of keys.  To properly indent each key in the docblock, a `*` should be used, not `-`.

Props whyisjake, audrasjb, SergeyBiryukov.
Fixes #52839.
Built from https://develop.svn.wordpress.org/trunk@50614


git-svn-id: http://core.svn.wordpress.org/trunk@50227 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-29 21:35:07 +00:00
Sergey Biryukov
69a7063a49 Code Modernization: Check if the _export_data_grouped post meta is an array when generating a personal data export file.
This avoids a fatal error on PHP 8 in `wp_privacy_generate_personal_data_export_file()` if the `_export_data_grouped` post meta exists but is not an array.

Additionally, refactor unit tests for the function to:
* Reduce redundant code
* Switch to data provider
* Test on the full HTML output instead of select pieces of the output
* Expand unhappy path coverage

Follow-up to [43012], [44786], [47146], [47278].

Props hellofromTonya, jrf, xknown.
See #51423.
Built from https://develop.svn.wordpress.org/trunk@50613


git-svn-id: http://core.svn.wordpress.org/trunk@50226 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-29 19:37:04 +00:00
Sergey Biryukov
59d32bfe24 Build/Test Tools: Remove explicit puppeteer dependency.
This was added in [48177] to fix an issue where Puppeteer was not being installed correctly as a dependency of `@wordpress/wp-scripts`. This has been fixed, so this explicit dependency can be removed.

Props isabel_brison, desrosj, SergeyBiryukov.
Fixes #52843.
Built from https://develop.svn.wordpress.org/trunk@50612


git-svn-id: http://core.svn.wordpress.org/trunk@50225 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-29 18:07:25 +00:00
Sergey Biryukov
dc4de0d5a5 Login and Registration: Add the "Error:" prefix to some password reset messages.
This makes the messages more consistent with other error messages related to authentication and registration.

Follow-up to [50589].

Props dd32.
Fixes #52914.
Built from https://develop.svn.wordpress.org/trunk@50611


git-svn-id: http://core.svn.wordpress.org/trunk@50224 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-28 10:24:05 +00:00
Sergey Biryukov
05631ab4cd Docs: Spell "non-existent" in a consistent way.
See #52628.
Built from https://develop.svn.wordpress.org/trunk@50610


git-svn-id: http://core.svn.wordpress.org/trunk@50223 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-27 13:34:12 +00:00
desrosj
87a4101834 Build/Test Tools: Update some devDependencies.
This updates the following `devDependencies`:

- `sinon` from `9.2.4` to `10.0.0`.
- `uglify-js` from `3.13.1` to `3.13.2`.

See #52624.
Built from https://develop.svn.wordpress.org/trunk@50598


git-svn-id: http://core.svn.wordpress.org/trunk@50211 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-26 15:47:21 +00:00
desrosj
755882578e Twenty Twelve: Change theme version back to 3.3.
Because the changes in Twenty Twelve did not impact site look or functionality, version 3.4 of Twenty Twelve was not released in coordination with WordPress 5.7.

This reverts the portion of [50508] relevant to Twenty Twelve, changing the version back to 3.3 so that version 3.4 is not skipped accidentally when there are changes that should be released.

See #52704.
Built from https://develop.svn.wordpress.org/trunk@50596


git-svn-id: http://core.svn.wordpress.org/trunk@50209 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-26 15:28:05 +00:00
desrosj
219cf1dd5f Build/Test Tools: Run code coverage workflow when the file is updated.
When the workflow file is updated, it should always be run to verify changes.

Follow up to [50592].

See #52786.
Built from https://develop.svn.wordpress.org/trunk@50595


git-svn-id: http://core.svn.wordpress.org/trunk@50208 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-26 15:14:04 +00:00
desrosj
2a76425048 Build/Test Tools: Run code coverage workflow using parallel jobs.
This splits the code coverage workflow into two separate jobs, allowing single site and multisite to run in parallel. This cuts the total workflow run time in half.

Fixes #52923.
Built from https://develop.svn.wordpress.org/trunk@50594


git-svn-id: http://core.svn.wordpress.org/trunk@50207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-26 15:11:04 +00:00
desrosj
ae3ae14958 Build/Test Tools: Do not checkout the Importer plugin in the Code Coverage workflow.
Since [50285], the WordPress Importer plugin (which is required for the test suite to run successfully) has been installed as part of the `npm run env:install` script.

See #52625.
Built from https://develop.svn.wordpress.org/trunk@50593


git-svn-id: http://core.svn.wordpress.org/trunk@50206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-26 14:59:03 +00:00
desrosj
952acb240a Build/Test Tools: Fix code coverage reporting to generate report from src.
Since [50441-50442] switched the test workflows to run from `src` instead of `build`, code coverage reporting has stopped working. This was caused by the code coverage configuration continuing to reference `build`. This corrects the configuration so coverage reporting can resume.

This change also introduces the `workflow_dispatch` event to the workflow, which will allow committers to manually run the workflow when desired. For example, to confirm changes to the test suite do not break reporting.

This also adds the `phpunit.xml.dist` and `tests/phpunit/multisite.xml` files to the `paths` list. Since these files are responsible for configuring the test suite and code coverage reporting, any changes to them should verify that no problems were introduced.

Props jrf, johnbillion.
Fixes #52786. See #51734.
Built from https://develop.svn.wordpress.org/trunk@50592


git-svn-id: http://core.svn.wordpress.org/trunk@50205 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-26 13:25:05 +00:00
desrosj
bbc301ca6e Build/Test Tools: Run test workflows on old branches on a schedule.
On TravisCI, old branches still receiving security updates were tested on a regular basis. This ensured tests continued to pass as time passed even if updates were not made to these branches.

On GitHub Actions, there is no interface to configure this (TravisCI had a UI), but there is a `schedule` event that can trigger workflow runs on cron that can be used to accomplish the same thing.

This introduces a workflow file that runs twice a month (on the 1st and 15th) to verify the tests within older branches.

Because the `schedule` event only runs within the primary branch, the appropriate workflows in each old branch will be triggered manually through the `workflow_dispatch` trigger using the GitHub REST API. `workflow_dispatch` will need to be added to all workflows in all old branches in order for the event to dispatch successfully.

Fixes #52653.
Built from https://develop.svn.wordpress.org/trunk@50590


git-svn-id: http://core.svn.wordpress.org/trunk@50203 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-26 13:08:03 +00:00
Sergey Biryukov
2c6e1dc1f9 Login and Registration: Restore the "Error:" prefix for the "Unknown username" message.
This makes the message more consistent with other error messages related to authentication and registration.

Follow-up to [46417].

Props dd32.
See #52914, #52915.
Built from https://develop.svn.wordpress.org/trunk@50589


git-svn-id: http://core.svn.wordpress.org/trunk@50202 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-26 12:14:07 +00:00
Peter Wilson
cc7bdc71e8 Media: Conditionally pass 2nd parameter to getimagesize().
In the wrapper function `wp_getimagesize()` check if the second parameter was passed before sending it to the PHP function `getimagesize()`. 

The PHP function has a different execution path depending on the number of parameters passed, this ensures the wrapper function follows the appropriate path.

Follow up to [50552].
Props azaozz, hellofromtonya, Mista-Flo, peterwilsoncc, rinatkhaziev, RogerTheriault, SergeyBiryukov, terriann, whyisjake.
Fixes #52826.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50199 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-26 00:09:04 +00:00
davidbaumwald
9b8c498eea Privacy: Print screen reader text for the "Copy suggested policy text..." action button.
This change switches out `sprintf` for `printf` on the "Copy suggested policy text from..." button screen reader text.  Also, wrap the actual button text in a `<span aria-hidden="true">` to prevent both the button text and the screen reader text from being spoken.

Props mukesh27, SergeyBiryukov, sabernhardt.
Fixes #52891.
Built from https://develop.svn.wordpress.org/trunk@50585


git-svn-id: http://core.svn.wordpress.org/trunk@50198 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-25 20:21:04 +00:00
davidbaumwald
bf267e05ca Docs: Fix description for $htmlhint argument in code editor settings.
Introduced in [41558].

Props sabernhardt.
See #52628.
Built from https://develop.svn.wordpress.org/trunk@50583


git-svn-id: http://core.svn.wordpress.org/trunk@50196 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-25 20:00:05 +00:00
davidbaumwald
eaffb58ce8 Posts, Post Types: Remove / from non-self-closing "clear" div tags.
In [49178], self-closing `br` tags were switched to non-self-closing `div` elements for "clearing" purposes, but the self-closing "/" remained in place.  This fix removes the unnecessary slash.

Props pavelvisualcomposer, audrasjb, sabernhardt, akabarikalpesh, SergeyBiryukov.
Fixes #52878.
Built from https://develop.svn.wordpress.org/trunk@50582


git-svn-id: http://core.svn.wordpress.org/trunk@50195 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-25 19:33:04 +00:00
desrosj
2e34561536 Build/Test Tools: Disable fail-fast for the NPM testing workflow.
This disables the `fail-fast` option in the GitHub Actions workflow for testing NPM. This allows all jobs in the test matrix to complete, even if one fails, painting a clear picture of where the issue lies.

Follow up to [50435].

See #52625.
Built from https://develop.svn.wordpress.org/trunk@50579


git-svn-id: http://core.svn.wordpress.org/trunk@50192 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-25 15:10:06 +00:00
ryelle
14eddefa5e Login, Registration: Prevent button misalignment on login screen.
Replace the float CSS removed in [50569], which is used to align the login & register buttons.

Props mukesh27, audrasjb.
Fixes #52834.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50190 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-25 14:23:03 +00:00
Sergey Biryukov
d6cc4f1aec Query: Consistently include a space in parentheses in WP_Meta_Query::get_sql_for_clause().
Props jillebehm, kaavyaiyer, hareesh-pillai.
Fixes #49279.
Built from https://develop.svn.wordpress.org/trunk@50576


git-svn-id: http://core.svn.wordpress.org/trunk@50189 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-25 12:39:07 +00:00
Peter Wilson
a66cb4bb18 Script Loader: Escape HTML5 boolean attribute names.
Add escaping of boolean attribute names in `wp_sanitize_script_attributes()` for themes supporting HTML5 script elements.

Props tmatsuur, johnbillion, joyously.
Fixes #52894.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50188 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-25 00:27:06 +00:00
Sergey Biryukov
fc6e4cbe3e Accessibility: Administration: Use a darker gray color for various admin UI items.
This ensures that the color meets the WCAG 2.0 AA recommended contrast ratio.

Follow-up to [50025], [50525].

Props sabernhardt, ryelle.
Fixes #52760.
Built from https://develop.svn.wordpress.org/trunk@50571


git-svn-id: http://core.svn.wordpress.org/trunk@50184 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-24 16:41:07 +00:00
gziolo
8f6ed34331 Editor: Add image default size to block editor settings
Related: https://github.com/WordPress/gutenberg/pull/29966

Add new imageDefaultSize value to block editor settings.

Props Mamaduka.
Fixes #52896.



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


git-svn-id: http://core.svn.wordpress.org/trunk@50183 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-24 07:33:08 +00:00
Peter Wilson
270f2011f8 Login, Registration: Prevent button misalignment on password reset screen.
Prevent misalignment of "generate password" and "save password" buttons on the password reset screen on narrow screens and in languages requiring longer text than English.

Props audrasjb, grapplerulrich, ryelle.
Fixes #52834.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50182 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-24 00:22:02 +00:00
Peter Wilson
ea83435668 Privacy: Wrap text in buttons on privacy policy guide.
On narrow screens allow the text to wrap in the copy buttons on the privacy policy guide screen to avoid horizontal overflow of the parent container.

Props audrasjb, davidbaumwald, jaymanpandya, paaljoachim, palmiak, sabernhardt, SergeyBiryukov, sumitsingh.
Fixes #52751.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-24 00:04:04 +00:00
Peter Wilson
c41990398c REST API: Prevent database error when deleting meta data.
Add a check to `WP_REST_Meta_Fields::delete_meta_value()` ensuring meta data is set before attempting to delete it from the database. If the data does not exist, the delete is considered successful as the data matches the desired state.

Props BrechtVds, goaroundagain, TimothyBlynJacobs.
Fixes #52787.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50180 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-23 23:36:04 +00:00
Peter Wilson
fedd1d2b63 Robots: Remove contradictory directive check in wp_robots().
Removes the mutually exclusive directives check in `wp_robots()`, ie allow both `follow` and `nofollow` to be specified and for `archive` and `noarchive` to be specified.

This fixes a bug in which WordPress would defer to the most permissive over the least permissive. When contradictory instructions are included, WordPress will defer to the search engine's or archivist's resolution policy: generally this is to observe the least, not most permissive.

Props Cybr, flixos90.
Fixes #52713.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50179 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-23 23:02:05 +00:00
Sergey Biryukov
d5a6a1ab44 Taxonomy: Use a consistent check for the $rewrite['hierarchical'] parameter.
This avoids a "Trying to access array offset on value of type bool" PHP warning in `get_term_link()` if the `$rewrite` parameter of `register_taxonomy()` is set as `false`.

Props Tkama, SergeyBiryukov.
Fixes #52882.
Built from https://develop.svn.wordpress.org/trunk@50565


git-svn-id: http://core.svn.wordpress.org/trunk@50178 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-23 13:55:03 +00:00
gziolo
3bd08d3bd4 Editor: Add new theme category for block types
Related: https://github.com/WordPress/gutenberg/pull/30020.

Introduces a new "theme" category to the default set to use with template-parts and other FSE blocks.

Props matveb.
Fixes #52883. 


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


git-svn-id: http://core.svn.wordpress.org/trunk@50177 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-23 09:02:06 +00:00
Sergey Biryukov
0ee244739a Code Modernization: Correct expected data type for WP_User_Search::$page property.
This fixes erroneous parentheses placement and applies the type cast to the variable it was intended for.

Follow-up to [3864].

Props hellofromTonya, jrf, xknown.
See #51423.
Built from https://develop.svn.wordpress.org/trunk@50563


git-svn-id: http://core.svn.wordpress.org/trunk@50176 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-22 22:42:04 +00:00
Sergey Biryukov
63fba77ec7 Docs: Fix typo in pre_term_link filter description.
See #52628.
Built from https://develop.svn.wordpress.org/trunk@50562


git-svn-id: http://core.svn.wordpress.org/trunk@50175 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-22 19:19:09 +00:00
Sergey Biryukov
590d59e92f Coding Standards: Move some translator comments to the correct place.
Follow-up to [48172].

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50561


git-svn-id: http://core.svn.wordpress.org/trunk@50174 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-21 13:13:03 +00:00
Sergey Biryukov
a885f914e4 Coding Standards: Add missing semicolon to some endif keywords.
See #52627.
Built from https://develop.svn.wordpress.org/trunk@50560


git-svn-id: http://core.svn.wordpress.org/trunk@50173 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-21 13:05:04 +00:00
Sergey Biryukov
63191bd646 Tests: Move the get_current_commenter() method next to the test it's used in.
Follow-up to [48133].

See #52625.
Built from https://develop.svn.wordpress.org/trunk@50559


git-svn-id: http://core.svn.wordpress.org/trunk@50172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-21 12:55:04 +00:00
Sergey Biryukov
5e10227d76 Coding Standards: Use strict comparison for return type checks in a few functions:
* `get_bookmark()`
* `get_comment()`
* `get_post()`
* `get_children()`
* `wp_get_recent_posts()`
* `wp_get_post_revision()`
* `wp_get_nav_menu_items()`

Follow-up to [45710] for `get_term()`, [48507] for `wpdb::get_row()` and `wpdb::get_results()`.

See #52627.
Built from https://develop.svn.wordpress.org/trunk@50558


git-svn-id: http://core.svn.wordpress.org/trunk@50171 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-21 12:41:04 +00:00
Sergey Biryukov
d72f4e0e48 Coding Standards: Use strict comparison in wp-admin/includes/class-wp-upgrader.php.
See #52627.
Built from https://develop.svn.wordpress.org/trunk@50557


git-svn-id: http://core.svn.wordpress.org/trunk@50170 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-21 12:12:07 +00:00
Sergey Biryukov
d3d78e755b Coding Standards: Add a space before / character in some self-closing HTML tags.
While this has no effect on the code, it fixes a minor inconsistency with the rest of core.

Props laxman-prajapati.
Fixes #52870.
Built from https://develop.svn.wordpress.org/trunk@50556


git-svn-id: http://core.svn.wordpress.org/trunk@50169 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-20 18:30:08 +00:00
Sergey Biryukov
643888dfc6 I18N: Update list of continents and cities for the timezone selection.
Props wangql, mukesh27.
Fixes #52861.
Built from https://develop.svn.wordpress.org/trunk@50555


git-svn-id: http://core.svn.wordpress.org/trunk@50168 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-19 15:42:04 +00:00
Sergey Biryukov
b4c09beba8 I18N: Remove duplicate entries from the list of continents and cities.
Follow-up to [37554].

See #52861.
Built from https://develop.svn.wordpress.org/trunk@50554


git-svn-id: http://core.svn.wordpress.org/trunk@50167 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-19 15:21:08 +00:00
whyisjake
471fc1e913 Media: Pass the appropriate reference into wp_getimagesize.
With changes that were introduced in [49889] the second parameter for getimagesize() function is expecting a a reference.

Previously, most calls did not pass the 2nd param, and as a result, we are getting unexpected results.

This was only a problem with applications that are using a custom stream wrapper, and the image contained EXIF data.

For more see:

* https://github.com/humanmade/S3-Uploads/issues/496
* https://github.com/aws/aws-sdk-php/issues/1923

Fixes #52826.
Props terriann, SergeyBiryukov, Mista-Flo, hellofromTonya, rinatkhaziev, whyisjake.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50165 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-19 00:01:03 +00:00
ryelle
3363e22f80 Pointers: Make pointer border darker to match arrow tip.
Props johnjamesjacoby, melchoyce, SergeyBiryukov.
Fixes #52670.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50164 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-18 23:26:05 +00:00
Peter Wilson
c7fac4a9ea External libraries: Update generated script loader version hashes.
Update the generated file `src/wp-includes/assets/script-loader-packages.php` following the clipboard.js update in [50544].

See #52850.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50163 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-18 22:45:04 +00:00
ryelle
0bfb5f043b Administration: Make focus states consistent in admin menu when collapsed.
When collapsed or on a small screen, these styles would override the color schemes, causing a dark background to appear regardless of the color scheme's settings. This change also uses `focus-within` to show or hide the menu item's arrow, consistent with how the arrow behaves on hover.

Props afercia, Bueltge.
Fixes #32579.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50162 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-18 21:44:09 +00:00
desrosj
707b80c194 Emoji: Update the Twemoji library to version 13.0.2.
This point release does not add any new Emoji and only slightly modifies 14 existing Emoji without changing their meanings.

Because of this, the same CDN location (currently `/images/core/emoji/13.0.1`) can be updated with the new versions and sites running WordPress 5.6 or higher will start using the updated versions once their cache expires.

See #52852.
Built from https://develop.svn.wordpress.org/trunk@50548


git-svn-id: http://core.svn.wordpress.org/trunk@50161 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-18 19:20:19 +00:00
Sergey Biryukov
87db5b833d External Libraries: Further fix jQuery deprecations in WordPress core.
Follow-up to [50001], [50270], [50367], [50383], [50410], [50420], [50429].

Props Clorith.
See #51812.
Built from https://develop.svn.wordpress.org/trunk@50547


git-svn-id: http://core.svn.wordpress.org/trunk@50160 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-18 19:01:03 +00:00
desrosj
cd3e85fe23 External Libraries: Update the jQuery Form library.
This updates the `jquery-form` library from version `4.2.1` to `4.3.0`.

A full list of changes can be found on GitHub: https://github.com/jquery-form/form/compare/v4.2.1...v4.3.0.

Fixes #52685.
Built from https://develop.svn.wordpress.org/trunk@50546


git-svn-id: http://core.svn.wordpress.org/trunk@50159 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-18 17:53:19 +00:00
desrosj
235b19b3b0 Build/Test Tools: Update some devDependencies.
This updates a handful of dependencies to their latest versions.

- `qunit` from `2.14.0` to `2.14.1`.
- `uglify-js` from `3.13.0` to `3.13.1`.
- `wait-on` from `5.2.1` to `5.3.0`.

See #52624.
Built from https://develop.svn.wordpress.org/trunk@50545


git-svn-id: http://core.svn.wordpress.org/trunk@50158 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-18 17:48:23 +00:00
desrosj
456973fa26 External Libraries: Update Clipboard.js library to version 2.0.8.
This updates the `clipboard` library from version `2.0.6` to `2.0.8`.

A full list of changes can be found on GitHub: https://github.com/zenorocha/clipboard.js/compare/v2.0.6...v2.0.8.

Fixes #52850.
Built from https://develop.svn.wordpress.org/trunk@50544


git-svn-id: http://core.svn.wordpress.org/trunk@50157 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-18 15:54:18 +00:00
desrosj
3a92b15f93 External Libraries: Update jQuery Color library to version 2.2.0.
This updates the `jquery-color` library from version `2.1.2` to `2.2.0`.

This also switches back to installing the dependency from NPM instead of GitHub. The maintainers have resumed publishing to NPM with the 2.2.0 release.

A full list of changes can be found on GitHub: https://github.com/jquery/jquery-color/compare/2.1.2...2.2.0.

Props hareesh-pillai, desrosj.
Fixes #51405.
Built from https://develop.svn.wordpress.org/trunk@50543


git-svn-id: http://core.svn.wordpress.org/trunk@50156 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-18 15:50:18 +00:00
desrosj
0baa695906 Build/Test Tools: Revert [50540].
The E2E workflow is failing after this change. Reverting to to investigate further.

Unprops desrosj.
See #52843.
Built from https://develop.svn.wordpress.org/trunk@50542


git-svn-id: http://core.svn.wordpress.org/trunk@50155 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-18 14:35:22 +00:00
Sergey Biryukov
bf29bb4441 Coding Standards: Use strict comparison for JS fragment in some admin files.
Follow-up to [48083].

Props nayanchamp7, rnaby.
Fixes #52845, #41988.
Built from https://develop.svn.wordpress.org/trunk@50541


git-svn-id: http://core.svn.wordpress.org/trunk@50154 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-18 14:13:08 +00:00
desrosj
357e77789c Build/Test Tools: Remove explicit puppeteer dependency.
This was added in [48177] to fix an issue where Puppeteer was not being installed correctly as a dependency of `@wordpress/wp-scripts`. This has been fixed, so this explicit dependency can be removed.

Props isabel_brison.
Fixes #52843.
Built from https://develop.svn.wordpress.org/trunk@50540


git-svn-id: http://core.svn.wordpress.org/trunk@50153 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-18 12:44:23 +00:00
Sergey Biryukov
6ad5c0c553 Docs: Correct formatting for the description of some register_post_type() parameters.
Props audrasjb.
Fixes #52836.
Built from https://develop.svn.wordpress.org/trunk@50538


git-svn-id: http://core.svn.wordpress.org/trunk@50151 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-17 17:33:10 +00:00
Sergey Biryukov
4d514bb6ad Tests: Correct some newly introduced @covers tags.
Follow-up to [50289], [50344].

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


git-svn-id: http://core.svn.wordpress.org/trunk@50150 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-16 18:46:07 +00:00
ryelle
5d983ec85b Help/About: Run image comparison script after all assets have loaded.
If the callback is called before the images are loaded, the comparison doesn't work. `wp.domReady` uses `DOMContentLoaded`, which does not guarantee that the images are loaded. This switches to use the `load` event, which waits for all resources to load.

Props vladytimy, joyously, sergeybiryukov.
Fixes #52758.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50148 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-15 19:51:09 +00:00
Sergey Biryukov
f9cc35ebad Twenty Seventeen: Remove extra space around post editor.
The editor uses the full height of its container, so the added margins cause the visual editor to break out of the container. This removes the top & bottom margins, and makes the left & right margins consistent with the meta box area.

Follow-up to [50465].

Props joseeyoast, audrasjb.
Fixes #52816.
Built from https://develop.svn.wordpress.org/trunk@50534


git-svn-id: http://core.svn.wordpress.org/trunk@50147 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-15 13:26:06 +00:00
Sergey Biryukov
7720afe9a7 Coding Standards: Remove some extra whitespace in sanitize_comment_cookies().
See #52627.
Built from https://develop.svn.wordpress.org/trunk@50533


git-svn-id: http://core.svn.wordpress.org/trunk@50146 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-14 17:01:12 +00:00
Sergey Biryukov
dc68fb8278 Docs: Synchronize $category_name description in WP_Block_Pattern_Categories_Registry methods.
Follow-up to [48156].

See #52628.
Built from https://develop.svn.wordpress.org/trunk@50532


git-svn-id: http://core.svn.wordpress.org/trunk@50145 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-13 11:17:03 +00:00
Sergey Biryukov
0a3794a0de Docs: Correct DocBlock formatting for register_block_style_handle().
Follow-up to [48141].

See #52628.
Built from https://develop.svn.wordpress.org/trunk@50531


git-svn-id: http://core.svn.wordpress.org/trunk@50144 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-13 11:15:04 +00:00
Sergey Biryukov
3f03bb352e Site Health: Use a singular string in dashboard widget if there is only one critical issue or recommendation.
Props Presskopp, hareesh-pillai.
Fixes #52521.
Built from https://develop.svn.wordpress.org/trunk@50530


git-svn-id: http://core.svn.wordpress.org/trunk@50143 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-13 10:59:02 +00:00
Sergey Biryukov
cb55990e50 Docs: Add missing @since tags for item_link and item_link_description post type and taxonomy labels.
Follow-up to [50527].

See #52688.
Built from https://develop.svn.wordpress.org/trunk@50529


git-svn-id: http://core.svn.wordpress.org/trunk@50142 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-13 10:25:06 +00:00
davidbaumwald
fb8c18e541 Docs: Correct unregister_block_style @param for $block_name.
In `unregister_block_style`, the `$block_name` parameter was documented as an array.  This change corrects the type to `string`, as that's what is expected in `WP_Block_Styles_Registry->unregister`. 

Props kraftner.
Fixes #52795.
Built from https://develop.svn.wordpress.org/trunk@50528


git-svn-id: http://core.svn.wordpress.org/trunk@50141 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-12 20:05:08 +00:00
gziolo
f27c179afc Editor: Make block type aware of variations
Currently block variations are only defined on the client. In some cases, creating block variations on the server can be very useful, especially when needed data is not exposed in the REST APIs.

Related to https://github.com/WordPress/gutenberg/pull/29095.

Props: gwwar, timothyblynjacobs.
Fixes: #52688.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50140 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-12 13:35:09 +00:00
Sergey Biryukov
96377c956f Accessibility: Administration: Use a darker color for post dates in the Activity and Quick Draft dashboard widgets.
This ensures that the color meets the WCAG 2.0 AA recommended contrast ratio.

Follow-up to [50025].

Props sabernhardt, Otshelnik-Fm, audrasjb.
Fixes #52760.
Built from https://develop.svn.wordpress.org/trunk@50525


git-svn-id: http://core.svn.wordpress.org/trunk@50138 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-12 12:06:13 +00:00
ryelle
9808fad416 Help/About: Use absolute URLs for inline images on About pages.
This ensures the images are loaded correctly from both single site and network About pages.

Props TobiasBg, audrasjb.
Fixes #52743.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50136 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-11 21:38:08 +00:00
Sergey Biryukov
88df1ef431 Coding Standards: Consistently format opendir() calls in get_plugins().
Props sabernhardt, subrataemfluence.
Fixes #44250.
Built from https://develop.svn.wordpress.org/trunk@50522


git-svn-id: http://core.svn.wordpress.org/trunk@50135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-11 15:19:08 +00:00
desrosj
efaa79d347 External Libraries: Update jQuery hoverIntent to version 1.10.1.
This updates the `jquery-hoverintent` dependency from 1.8.3 to 1.10.1.

For a full list of changes, see https://github.com/briancherne/jquery-hoverIntent/compare/v1.8.3...v1.10.1.

Fixes #52686.
Built from https://develop.svn.wordpress.org/trunk@50521


git-svn-id: http://core.svn.wordpress.org/trunk@50134 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-10 15:25:20 +00:00
desrosj
de074081d1 External Libraries: Update jQuery to version 3.6.0.
This updates the jQuery dependency from 3.5.1 to 3.6.0.

For a full list of changes, see https://github.com/jquery/jquery/compare/3.5.1...3.6.0.

Fixes #52707. See #51812.
Built from https://develop.svn.wordpress.org/trunk@50520


git-svn-id: http://core.svn.wordpress.org/trunk@50133 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-10 15:07:24 +00:00
Sergey Biryukov
a292585ea4 Help/About: Correct the WebM video URL on About page.
Props mihdan, audrasjb.
Fixes #52756.
Built from https://develop.svn.wordpress.org/trunk@50518


git-svn-id: http://core.svn.wordpress.org/trunk@50131 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-10 10:28:11 +00:00
Peter Wilson
0b75f9557e Docs: Improve spelling in [50516].
Props jeremyfelt.
See #52628, #34564.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50130 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-09 23:22:06 +00:00
Peter Wilson
fb1857def8 Docs: Improve compatibility comment in WP_List_Table.
Improve comment explaining backward compatibility check for the primary column in `WP_List_Table::get_column_info()`.

Unprops helen, markjaquith.
See #52628, #34564.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50129 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-09 22:35:06 +00:00
Sergey Biryukov
ebee7d0ab9 Classic Editor: Make sure word count is hidden if JavaScript is disabled.
Removing `display: block` from the element allows the `.hide-if-no-js` class to have the intended effect.

Follow-up to [34275].

Props sabernhardt, mukesh27.
Fixes #52662.
Built from https://develop.svn.wordpress.org/trunk@50512


git-svn-id: http://core.svn.wordpress.org/trunk@50125 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-09 10:13:08 +00:00
desrosj
a8b7cd17e0 Update $_old_files for 5.7.
Follow up to [50066].

See #52334.
Built from https://develop.svn.wordpress.org/trunk@50510


git-svn-id: http://core.svn.wordpress.org/trunk@50123 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-08 18:30:07 +00:00
desrosj
e2a19b5352 Bundled Themes: Bump theme version numbers for WordPres 5.7.
This updates all new default themes to new versions, which will be released shortly after WordPress 5.7. The new versions are:

- Twenty Twenty-One: 1.2
- Twenty Twenty: 1.7
- Twenty Nineteen: 2.0
- Twenty Seventeen: 2.6
- Twenty Sixteen: 2.4
- Twenty Fifteen: 2.9
- Twenty Fourteen: 3.1
- Twenty Thirteen: 3.3
- Twenty Twelve: 3.4
- Twenty Eleven: 3.7
- Twenty Ten: 3.3

Fixes #52704.
Built from https://develop.svn.wordpress.org/trunk@50507


git-svn-id: http://core.svn.wordpress.org/trunk@50120 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-08 14:17:08 +00:00
Sergey Biryukov
fa5a9d5e92 Upgrade/Install: Display version number on the "Update now" button on WordPress Updates screen.
Additionally, adjust the "Update to latest nightly" button to include the major version number of the nightly build.

This makes the button labels more accurate and provides more clear understanding of what the update will be.

Follow-up to [49984].

Props afragen, pbiron, SergeyBiryukov.
Fixes #52513.
Built from https://develop.svn.wordpress.org/trunk@50506


git-svn-id: http://core.svn.wordpress.org/trunk@50119 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-08 11:31:09 +00:00
John Blackbourn
52679edbff Docs: Add examples of possible names for various hooks whose name contains a dynamic portion.
This provides greater discoverability of such hooks in search results on the Code Reference site as well as increased clarity when reading the source.

See #50734, #52628

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


git-svn-id: http://core.svn.wordpress.org/trunk@50118 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-07 12:32:09 +00:00
Sergey Biryukov
f4f826d74d Docs: Add a @since note to wp_admin_bar_edit_menu() about the "View Post" link on Comments screen for a single post.
Follow-up to [47903].

Props sabernhardt, janak007, munyagu.
Fixes #42366.
Built from https://develop.svn.wordpress.org/trunk@50504


git-svn-id: http://core.svn.wordpress.org/trunk@50117 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-07 11:56:07 +00:00
John Blackbourn
2b596377be Build/Test Tools: Ensure the test_php_and_js_shortcode_attribute_regexes_match() test can run when testing using either the src or build directory.
Props alexstine, desrosj

See #51734

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


git-svn-id: http://core.svn.wordpress.org/trunk@50114 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-05 15:28:03 +00:00
Sergey Biryukov
497171a1c8 XML-RPC: Pass an empty array to the xmlrpc_call action in methods that have no arguments.
This avoids an "Undefined variable" PHP notice in the `::mt_supportedMethods()` and `::mt_supportedTextFilters()` methods.

Follow-up to [50353].

Props dd32.
Fixes #52524.
Built from https://develop.svn.wordpress.org/trunk@50499


git-svn-id: http://core.svn.wordpress.org/trunk@50112 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-05 11:03:06 +00:00
noisysocks
328fa9858d Editor: Update @wordpress npm packages
Update @wordpress npm packages to the latest published versions. This includes
block editor bug fixes for WordPress 5.7 RC 3.

See #52718.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50109 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-05 04:10:44 +00:00
ryelle
22358d62ce Help/About: Clarify two strings.
The intro text has been updated for accuracy and to make it easier for translation. The button text has been updated for accuracy.

Props jdy68, audrasjb, marybaum, davidbaumwald.
See #52347.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50108 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-04 19:10:06 +00:00
desrosj
d3324379f9 Twenty Twenty-One: Make text readable when dark background is selected for the Media & Text block.
This change ensures that the text in the Media & Text block is readable when dark background colors are selected.

This is a regression that was introduced in [49987].

Props hellofromTonya, poena, paaljoachim, ryelle.
Fixes #52702.
Built from https://develop.svn.wordpress.org/trunk@50493


git-svn-id: http://core.svn.wordpress.org/trunk@50106 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-04 16:57:05 +00:00
Sergey Biryukov
290229ae07 Docs: Update inline comments in some test files per the documentation standards.
See #52628.
Built from https://develop.svn.wordpress.org/trunk@50491


git-svn-id: http://core.svn.wordpress.org/trunk@50104 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-04 10:13:07 +00:00
Peter Wilson
4d2abda74a Roles/Caps: Return same result from current_user_can and user_can().
Ensure `current_user_can()` and `user_can()` return the same results for logged out users. For core capabilities this changes `user_can( 0, 'exist' )` to return `true` rather than `false` in line with `current_user_can( 'exist' )` for logged out users.

Convert `current_user_can()` and `current_user_can_for_blog()` to wrapper functions ultimately calling `user_can()`.

Add anonymous user to primitive capability checks as appropriate. Convert `Tests_User_Capabilities::test_other_caps_for_all_roles()` to use a data provider and add tests to check whether user exists in the database (`WP_User::exists()`) as that intentionally differs from the `exist` capability.

Props jjj, johnbillion, peterwilsoncc, SergeyBiryukov, TimothyBlynJacobs.
Fixes #52076.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50103 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-04 00:14:04 +00:00
noisysocks
534bbf3f36 Block Editor: Fix color support for dynamic blocks
Changes wp_apply_colors_support to check for for color instead of
__experimentalColor when determining block support for color.

Props nosolosw, rafhun, youknowriad.
See #52709.

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


git-svn-id: http://core.svn.wordpress.org/trunk@50101 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-03 23:31:04 +00:00
desrosj
bbdc16d705 Build/Test Tools: Update some dependencies.
This updates the following `devDependencies`:

- `grunt-contrib-cssmin` from `3.0.0` to `4.0.0`.
- `uglify-js` from `3.12.8` to `3.13.0`.

See #52624.
Built from https://develop.svn.wordpress.org/trunk@50487


git-svn-id: http://core.svn.wordpress.org/trunk@50100 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-03 21:16:22 +00:00
desrosj
c082c48111 Build/Test Tools: Pin SHA versions to the remaining 3rd party actions.
This also adds inline comments to the end of each action installed using a SHA value to make it easier to determine which version of an action is currently being used.

Follow up to [50474,50476].

Props johnbillion.
See #52625.
Built from https://develop.svn.wordpress.org/trunk@50486


git-svn-id: http://core.svn.wordpress.org/trunk@50099 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-03 20:31:06 +00:00
desrosj
2af9d4751a Build/Test Tools: Generalize the NPM test workflow.
The NPM test GitHub Actions workflow is currently used to verify that `npm install` and `npm run build` will complete successfully on Windows.

This generalizes the workflow and adds testing for Linux and MacOS to confirm that the scripts used to build WordPress also complete successfully in those environments.

Because MacOS workflow runs consume GHA minutes at a 10x rate, it’s added in a separate job in order to perform a more strict check.

This also adds steps to verify that using `npm run build:dev` and `npm run grunt clean`/`npm run grunt clean —dev` run successfully 

Props johnbillion.
Fixes #52658.
Built from https://develop.svn.wordpress.org/trunk@50485


git-svn-id: http://core.svn.wordpress.org/trunk@50098 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-03 19:52:05 +00:00
Sergey Biryukov
4f61efe826 Docs: Update documentation in some WP_REST_Request tests per the documentation standards.
Follow-up to [49329].

See #52628.
Built from https://develop.svn.wordpress.org/trunk@50484


git-svn-id: http://core.svn.wordpress.org/trunk@50097 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-03 19:26:08 +00:00
Sergey Biryukov
3cdbafe164 Help/About: Clarify a string about lazy-loading iframes.
Props davidbaumwald, audrasjb, hellofromTonya.
See #52347.
Built from https://develop.svn.wordpress.org/trunk@50483


git-svn-id: http://core.svn.wordpress.org/trunk@50094 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-02 21:38:03 +00:00
desrosj
679c86818b Build/Test Tools: Add path detection when running GitHub Actions on pull_request.
This change adds a list of paths to check when determining which workflows to run on `pull_request`. This will prevent certain workflows from running unnecessarily when the files updated are not related to the tests and checks being performed.

Props peterwilsoncc, johnbillion.
Fixes #52667.
Built from https://develop.svn.wordpress.org/trunk@50479


git-svn-id: http://core.svn.wordpress.org/trunk@50090 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-02 19:59:03 +00:00
ryelle
f4f117144e Help/About: Iterate on the 5.7 About Page.
Adds a more obviously interactive comparison for viewing the color scheme differences. Improvements on RTL and IE11. Update strings to be more clear and consistent. Switch to the CDN for loading images.

Props sarahricker, desrosj, melchoyce, SergeyBiryukov, tikifez, clorith, marybaum, audrasjb, francina, hellofromTonya.
Fixes #52693. See #52347.


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


git-svn-id: http://core.svn.wordpress.org/trunk@50089 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-02 19:50:04 +00:00
desrosj
37b71d9d40 Build/Test Tools: Change the cancel-workflow-action version to a SHA value.
Additionally, the `access_token` input now defaults to `github.token`, so specifying it is unnecessary.

Follow up to [50474].

Props johnbillion.
See #52625.
Built from https://develop.svn.wordpress.org/trunk@50476


git-svn-id: http://core.svn.wordpress.org/trunk@50087 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-02 17:49:02 +00:00