Commit Graph

17816 Commits

Author SHA1 Message Date
Sergey Biryukov ae40aad4c0 Docs: Switch a comment in `WP_Media_List_Table::prepare_items()` to multi-line format, per the documentation standards.
Follow-up to [48417].

Props pinkalbeladiya, davidbaumwald.
Fixes #52025.
Built from https://develop.svn.wordpress.org/trunk@50071


git-svn-id: http://core.svn.wordpress.org/trunk@49772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-29 18:54:01 +00:00
noisysocks 4825dccd26 Block Editor: Add enableCustomSpacing
Adds the `enableCustomSpacing` editor setting. This enables the custom block
spacing feature from Gutenberg.

Props nosolosw, gziolo.
Fixes #51760.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-29 05:04:59 +00:00
noisysocks 2152259257 Block Editor: Add defaultEditorStyles
The `defaultEditorStyles` setting was missing from the default block
editor settings. This causes the "Use theme styles" setting which was
added in WordPress 5.6 to not function properly.

Also, the RTL version of editor styles were not being loaded. This
change has not yet been ported over from Gutenberg.

Fixes #52394.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49770 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-29 04:58:58 +00:00
antpb 3dc428f0de Media: Remove unused `refresh` from _requery.
In [50067] `props.cache` was removed as it was unused. This left a lingering unused `refresh` in the `_requery` function.

Props peterwilsoncc.
See #50025.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-29 02:41:57 +00:00
antpb ffc2cc5617 Media: Remove caching from filter by date in media library.
Previously, newly uploaded media attachments were missing when filtering media items by date due to lack of cache invalidation.

Props adamsilverstein, teamdnk, afercia, Mista-Flo, joedolson, youknowriad, talldanwp.
Fixes #50025.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49768 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-29 01:35:59 +00:00
noisysocks 97acbb1c7f Editor: Move blocks/classic -> blocks/freeform
Moves src/wp-includes/blocks/classic to src/wp-includes/blocks/freeform. This
reflects the 'classic' block being renamed to 'freeform'.

Follows [50048].
See #52334.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49767 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-29 00:26:58 +00:00
TimothyBlynJacobs cd6238947e App Passwords: Introduce introspection endpoint.
This introduces a new endpoint, `wp/v2/users/me/application-passwords/introspect`, that will return details about the App Password being used to authenticate the current request. This allows for an application to disambiguate between multiple installations of their application which would all share the same `app_id`.

Props xkon, peterwilsoncc, TimothyBlynJacobs.
Fixes #52275.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49766 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-29 00:07:02 +00:00
TimothyBlynJacobs 0000f669b6 REST API: Refactor `rest_validate_value_from_schema` into separate validation functions per-type.
Props yakimun.
Fixes #52375.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49761 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-28 18:00:58 +00:00
whyisjake 22bb49e4d6 Site Health: Update the language around how PHP should be updated.
Follow-up to [50042].

Props SergeyBiryukov.

See #52327.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-28 17:23:09 +00:00
Sergey Biryukov 5478a88919 Docs: Update documentation for `WP_Application_Passwords::application_name_exists_for_user()` per the documentation standards.
Follow-up to [50030].

See #51941.
Built from https://develop.svn.wordpress.org/trunk@50057


git-svn-id: http://core.svn.wordpress.org/trunk@49758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-28 13:10:57 +00:00
Sergey Biryukov 6f2bba08d9 Privacy: Add newlines to the `index.php` file in `wp-personal-data-exports` directory, for consistency with other similar files.
Follow-up to [50037].

See #52299.
Built from https://develop.svn.wordpress.org/trunk@50055


git-svn-id: http://core.svn.wordpress.org/trunk@49756 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-28 12:58:58 +00:00
Sergey Biryukov 7f7c0914af Docs: Update documentation for `wp_is_site_protected_by_basic_auth()` per the documentation standards.
Follow-up to [49752], [50006].

See #52066.
Built from https://develop.svn.wordpress.org/trunk@50053


git-svn-id: http://core.svn.wordpress.org/trunk@49754 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-28 11:05:58 +00:00
Sergey Biryukov 2ca69453bd Docs: Revert documentation change for `wp_get_attachment_metadata()`.
This more accurately describes the behavior of the function, and is more consistent with the documentation for other post and attachment functions.

Follow-up to [50039].

Props Mista-Flo.
See #52196.
Built from https://develop.svn.wordpress.org/trunk@50051


git-svn-id: http://core.svn.wordpress.org/trunk@49752 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-28 10:42:01 +00:00
Sergey Biryukov 38b205e5dc Coding Standards: Simplify a long condition in `WP_Site_Health_Auto_Updates::test_wp_version_check_attached()` for better readability.
Follow-up to [50035].

See #52135.
Built from https://develop.svn.wordpress.org/trunk@50049


git-svn-id: http://core.svn.wordpress.org/trunk@49750 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-28 10:35:59 +00:00
noisysocks 43e36a3541 Editor: Update @wordpress npm packages
Update @wordpress npm packages to the latest published versions. This means that
the block editor includes functionality that exists in Gutenberg 9.8.

See #52334.
Props isabel_brison.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49749 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-28 02:04:13 +00:00
whyisjake d3d95965dd Site Health: Update php update strings to not overpromise performance.
Fixes #52327.

Props chanthaboune, SergeyBiryukov, audrasjb, Clorith, whyisjake.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-28 00:17:58 +00:00
whyisjake 3beabe0b11 Media: Ensure that `wp_get_attachment_metadata` can return values from the global `$post`, if avaiable.
In [49084] (for #50679), wp_get_attachment_metadata() was changed to improve performance, but it had the side effect of eliminating the ability to call it with no arguments and have it default to using the global $post.

This change restores that ability, while keeping the performance improvements from the original change.

Fixes #52196.

Props cfinke, hellofromTonya, mukesh27, dilipbheda, Mista-Flo, audrasjb, SergeyBiryukov, whyisjake.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49740 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-28 00:08:58 +00:00
whyisjake 5f532382aa Privacy: Ensure that exported user data reports can't be found with directory listings.
By moving from `.html` to `.php` files, we can prevent directory listings, and ensure that WordPress can load.

Fixes #52299.

Props lucasbustamante, xkon, freewebmentor, SergeyBiryukov, whyisjake. 

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


git-svn-id: http://core.svn.wordpress.org/trunk@49738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-27 23:46:58 +00:00
whyisjake ab6271c0a7 Site Health: Only run the version checks on the main site.
The version checks that are setup in `wp-includes/update.php` do set up the action, but only for the main site.

Fixes #52135.

Props audrasjb, SergeyBiryukov, maxpertici, aaribaud.
 

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


git-svn-id: http://core.svn.wordpress.org/trunk@49736 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-27 23:27:00 +00:00
joedolson 35aaaacc04 Revisions: Generate correct number of columns in wp_text_diff.
The function `wp_text_diff` generated an invalid table structure if the $args parameter contained any values. This patch corrects the structure generated by `wp_text_diff` and related usages so that the column count matches the data generated. Additionally, this patch passes arguments to the Revisions screen so that the screen has column headings that reflect the content in each column. Improves the accessibility and usability of the Revisions table.

Props joedolson, mehulkaklotar, afercia, adamsilverstein, zodiac1978, jeremyfelt
Fixes #25473
Built from https://develop.svn.wordpress.org/trunk@50034


git-svn-id: http://core.svn.wordpress.org/trunk@49735 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-27 21:53:58 +00:00
joedolson 830d3942a0 Twenty Twenty: Remove aria-expanded on search modal close button.
The Twenty Twenty search modal uses aria-expanded correctly on the Search button, but toggles the aria-expanded value on the 'close' button. The close button is a different control, however, so the attribute value toggling is uneven. The close button does not toggle any behavior; it only closes a control that has already been opened.

Props alexstine, audrasjb
Fixes #52355
Built from https://develop.svn.wordpress.org/trunk@50033


git-svn-id: http://core.svn.wordpress.org/trunk@49734 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-27 21:32:58 +00:00
joedolson ee751b9779 Administration: Remove italic text to improve readability.
Italicized text can be difficult to read for some people with dyslexia or related forms of reading disorders. This removes italics on a number of larger blocks onpm run grunt rpf text in the admin. This has been a task 5.3; this commit closes the task. Further instances of italicized text should be addressed individually.

Props afercia, xkon, audrasjb
Fixes #47327
Built from https://develop.svn.wordpress.org/trunk@50032


git-svn-id: http://core.svn.wordpress.org/trunk@49733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-27 21:03:57 +00:00
TimothyBlynJacobs ee710f2c16 App Passwords: Improve validation and sanitization of the application name.
Application names are now required to be unique and cannot contain solely whitespace characters. Additionally, invalid characters are now stripped from the application name using `sanitize_text_field()`.

Props Boniu91, hellofromTonya, engahmeds3ed, xkon, francina.
Fixes #51941.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-27 19:05:02 +00:00
antpb d7e0ddebd1 Media: Reintroduce caching for Media Library query.
In [50021], caching was removed causing unintended classic block media flows to fail.

Reverts [50021].
See #50025.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-27 14:51:00 +00:00
Sergey Biryukov 401b0bbe8c Accessibility: Administration: Respect the `prefers-reduced-motion` media query for update icon spinner animations.
The update icon rotation should not occur when the user has opted to reduce motion, for example by selecting the "Reduce motion" option in macOS' preferences or unselecting "Show animations in Windows" in Windows' preferences.

Follow-up to [47813], [50027].

Props xkon, audrasjb, johnbillion.
Fixes #52263. See #51476.
Built from https://develop.svn.wordpress.org/trunk@50028


git-svn-id: http://core.svn.wordpress.org/trunk@49729 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-27 11:40:59 +00:00
Sergey Biryukov 3a695a7be2 Plugins: Rotate the Updates icon in the admin bar when performing inline updates on the Plugins screen.
This provides better indication within the viewport about ongoing processes on the page when updating several plugins at the same time, but without using the bulk updater.

Props ravipatel, audrasjb, johnjamesjacoby, paaljoachim, hellofromTonya, sabernhardt, mdwolinski, karmatosed, SergeyBiryukov.
Fixes #51476.
Built from https://develop.svn.wordpress.org/trunk@50027


git-svn-id: http://core.svn.wordpress.org/trunk@49728 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-27 10:59:02 +00:00
Sergey Biryukov 11ea669f7f Twenty Twenty-One: Correct colors for the Menu button.
As per design, the background should be transparent and the text should be dark grey, not vice versa.

Follow-up to [49987].

Props poena.
Fixes #52374. See #51927.
Built from https://develop.svn.wordpress.org/trunk@50026


git-svn-id: http://core.svn.wordpress.org/trunk@49727 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-26 18:59:57 +00:00
ryelle fed21a9863 Administration: Standardize colors used in CSS to a single palette.
This is part of a larger project in cleaning up core's admin CSS. This collapses all colors used in the CSS to one of 12 blues, greens, reds, and yellows, 13 grays, pure black, and pure white. The colors are perceptually uniform from light to dark, half of each range has a 4.5 or higher contrast against white, the other half has a 4.5 or higher contrast against black.

Standardizing on this set of colors will help contributors make consistent, accessible design decisions. The full color palette can be seen here: https://codepen.io/ryelle/full/WNGVEjw

Props notlaura, danfarrow, kburgoine, drw158, audrasjb, Joen, hedgefield, ibdz, melchoyce.
See #49999.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49726 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-26 18:54:59 +00:00
John Blackbourn 3670cc0b36 REST API: Introduce `modified_before` and `modified_after` query parameters for the posts endpoints.
These parameters work just the same as `before` and `after` except they operate on the post modified date instead of the post published date.

Props claytoncollie, TimothyBlynJacobs, hellofromTonya

Fixes #50617

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


git-svn-id: http://core.svn.wordpress.org/trunk@49725 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-26 18:28:03 +00:00
Sergey Biryukov 4ad17435f9 Mail: Make sure the `SMTP` class is only required once if a plugin requires `wp-includes/class-smtp.php` directly.
Follow-up to [48033], [48530].

Props oellin, greatsaltlake, audrasjb.
Fixes #52369. See #50716, #41750.
Built from https://develop.svn.wordpress.org/trunk@50022


git-svn-id: http://core.svn.wordpress.org/trunk@49723 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-26 13:45:57 +00:00
antpb c699cbcf0a Media: Remove caching from filter by date in media library.
Previously, newly uploaded media attachments were missing when filtering media items by date due to lack of cache invalidation.
Props adamsilverstein, teamdnk, afercia, Mista-Flo, joedolson.
Fixes #50025.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49722 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-26 05:26:01 +00:00
desrosj ad7754dbd9 Build/Test Tools: Update `autoprefixer` dependency.
This updates `autoprefixer` from version `9.6.2` to `9.8.6`. This includes changes as a result of running `npm run grunt precommit:css`.

See #51801.
Built from https://develop.svn.wordpress.org/trunk@50017


git-svn-id: http://core.svn.wordpress.org/trunk@49718 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-25 14:51:15 +00:00
desrosj 55df82ab1e Build/Test Tools: Update `sinon` dependency.
This updates `sinon` from version `9.2.3` to `9.2.4`.

See #51801.
Built from https://develop.svn.wordpress.org/trunk@50016


git-svn-id: http://core.svn.wordpress.org/trunk@49717 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-25 13:34:14 +00:00
Sergey Biryukov b97ae4e14c Toolbar: Update Documentation and Support links.
This replaces the Codex URL in the "WordPress" section of the admin bar with the HelpHub URL, and updates the Support link to point to the forums.

Follow-up to [45140], [45412].

Props audrasjb.
Fixes #52352. See #46790, #47239.
Built from https://develop.svn.wordpress.org/trunk@50015


git-svn-id: http://core.svn.wordpress.org/trunk@49716 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-25 12:53:58 +00:00
Gary Pendergast 91a89f2df2 Menus: Fix linting errors introduced in [50013].
Props TimothyBlynJacobs.
Fixes #52189.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-25 06:55:02 +00:00
Gary Pendergast 2660382579 Menus: Make use of `wp_resolve_post_date()` when updating menu items.
This allows a menu item `post_date` to be set to particular value, rather than only allowing it to be set to "now". In particular, the WordPress Importer can use this to perform faster, more accurate duplicate checks.

Props jmdodd.
Fixes #52189.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-25 01:23:58 +00:00
Gary Pendergast ce19f7a630 Posts: Create a new function for resolving the post date.
`wp_insert_post()` has a few checks using `post_date` and `post_date_gmt`, to determine the correct post date. This functionality is now extracted out into a new `wp_resolve_post_date()` function, allowing the checks to be reused elsewhere.

Props jmdodd.
Fixes #52187.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-25 01:07:59 +00:00
Gary Pendergast 7e93e28784 Export: Create an export-specific filter for post titles.
Since WordPress 2.5 and 2.6, `post_content` and `post_excerpt` have both had export-specific filters: `the_content_export`, and `the_excerpt_export`, respectively. `post_title`, however, has used `the_title_rss`, which behaves differently in two important ways:

- It strips HTML tags from the string.
- It HTML-encodes the title string.

These behaviours are not ideal for exports, since it changes the post title, resulting in data loss in export files, and incorrect post duplicate matching on import. This changes replaces the usage of `the_title_rss` with a new filter, `the_title_export`. The new filter is intended to be used in the same as `the_content_export` and `the_excerpt_export`.

Props jmdodd, audrasjb.
Fixes #52250.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-25 00:09:59 +00:00
TimothyBlynJacobs 1a65652cbc REST API: Support type coercion when validating the `enum` JSON Schema keyword.
Previously, the `enum` keyword was validated by perform a strict equality check. For `string` types this is generally ok, but it prevented using alternative types like `number` when rich type support isn't available.

Now the same level of type coercion/sanitization is applied when validating `enum` as all other validation checks. This means that a value of `"1"` will be accepted for an `enum` of `[ 0, 1 ]`. Additionally, `object` types now properly ignore key order when checking for equality.

Props yakimun.
Fixes #51911.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49711 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-24 16:52:00 +00:00
Sergey Biryukov db01832512 Docs: Correct default value for the `number` argument of `wp_tag_cloud()`.
Follow-up to [42658].

Props audrasjb, pawki07.
Fixes #52348.
Built from https://develop.svn.wordpress.org/trunk@50009


git-svn-id: http://core.svn.wordpress.org/trunk@49710 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-24 14:07:57 +00:00
Sergey Biryukov 2259adf433 Docs: Document globals in `dropdown_categories()` and `dropdown_link_categories()`.
Props umangvaghela123, pawki07.
Fixes #41504.
Built from https://develop.svn.wordpress.org/trunk@50008


git-svn-id: http://core.svn.wordpress.org/trunk@49709 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-24 13:59:58 +00:00
TimothyBlynJacobs 1ae368e91d REST API: Add more specific error codes for schema validation.
Previously, the majority of JSON Schema validation errors returned a generic `rest_invalid_param` error code. In preparation for #46191, where the underlying validation error code will be exposed, this commit adds specific error codes for each failure scenario.

Fixes #52317.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49708 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-24 03:58:57 +00:00
TimothyBlynJacobs 6a8a83ea09 App Passwords: Extract Basic Auth check into a reusable filterable function.
In [49752] a check was added to prevent creating new Application Passwords if Basic Auth credentials were detected to prevent conflicts. This check takes place in WP-Admin, though a conflict would only arise if Basic Auth was used on the website's front-end.

This commit extracts the Basic Auth check into a reusable function, `wp_is_site_protected_by_basic_auth()`, which can be adjusted using a filter of the same name. This way, a site that uses Basic Auth to protect WP-Admin can still use the Application Passwords feature.

In the future, instead of requiring the use of a filter, WordPress could make a loopback request and check for a `WWW-Authenticate` header to make this detection more robust out of the box.

Props SeBsZ, archon810, aaroncampbell, ocean90, SergeyBiryukov, TimothyBlynJacobs.
Fixes #52066.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49707 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-24 02:57:59 +00:00
TimothyBlynJacobs 20d961e622 REST API: Support embedding links in `rest_preload_api_request()`.
Props lpawlik, spacedmonkey.
Fixes #51722.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49706 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-23 23:26:58 +00:00
Sergey Biryukov c3e48b857b App Passwords: Use correct translation function for a heading on Authorize Application screen.
Props akramipro.
Fixes #52351.
Built from https://develop.svn.wordpress.org/trunk@50003


git-svn-id: http://core.svn.wordpress.org/trunk@49704 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-23 13:12:57 +00:00
Sergey Biryukov a45a292777 Docs: Fix typo in `WP_Links_List_Table` DocBlock.
Props audrasjb.
Fixes #52349.
Built from https://develop.svn.wordpress.org/trunk@50002


git-svn-id: http://core.svn.wordpress.org/trunk@49703 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-23 07:25:02 +00:00
Sergey Biryukov 9f12d7f575 External Libraries: First pass at fixing jQuery deprecations in WordPress core and bundled themes.
To be able to disable jQuery Migrate as step 3 of updating the jQuery version shipped with WordPress, all `JQMIGRATE` warnings in the browser console will have to be addressed.

This includes many minor adjustments to a wide array of core files.

Follow-up to:
* Step 1: Disabling jQuery Migrate 1.4.1 in WordPress 5.5: [48323], [48324]
* Step 2: Updating jQuery to 3.5.1 and adding jQuery Migrate 3.3.x in WordPress 5.6: [49101], [49338], [49615], [49649]

Props Clorith, azaozz.
See #51812.
Built from https://develop.svn.wordpress.org/trunk@50001


git-svn-id: http://core.svn.wordpress.org/trunk@49702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-22 12:32:03 +00:00
Sergey Biryukov 8b1be13c86 5.7-alpha-50000 🎉🙌❤️
Thank you for the past
Excited for the future
We are #WordPressStrong!
Built from https://develop.svn.wordpress.org/trunk@50000


git-svn-id: http://core.svn.wordpress.org/trunk@49701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-21 12:39:54 +00:00
Sergey Biryukov 4e8ff35289 Twenty Twenty-One: Consistently use Yoda condition for `display_title_and_tagline` setting.
Props mukesh27.
Fixes #52329.
Built from https://develop.svn.wordpress.org/trunk@49994


git-svn-id: http://core.svn.wordpress.org/trunk@49695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-21 12:16:59 +00:00
Sergey Biryukov 334c279d5b Twenty Twenty-One: Add missing HTML comments for `</header>` tag.
This brings some consistency to closing `</header>` tags in theme templates and ensures they all have an associated HTML comment.

Props freewebmentor, mukesh27.
Fixes #52328.
Built from https://develop.svn.wordpress.org/trunk@49993


git-svn-id: http://core.svn.wordpress.org/trunk@49694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-21 12:10:01 +00:00
Felix Arntz 3716c8c20f Robots: Introduce Robots API.
This changeset introduces a filter-based Robots API, providing central control over the `robots` meta tag.

* Introduces `wp_robots()` function which should be called anywhere a `robots` meta tag should be included.
* Introduces `wp_robots` filter which allows adding or modifying directives for the `robots` meta tag. The `wp_robots()` function is entirely filter-based, i.e. if no filter is added to `wp_robots`, no directives will be present, and therefore the entire `robots` meta tag will be omitted.
* Introduces the following `wp_robots` filter functions which replace similar existing functions that were manually rendering a `robots` meta tag:
    * `wp_robots_noindex()` replaces `noindex()`, which has been deprecated.
    * `wp_robots_no_robots()` replaces `wp_no_robots()`, which has been deprecated.
    * `wp_robots_sensitive_page()` replaces `wp_sensitive_page_meta()`, which has been deprecated. Its rendering of the `referrer` meta tag has been moved to another new function `wp_strict_cross_origin_referrer()`.

Migration to the new functions is straightforward. For example, a call to `add_action( 'wp_head', 'wp_no_robots' )` should be replaced with `add_filter( 'wp_robots', 'wp_robots_no_robots' )`.

Plugins and themes that render their own `robots` meta tags are encouraged to switch to rely on the `wp_robots` filter in order to use the central management layer now provided by WordPress core.

Props adamsilverstein, flixos90, timothyblynjacobs, westonruter.
See #51511.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49693 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-21 01:37:00 +00:00
desrosj 3eb9b3e714 Build/Test Tools: Update CSS files after `grunt precommit:css`.
This removes instances of the `-moz-user-select` property, which was required until Firefox 68.

Firefox is currently in version 84, so these can safely be removed.

Fixes #52332.
Built from https://develop.svn.wordpress.org/trunk@49991


git-svn-id: http://core.svn.wordpress.org/trunk@49692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-20 19:07:00 +00:00
desrosj 6a12c9522b Build/Test Tools: Update more NPM packages
This updates two NPM packages:
- `qunit` from `2.13.0` to `2.14.0`.
- `sinon` from `9.2.2` to `9.2.3`.

See #51801.
Built from https://develop.svn.wordpress.org/trunk@49990


git-svn-id: http://core.svn.wordpress.org/trunk@49691 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-20 14:42:15 +00:00
desrosj ebeaae9de0 Build/Test Tools: Update the `uglify-js` package.
This updates the `uglify-js` package from version `3.12.4` to `3.12.5`.

See #51801.
Built from https://develop.svn.wordpress.org/trunk@49989


git-svn-id: http://core.svn.wordpress.org/trunk@49690 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-20 13:35:18 +00:00
Sergey Biryukov a0db82e9c8 Twenty Twenty-One: Add missing styles for `<button>` element.
Props poena, slaFFik.
Fixes #52029.
Built from https://develop.svn.wordpress.org/trunk@49988


git-svn-id: http://core.svn.wordpress.org/trunk@49689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-20 07:05:58 +00:00
Sergey Biryukov b3bb99b3d7 Twenty Twenty-One: Clean up Button styles.
This change restructures the Button element styles for better a11y and expected color behaviors. Here what has changed:

- The `button-style()` mixin is now the ''single source or truth'' for how Button should look site-wide.
  - Button Block, File Block, and Search form Blocks all rely on this one mixin.
  - The same styles is also applied to the `<button>` element which appears in widgets, the 404 search form and comments form.
- Improves expected button styles for various conditions and contexts as follows: 
  - User color palette selections for Buttons are retained regardless of a parent block’s color settings or dark-mode.
  - Supports both Default/Filled styles and Outline styles.
  - More consistent `:hover` and `:active` styles.
  - `:focus` styles are now always visible and legible.
- Adds a `--local-color` color variable to scope color relationships to nested blocks.
- Reduces selectors in `style.css` output.
- 1:1 experience between editor and front end button styles.
- Properly supports Dark-mode.

Props allancole, poena, scruffian, megphillips91.
Fixes #51927.
Built from https://develop.svn.wordpress.org/trunk@49987


git-svn-id: http://core.svn.wordpress.org/trunk@49688 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-20 05:51:02 +00:00
Peter Wilson ce5a508734 Media: Ensure `get_post_status()` does not contain half a comment.
Removes a misplaced comment, follow up to [49985].

Props SergeyBiryukov.
Fixes #52326.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-20 05:00:01 +00:00
Peter Wilson 9c2c78b6c8 Media: Ensure `get_post_status()` returns correct result for attachments.
Prevent `get_post_status()` returning `false` for attachments if the parent post has been deleted. The returned attachment post status is now passed through the `get_post_status` filter.

Add tests for `get_post_status()`.

Props peterwilsoncc, timothyblynjacobs for review.
Fixes #52326.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-20 04:41:03 +00:00
Sergey Biryukov 777f752c2d Upgrade/Install: Display version number on the "Re-install now" button on WordPress Updates screen.
This makes the button label more clear and allows for removing unnecessary description.

Props afragen, audrasjb.
Fixes #51774.
Built from https://develop.svn.wordpress.org/trunk@49984


git-svn-id: http://core.svn.wordpress.org/trunk@49685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-19 16:48:07 +00:00
desrosj dfc20f02ae Build/Test Tools: Update the `webpack-dev-server` package.
This updates the `webpack-dev-server` package from version `3.11.1` to `3.11.2`.

See #51801.
Built from https://develop.svn.wordpress.org/trunk@49983


git-svn-id: http://core.svn.wordpress.org/trunk@49684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-19 16:37:32 +00:00
gziolo e8c035f25d Blocks: Add automatic RTL handlind for block styles registered from metadata
Related Gutenberg issue: https://github.com/WordPress/gutenberg/pull/28274

With this change it is going to be possible to use the same pattern that wp_style_add_data uses for RTL handling. If the block style file with "-rtl.css" is included in addition to the regular style referenced in "block.json" file then it is going to be automatically registered.

Props swisspidy, aristath.
See #52301.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-19 11:50:08 +00:00
gziolo 2dbcd8933e Blocks: Add i18n support to register_block_type_from_metadata
Related Gutenberg issue: https://github.com/WordPress/gutenberg/issues/23636.
Related WP-CLI PR: https://github.com/wp-cli/i18n-command/pull/210.
Related documentation proposal: https://github.com/WordPress/gutenberg/blob/master/docs/designers-developers/developers/block-api/block-metadata.md#internationalization-not-implemented

Adds programatic i18n support to `register_block_type_from_metadata` function for block settings registered from `block.json` file that provides `textdomain` field.


Props swissspidy, ocean90.
Fixes #52301.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-19 11:06:14 +00:00
ryelle 524d6bb167 Twenty Twenty-One: Remove duplicate CSS rules.
Introduces a new PostCSS plugin, `postcss-discard-duplicates`, which will automatically remove any duplicate CSS rules. All the CSS that is removed shows up again later in the file. This also fixes a bug from `postcss-css-variables`, where media queries are duplicated.

Fixes #52158.
Props poena.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49681 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-18 17:53:09 +00:00
Sergey Biryukov 489e47692a Media: Use consistent method for instantiating an attachment author object in Media Library.
Previously, attachments without an author could cause a PHP fatal error due to calling the `::exists()` method on a `false` value.

Props antpb, carloscastilloadhoc, hellofromTonya, garrett-eclipse.
Fixes #52030.
Built from https://develop.svn.wordpress.org/trunk@49979


git-svn-id: http://core.svn.wordpress.org/trunk@49680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-18 12:55:07 +00:00
Sergey Biryukov 1671941bff General: Set `svn:eol-style` for some more files in the root directory.
Follow-up to [43309], [48650], [48845].

See #51113.
Built from https://develop.svn.wordpress.org/trunk@49978


git-svn-id: http://core.svn.wordpress.org/trunk@49679 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-18 12:44:08 +00:00
Sergey Biryukov f5bd63d352 Docs: Link to the parent function for accepted arguments in some filters for HTML output.
See #51800.
Built from https://develop.svn.wordpress.org/trunk@49977


git-svn-id: http://core.svn.wordpress.org/trunk@49678 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-18 12:28:07 +00:00
Sergey Biryukov b5953b551e Posts, Post Types: Introduce a filter `paginate_links()` output.
Props sabernhardt, audrasjb, re.ardestani.
Fixes #44018.
Built from https://develop.svn.wordpress.org/trunk@49976


git-svn-id: http://core.svn.wordpress.org/trunk@49677 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-18 12:07:07 +00:00
Sergey Biryukov b88116d24f Coding Standards: Improve code layout in `wp-admin/includes/class-wp-media-list-table.php`.
This allows for better readability and easier understanding of where each section opens and closes.

Props laxman-prajapati, hansjovisyoast, audrasjb.
Fixes #51014.
Built from https://develop.svn.wordpress.org/trunk@49975


git-svn-id: http://core.svn.wordpress.org/trunk@49676 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-18 09:50:10 +00:00
Peter Wilson a817f47d30 Tests: Remove references to post status `public`.
Replace invalid post status `public` with the valid status `publish`.

See #51802.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49675 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-18 03:28:07 +00:00
joedolson fe3610466a Widgets: Implement TinyMCE on text widgets in Accessibility Mode
TinyMCE was not implemented on the accessibility mode for widgets, disabling text editing fields. Change ensures that TinyMCE is initialized when accessibility mode is set up. Prior implementation hid the text widget fields if they were empty, which they always were for new widgets.

Props MadtownLems, alexstine, hareesh-pillai, dariak
Built from https://develop.svn.wordpress.org/trunk@49973


git-svn-id: http://core.svn.wordpress.org/trunk@49674 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-17 18:17:07 +00:00
Dominik Schilling dc138704c6 Script Loader: Remove unused source file for `wp-a11y.js` which was replaced with the `@wordpress/a11y` package.
Props afercia, audrasjb.
See [46167], [46169], and [46179].
Fixes #50093.
Built from https://develop.svn.wordpress.org/trunk@49972


git-svn-id: http://core.svn.wordpress.org/trunk@49673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-17 17:52:06 +00:00
Sergey Biryukov 5ff0831d4e Privacy: Update unit test files missed in [49970].
See #51849.
Built from https://develop.svn.wordpress.org/trunk@49971


git-svn-id: http://core.svn.wordpress.org/trunk@49672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-17 17:50:07 +00:00
Sergey Biryukov 4104f92d7f Privacy: Use more consistent wording for strings related to personal data requests.
This replaces "user privacy" in various error messages with "personal data", for consistency with other existing strings.

Follow-up to [49090].

Props xkon, transl8or.
Fixes #51849.
Built from https://develop.svn.wordpress.org/trunk@49970


git-svn-id: http://core.svn.wordpress.org/trunk@49671 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-17 17:46:06 +00:00
Dominik Schilling cf3e30b301 Customize: Update button label reference in themes help text to reflect the label introduced in [41626].
Props ovidiul.
See #39896, #42305.
Fixes #52271.
Built from https://develop.svn.wordpress.org/trunk@49969


git-svn-id: http://core.svn.wordpress.org/trunk@49670 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-17 17:01:08 +00:00
Sergey Biryukov ed240e087e Docs: Correct description for `wp_slash()` and `wp_unslash()`.
The array received or returned by these functions is not always an array of strings, for example when slashing or unslashing an array of arrays.

Follow-up to [47400], [48441], [49926].

Props johnbillion.
See #51800.
Built from https://develop.svn.wordpress.org/trunk@49968


git-svn-id: http://core.svn.wordpress.org/trunk@49669 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-17 16:38:06 +00:00
Dominik Schilling 87b092dc30 I18N: Add support for German (Austria) locale in `remove_accents()`.
Props patopaiar, nonverbla.
Fixes #52110.
Built from https://develop.svn.wordpress.org/trunk@49967


git-svn-id: http://core.svn.wordpress.org/trunk@49668 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-17 15:46:08 +00:00
TimothyBlynJacobs cc1c1b0b5d REST API: Allow sending an empty array to delete multi meta keys.
Previously, only `null` was supported.

Fixes #50790.
Props chrisvanpatten.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49667 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-17 00:51:09 +00:00
Sergey Biryukov ba0906799c Coding Standards: Fix WPCS issue in [49963].
Props pawki07, mukesh27.
Fixes #52316. See #51800.
Built from https://develop.svn.wordpress.org/trunk@49965


git-svn-id: http://core.svn.wordpress.org/trunk@49666 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-16 17:20:12 +00:00
Sergey Biryukov dc17e504bf Menus: Fix minor UI issues on Edit Menus screen on smaller viewports.
This removes extra margin from the Select button and ensures the checkboxes in the Menu Settings section are fully visible.

Props sabernhardt, passoniate, mukesh27, afercia, audrasjb, Boniu91, ravipatel, jomisica.
Fixes #49245, #51706.
Built from https://develop.svn.wordpress.org/trunk@49964


git-svn-id: http://core.svn.wordpress.org/trunk@49665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-16 05:00:08 +00:00
Sergey Biryukov 5c663524c2 Docs: In various `@return` tags, list the expected type first, instead of `false`.
Follow-up to [46696], [47060], [49926], [49927], [49929].

See #51800.
Built from https://develop.svn.wordpress.org/trunk@49963


git-svn-id: http://core.svn.wordpress.org/trunk@49664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-15 20:08:07 +00:00
Sergey Biryukov 585303540a I18N: Add context for the `Public` string in site attributes list on Edit Site screen.
This allows for the string to be distinguished from a post status of the same name, which is useful for better translations in languages were "public" can be masculine or feminine depending on context.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49663 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-15 17:39:12 +00:00
ryelle 476d0a1450 Administration: Update hover and focus states in admin menu.
This adds a border along the side of admin menu links when hovering or focusing on them, as color should not be the only indicator of link state.

Props accessiblejoe florianziegler afercia rianrietveld michael-arestad ryan hedgefield audrasjb ibdz.
Fixes #28599.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-14 22:00:11 +00:00
Sergey Biryukov 2a5dfab642 Twenty Twenty-One: Remove leftover file from `build:rtl` task.
The `style-dark-mode.css` file is now in `assets/css/` and has its own `build:dark-rtl` task.

Props yoavf.
Fixes #52293.
Built from https://develop.svn.wordpress.org/trunk@49960


git-svn-id: http://core.svn.wordpress.org/trunk@49659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-14 12:14:07 +00:00
Peter Wilson 7914138e85 Build/Test Tools: Update script loader following [49933].
See #51801.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-14 02:24:12 +00:00
Sergey Biryukov c5d1214607 Accessibility: Administration: Remove `<strong>` tags from labels on plugin/theme editor screens.
If every single label is emphasized with a `<strong>` tag, none of them is really emphasized anymore.

This removes the tags in favor of CSS styling, for consistency with the other labels on the screen.

Props chemiker, audrasjb, mukesh27, paaljoachim, estelaris, ibdz, SergeyBiryukov.
Fixes #52232.
Built from https://develop.svn.wordpress.org/trunk@49958


git-svn-id: http://core.svn.wordpress.org/trunk@49657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-13 14:08:10 +00:00
Sergey Biryukov 001dad10c6 Docs: Clarify the instructions on starting the local environment for the first time.
This adds a mention of cloning the repository before running the npm commands in the terminal. 

Props justinahinon.
Fixes #52278. See #51414.
Built from https://develop.svn.wordpress.org/trunk@49957


git-svn-id: http://core.svn.wordpress.org/trunk@49656 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-12 11:34:11 +00:00
Sergey Biryukov 6f18efba66 Privacy: Clarify the "Contact information" heading in default privacy policy content.
The section is intended to tell how to contact the website owners, and is not about the visitor's contact information.

Props shital-patel, TylerTork, audrasjb.
Fixes #52272.
Built from https://develop.svn.wordpress.org/trunk@49956


git-svn-id: http://core.svn.wordpress.org/trunk@49655 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-11 19:53:14 +00:00
John Blackbourn 35e1b34f8e REST API: Corrections and improvements to docblocks for REST API filters.
See #51800

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


git-svn-id: http://core.svn.wordpress.org/trunk@49654 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-10 22:23:09 +00:00
Sergey Biryukov 9b44c28f78 Themes: Add missing `<p>` tags to error message in `WP_Theme_Install_List_Table::prepare_items()`.
Follow-up to [45909], [49953].

See #52254.
Built from https://develop.svn.wordpress.org/trunk@49954


git-svn-id: http://core.svn.wordpress.org/trunk@49653 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-10 19:37:06 +00:00
Sergey Biryukov 75d686563f Bootstrap/Load: Add missing `<p>` tags to error message in `wp-load.php`.
Follow-up to [45909].

Props mukesh27, TimothyBlynJacobs, audrasjb.
Fixes #52254.
Built from https://develop.svn.wordpress.org/trunk@49953


git-svn-id: http://core.svn.wordpress.org/trunk@49652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-10 19:28:08 +00:00
TimothyBlynJacobs b1f8ffa77d REST API: Fix fatal error on multisite when calling the single item plugin routes.
The `is_network_only_plugin` and `is_plugin_active` functions are not available in a front-end context and must be specifically loaded.

Props oakesjosh.
Fixes #52205.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49651 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-09 20:22:11 +00:00
Sergey Biryukov ef956a1309 Tests: Set up the plugin download in multisite plugin tests to come locally.
This brings consistency between single site and multisite in REST API plugin installation tests.

Previously, multisite tests were unnecessarily downloading the plugin from WordPress.org on each test run, causing external HTTP requests and leading to failures in case of a timeout.

Follow-up to [48242], [49491], [49913].

See #51669.
Built from https://develop.svn.wordpress.org/trunk@49951


git-svn-id: http://core.svn.wordpress.org/trunk@49650 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-09 05:58:07 +00:00
John Blackbourn b364ff86e5 Posts, Post Types: Introduce the `wp_list_table_show_post_checkbox` filter which allows the visibility of the bulk edit checkbox on the post list table to be controlled separately from the `edit_post` capability of the current user.
Props coreyw, alexstine

Fixes #51291

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


git-svn-id: http://core.svn.wordpress.org/trunk@49649 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-08 17:18:07 +00:00
Sergey Biryukov 47c146ac27 Accessibility: Customize: Add an empty `alt` attribute to the `<img>` tag used as a hidden placeholder in the Customizer preview when no logo is chosen.
Per accessibility best practices, it is recommended that all HTML `<img>` elements have an `alt` attribute. Any decorative images should have an empty `alt` attribute (`alt=""`).

Props laxman-prajapati, sabernhardt, audrasjb.
Fixes #51846.
Built from https://develop.svn.wordpress.org/trunk@49949


git-svn-id: http://core.svn.wordpress.org/trunk@49648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-08 16:55:07 +00:00
gziolo a756900974 Editor: Support filtering arguments in block type registration from metadata
Adds 2 new hooks in `register_block_type_from_metadata`:

- Named `block_type_metadata` to filter the content of metadata read from `block.json`
- Named `block_type_metadata_settings` to filter the settings object determined from the metadata that is passed to `register_block_type` call

Props swissspidy.
Fixes #52138.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49647 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-08 16:45:07 +00:00
John Blackbourn 2be70e8aa4 Taxonomy: Correct and clarify documentation for the return types of term query functions.
See #51800, #38266

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


git-svn-id: http://core.svn.wordpress.org/trunk@49646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-08 15:24:07 +00:00
John Blackbourn 6f3a940e64 Plugins: Replace usage of `$this` in action and filter parameter docblocks with more appropriate variable names.
See #51800, #52217

Fixes #52243

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


git-svn-id: http://core.svn.wordpress.org/trunk@49645 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-08 14:30:14 +00:00
John Blackbourn 4fb7dc8429 Login and Registration: Introduce the `lostpassword_user_data` filter which allows for the user data object during a password reset request to be filtered.
Props marcelo2605

Fixes #51924

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


git-svn-id: http://core.svn.wordpress.org/trunk@49644 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-07 17:26:09 +00:00
John Blackbourn bc5b34672c Quick/Bulk Edit: By the power vested in me, I hereby declare the top bulk actions and the bottom bulk actions joined forever in MatrimonyScript.
This joyous marriage means that users will no longer find a selected top bulk action on a list table unexpectedly being applied instead of their selected bottom bulk action. The top and bottom controls for changing user roles are equally wedded forever too.

Props clayray, subrataemfluence, garrett-eclipse, pbiron, hareesh-pillai

Fixes #46872

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


git-svn-id: http://core.svn.wordpress.org/trunk@49643 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-07 16:23:07 +00:00
Sergey Biryukov 7e4a39ba6e Accessibility: Help/About: Use more descriptive link text for the Privacy Policy link on the Privacy screen.
Props audrasjb, carike, mukesh27.
Fixes #52233.
Built from https://develop.svn.wordpress.org/trunk@49943


git-svn-id: http://core.svn.wordpress.org/trunk@49642 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-07 16:09:08 +00:00
John Blackbourn f0078d043e Docs: Miscellaneous docblock corrections and improvements.
See #51800.
Built from https://develop.svn.wordpress.org/trunk@49942


git-svn-id: http://core.svn.wordpress.org/trunk@49641 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-07 14:17:11 +00:00
Sergey Biryukov c38bdce55b Docs: Correct description for `wp_parse_list()`.
The function simply converts a comma- or space-separated list of scalar values to an array and does not perform any sanitization on its own.

Follow-up to [44546].

Props johnjamesjacoby.
See #51800.
Built from https://develop.svn.wordpress.org/trunk@49941


git-svn-id: http://core.svn.wordpress.org/trunk@49640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-06 17:25:07 +00:00
desrosj 05f174acf6 Build/Test Tools: Update UglifyJS to the latest version.
This updates the `uglify-js` package from version `3.6.0` to `3.12.4`.

See #51801.
Built from https://develop.svn.wordpress.org/trunk@49940


git-svn-id: http://core.svn.wordpress.org/trunk@49639 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-06 15:29:24 +00:00
desrosj 60a2f144ac Build/Test Tools: Update several NPM packages.
This updates the following packages to the latest versions. 

Updated packages:
- `copy-webpack-plugin` from `5.1.1` to `5.1.2`.
- `grunt` from `1.1.0` to `1.3.0`.
- `grunt-contrib-jshint` from `2.1.0` to `3.0.0`.
- `grunt-contrib-qunit` from `3.1.0` to `4.0.0`.
- `grunt-rtlcss` from `2.0.1` to `2.0.2`.
- `qunit` from `2.9.0` to `2.13.0`.
- `sinon` from `9.0.0` to `9.2.2`.
- `source-map-loader` from `0.2.4` to `1.1.3`.
- `uuid` from `8.2.0` to `8.3.2`.
- `webpack-dev-server` from `3.11.0` to `3.11.1`.

See #51801.
Built from https://develop.svn.wordpress.org/trunk@49939


git-svn-id: http://core.svn.wordpress.org/trunk@49638 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-06 14:53:40 +00:00
desrosj 4df3473b3b Build/Test Tools: Simplify Composer package caching.
This simplifies the caching of Composer dependencies in the coding standards and PHP compatibility workflows by using a published action. This combines 3 steps into 1 within these workflows.

Because the Composer implementation within the PHPUnit test workflow is a bit specialized (`composer install` is run within the Docker container), caching has been left as is in that workflow. However, the cache key has been changed to include the version of PHP being tested. This will prevent incorrect versions of dependencies being present when they are required on jobs other than PHP 8.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49637 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-05 19:23:02 +00:00
desrosj ed087258e3 Build/Test Tools: Update some NPM packages.
This updates the following packages to the latest versions. 

Updated packages:
- `check-node-version` from `4.0.1` to `4.0.3`.
- `node-sass` from `4.14.1` to `5.0.0`.
- `wait-on` from `3.3.0` to `5.2.1`.

See #51801.
Built from https://develop.svn.wordpress.org/trunk@49937


git-svn-id: http://core.svn.wordpress.org/trunk@49636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-05 19:13:35 +00:00
John Blackbourn b59c0f307b Docs: Corrections and improvements to types used in various docblocks.
See #51800, #52217

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


git-svn-id: http://core.svn.wordpress.org/trunk@49635 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-05 17:16:11 +00:00
Sergey Biryukov 7ced0efbf4 Docs: Use more consistent descriptions for `void|false` return values.
See #51800.
Built from https://develop.svn.wordpress.org/trunk@49935


git-svn-id: http://core.svn.wordpress.org/trunk@49634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-05 16:48:07 +00:00
Sergey Biryukov 43bc55f38d Docs: Fix typo in `wp_set_comment_status` filter DocBlock.
Follow-up to [49926].

See #51800.
Built from https://develop.svn.wordpress.org/trunk@49934


git-svn-id: http://core.svn.wordpress.org/trunk@49633 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-05 16:46:10 +00:00
desrosj 0147765a7c Build/Test Tools: Update several NPM packages.
This updates the following packages to the latest versions. 

Updated packages:
- `grunt-contrib-uglify` from `4.0.1` to `5.0.0`.
- `grunt-jsdoc` from `2.4.0` to `2.4.1`.
- `grunt-legacy-util` from `1.1.1` to `2.0.0`.
- `grunt-webpack` from `3.1.3` to `4.0.2`.

See #51801.
Built from https://develop.svn.wordpress.org/trunk@49933


git-svn-id: http://core.svn.wordpress.org/trunk@49632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-05 15:34:26 +00:00
Peter Wilson 972c42288a Tests: Increase use of shared fixtures in capability checks.
See #51802.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-04 23:34:12 +00:00
desrosj 79dc525f28 Build/Test Tools: Change the frequency of code coverage reporting.
Before the coverage reports were submitted to Codecov.io, HTML coverage reports were compressed into ZIP files and uploaded to the workflow run as an artifact. A weekly schedule was chosen to run this workflow because generating a coverage report is more time consuming, and the resulting reports are quite large (~150-200MB each).

This changes the schedule for the code coverage workflow from weekly to daily and eliminates the ZIP artifacts that were previously generated. This will ensure the code coverage data found at https://codecov.io/gh/WordPress/wordpress-develop is relatively accurate on any given day of the week without needlessly consuming artifact storage.

Props jorbin.
See #50401, #52141.
Built from https://develop.svn.wordpress.org/trunk@49931


git-svn-id: http://core.svn.wordpress.org/trunk@49630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-04 19:48:05 +00:00
Sergey Biryukov de0ff7d845 Twenty Twenty-One: Make sure filtering attachment image attributes only affects front end and not the admin area.
Props denisco.
Fixes #52212.
Built from https://develop.svn.wordpress.org/trunk@49930


git-svn-id: http://core.svn.wordpress.org/trunk@49629 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-04 17:45:06 +00:00
Sergey Biryukov 37662df05e Docs: In various `@return` tags, list the expected type first, instead of `false` or `WP_Error`.
Follow-up to [46696], [47060], [49926], [49927].

See #51800.
Built from https://develop.svn.wordpress.org/trunk@49929


git-svn-id: http://core.svn.wordpress.org/trunk@49628 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-04 17:18:04 +00:00
Sergey Biryukov f4d610310c Docs: Synchronize and correct documentation for `has_filter()` and `WP_Hook::has_filter()`.
`WP_Hook::has_filter()` returns true if `$function_to_check` is omitted and the hook being checked has one or more registered callbacks.

Follow-up to [49927].

See #51800.
Built from https://develop.svn.wordpress.org/trunk@49928


git-svn-id: http://core.svn.wordpress.org/trunk@49627 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-04 16:58:08 +00:00
John Blackbourn dfe1f9b322 Docs: Promote many `bool` types to `true` or `false` where only that value is used.
See #51800

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


git-svn-id: http://core.svn.wordpress.org/trunk@49626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-03 22:04:04 +00:00
John Blackbourn 53da9208dd Docs: Various docblock corrections particularly relating to boolean types.
See #51800

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


git-svn-id: http://core.svn.wordpress.org/trunk@49625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-03 21:57:09 +00:00
TimothyBlynJacobs bf51961e7e REST API: Expose all themes in the themes controller.
Previously, only the active theme was made available. This commit allows for all themes to be queried if the user has the `switch_themes` or `manage_network_themes` capabilities.

This commit also no longer exposes the `page`, `per_page`, `search` and `context` query parameters since they are not supported by this controller.

Props spacedmonkey, lpawlik, TimothyBlynJacobs.
Fixes #50152.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-03 21:47:05 +00:00
Sergey Biryukov d495eb4548 Canonical: Check if the post type exists when attempting a canonical redirect.
This avoids a PHP notice if the post type is no longer registered.

Follow-up to [14595], [35480].

Props bobbingwide, hareesh-pillai.
Fixes #40309.
Built from https://develop.svn.wordpress.org/trunk@49924


git-svn-id: http://core.svn.wordpress.org/trunk@49623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-03 17:56:06 +00:00
TimothyBlynJacobs 7d4a40f4ee REST API: Move the `WP_Query` args filter after the `tax_query` is setup.
This ensures that the entire list of `WP_Query` args are filterable in the posts controller.

Props Krstarica, TimothyBlynJacobs.
Fixes #42762.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-03 02:39:11 +00:00
TimothyBlynJacobs 4e3c568fb1 REST API: Only include the controller's own taxonomy in it's schema.
Previously, all taxonomies were incorrectly exposed as possible values.

Props johnbillion.
Fixes #51940.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49621 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-02 23:49:05 +00:00
TimothyBlynJacobs 5363474e5d App Passwords: Ensure the Add New button isn't hidden on mobile.
Also removes an unnecessary `!important` rule introduced in [49772] when fixing a similar issue.

Props vladytimy, mukesh27.
Fixes #51980.
See [49772].

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


git-svn-id: http://core.svn.wordpress.org/trunk@49620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-02 22:36:05 +00:00
TimothyBlynJacobs 6d3109dd2a App Passwords: Correct authorize app action names and signatures.
When App Passwords was introduced, the `wp_authorize_application_password_form` and `wp_application_passwords_approve_app_request_success` hook were mistakenly duplicated and incorrectly documented. This commit corrects the hook names and ensures the correct parameters are passed.

Props johnbillion, engahmeds3ed.
Fixes #52013.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49619 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-02 22:21:04 +00:00
TimothyBlynJacobs fa88bbfc79 App Passwords: Only attempt auth if the username and password are set.
Previously, only the username was checked which caused a PHP warning in some server setups, for instance Shibboleth SSO, where the server only populates the `PHP_AUTH_USER` field.

Props MadtownLems, johnbillion, richard.tape, engahmeds3ed.
Fixes #52003.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49618 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-02 21:35:04 +00:00
TimothyBlynJacobs c56eb69d7d REST API: Properly display JSON encoding errors.
Previously `null` was returned because the server was accessing the incorrect variable.

Props atimmer, technosailor.
Fixes #52106.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-02 20:36:06 +00:00
TimothyBlynJacobs 33cb202f07 Site Health: Use a front-end URL for loopback tests.
In [49154] the async Site Health tests were changed to use the REST API instead of admin-ajax. An unintended side effect of this change was that the loopback tests which tried to ping the site's `admin_url()` were no longer authenticated because admin-cookies aren't provided to the REST API.

This commit adjusts the loopback test to use the front-end `site_url` which checks that cron will function properly. A follow-up ticket will focus on tests that will cover the file editor checks.

Props Clorith.
Fixes #52097.
See #48105.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49616 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-02 20:09:08 +00:00
Sergey Biryukov e596f54ecc Build/Test Tools: Check if Travis/GitHub Actions environment variables are defined.
This adjusts the logic for determining whether to skip some tests when not in the primary branch, and allows for running these tests locally.

Follow-up to [47000], [47001], [49264], [49267], [49280].

See #50401.
Built from https://develop.svn.wordpress.org/trunk@49916


git-svn-id: http://core.svn.wordpress.org/trunk@49615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-02 12:21:06 +00:00
Sergey Biryukov 8c8af01d86 Happy New Year!
Update copyright year to 2021 in `license.txt` and bundled themes.
Built from https://develop.svn.wordpress.org/trunk@49915


git-svn-id: http://core.svn.wordpress.org/trunk@49614 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-01 00:19:07 +00:00
Sergey Biryukov 2818d14fa8 Twenty Twenty-One: Remove extra brackets from `:last-child` CSS pseudo-class.
Props munyagu, mukesh27, activecoder.
Fixes #52176.
Built from https://develop.svn.wordpress.org/trunk@49914


git-svn-id: http://core.svn.wordpress.org/trunk@49613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-31 07:38:06 +00:00
Sergey Biryukov 25441f33f8 Tests: Disable update checks while running REST API plugin installation tests.
This prevents external HTTP requests that are not required for the tests in question and may interfere with the results in case of a timeout.

Follow-up to [48242], [49491].

See #51669.
Built from https://develop.svn.wordpress.org/trunk@49913


git-svn-id: http://core.svn.wordpress.org/trunk@49612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-30 19:04:10 +00:00
Sergey Biryukov ee7c953731 Docs: Second pass at replacing Codex URLs with a corresponding HelpHub or DevHub article.
Follow-up to [45674-45677].

Props marcio-zebedeu, zodiac1978, netweb.
See #48987.
Built from https://develop.svn.wordpress.org/trunk@49912


git-svn-id: http://core.svn.wordpress.org/trunk@49611 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-29 20:14:11 +00:00
Andrew Ozz 0f0b303d5a Editor: Trigger the `tinymce-editor-init` custom jQuery event on DOM ready. Otherwise TinyMCE may initialize earlier and handlers attached on DOM ready may not get triggered. Fixes making the editor menu "sticky" and setting/resetting some screen options on the old Edit Post screen.
Fixes 52046, 51995.
Built from https://develop.svn.wordpress.org/trunk@49911


git-svn-id: http://core.svn.wordpress.org/trunk@49610 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-29 13:21:07 +00:00
Sergey Biryukov fa83e92c76 Export: Add `post_modified` and `post_modified_gmt` fields to the generated WXR export file.
This allows for more flexibility when determining which version of a post is the latest one, and makes it possible to implement import logic involving updating and adding revisions to existing posts or pages.

Props jmdodd.
Fixes #52180.
Built from https://develop.svn.wordpress.org/trunk@49910


git-svn-id: http://core.svn.wordpress.org/trunk@49609 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-28 15:26:08 +00:00
Gary Pendergast 4dc59b954a Site Health: Check that WordPress is installed before scheduling the HTTPS cron.
Trying to schedule cron jobs before WordPress is installed results in DB errors, which is suboptimal.

See #47577.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49608 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-28 01:45:06 +00:00
Sergey Biryukov 1fd05dee6e Site Health: Add `WP_MEMORY_LIMIT` constant to debug info.
This complements the `WP_MAX_MEMORY_LIMIT` constant previously displayed there.

Props sanketchodavadiya, nre, talldanwp, noisysocks.
Fixes #51680.
Built from https://develop.svn.wordpress.org/trunk@49908


git-svn-id: http://core.svn.wordpress.org/trunk@49607 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-27 19:27:06 +00:00
Sergey Biryukov 3f05756219 Accessibility: Upgrade/Install: Add more contrast to input borders during installation.
This brings the accessibility improvements previously made for other areas of the admin in WordPress 5.3 to the installation screens too.

Follow-up to [46241-46244], [46247], [46248], [46293], [46425].

Props Maigret, audrasjb.
Fixes #51854.
Built from https://develop.svn.wordpress.org/trunk@49907


git-svn-id: http://core.svn.wordpress.org/trunk@49606 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-26 19:54:07 +00:00
Sergey Biryukov c3b89441f7 Docs: Correct the type of the `$user` parameter in `WP_REST_Users_Controller::prepare_links()`.
Props iviweb, mukesh27.
Fixes #52175.
Built from https://develop.svn.wordpress.org/trunk@49906


git-svn-id: http://core.svn.wordpress.org/trunk@49605 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-25 14:54:07 +00:00
Sergey Biryukov 5a7fa8b7f3 Posts, Post Types: Correct the check for term IDs to be queued for lazy-loading term meta.
This ensures that the `$term_ids` array in `wp_queue_posts_for_term_meta_lazyload()` (an indexed array not keyed by ID) does not contain duplicate values.

Props denishua, akabarikalpesh.
Fixes #52144.
Built from https://develop.svn.wordpress.org/trunk@49905


git-svn-id: http://core.svn.wordpress.org/trunk@49604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-24 11:21:04 +00:00
Felix Arntz c81db1f6e6 Security, Site Health: Detect HTTPS support and encourage switching.
This changeset modifies the Site Health panel for HTTPS to provide more accurate recommendations based on whether the environment is already set up for HTTPS.

* Introduces `wp_is_using_https()` to check whether the site is configured to use HTTPS (via its Site Address and WordPress Address).
* Introduces `wp_is_https_supported()` to check whether the environment supports HTTPS. This relies on a cron job which periodically checks support using a loopback request.

Props Clorith, flixos90, miinasikk, westonruter.
Fixes #47577.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49603 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-23 19:13:04 +00:00
Aaron Jorbin 9f4be0f698 Build/Test: Send Code Coverage reports to Codecov.
Help visualize and explore code coverage reports to avoid blunders.

Props desrosj, swissspidy.
Fixes #52141.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-23 18:19:05 +00:00
Sergey Biryukov 4a91698129 Tests: Correct `@ticket` references in `tests/query/invalidQueries.php`.
This ensures that running `phpunit --group 48556` works as expected.

Follow-up to [49900].

See #48556.
Built from https://develop.svn.wordpress.org/trunk@49902


git-svn-id: http://core.svn.wordpress.org/trunk@49601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-23 15:07:03 +00:00
Sergey Biryukov c18ec08dbb Twenty Nineteen: Correct `@since` version for `twentynineteen_excerpt_more()`.
Follow-up to [49831].

See #46177.
Built from https://develop.svn.wordpress.org/trunk@49901


git-svn-id: http://core.svn.wordpress.org/trunk@49600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-23 15:05:08 +00:00
Peter Wilson c50ff2ac10 Query: Add bad path tests with invalid `WP_Query` parameters.
See #48556.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49599 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-23 03:05:06 +00:00
Peter Wilson aaf7710529 Query: Revert post-type specific capability changes.
The modified checks of the `read_private_posts` capability could result in unexpected SQL queries when calling `WP_Query` with invalid parameters.

Reverts [49830], [49832] and [49833].
See #48556.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49598 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-23 03:02:06 +00:00
desrosj 7c8d9b2e6a Build/Test Tools: Remove the TravisCI configuration file.
In [49162], GitHub Action workflow configuration files were introduced to run all of Core’s automated testing with the intent to fully transition after some time was allowed for testing.

After two full months of testing, the time to finish this transition has come.

We thank TravisCI for testing the codebase through nearly 20 major and many more minor releases.

Fixes #52161. See #50401.
Built from https://develop.svn.wordpress.org/trunk@49876


git-svn-id: http://core.svn.wordpress.org/trunk@49595 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-22 21:01:10 +00:00
desrosj 51ca44d9c7 Bundled Themes: Bump the versions of Twenty Twenty-One and Twenty Nineteen.
New versions:

- Twenty Twenty-One: 1.1.
- Twenty Nineteen: 1.9.

Props poena.
Fixes #52160.
Built from https://develop.svn.wordpress.org/trunk@49873


git-svn-id: http://core.svn.wordpress.org/trunk@49592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-22 18:19:05 +00:00
desrosj 0111002414 Twenty Nineteen: Add the `block-patterns` tag to the appropriate SASS file.
This prevents the tag from being removed from `styles.css` when rebuilding the CSS.

Props danfarrow
Fixes #52159.
Built from https://develop.svn.wordpress.org/trunk@49872


git-svn-id: http://core.svn.wordpress.org/trunk@49591 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-22 18:15:09 +00:00
ryelle f8e65a20b6 Twenty Twenty-One: Set a maximum width on inputs.
Text inputs with a size attribute can end up longer than the screen width on small screens. A max-width of 100% keeps the inputs from breaking out of the container.

Props basscan, kjellr, poena, sabernhardt
Fixes #52083.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49589 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-22 16:53:06 +00:00
desrosj de18e6c5a2 Twenty Twenty-One: Improve strings found in post navigations for easier translating.
This change adjusts strings found within post navigations to ensure translators are provided the full context needed to properly translate.

Props poena, SergeyBiryukov, aristath.
Fixes #52047.
Built from https://develop.svn.wordpress.org/trunk@49866


git-svn-id: http://core.svn.wordpress.org/trunk@49585 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-22 16:15:06 +00:00
desrosj b0fe9f059c Twenty Twenty-One: Only load IE specific polyfills when actually using Internet Exploreer.
The `twenty-twenty-one-ie11-polyfills` script now has a `null` source, and the new `twenty-twenty-one-ie11-polyfills-asset` (which points to the actual `polyfills.js` source) will be loaded only if IE is detected by through the use of `wp_get_script_polyfill()`.

Because the original script name remains the same, this change is backwards compatible with any code registering `twenty-twenty-one-id11-polyfills` as a script dependency.

Props poena, ismail.elkorchi, peterwilsoncc
Fixes #52098.
Built from https://develop.svn.wordpress.org/trunk@49865


git-svn-id: http://core.svn.wordpress.org/trunk@49584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-22 15:44:08 +00:00
desrosj c58be3c57e Twenty Twenty-One: Improve striped table styling in Dark Mode.
This change improves the display of table blocks with the “Stripes” style selected.

Previously, the text was not visible in striped rows when using Dark Mode.

Props ryelle, poena, melchoyce, celendesign, audrasjb.
Fixes #52129.
Built from https://develop.svn.wordpress.org/trunk@49864


git-svn-id: http://core.svn.wordpress.org/trunk@49583 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-22 15:02:05 +00:00
Sergey Biryukov aedf6c6443 Tests: Use shared post fixture in comment template tests.
This reinstates [49848], previously reverted in [49849], with the addition of `static` keyword for the `wpSetUpBeforeClass()` method, allowing the tests to pass on PHP 8.

Props peterwilsoncc.
See #51802.
Built from https://develop.svn.wordpress.org/trunk@49863


git-svn-id: http://core.svn.wordpress.org/trunk@49582 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-22 07:44:06 +00:00
John Blackbourn ec80a9fd63 XML-RPC: Emit an appropriate HTTP status code when an error is returned in response to an XML-RPC request.
This most notably affects the response when XML-RPC is disabled or when the supplied username and password is incorrect.

Props ericmann

Fixes #48213

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


git-svn-id: http://core.svn.wordpress.org/trunk@49581 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-21 20:23:02 +00:00
desrosj b8e5751dd1 Twenty Twenty-One: Do not specify `loading=“eager”` for single post thumbnails.
While `loading=“eager”` is a supported alternative to omitting the attribute entirely, browsers follow the value of this attribute explicitly when specified.

Specifying `eager` would prevent the user from receiving any additional potential benefits implemented at the browser level, such as further mechanisms to automatically decide which elements to lazy-load.

Props flixos90, ryelle, poena.
Fixes #52139.
Built from https://develop.svn.wordpress.org/trunk@49860


git-svn-id: http://core.svn.wordpress.org/trunk@49579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-21 18:39:03 +00:00
Sergey Biryukov 1d3fd41977 Docs: Move `locale` filter documentation to the canonical place.
See #51800.
Built from https://develop.svn.wordpress.org/trunk@49859


git-svn-id: http://core.svn.wordpress.org/trunk@49578 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-21 18:27:04 +00:00
Sergey Biryukov 5550b5fd6a Docs: Move `sanitize_file_name` filter documentation to the canonical place.
See #51800.
Built from https://develop.svn.wordpress.org/trunk@49858


git-svn-id: http://core.svn.wordpress.org/trunk@49577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-21 18:25:05 +00:00
John Blackbourn f508fe5112 Build/Test Tools: Don't mark the `Tests_Cache::test_flush()` test as risky when running the test suite with an object cache in place.
See #51802

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


git-svn-id: http://core.svn.wordpress.org/trunk@49576 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-21 17:51:07 +00:00
John Blackbourn cc2dd60fe1 XML-RPC: Fix a type error when requesting the `menu` field of a taxonomy.
Fixes #51493

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


git-svn-id: http://core.svn.wordpress.org/trunk@49575 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-21 17:11:05 +00:00
desrosj 55209a7309 Twenty Twenty-One: Allow local anchor links to be used in primary navigation.
This adds some JavaScript to detect when an anchor link is clicked within the primary navigation on mobile devices and closes the menu before scrolling to the location on the page.

Props poena, macmanx, t-p.
Fixes #52006.
Built from https://develop.svn.wordpress.org/trunk@49854


git-svn-id: http://core.svn.wordpress.org/trunk@49573 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-21 15:05:08 +00:00
gziolo 671d5da0e4 Blocks: Align with Gutenberg the name of generated asset handle for core blocks
Related Gutenberg PR: https://github.com/WordPress/gutenberg/pull/25220.

It aligns with the latest changes added by aristath to the Gutenberg project. As part of styles splitting for core blocks, there was a special pattern introduced for how style handles are named. Ideally, we would apply it to all blocks but there might be some backward compatibility considerations so I left the handling for non-core blocks unchanged.

Props aristath.
See #50328.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49569 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-21 11:39:08 +00:00
Peter Wilson 65351d3908 Tests: Revert use of shared post fixture in comment template tests.
Removes code throwing a fatal in PHP 8.

Reverts [49848] from trunk.
See #51802.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49568 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-21 03:35:04 +00:00
Peter Wilson c56ec035ce Tests: Use shared post fixture in comment template tests.
See #51802.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-21 03:17:01 +00:00
Peter Wilson 7a3d769b0f Query: Correct some coding standards after [49843].
See #44183

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


git-svn-id: http://core.svn.wordpress.org/trunk@49566 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-21 02:56:05 +00:00
John Blackbourn 8bc6a4ae6d Query: Correct some coding standards after [49843].
See #44183
Built from https://develop.svn.wordpress.org/trunk@49846


git-svn-id: http://core.svn.wordpress.org/trunk@49565 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-21 00:33:08 +00:00
John Blackbourn e7cc15b321 Upload: Introduce the `{$action}_overrides` filter that allows the overrides parameter for file uploads and file sideloads to be filtered.
The dynamic portion of the hook name, `$action`, refers to the post action.

Props iandunn, jakub.tyrcha, nacin, wonderboymusic, Mte90, johnbillion

Fixes #16849

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


git-svn-id: http://core.svn.wordpress.org/trunk@49564 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-20 16:15:03 +00:00
John Blackbourn f0d44a3402 Mail: Introduce a `pre_wp_mail` filter to allow short-circuiting the `wp_mail()` function without having to override the pluggable function.
Props DvanKooten, swissspidy, SergeyBiryukov, jtsternberg, ericlewis, Mte90, birgire, ayeshrajans

Fixes #35069

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


git-svn-id: http://core.svn.wordpress.org/trunk@49563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-20 15:09:06 +00:00
John Blackbourn 5007f1ce13 Query: Ensure the author archive title always shows the name of the queried author, regardless of whether there are results.
This brings the behaviour inline with the `<title>` element of the page which always shows the author name.

Props Tkama, subrataemfluence

Fixes #44183

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


git-svn-id: http://core.svn.wordpress.org/trunk@49562 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-20 14:37:04 +00:00
Sergey Biryukov 0fe844c9c9 Docs: Use a canonical form of "knowledgeable" in `readme.html`.
Props shahinsid07, audrasjb.
Fixes #52125.
Built from https://develop.svn.wordpress.org/trunk@49842


git-svn-id: http://core.svn.wordpress.org/trunk@49561 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-20 12:58:02 +00:00
Sergey Biryukov 0e700c40ea Docs: Fix typo in `getCursorMarkerSpan()` DocBlock in `js/_enqueues/wp/editor/base.js`.
Props voboghure, mukesh27, audrasjb.
Fixes #52128.
Built from https://develop.svn.wordpress.org/trunk@49841


git-svn-id: http://core.svn.wordpress.org/trunk@49560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-20 12:32:11 +00:00
Sergey Biryukov e4dfced545 Twenty Ten: Correct `$post_title` variable name in `loop-attachment.php`.
Follow-up to [45609] / #47632.

Props sabernhardt.
Fixes #52121.
Built from https://develop.svn.wordpress.org/trunk@49840


git-svn-id: http://core.svn.wordpress.org/trunk@49559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-19 20:45:05 +00:00
Sergey Biryukov 08e11dc1e6 Twenty Twenty-One: Clarify a sentence in `readme.txt`.
Props gkibria69.
Fixes #52120.
Built from https://develop.svn.wordpress.org/trunk@49838


git-svn-id: http://core.svn.wordpress.org/trunk@49557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-19 20:36:06 +00:00
Sergey Biryukov 41c9686313 Docs: Update the reference to Appearance → Theme Editor admin menu item in the inline documentation.
Follow-up to [42685].

See #51800.
Built from https://develop.svn.wordpress.org/trunk@49837


git-svn-id: http://core.svn.wordpress.org/trunk@49556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-18 15:46:04 +00:00
desrosj 24d77a5793 Build/Test Tools: Support the use of MariaDB in the local Docker environment.
In addition to MySQL, WordPress also supports MariaDB for databases. This makes changes to the local Docker environment to allow MariaDB to be used instead, if desired.

The `LOCAL_DB_TYPE` environment variable will now be used to determine which type of database container to use. This will default to `mysql`, but will also accept `mariadb`.

The `LOCAL_MYSQL` environment variable (which previously held the version of MySQL to use) has been replaced with the new, more generic `LOCAL_DB_VERSION` environment variable.

This change will make it possible to perform automated testing on a wider array of supported database types and versions.

Props davidbaumwald.
Fixes #51744. See #30462.
Built from https://develop.svn.wordpress.org/trunk@49836


git-svn-id: http://core.svn.wordpress.org/trunk@49555 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-18 15:29:03 +00:00
desrosj fcb36e86bb Build/Test Tools: Run the Ajax test group for multisite.
This will help catch issues with Ajax related functionality on multisite.

A few tests have also been marked as `skipWithMultisite()` as they require network admin level capabilities when performing the same operations on a multisite install.

Props garrett-eclipse, netweb.
Fixes #46567.
Built from https://develop.svn.wordpress.org/trunk@49835


git-svn-id: http://core.svn.wordpress.org/trunk@49554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-18 14:40:10 +00:00
desrosj 670500c739 Build/Test Tools: Generate a code coverage report using GitHub Actions.
This introduces a new GitHub Action workflow to generate a code coverage report when running the PHPUnit test suite as both a single and multisite install.

The workflow will run once per week on Sunday at 00:00 UTC.

For now, the reports are not submitted anywhere, but they will be uploaded to the workflow run as ZIP file artifacts where they will persist for 90 days.

Making code coverage reports more readily available will hopefully better highlight areas of Core with poor coverage, and encourage more contributors to help increase test coverage of those areas.

Props ocean90, johnbillion.
Fixes #52034.
Built from https://develop.svn.wordpress.org/trunk@49834


git-svn-id: http://core.svn.wordpress.org/trunk@49553 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-18 00:30:06 +00:00
Peter Wilson 343b375097 Coding Standards: Minor fixes following [49830].
Fixes the fixes missed in [49832]. They are fixed now.

See #13509, #48968, #48556.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49552 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-18 00:28:03 +00:00
Peter Wilson 08acf6606a Coding Standards: Minor fixes following [49830].
See #13509, #48968, #48556.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-18 00:19:05 +00:00
Sergey Biryukov fa7e570e2a Twenty Nineteen: Add "Continue reading" link for post excerpts.
This ensures that archive pages have a meaningful link text after the excerpts.

Props metalandcoffee, alex27, sabernhardt, mdrockwell, laurelfulford.
Fixes #46177.
Built from https://develop.svn.wordpress.org/trunk@49831


git-svn-id: http://core.svn.wordpress.org/trunk@49550 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-17 18:21:05 +00:00
Boone Gorges f124a2e529 Query: Respect post-type specific capabilities when querying for multiple post types.
After this change, the relevant `read_private_posts` capability is checked for
each queried post type. This ensures that private posts appear in search and
archive queries for users who have the ability to view those posts.

Props leogermani.

Fixes #13509, #48968, #48556.
Built from https://develop.svn.wordpress.org/trunk@49830


git-svn-id: http://core.svn.wordpress.org/trunk@49549 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-17 16:17:07 +00:00
desrosj 6daeadb85e Twenty Twenty-One: Correct `@since` inline documentation tags.
Previously, `1.0.0` was used for the version. This is inconsistent with the versioning used in the other default themes, which use use X.X and not X.X.X.

This change corrects all `1.0.0` occurrences to `1.0`, and adds the additional context of `Twenty Twenty-One` to avoid confusion with `WordPress 1.0`.

Props SergeyBiryukov, poena.
Fixes #51958.
Built from https://develop.svn.wordpress.org/trunk@49826


git-svn-id: http://core.svn.wordpress.org/trunk@49545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-17 14:57:07 +00:00
desrosj 66d46430a7 Twenty Twenty-One: Make text within code blocks readable in Dark Mode.
This change ensures that the primary text color specific to Dark Mode is used instead of the one specified for normal mode. The latter is not legible in Dark Mode.

Props slaFFik, poena, mukesh27, justinahinon.
Fixes #51985.
Built from https://develop.svn.wordpress.org/trunk@49825


git-svn-id: http://core.svn.wordpress.org/trunk@49544 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-17 14:22:05 +00:00
desrosj b7a899e8aa Twenty Twenty-One: Prevent `<iframe>` embeds from being too narrow.
This fixes an issue where `<iframe>` embeds were being pushed to the side of the screen and compressed to the point of being unusable.

Props helen, mukesh27, poena, thorlentz.
Fixes #52004.
Built from https://develop.svn.wordpress.org/trunk@49823


git-svn-id: http://core.svn.wordpress.org/trunk@49542 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-17 14:05:05 +00:00
desrosj 3dce40e526 Build/Test Tools: Save changes resulting from `npm install`.
See #51801.
Built from https://develop.svn.wordpress.org/trunk@49822


git-svn-id: http://core.svn.wordpress.org/trunk@49541 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-17 13:59:08 +00:00
Felix Arntz bb234abee7 Media: Enable lazy-loading of iframes by adding the `loading="lazy"` attribute to iframe tags on the front-end.
* Expands the capabilities of `wp_filter_content_tags()` to add the attribute to iframe tags if enabled.
* Modifies the default behavior of `wp_lazy_loading_enabled()` so that it returns `true` for `iframe` tags.
* Introduces a `wp_iframe_tag_add_loading_attr()` function.
* Introduces a `wp_iframe_tag_add_loading_attr` filter.

Like for images, the attribute is only added to iframes which have both `width` and `height` specified (see related #50367).

Props azaozz, flixos90, westonruter.
Fixes #50756.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-16 21:19:07 +00:00
Andrew Ozz 71ae342050 Editor: Fix improper triggering of the "Are you sure" prompt when navigating away from the old, "classic" Edit Post screen and there are no changes. Was triggered when there is an instance of TinyMCE in the Excerpt postbox.
Props rodrigosprimo, jonathanstegall, kevin940726, azaozz.
Fixes #52038.
Built from https://develop.svn.wordpress.org/trunk@49807


git-svn-id: http://core.svn.wordpress.org/trunk@49530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-16 15:25:09 +00:00
iandunn 2ebc78cbf4 Feed: Replace `join()` with `implode()` for safety.
Canonical functions should be used instead of aliases, because aliases can be deprecated or removed withough much notice. See r49193.

Props SergeyBiryukov.
See #51056.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-16 14:05:07 +00:00
Andrew Ozz 734f9bd9e2 Media: Fix the template for the "Align" and "Link To" fields in the media modal when inserting an image from URL.
Props noisysocks, mukesh27.
Fixes #52065.
Built from https://develop.svn.wordpress.org/trunk@49804


git-svn-id: http://core.svn.wordpress.org/trunk@49527 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-16 12:45:11 +00:00
iandunn d544fc7cb4 Feed: Merge multiple header values to avoid fatal error.
When SimplePie parses HTTP headers, it combines multiple values for the same header into a comma-separated string. `WP_SimplePie_File` overrides the parsing, but was leaving them as an array instead.

That lead to a fatal error in PHP 8, because other parts of the codebase ended up passing an array to a function that expected a string.

Props david.binda, litemotiv, inc2734, NicolasKulka, hellofromTonya, mbabker, skithund, SergeyBiryukov, desrosj, timothyblynjacobs.
Fixes #51056. See #51956.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49526 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-16 00:51:05 +00:00
John Blackbourn ec900ebb43 Docs: Correct the documentation for the `map_meta_cap()` function and its filter.
See #51800

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


git-svn-id: http://core.svn.wordpress.org/trunk@49525 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-15 22:18:07 +00:00
Sergey Biryukov b8f6d41a2c Twenty Twenty-One: Fix typos in some inline comments.
Props manzurahammed, mukesh27.
Fixes #52071.
Built from https://develop.svn.wordpress.org/trunk@49801


git-svn-id: http://core.svn.wordpress.org/trunk@49524 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-15 13:28:06 +00:00
ryelle da72be5227 Twenty Twenty-One: Bring back PostCSS config.
Twenty Twenty-One uses PostCSS to convert the custom properties for Internet Explorer. Without a config file, the postcss command does nothing, causing issues in IE. This brings back the config from GitHub, which replaces all custom properties with the default values.

Props t-p, poena.
Fixes #52040.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49523 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-14 16:49:03 +00:00
Sergey Biryukov 71bbd2b166 Twenty Twenty-One: Correct the DocBlock for `map-deep-set()` Sass function.
Props mukesh27.
Fixes #52064.
Built from https://develop.svn.wordpress.org/trunk@49799


git-svn-id: http://core.svn.wordpress.org/trunk@49522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-14 15:22:09 +00:00
Sergey Biryukov 9494c5fbee Twenty Twenty-One: Use a more specific link for Dark Mode instructions.
Make both instances of the link translatable, for consistency.

Props engahmeds3ed, justinahinon.
Fixes #52010.
Built from https://develop.svn.wordpress.org/trunk@49798


git-svn-id: http://core.svn.wordpress.org/trunk@49521 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-13 18:40:06 +00:00
desrosj 3ed22735d3 Build/Test Tools: Allow code coverage reports to be generated when running tests as a multisite.
This adds the information needed to generate a code coverage report to the multisite ruleset.

Fixes #52034.
Built from https://develop.svn.wordpress.org/trunk@49797


git-svn-id: http://core.svn.wordpress.org/trunk@49520 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-12 20:09:08 +00:00
desrosj 4d4ec9484c Build/Test Tools: Remove PHPUnit 3.6.x specific settings from the multisite configuration.
In PHPUnit 3.6.x, `exclude` and `file` paths were required to be relative to the checkout root. This changed in PHPUnit 4 when the path requirements were changed require them to be relative to the configuration file.

Since PHPUnit 3.6.x is only used to test on PHP 5.2 in older branches and is no longer supported, these can be safely removed from the configuration file.

See #51802.
Built from https://develop.svn.wordpress.org/trunk@49796


git-svn-id: http://core.svn.wordpress.org/trunk@49519 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-12 18:08:02 +00:00
Sergey Biryukov 994167b76f Twenty Twenty-One: Fix typos in some inline comments.
Props tanvirul, mukesh27.
Fixes #52042.
Built from https://develop.svn.wordpress.org/trunk@49795


git-svn-id: http://core.svn.wordpress.org/trunk@49518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-12 15:03:06 +00:00
Sergey Biryukov 4ca3db8c90 Twenty Twenty-One: Correct version in `file-header.scss`.
Fixes #52044.
Built from https://develop.svn.wordpress.org/trunk@49794


git-svn-id: http://core.svn.wordpress.org/trunk@49517 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-12 14:57:07 +00:00
ryelle bba3a9d529 Twenty Nineteen: Add images for use in block patterns.
The block patterns were added in #51099, but the images were not included in the commit. This adds the images to the expected folder.

Props transl8or, mukesh27.
Fixes #51996.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-11 16:55:03 +00:00
Sergey Biryukov 43bbbf1176 Docs: Document the usage of `$wpdb` global in `WP_Query::get_posts()` and `::set_found_posts()`.
Props jontyravi.
Fixes #52027.
Built from https://develop.svn.wordpress.org/trunk@49792


git-svn-id: http://core.svn.wordpress.org/trunk@49515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-11 16:53:10 +00:00
desrosj e4066a9af8 Build/Test Tools: Update several NPM packages.
These were updated using `npm audit fix`.

See #51801.
Built from https://develop.svn.wordpress.org/trunk@49791


git-svn-id: http://core.svn.wordpress.org/trunk@49514 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-11 14:05:07 +00:00
John Blackbourn bf83c368fd Docs: Various docblock improvements.
See #51800

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


git-svn-id: http://core.svn.wordpress.org/trunk@49513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-10 23:59:03 +00:00
John Blackbourn 42fcfa5b3d Docs: Various docblock corrections.
See #51800

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


git-svn-id: http://core.svn.wordpress.org/trunk@49512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-10 23:53:07 +00:00
John Blackbourn 7e9060a0e4 Upgrade/Install: Remove a duplicate description for the `upgrader_overwrote_package` action.
See #51800, #9757

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


git-svn-id: http://core.svn.wordpress.org/trunk@49511 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-10 23:38:04 +00:00
John Blackbourn 1ead0719b7 Docs: Fix some docblock issues introduced in 5.6.
See #51800

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


git-svn-id: http://core.svn.wordpress.org/trunk@49510 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-10 23:27:06 +00:00
desrosj 2808e92c43 Build/Test Tools: Reestablish the codebase as a Git repo before reporting test results.
The test reporter uses the hidden `.svn` or `.git` directories to determine which changeset to send to WordPress.org along with the test report.

Because the GitHub Action workflow builds and prepares WordPress in a preceding job to share with each test job, the `.git` directory is missing (it is purposefully not included to limit artifact size).

This re-establishes the directory as a checkout of the `wordpress-develop` repository so that test results can be reported correctly.

See #50401.
Built from https://develop.svn.wordpress.org/trunk@49786


git-svn-id: http://core.svn.wordpress.org/trunk@49509 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-10 19:19:06 +00:00
Sergey Biryukov 4a69dfa63a Docs: Fix typo in some DocBlocks.
See #51800.
Built from https://develop.svn.wordpress.org/trunk@49785


git-svn-id: http://core.svn.wordpress.org/trunk@49508 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-10 18:12:03 +00:00
desrosj c0806cf29c Build/Test Tools: Inline documentation updates for the PHPUnit workflow.
See #50401.
Built from https://develop.svn.wordpress.org/trunk@49784


git-svn-id: http://core.svn.wordpress.org/trunk@49507 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-10 15:30:04 +00:00
desrosj 66b75f9ad7 Build/Test Tools: Enable reporting of results to WordPress.org.
This configures reporting of the test results to the WordPress.org Host Test Results in the new GitHub Actions workflow for PHPUnit testing.

See https://make.wordpress.org/hosting/test-results/

Props mikeschroder, dd32.
See #50401.
Built from https://develop.svn.wordpress.org/trunk@49783


git-svn-id: http://core.svn.wordpress.org/trunk@49506 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-10 14:20:08 +00:00
desrosj fb4450a86f Build/Test Tools: Use NodeJS 14 in GitHub Action workflows.
14.x is the current LTS release, and is what `trunk` currently runs.

See #50401.
Built from https://develop.svn.wordpress.org/trunk@49782


git-svn-id: http://core.svn.wordpress.org/trunk@49505 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-09 20:57:04 +00:00
desrosj 030b4bd1da Build/Test Tools: Disable GitHub Action workflow runs triggered on `push` for forks and mirrors.
In the current state, the workflows run regardless of the repository context. This results many needless workflow runs that waste resources.

Workflow runs for private repositories are not free (accounts have a finite allotment of minutes for private repositories). This becomes problematic in private repositories that also mirror the WordPress develop repository, as any workflow runs will draw from a user’s or organization’s allotted action minutes.

Without blanket disabling the workflow manually for all event triggers, or modifying the workflow files in the forked/mirrored repository, there is no way to tune when the workflows run.

This change introduces a conditional statement into all GitHub Action workflows that prevents them from running on forked/mirrored repositories that are not `wordpress-develop`, except when a pull request is being submitted to that repository.

The exception to this is the Welcome workflow that posts a helpful message to first time contributors to `wordpress-develop`. This message is specific to this repository, so should only run when a PR is submitted to that repository.

See #50401.
Built from https://develop.svn.wordpress.org/trunk@49781


git-svn-id: http://core.svn.wordpress.org/trunk@49504 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-09 20:06:04 +00:00
desrosj e9feb6fca3 Build/Test Tools: Update `package-lock.json` file with several package updates.
These updates result from running `npm install`.

Also, update the version of `grunt-patch-wordpress` in the lock file from `3.0.0` to `3.0.1`.

See #51801.
Built from https://develop.svn.wordpress.org/trunk@49780


git-svn-id: http://core.svn.wordpress.org/trunk@49503 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-09 19:33:06 +00:00
desrosj 2e90ec8789 Build/Test Tools: Remove the Appveyor configuration file.
Appveyor was added to Core in [44594] to ensure that NPM and the WordPress build tools continue to work correctly on Windows systems as changes are made. Using an additional service for this was required at the time, TravisCI did not support testing on Windows.

[49162] introduced a GitHub Action workflow that performed the same testing. Since all automated testing is moving to GitHub Actions, using Appveyor is no longer necessary, and it’s preferable to have all automated testing in one location as much as possible.

Props ayeshrajans.
Fixes #51968.
Built from https://develop.svn.wordpress.org/trunk@49779


git-svn-id: http://core.svn.wordpress.org/trunk@49502 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-09 13:35:05 +00:00
Helen Hou-Sandí e516134d10 Update `$_old_files` for 5.6.
See #39943.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49497 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-08 21:50:07 +00:00
TimothyBlynJacobs a9244a2912 App Passwords: Ensure redirection description is shown on mobile devices.
Props #core.
Fixes #51970.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49495 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-08 20:28:04 +00:00
ryelle aaf90076c5 Help/About: Use CDN URLs for About page images.
See #51415.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-08 17:02:06 +00:00
Sergey Biryukov 52d2b07600 Docs: Fix typo in references to `WP_Error` in some DocBlocks.
See #51800.
Built from https://develop.svn.wordpress.org/trunk@49769


git-svn-id: http://core.svn.wordpress.org/trunk@49492 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-08 11:51:05 +00:00
TimothyBlynJacobs efdba220e6 App Passwords: Store the "in use" option in the main network options.
Whether App Passwords are being used is a global featurel, not a per-network feature. This fixes issues on Multi Network installs if App Passwords are used on a different network from where they were created.

Props spacedmonkey.
Fixes #51939.
See [49752].

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


git-svn-id: http://core.svn.wordpress.org/trunk@49487 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-07 15:59:04 +00:00
Sergey Biryukov 29e882c177 Bundled Themes: Bump theme versions ahead of WordPress 5.6.
The following theme versions will be released in coordination with WordPress 5.6:

* Twenty Ten: 3.2
* Twenty Eleven: 3.6
* Twenty Twelve: 3.3
* Twenty Thirteen: 3.2
* Twenty Fourteen: 3.0
* Twenty Fifteen: 2.8
* Twenty Sixteen: 2.3
* Twenty Seventeen: 2.5
* Twenty Nineteen: 1.8
* Twenty Twenty: 1.6
* Twenty Twenty-One: 1.0

Props peterwilsoncc, hareesh-pillai, dkarfa, sabernhardt, poena, aristath, SergeyBiryukov.
Fixes #51919.
Built from https://develop.svn.wordpress.org/trunk@49763


git-svn-id: http://core.svn.wordpress.org/trunk@49486 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-07 15:55:05 +00:00
Sergey Biryukov 12ce5683ab Twenty Twenty-One: Use `esc_url()` for the WordPress.org link in `footer.php`.
Props mukesh27, poena.
Fixes #51954.
Built from https://develop.svn.wordpress.org/trunk@49762


git-svn-id: http://core.svn.wordpress.org/trunk@49485 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-07 14:17:04 +00:00
Sergey Biryukov 2095631176 Twenty Twenty-One: Use consistent HTML comments after closing HTML tags.
Follow-up to [45209] for other bundled themes.

Props arcangelini, audrasjb.
Fixes #51950.
Built from https://develop.svn.wordpress.org/trunk@49761


git-svn-id: http://core.svn.wordpress.org/trunk@49484 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-07 14:07:06 +00:00
Sergey Biryukov a4730c14ba Twenty Twenty-One: Fix the nesting of the `main` element.
The `main` element must not appear as a descendant of the `section` element. Correct markup is the first requirement to make user agents and assistive technologies work properly.

Changes the `<section>` element that was wrapping the `<main>` element to a `<div>`.

Follow-up to [45942] for Twenty Nineteen.

Props albertomake, poena.
Fixes #51944.
}}}
Built from https://develop.svn.wordpress.org/trunk@49759


git-svn-id: http://core.svn.wordpress.org/trunk@49482 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-06 16:22:06 +00:00
Peter Wilson 675620a844 Docs, Tests: Correctly capitalize JavaScript.
Correct Javascript to JavaScript within Wordpress core ;)

See #51800, #51802.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49481 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-06 02:21:07 +00:00
Sergey Biryukov 90510b8762 Tests: Correct `@ticket` references in some test files.
See #51802.
Built from https://develop.svn.wordpress.org/trunk@49757


git-svn-id: http://core.svn.wordpress.org/trunk@49480 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-05 15:51:10 +00:00
TimothyBlynJacobs aac98aae97 App Passwords: Prevent conflicts when Basic Auth is already used by the site.
Application Passwords uses Basic Authentication to transfer authentication details. If the site is already using Basic Auth, for instance to implement a private staging environment, then the REST API will treat this as an authentication attempt and would end up generating an error for any REST API request.

Now, Application Password authentication will only be attempted if Application Passwords is in use by a site. This is flagged by setting an option whenever an Application Password is created. An upgrade routine is added to set this option if any App Passwords already exist.

Lastly, creating an Application Password will be prevented if the site appears to already be using Basic Authentication.

Props chexwarrior, georgestephanis, adamsilverstein, helen, Clorith, marybaum, TimothyBlynJacobs.
Fixes #51939.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49475 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-04 21:44:07 +00:00
iandunn 77236320d3 Media: Return `WP_Error` when cropping with bad input to avoid fatal.
This avoids an error on PHP 8 caused by calling `wp_imagecreatetruecolor()` with inputs that aren't numeric, or are less than 0.

Props hellofromtonya, Boniu91, metalandcoffee, SergeyBiryukov.
Fixes #51937.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49474 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-04 21:41:06 +00:00
Sergey Biryukov e7b601f7c5 Database: Check the correct value for displaying the "Successfully repaired table" or "Failed to repair" messages on Database Repair screen.
Additionally, rename the variables holding the results of `ANALYZE TABLE` and `OPTIMIZE TABLE` requests, for clarity.

Props mehrshaddarzi.
Fixes #51932.
Built from https://develop.svn.wordpress.org/trunk@49750


git-svn-id: http://core.svn.wordpress.org/trunk@49473 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-04 15:50:12 +00:00
TimothyBlynJacobs 692c6498e9 App Passwords: Ensure the Created At and Last Used dates are properly translated.
The `date_i18n` function is now used when formatting the dates in PHP instead of `gmdate` which doesn't handle localization properly.

Additionally, we now use a translation to get the date format to use instead of pulling from the `date_format` option which is only supposed to affect the front-end.

Lastly, when passing the date format to the Backbone JS template, we now use `wp_json_encode()` to format the value for JavaScript. This ensures that backslashes are properly preserved which are used by some locales to escape date formatting control characters.

Props pedromendonca, TimothyBlynJacobs, ocean90, hellofromtonya, SergeyBiryukov, antpb.
Fixes #51918.
See [35811].

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


git-svn-id: http://core.svn.wordpress.org/trunk@49469 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-03 21:06:08 +00:00
iandunn 4de6175227 Multisite: Cache absolute `dirsize` paths to avoid PHP 8 fatal.
r49212 greatly improved the performance of `get_dirsize()`, but also changed the structure of the data stored in the `dirsize_cache` transient. It stored relative paths instead of absolute ones, and also removed the unnecessary `size` array.

That difference in data structures led to a fatal error in the following environment:

* PHP 8
* Multisite
* A custom `WP_CONTENT_DIR` which is not a child of WP's `ABSPATH` folder (e.g., [https://roots.io/bedrock/ Bedrock])
* The `upload_space_check_disabled` option set to `0`

After upgrading to WP 5.6, the `dirsize_cache` transient still had data in the old format. When `wp-admin.php/index.php` was visited, `get_space_used()` received an `array` instead of an `int`, and tried to divide it by another `int`. PHP 7 would silently cast the arguments to match data types, but [https://wiki.php.net/rfc/arithmetic_operator_type_checks PHP 8 throws a fatal error]: 

`Uncaught TypeError: Unsupported operand types: array / int`

`recurse_dirsize()` was using `ABSPATH` to convert the absolute paths to relative ones, but some upload locations are not located under `ABSPATH`. In those cases, `$directory` and `$cache_path` were identical, and that triggered the early return of the old `array`, instead of the expected `int`. 

In order to avoid that, this commit restores the absolute paths, but without the `size` array. It also adds a type check when returning cached values. Using absolute paths without `size` has the result of overwriting the old data, so that it matches the new format. The type check and upgrade routine are additional safety measures.

Props peterwilsoncc, janthiel, helen, hellofromtonya, francina, pbiron.
Fixes #51913. See #19879.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49467 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-03 20:39:02 +00:00
Sergey Biryukov 203b48f281 Upgrade/Install: Update sodium_compat to v1.14.0.
This includes improved PHP 8 support and more inclusive language.

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

Follow-up to [48121], [49056], [49057].

Props jrf.
Fixes #51925.
Built from https://develop.svn.wordpress.org/trunk@49741


git-svn-id: http://core.svn.wordpress.org/trunk@49464 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-03 17:41:07 +00:00
TimothyBlynJacobs 4dd08e20b8 App Passwords: Return true when rate limiting a password's last used time.
Previously we returned a `WP_Error` instance saying that the password was not found which is inaccurate.

Props dlh.
Fixes #51922.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49462 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-03 16:30:06 +00:00
Sergey Biryukov fc3a155f6a Editor: Update components package for WordPress 5.6 RC3.
@wordpress/components: 11.1.2 -> 11.1.3

This fixes an accessibility regression with VoiceOver not announcing the input label or an existing selection in the parent page dropdown under "Page Attributes" in the sidebar.

See https://github.com/WordPress/gutenberg/pull/27431 for more details.

Props isabel_brison, sarahricker, alexstine, kevin940726, talldanwp.
Fixes #51923.
Built from https://develop.svn.wordpress.org/trunk@49737


git-svn-id: http://core.svn.wordpress.org/trunk@49460 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-03 14:43:31 +00:00
Sergey Biryukov be2891ef1a Upgrade/Install: Check `$wp_version` global for displaying "You are using a development version" message in the admin footer.
This brings some consistency with the same check in `core_upgrade_preamble()` and avoids a PHP warning if `$cur->version` is not set.

Additionally, remove the check for `$cur->url` property, unused since [8595].

Follow-up to [49708], [49709].

Props pbiron, afragen, audrasjb.
Fixes #51892.
Built from https://develop.svn.wordpress.org/trunk@49736


git-svn-id: http://core.svn.wordpress.org/trunk@49459 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-03 14:06:04 +00:00
Sergey Biryukov 0a20850f57 Docs: Clarify the `$format` parameter description in `comment_time()`.
See #51800.
Built from https://develop.svn.wordpress.org/trunk@49735


git-svn-id: http://core.svn.wordpress.org/trunk@49458 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-02 16:55:06 +00:00
John Blackbourn 00680f2e89 REST API: Pass the previous state of the post as a parameter to the `wp_after_insert_post` hook.
This enables, for example, the previous post status to be used by this hook without the need to first capture it on an earlier hook.

This also fixes the value of the `$fire_after_hooks` parameter in `get_default_post_to_edit()` so the `wp_after_insert_post` action correctly fires just once on the new post screen.

Props Collizo4sky, peterwilsoncc, hellofromTonya, TimothyBlynJacobs, SergeyBiryukov

Fixes #45114

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


git-svn-id: http://core.svn.wordpress.org/trunk@49454 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-01 20:47:06 +00:00
desrosj 5bd111eb76 Twenty Twenty-One: Sync the latest changes for 5.6 RC2.
This will be the final sync from GitHub before placing that repository into read-only mode. All further changes should now flow entirely through Trac.

For a full list of changes since [49633], see 1d5a895...53acd9b.

Props poena, luminuu, kjellr, ryelle, allancole, melchoyce, felipeelia, aljullu, kebbet, chaton666, Clorith, mkaz, ingereck, paaljoachim.
See #51526.
Built from https://develop.svn.wordpress.org/trunk@49726


git-svn-id: http://core.svn.wordpress.org/trunk@49449 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-01 19:09:05 +00:00
Sergey Biryukov 2c1bfb5baf Administration: Make sure row actions for recent comments in Activity dashboard widget stay visible when a single row gets focus.
Follow-up to [49142].

Props sabernhardt, kebbet, hareesh-pillai, pbiron.
Fixes #51886. See #51516, #49715.
Built from https://develop.svn.wordpress.org/trunk@49725


git-svn-id: http://core.svn.wordpress.org/trunk@49448 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-01 18:16:07 +00:00
Sergey Biryukov 8e70bc7720 Editor: Don't unnecessarily split a translatable string in block templates.
As a best practice, strings available for translation should contain entire sentences whenever possible.

Splitting a sentence in two parts and putting them back together after translation should be avoided, as the word order in other languages can be different from English.

Props tobifjellner, kebbet, audrasjb, mukesh27, hellofromTonya, azaozz, SergeyBiryukov.
Fixes #51893.
Built from https://develop.svn.wordpress.org/trunk@49722


git-svn-id: http://core.svn.wordpress.org/trunk@49445 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-01 17:03:04 +00:00
Sergey Biryukov 785cb6cc7d Media: Revert [49567].
This addresses a regression with the pagination section in Media Library no longer taking additional query filtering into account.

Props iCaleb, trepmal, peterwilsoncc.
See #39968.
Built from https://develop.svn.wordpress.org/trunk@49720


git-svn-id: http://core.svn.wordpress.org/trunk@49443 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-01 16:33:05 +00:00
Sergey Biryukov a9490c4639 Editor: Update packages for WordPress 5.6 RC2.
The following package versions were changed:

@wordpress/block-directory: 1.17.4 -> 1.17.5
@wordpress/block-editor: 5.1.3 -> 5.1.4
@wordpress/block-library: 2.26.4 -> 2.26.5
@wordpress/blocks: 6.24.1 -> 6.24.2
@wordpress/components: 11.1.1 -> 11.1.2
@wordpress/core-data: 2.24.1 -> 2.24.2
@wordpress/edit-post: 3.25.4 -> 3.25.5
@wordpress/editor: 9.24.3 -> 9.24.4
@wordpress/format-library: 1.25.3 -> 1.25.4
@wordpress/list-reusable-blocks: 1.24.1 -> 1.24.2
@wordpress/nux: 3.23.1 -> 3.23.2
@wordpress/reusable-blocks: 1.0.3 -> 1.0.4
@wordpress/server-side-render: 1.19.1 -> 1.19.2

See https://github.com/WordPress/gutenberg/pull/27366 for the list of fixed bugs.

Props isabel_brison.
Fixes #51902.
Built from https://develop.svn.wordpress.org/trunk@49718


git-svn-id: http://core.svn.wordpress.org/trunk@49441 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-01 12:19:43 +00:00
TimothyBlynJacobs c3b40f7f80 Site Health, App Passwords: Ensure REST API responses are properly translated.
The REST API requests in Site Health and App Passwords now include `_locale=user` in the request URL to ensure the user's locale is used instead of the site locale. Additionally, the `apiRequest` library now sends a JSON `Accept` header which is required by `determine_locale()` to respect the `_locale` query parameter.

The Site Health REST API controllers now manually load the default admin textdomain if not `is_admin()`. This allows for the Site Health tests to be translated even though the translations are part of the administration project and the REST API is not.

Props oglekler, kebbet, Clorith, TimothyBlynJacobs, ocean90, SergeyBiryukov, adamsilverstein.
Fixes #51871.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49439 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-12-01 03:44:05 +00:00
Sergey Biryukov b3a952972e External Libraries: Upgrade PHPMailer to version 6.2.0.
For a full list of changes in this update, see the PHPMailer GitHub:
https://github.com/PHPMailer/PHPMailer/compare/v6.1.8...v6.2.0

Props ayeshrajans, jrf.
Fixes #51874.
Built from https://develop.svn.wordpress.org/trunk@49713


git-svn-id: http://core.svn.wordpress.org/trunk@49436 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-30 17:10:05 +00:00
Andrew Ozz 190b9a0b32 Quick/Bulk Edit: Follow up to [49703]. Improve the logic a bit and always return `this` (the jQuery object) in `wpTagsSuggest`.
Fixes #51872.
Built from https://develop.svn.wordpress.org/trunk@49710


git-svn-id: http://core.svn.wordpress.org/trunk@49433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-30 14:31:04 +00:00
Sergey Biryukov ce3334571d Upgrade/Install: Display "You are using a development version" message on WordPress Updates screen for Beta or RC versions.
This ensures that the message is displayed when the `WP_AUTO_UPDATE_CORE` constant is set to `beta` or `rc` and the user is on a development version.

Follow-up to [49245], [49254], [49292], [49638], [49708].

Props afragen, audrasjb, azaozz, SergeyBiryukov.
Fixes #51822.
Built from https://develop.svn.wordpress.org/trunk@49709


git-svn-id: http://core.svn.wordpress.org/trunk@49432 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-30 13:42:07 +00:00
Sergey Biryukov 95f28a3fd2 Upgrade/Install: Display "You are using a development version" message in the admin footer for Beta or RC versions.
This ensures that the message is displayed when the `WP_AUTO_UPDATE_CORE` constant is set to `beta` or `rc` and the user is on a development version.

Props afragen.
Fixes #51892.
Built from https://develop.svn.wordpress.org/trunk@49708


git-svn-id: http://core.svn.wordpress.org/trunk@49431 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-29 16:13:06 +00:00
Sergey Biryukov 2797594835 Comments: Correct ending tag placement in the "Search results for: ..." subtitle.
Follow-up to [49284], [49286].

Props Clorith, kebbet, johnbillion, audrasjb, azaozz.
Fixes #51889. See #37353.
Built from https://develop.svn.wordpress.org/trunk@49705


git-svn-id: http://core.svn.wordpress.org/trunk@49428 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-28 17:28:05 +00:00
Andrew Ozz 94e8230864 External Libraries: Fix hiding of the text in the jQuery UI dialog close button.
Props marijnkoopman, SergeyBiryukov, Clorith, azaozz.
Fixes #51863.
Built from https://develop.svn.wordpress.org/trunk@49704


git-svn-id: http://core.svn.wordpress.org/trunk@49427 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-28 13:50:03 +00:00
Andrew Ozz bac1ada04d Quick/Bulk Edit: Fix `undefined` error when initializing UI Autocomplete 1.12.1 on non-existing element and then attempting to use the autocomplete instance.
Example: `jQuery( '#nonexisting' ).autocomplete().autocomplete( 'instance' ).something`.

Props _luigi, sabernhardt, donmhico, azaozz.
Fixes #51872.
Built from https://develop.svn.wordpress.org/trunk@49703


git-svn-id: http://core.svn.wordpress.org/trunk@49426 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-28 12:46:05 +00:00
ryelle 33749fcc74 Help/About: Update URLs in About page
Replace the placeholder links now that the posts have been published. This also updates the jQuery plugin links to to local-site links, if the user can install plugins.

Follow-up to [49640].
Props mukesh27, ocean90.
See #51415.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-27 17:10:07 +00:00
Sergey Biryukov 25d67c30b0 Tests: Test that `sanitize_title_with_dashes()` strips HTML tags.
`sanitize_title()` already has the same test in its own file.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49424 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-27 12:52:06 +00:00
John Blackbourn 40b738335b Docs: Corrections and improvements to docs for properties of the `WP_Query` class.
This also adds additional type hinting inside some methods to help IDEs.

See #51800

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


git-svn-id: http://core.svn.wordpress.org/trunk@49423 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-26 17:04:06 +00:00
Sergey Biryukov f0b5757e35 Options, Meta APIs: Pass `$meta_type` to the `get_{$meta_type}_metadata` filter in `metadata_exists()`.
This matches the main instance of the filter in `get_metadata_raw()`.

Follow-up to [48505].

Props pbiron, jsmoriss, TimothyBlynJacobs.
Fixes #51866.
Built from https://develop.svn.wordpress.org/trunk@49699


git-svn-id: http://core.svn.wordpress.org/trunk@49422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-26 12:34:06 +00:00
Sergey Biryukov 82d074fb0a Docs: Use typed array notation for the `$size` parameter of `embed_defaults` filter.
Previously committed in [42876], accidentally reverted in [44154].

See #51800.
Built from https://develop.svn.wordpress.org/trunk@49698


git-svn-id: http://core.svn.wordpress.org/trunk@49421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-25 12:14:05 +00:00
Peter Wilson e89f669274 Build/Test Tools: Use dataProviders for some kses tests.
Refactor several kses tests to use dataProviers rather than looping through assertions.

See #51802.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49420 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-25 04:51:03 +00:00
Peter Wilson 5a9a4865ad Build/Test Tools: Remove unused posts from AJAX test `setUp()`.
Removes the creation of five posts from the AJAX test suite `setUp()` function, replacing it with a shared fixture only where required.

See #51802.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-25 04:11:05 +00:00
noisysocks 7aa60ecce9 Editor: Remove render_block hooks from WP_Block
Reverts the move of pre_render_block, render_block_data, and
render_block_context to WP_Block.

This change has more implications than first thought so will be revisted later
in 5.7.

Reverts [49609,49608].
See #51612.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49418 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-25 01:20:09 +00:00
John Blackbourn f4cda1b62f Docs: Upgrade more parameters in docblocks to used typed array notation.
See #51800, #41756

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


git-svn-id: http://core.svn.wordpress.org/trunk@49416 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-24 21:27:05 +00:00
John Blackbourn 780cdb5eb5 Docs: Various docblock corrections relating to parameter types.
See #51800

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


git-svn-id: http://core.svn.wordpress.org/trunk@49415 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-24 21:22:04 +00:00
Sergey Biryukov d26f6daa23 Tests: Ignore EOL differences in `WP_List_Table::get_bulk_items()` test for optgroups.
This avoids a misleading failure due to Unix vs. Windows EOL style mismatches and allows the test to pass on Windows.

Follow-up to [46612], [49190].

See #19278.
Built from https://develop.svn.wordpress.org/trunk@49691


git-svn-id: http://core.svn.wordpress.org/trunk@49414 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-24 20:43:08 +00:00
Sergey Biryukov 0f9170b82d Docs: Clarify that the `$class` argument of `wp_list_bookmarks()` can accept an array.
Follow-up to [32906].

See #51855, #51800.
Built from https://develop.svn.wordpress.org/trunk@49688


git-svn-id: http://core.svn.wordpress.org/trunk@49411 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-24 12:29:07 +00:00
Sergey Biryukov 771b1048be Help/About: Move trailing punctuation in the jQuery Migrate Helper plugin link outside of the HTML tag.
Props psmits1567, audrasjb, tobifjellner, fierevere, markscottrobson.
Fixes #51813.
Built from https://develop.svn.wordpress.org/trunk@49685


git-svn-id: http://core.svn.wordpress.org/trunk@49408 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-23 19:35:03 +00:00
Sergey Biryukov 5f9cf0141e Plugins: Check if `_error_nonce` is set before attempting to verify it.
This avoids a PHP notice on the Plugins screen when `error` query string is added to the URL.

Props wponlinesupport.
Fixes #43876.
Built from https://develop.svn.wordpress.org/trunk@49683


git-svn-id: http://core.svn.wordpress.org/trunk@49406 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-23 13:36:07 +00:00
Sergey Biryukov 8312762816 Docs: Update syntax for multi-line comment in `core_auto_updates_settings()` per the documentation standards.
Follow-up to [49677].

See #51827.
Built from https://develop.svn.wordpress.org/trunk@49681


git-svn-id: http://core.svn.wordpress.org/trunk@49404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-22 15:59:05 +00:00
Sergey Biryukov 3af1bfdbfa Docs: Add documentation for the `$type` and `$mime_type` properties in `WP_Customize_Image_Control`.
Follow-up to [20319], [30309], [31698], [32023], [49679].

Props subrataemfluence.
Fixes #44411.
Built from https://develop.svn.wordpress.org/trunk@49680


git-svn-id: http://core.svn.wordpress.org/trunk@49403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-22 15:53:03 +00:00
Sergey Biryukov f31f929a5b Docs: Add documentation for the `$type`, `$mime_type`, and `$button_labels` properties in `WP_Customize_Upload_Control`.
Follow-up to [20319], [30309], [31698], [32023].

Props subrataemfluence.
See #44411.
Built from https://develop.svn.wordpress.org/trunk@49679


git-svn-id: http://core.svn.wordpress.org/trunk@49402 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-22 15:51:03 +00:00
Sergey Biryukov dda5dcd028 Docs: Correct `@since` tag for the `class-wp-widget-area-customize-control.php` file.
Per the documentation standards, the file header `@since` tag is supposed to specify when the file was introduced.

Follow-up to [35389].

See #51800.
Built from https://develop.svn.wordpress.org/trunk@49678


git-svn-id: http://core.svn.wordpress.org/trunk@49401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-22 15:12:03 +00:00
Andrew Ozz 991114fb57 Upgrade/Install: Replace the conditionals that check the `AUTOMATIC_UPDATER_DISABLED` constant and the `automatic_updater_disabled` filter in update-core.php with a call to `WP_Automatic_Updater::is_disabled()`. This prevents a PHP warning, fixes the logic, and considers `wp_is_file_mod_allowed( 'automatic_updater' )` when determining the UI state.
Props jamesros161, pbiron, audrasjb, azaozz.
Fixes #51827.
Built from https://develop.svn.wordpress.org/trunk@49677


git-svn-id: http://core.svn.wordpress.org/trunk@49400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-22 13:03:06 +00:00
Sergey Biryukov 9150652fed Site Health: Check if `$core_updates` is an array before iterating on it.
This avoids a PHP warning if `get_core_updates()` returns `false`.

Props paulschreiber.
Fixes #51818.
Built from https://develop.svn.wordpress.org/trunk@49676


git-svn-id: http://core.svn.wordpress.org/trunk@49399 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-21 14:39:03 +00:00
Sergey Biryukov 5ab5b3e73b Docs: Add missing `@since` tags for `WP_Upgrader_Skin` methods.
See #51800.
Built from https://develop.svn.wordpress.org/trunk@49675


git-svn-id: http://core.svn.wordpress.org/trunk@49398 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-21 12:08:05 +00:00
ryelle 7ded4af960 Help/About: Clarify accessibility features.
* Captions are uploaded in the block editor, and not created in the editor.
* Avoid making an invalid claim of WCAG 2.1 conformance or trivialize the efforts still required to build an accessible and compliant site.

Follow-up to [49640].
Props joedolson.
See #51415.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-21 00:13:07 +00:00
Sergey Biryukov d86f6bde55 Docs: Correct `$fire_after_hooks` parameter name in `@since` tags.
Follow-up to [49172], [49173].

See #45114.
Built from https://develop.svn.wordpress.org/trunk@49673


git-svn-id: http://core.svn.wordpress.org/trunk@49396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-20 11:58:06 +00:00
John Blackbourn 35f6c356c1 Docs: Document parameters that accept an array of integers using typed array notation.
While many of these parameters also technically accept an array of numerical strings, they are all ultimately cast to an array of integers. Documenting them as such assists developers in understanding the expected types.

See #51800, #41756

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


git-svn-id: http://core.svn.wordpress.org/trunk@49395 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-19 18:24:09 +00:00
John Blackbourn 6e472178d1 Docs: Add missing `@since` tags.
See #51800

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


git-svn-id: http://core.svn.wordpress.org/trunk@49394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-19 17:54:05 +00:00
John Blackbourn 792c53ac8c Docs: Clarify and standardise on terminology used for rewrite rule endpoint masks.
See #51800

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


git-svn-id: http://core.svn.wordpress.org/trunk@49393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-19 16:15:08 +00:00
Sergey Biryukov aab7112b09 Docs: Use more specific type in parameter descriptions for `in_category()` and `is_object_in_term()`.
This better aligns with `is_category()` and other conditional tags and their `WP_Query` counterpart methods.

Follow-up to [47402].

Props princeahmed.
Fixes #51825.
Built from https://develop.svn.wordpress.org/trunk@49669


git-svn-id: http://core.svn.wordpress.org/trunk@49392 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-19 15:20:05 +00:00
Sergey Biryukov da6ab833d5 Coding Standards: Remove redundant `isset()` check in `core_upgrade_preamble()`.
`isset()` can be safely used to check properties and subproperties of objects directly.

Follow-up to [49638].

See #51799.
Built from https://develop.svn.wordpress.org/trunk@49668


git-svn-id: http://core.svn.wordpress.org/trunk@49391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-19 12:05:06 +00:00
Sergey Biryukov 6cde96263b Help/About: Correct placeholder for the accessibility statement feature plugin link.
Add missing translator comment.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-18 15:51:04 +00:00
Sergey Biryukov 05125ed8bf Site Health: Add missing i18n for the App Passwords documentation link.
Follow-up to [49334].

Props tai.
Fixes #51815.
Built from https://develop.svn.wordpress.org/trunk@49650


git-svn-id: http://core.svn.wordpress.org/trunk@49387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-18 15:04:05 +00:00
Andrew Ozz e261cf0d1e External Libraries: Update jQuery Migrate to 3.3.2.
Props mgol, azaozz.
Fixes #50564.
Built from https://develop.svn.wordpress.org/trunk@49649


git-svn-id: http://core.svn.wordpress.org/trunk@49386 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-18 09:06:06 +00:00
Helen Hou-Sandí 7c5a072f38 Trunk is now really 5.7-alpha.
Built from https://develop.svn.wordpress.org/trunk@49645


git-svn-id: http://core.svn.wordpress.org/trunk@49383 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-17 22:57:03 +00:00
Helen Hou-Sandí a434baf9e8 Trunk is now 5.7-alpha.
Built from https://develop.svn.wordpress.org/trunk@49644


git-svn-id: http://core.svn.wordpress.org/trunk@49382 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-17 22:52:03 +00:00
Helen Hou-Sandí 5ac21f5fbc Post WordPress 5.6 RC 1 version bump.
Built from https://develop.svn.wordpress.org/trunk@49642


git-svn-id: http://core.svn.wordpress.org/trunk@49380 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-17 22:39:05 +00:00
Helen Hou-Sandí c267ad2fde WordPress 5.6 RC 1.
Built from https://develop.svn.wordpress.org/trunk@49641


git-svn-id: http://core.svn.wordpress.org/trunk@49379 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-17 22:01:02 +00:00
ryelle 6214f61cb1 Help/About: WordPress 5.6 About Page.
This change introduces the new About page for WordPress 5.6.

Props elmastudio, ryelle, melchoyce, karmatosed, webcommsat, marybaum, meher, OGlekler, lmurillom, vimes1984, sabrinazeidan, nalininonstopnewsuk, afshanadiya, michelleames, bmcdede, yvettesonneveld, sarahricker, isabel_brison, helen, hellofromtonya, poena, chanthaboune, cbringmann, joedolson, sabernhardt, garrett-eclipse, audrasjb, marks99.
See #51415.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49378 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-17 21:34:04 +00:00
Sergey Biryukov 700c9455ab I18N: Avoid PHP notices for relative URLs in `load_script_textdomain()`.
Props hellofromTonya, SeBsZ, archon810, nourma, justinahinon, SergeyBiryukov.
Fixes #49145.
Built from https://develop.svn.wordpress.org/trunk@49639


git-svn-id: http://core.svn.wordpress.org/trunk@49377 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-17 20:52:09 +00:00
Helen Hou-Sandí b456e9c9c8 Upgrade/Install: Consistent layout and accurate messages on the update screen.
* Clarifies that if you are on maintenance/security auto-updates that you are only on those and therefore there are more options available.
* Adds a message if a version control system has been detected, as automatic updates are disabled in that case.
* Ensures only one heading between `update available`, `you are on a dev version`, and `you are on latest` appears at any given time, falling back to `you are on latest` if something strange happens with the returned update data.
* Removes some older strings related to auto-updates, which greatly simplifies the above.
* Strips the `core-major-auto-updates-saved` query arg from the URL, as it is related to a dismissible notice.

Props audrasjb, pbiron, helen.
Fixes #51742.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49376 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-17 20:28:04 +00:00
Sergey Biryukov cce65c9baf Users: Use `do_action_ref_array()` for `pre_get_users` and `pre_get_terms` actions.
This brings some consistency with the other similar actions:

* `pre_get_comments`
* `pre_get_networks`
* `pre_get_posts`
* `pre_get_sites`
* `pre_user_query`

Follow-up to [29363] and [37572].

Props andy, adamsilverstein, hellofromTonya, desrosj, SergeyBiryukov.
Fixes #50961.
Built from https://develop.svn.wordpress.org/trunk@49637


git-svn-id: http://core.svn.wordpress.org/trunk@49375 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-17 20:09:05 +00:00
desrosj bcb9027236 Build/Test Tools: Update the `package.json` `engines` to point to the new LTS versions of Node/NPM.
Props mkaz, jorbin.
Fixes #51749.
Built from https://develop.svn.wordpress.org/trunk@49636


git-svn-id: http://core.svn.wordpress.org/trunk@49374 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-17 19:52:00 +00:00
Sergey Biryukov dfc3eeff10 General: Rename the `wp_error_checked` action to `is_wp_error_instance` for clarity.
Follow-up to [49022], [49023].

Props johnbillion, helen, johnjamesjacoby, Mte90, alexstandiford, hellofromTonya, jnylen0, SergeyBiryukov.
Fixes #40568.
Built from https://develop.svn.wordpress.org/trunk@49635


git-svn-id: http://core.svn.wordpress.org/trunk@49373 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-17 19:21:05 +00:00
desrosj 50bf937ebb Build/Test Tools: Update several NPM dependencies.
These updates were applied when running `npm install`.

See #50769.
Built from https://develop.svn.wordpress.org/trunk@49634


git-svn-id: http://core.svn.wordpress.org/trunk@49372 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-17 19:19:06 +00:00
desrosj 634e6b16c8 Twenty Twenty-One: Sync the latest changes for 5.6 RC1.
For a full list of changes since [49574-49577], see https://github.com/WordPress/twentytwentyone/compare/aa284fd...trunk.

Props poena, luminuu, kjellr, ryelle, aristath.
See #51526.
Built from https://develop.svn.wordpress.org/trunk@49633


git-svn-id: http://core.svn.wordpress.org/trunk@49371 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-17 19:00:08 +00:00
Sergey Biryukov cf75a715c4 App Passwords: Regenerate the `.htaccess` file to add a new rule.
Application Passwords introduced a new Rewrite Rule to handle the Authorization header on certain systems.

This bumps the database version and updates the file so the change is applied to sites upon upgrading to 5.6.

Follow-up to [49534].

Props pbiron, TimothyBlynJacobs, SergeyBiryukov.
Fixes #51723.
Built from https://develop.svn.wordpress.org/trunk@49632


git-svn-id: http://core.svn.wordpress.org/trunk@49370 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-17 17:24:06 +00:00
Sergey Biryukov f97647c207 Plugins: Make sure the HTML ID attributes for plugin checkboxes are unique.
Follow-up to [48374].

Props helen, sabernhardt, kishanjasani, mukesh27, hareesh-pillai.
Fixes #51256.
Built from https://develop.svn.wordpress.org/trunk@49631


git-svn-id: http://core.svn.wordpress.org/trunk@49369 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-17 16:48:09 +00:00
Sergey Biryukov 7860b364fe Docs: Further remove tautology from comments in `recurse_dirsize()` tests.
Follow-up to [49212], [49616], [49628].

See #19879.
Built from https://develop.svn.wordpress.org/trunk@49630


git-svn-id: http://core.svn.wordpress.org/trunk@49368 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-17 15:50:06 +00:00
Sergey Biryukov 5801fc9a93 Multisite: Rename the `calculate_current_dirsize` filter to `pre_recurse_dirsize`.
Set the default value to `false`. This brings some consistency with the `pre_get_space_used` filter.

Follow-up to [49212], [49616], [49628].

See #19879.
Built from https://develop.svn.wordpress.org/trunk@49629


git-svn-id: http://core.svn.wordpress.org/trunk@49367 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-17 15:44:07 +00:00
Sergey Biryukov e123448589 Docs: Adjust comments for `recurse_dirsize()` and related tests per the documentation standards.
Follow-up to [49212], [49616].

See #19879.
Built from https://develop.svn.wordpress.org/trunk@49628


git-svn-id: http://core.svn.wordpress.org/trunk@49366 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-17 15:38:10 +00:00
Sergey Biryukov f7d3a8b5c4 App Passwords: Add missing i18n for an error message.
Follow-up to [49617].

See #51513.
Built from https://develop.svn.wordpress.org/trunk@49627


git-svn-id: http://core.svn.wordpress.org/trunk@49365 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-17 10:21:08 +00:00
Sergey Biryukov 1642f9bb1d Docs: Document the `$args` parameter of `wp_oembed_get()`.
Link to `wp_oembed_get()` as the canonical source when documenting additional arguments in various `WP_oEmbed` methods.

Follow-up to [49620].

See #51269.
Built from https://develop.svn.wordpress.org/trunk@49626


git-svn-id: http://core.svn.wordpress.org/trunk@49364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-17 10:11:11 +00:00
noisysocks 9f065de733 Customize: Temporary fix for autosave restore notice not being removed
Fixes the "There is a more recent autosave of your changes" notice from not
being removed when the dismiss button is clicked.

The problem is caused by the notice being initialized twice: once by the
`common` script and then again by the `customize-controls` script.

This temporary fix prevents `customize-controls` from initializing a notice if
it has already been initialized.

A better fix would be to not initialize notices twice. This can be done by
removing `common` as a dependency of `updates` when `deprecateL10nObject` is
removed.

When this happens (est: 5.7), this temporary fix should be reverted.

Fixes #51425.
See #51317.
Props karthikbhatb, dlh, SergeyBiryukov.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49363 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-17 04:45:11 +00:00
noisysocks a3c8b3ddea Customize: Ensure multiple CSS classes are passed to nav_menu_link_attributes as an array
When multiple CSS classes are added to a menu item, the nav_menu_link_attributes
filter should be called with $item->classes set to an array of CSS class names.

When previewing in the Customizer, however, a single string was being passed to
$item->classes because WP_Customize_Nav_Menu_Item_Setting::preview() bypasses
wp_update_nav_menu_item() and instead uses filter_wp_get_nav_menu_items().

The fix is to make filter_wp_get_nav_menu_items() match what
wp_update_nav_menu_item() does and split the string into an array.

Fixes #43113.
Props dlh.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-17 04:31:08 +00:00
noisysocks fb2f5a743b Editor: Update WordPress packages for RC1
@wordpress/block-directory: 1.17.3 -> 1.17.4
@wordpress/block-library: 2.26.3 -> 2.26.4
@wordpress/edit-post: 3.25.3 -> 3.25.4

Fixes #51793.
Props isabel_brison.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49361 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-17 04:13:29 +00:00
Peter Wilson 30b79ebd28 Permalinks: Prevent attachment pages 404ing following [49563].
This largely reverts [49563] due to attachment pages returning 404: File not found errors when they use the `inherit` status.

Permalink changes to attachment pages are retained when they are descendants of trashed or deleted posts.

Props Toro_Unit, helen, johnbillion, peterwilsoncc.
Fixes #51776.
See #5272.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49360 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-17 03:29:12 +00:00
desrosj 03eba7beb2 Code Modernization: Only call `libxml_disable_entity_loader()` in PHP < 8.
This function has been deprecated in PHP 8.0 because in libxml 2.9.0, external entity loading is disabled by default, so this function is no longer needed to protect against XXE attacks.

This change fixes an instance of `libxml_disable_entity_loader()` within the getID3 library that has not yet been included in a tagged release for the library.

Props jrf, hellofromtonya.
Fixes #50898.
Built from https://develop.svn.wordpress.org/trunk@49621


git-svn-id: http://core.svn.wordpress.org/trunk@49359 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-17 01:00:08 +00:00
Helen Hou-Sandí 85b28a939f Embeds: Document $args in wp_oembed_get().
Props hellofromTonya, audrasjb, SergeyBiryukov.
Fixes #51269.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49358 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-16 23:13:08 +00:00
whyisjake 3c51950baf Feeds: Add an early exit when calling RSS functions directly.
While this file is depracated, it shouldn't throw errors when called directly.

Fixes #35835.

Props thib3113, dd32, TheGP, flymike, zodiac1978, williampatton.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49357 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-16 22:52:05 +00:00
whyisjake ec9434735a Build/Test Tools: Update several NPM dependencies.
These updates were applied by running `npm i`. These are changing some `http` links to `https`.

See #50769.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49356 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-16 22:47:06 +00:00
TimothyBlynJacobs d9b35c8e98 App Passwords: Unify availability language.
Previously App Passwords used a mix of "enabled" and "available". We've now standardized on using "available".

Additionally, we now use a 501 status code when indicating that App Passwords is not available.

Props SergeyBiryukov, ocean90, TimothyBlynJacobs.
Fixes #51513.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49355 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-16 22:42:04 +00:00
Helen Hou-Sandí aceaf33edd Multisite: More consistency for `clean_dirsize_cache()`.
Props SergeyBiryukov.
Fixes #19879.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49354 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-16 22:31:06 +00:00
Sergey Biryukov 7712866212 Script Loader: Correct version for jQuery Migrate.
Follow-up to [49338].

See #51621, #50564.
Built from https://develop.svn.wordpress.org/trunk@49615


git-svn-id: http://core.svn.wordpress.org/trunk@49353 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-16 21:36:05 +00:00
Helen Hou-Sandí 14bd8cc469 Posts, Post Types: Go back to "Auto Draft" for CPTs without title support.
Reverts [49288] due to late point in 5.6 cycle and lack of update in Gutenberg package to account for the string change.
See #45516.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49352 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-16 19:44:07 +00:00
Helen Hou-Sandí ee48cca207 Media: Avoid fatal error in `wp_prepare_attachment_for_js().
In certain contexts, in particular on the front-end, `get_media_states()` is not availble.

Props rebasaurus.
Fixes #51791.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49351 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-16 19:20:09 +00:00
Sergey Biryukov 801152b9d7 Docs: Fix typo in `wp_get_object_terms` filter DocBlock.
Follow-up to [49597].

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


git-svn-id: http://core.svn.wordpress.org/trunk@49350 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-16 17:28:08 +00:00
Sergey Biryukov 6a8f9bf499 Docs: Add missing full stop for a comment in `create_initial_rest_routes()`.
Follow-up to [49154].

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


git-svn-id: http://core.svn.wordpress.org/trunk@49349 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-16 16:48:12 +00:00
John Blackbourn 753ae723ad Docs: Corrections and improvements to inline docs relating to the REST API.
See #50768

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


git-svn-id: http://core.svn.wordpress.org/trunk@49348 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-16 11:04:12 +00:00
Sergey Biryukov b51eeb4eef Docs: Drop `src/` from `pre_render_block` duplicate hook reference.
Follow-up to [49608].

See #51612.
Built from https://develop.svn.wordpress.org/trunk@49609


git-svn-id: http://core.svn.wordpress.org/trunk@49347 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-16 10:53:11 +00:00
noisysocks 341704d640 Editor: Move pre_render_block, render_block_data, render_block_context
Move the pre_render_block, render_block_data, and render_block_context
filters from render_block() to WP_Block. This ensures that they are
called for all blocks, including nested blocks, not just top-level
blocks.

Fixes #51612.
Props gaambo, gziolo, TimothyBlynJacobs.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49346 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-16 00:47:11 +00:00
TimothyBlynJacobs 44125fc590 App Passwords: Include authorization rewrite rule in default multisite .htaccess
This rule was previously added to `WP_Rewrite`, but multisite uses a different .htaccess generation mechanism.

Props pbiron.
Fixes #51772.
See [49109].

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


git-svn-id: http://core.svn.wordpress.org/trunk@49345 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-15 17:46:06 +00:00
John Blackbourn 14d60739d1 Build/Test Tools: Misc test enhancements.
See #51344

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


git-svn-id: http://core.svn.wordpress.org/trunk@49344 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-15 17:19:10 +00:00
John Blackbourn bd52453064 Built/Test Tools: Switch to a data provider for the default user role and capability tests.
This test previously performed 1,010 assertions, and a failure in any one would prevent the other assertions from running. Using a data provider means simultaneous failures will all be reported at once.

See #51344, #32394

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


git-svn-id: http://core.svn.wordpress.org/trunk@49343 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-15 14:59:06 +00:00
John Blackbourn 2062b81430 Build/Test Tools: Ensure user capability assertions are performed for all default roles.
The existing assertions were erroneously placed outside the iteration of all users, and therefore were only run against the last user in the list, which is the Subscriber role.

See #51344, #32394

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


git-svn-id: http://core.svn.wordpress.org/trunk@49342 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-15 14:19:08 +00:00
John Blackbourn ffe8f1cba4 Build/Test Tools: Standardise the name, signature, and usage of the `wpSetUpBeforeClass()` method that's used in test classes.
This brings consistency to this often-used method, and allows IDEs to provide help to developers when using its `$factory` parameter.

See #51344

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


git-svn-id: http://core.svn.wordpress.org/trunk@49341 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-15 14:01:06 +00:00
Sergey Biryukov b618452411 Twenty Nineteen: Remove unnecessary references to some variables in `twentynineteen_hsl_hex()` before they are defined.
Props ankitmaru, sabernhardt.
Fixes #49052.
Built from https://develop.svn.wordpress.org/trunk@49602


git-svn-id: http://core.svn.wordpress.org/trunk@49340 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-15 12:16:09 +00:00
John Blackbourn 1daf22cae6 Build/Test Tools: Improve the reliability of the test that ensures correct dependency order when inline scripts are used.
This test already ensures `WP_Scripts->do_concat` is true, therefore it has no dependency on `SCRIPT_DEBUG` being false. This means the test can run in an environment where the `.min` suffix is not used.

This change allows for the test to pass in this situation.

See #36392, #51734, #51344

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


git-svn-id: http://core.svn.wordpress.org/trunk@49339 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-14 17:22:05 +00:00
John Blackbourn 48f35e42fc Docs: For clarity, add some information about the return types of `get_option()`.
Props ReneHermi, johannadevos

See #51278

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


git-svn-id: http://core.svn.wordpress.org/trunk@49338 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-14 17:02:05 +00:00
Sergey Biryukov df2644a14a Docs: Add missing descriptions for `_WP_List_Table_Compat` methods.
Props johannadevos, SaeedFard, swissspidy, desrosj, SergeyBiryukov.
Fixes #46842.
Built from https://develop.svn.wordpress.org/trunk@49599


git-svn-id: http://core.svn.wordpress.org/trunk@49337 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-14 16:54:08 +00:00
John Blackbourn 429079a9b2 Docs: Revert an accidental revert of this package name.
See #51414, #50768

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


git-svn-id: http://core.svn.wordpress.org/trunk@49336 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-14 16:40:07 +00:00
John Blackbourn 170ca32007 Docs: Various docblock corrections and improvements.
See #50768

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


git-svn-id: http://core.svn.wordpress.org/trunk@49335 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-14 16:35:06 +00:00
Sergey Biryukov 185607c417 Docs: Add missing descriptions for `Automatic_Upgrader_Skin` methods.
Props johannadevos, dilipbheda.
Fixes #44546.
Built from https://develop.svn.wordpress.org/trunk@49596


git-svn-id: http://core.svn.wordpress.org/trunk@49334 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-14 16:23:10 +00:00
Sergey Biryukov ec051cfb3e Docs: Clarify that `get_pages()` returns an array of pages, not an HTML list.
Props ben.meredith@gmail.com, ovenall, johannadevos.
Fixes #39049. See #51768.
Built from https://develop.svn.wordpress.org/trunk@49595


git-svn-id: http://core.svn.wordpress.org/trunk@49333 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-14 15:01:13 +00:00
John Blackbourn 1260493569 Docs: Correct the Chocolatey package name for Node in the local environment setup instructions.
Props pbearne

See #51414

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


git-svn-id: http://core.svn.wordpress.org/trunk@49332 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-14 10:17:08 +00:00
Andrew Ozz d817ad9b55 Upgrade/Install: Ensure the current user can update core when saving the auto-update options.
See #51742.
Built from https://develop.svn.wordpress.org/trunk@49593


git-svn-id: http://core.svn.wordpress.org/trunk@49331 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-13 16:57:13 +00:00
Sergey Biryukov 0bc22bb1fc Upgrade/Install: Account for the `automatic_updater_disabled` filter in core auto-update settings UI.
Follow-up to [49587].

Props markparnell, audrasjb.
See #51742.
Built from https://develop.svn.wordpress.org/trunk@49592


git-svn-id: http://core.svn.wordpress.org/trunk@49330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-13 11:14:08 +00:00
Sergey Biryukov d6a597efe2 I18N: Remove HTML tags from translatable strings on WordPress Updates screen.
Follow-up to [49587].

Props fierevere.
See #51742.
Built from https://develop.svn.wordpress.org/trunk@49591


git-svn-id: http://core.svn.wordpress.org/trunk@49329 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-13 10:50:08 +00:00
Helen Hou-Sandí 845371edab Post-WordPress 5.6 Beta 4 bump.
Built from https://develop.svn.wordpress.org/trunk@49590


git-svn-id: http://core.svn.wordpress.org/trunk@49328 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 23:45:10 +00:00
Helen Hou-Sandí 81659521ad WordPress 5.6 Beta 4, for real.
Built from https://develop.svn.wordpress.org/trunk@49589


git-svn-id: http://core.svn.wordpress.org/trunk@49327 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 23:08:08 +00:00
Helen Hou-Sandí 16feb07916 WordPress 5.6 Beta 4.
Built from https://develop.svn.wordpress.org/trunk@49588


git-svn-id: http://core.svn.wordpress.org/trunk@49326 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 23:02:09 +00:00
Helen Hou-Sandí 582ca50733 Upgrade/Install: Better UI for auto-update settings on update screen.
This adds clearer messages about what your current settings mean for updates, uses a more compact link-based action instead of a checkbox to change the setting, and respects constants and filters.

Props audrasjb, karmatosed, helen, azaozz, hedgefield, marybaum.
Fixes #51742.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 22:37:10 +00:00
Sergey Biryukov c5257328b7 Customize: Exclude widget ID attributes from search.
Having search terms match the ID attributes leads to confusing results, specifically when the admin interface is set to a language other than English.

Follow-up to [27650].

Props afercia, dlh, noisysocks.
Fixes #46456.
Built from https://develop.svn.wordpress.org/trunk@49586


git-svn-id: http://core.svn.wordpress.org/trunk@49324 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 22:05:09 +00:00
Sergey Biryukov 7baab642c1 Bundled Themes: Add `block-patterns` tag to Twenty Nineteen and Twenty Twenty.
Follow-up to [49347], [49348].

See #51098, #51099.
Built from https://develop.svn.wordpress.org/trunk@49585


git-svn-id: http://core.svn.wordpress.org/trunk@49323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 21:56:12 +00:00
Sergey Biryukov 87fbad7286 Bundled Themes: Introduce block patterns for Twenty Seventeen.
Props melchoyce, kjellr, onemaggie, ryelle, beafialho, bridgetwillard, poena.
Fixes #51100.
Built from https://develop.svn.wordpress.org/trunk@49584


git-svn-id: http://core.svn.wordpress.org/trunk@49322 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 21:22:12 +00:00
Sergey Biryukov b6f30e3009 Bundled Themes: Introduce block patterns for Twenty Sixteen.
Props melchoyce, kjellr, onemaggie, ryelle, beafialho, bridgetwillard, poena, jffng.
Fixes #51101.
Built from https://develop.svn.wordpress.org/trunk@49583


git-svn-id: http://core.svn.wordpress.org/trunk@49321 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 21:14:12 +00:00
Sergey Biryukov f2364f163b Administration: Make sure auto-update counts properly update when bulk deleting plugins or themes.
Props pbiron, noisysocks, desrosj, audrasjb, hellofromTonya.
Fixes #50870.
Built from https://develop.svn.wordpress.org/trunk@49582


git-svn-id: http://core.svn.wordpress.org/trunk@49320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 20:42:10 +00:00
Helen Hou-Sandí d5fd3bd452 Upgrade/Install: Enable all core autoupdates for new installs.
Likely needs more work for multisite installs.

Reference: https://make.wordpress.org/core/2020/11/10/wp5-6-auto-update-implementation-change/

Props audrasjb, azaozz.
See #51743.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49319 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 20:22:09 +00:00
John Blackbourn 9115246f72 General: Convert `wp_array_get()` to a "private" function and add tests.
This function may be promoted in the future if it's deemed useful enough.

Props dd32, jorgefilipecosta, Hareesh Pillai

Fixes #51720

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


git-svn-id: http://core.svn.wordpress.org/trunk@49318 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 20:20:12 +00:00
Sergey Biryukov 1d738052b1 Editor: Update packages.
The following package versions were changed:

@wordpress/block-directory: 1.17.2 -> 1.17.3
@wordpress/block-editor: 5.1.2 -> 5.1.3
@wordpress/block-library: 2.26.2 -> 2.26.3
@wordpress/edit-post: 3.25.2 -> 3.25.3
@wordpress/editor: 9.24.2 -> 9.24.3
@wordpress/format-library: 1.25.2 -> 1.25.3
@wordpress/reusable-blocks: 1.0.2 -> 1.0.3

See https://github.com/WordPress/gutenberg/pull/26874 for the list of fixed bugs.

Props isabel_brison.
Fixes #51696.
Built from https://develop.svn.wordpress.org/trunk@49579


git-svn-id: http://core.svn.wordpress.org/trunk@49317 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 19:36:36 +00:00
desrosj 6703f8efee Twenty Twenty-One: Use consistent casing in strings.
This converts strings using Title Case to sentence case, which is currently preferred for consistency (see discussions on #40244).

Also included is the replacement of an escaped apostrophe with `&#8217;`, which is also preferred per the Internationalization guidelines.

See #51526.
Built from https://develop.svn.wordpress.org/trunk@49578


git-svn-id: http://core.svn.wordpress.org/trunk@49316 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 19:30:11 +00:00
desrosj 5de5b186f3 Twenty Twenty-One: Ignore the `node_modules` folder in SVN.
[49576] mistakenly partially reverted [49250].

See #51526.
Built from https://develop.svn.wordpress.org/trunk@49577


git-svn-id: http://core.svn.wordpress.org/trunk@49315 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 19:07:10 +00:00
desrosj d23292b3c0 Twenty Twenty-One: Ignore `.css.map` files.
These are generated when Sass is compiled, but should never be committed.

See #51526.
Built from https://develop.svn.wordpress.org/trunk@49576


git-svn-id: http://core.svn.wordpress.org/trunk@49314 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 19:00:10 +00:00
desrosj ee888ad547 Twenty Twenty-One: Convert inline ESLint comments to JSHint.
WordPress Core currently uses JSHint instead of ESlint.

See #51526.
Built from https://develop.svn.wordpress.org/trunk@49575


git-svn-id: http://core.svn.wordpress.org/trunk@49313 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 18:48:08 +00:00
desrosj 967d29d83d Twenty Twenty-One: Merge the latest changes changes from GitHub for Beta 4.
In addition to syncing the latest changes, this change also merges the theme’s `.scss` files and other related build tool configurations required to compile the theme’s CSS.

This will allow development of the theme to continue on Trac after 5.6 is released and the GitHub repository is archived.

For a full list of changes since [], see e7d5991...aa284fd.

Props poena, luminuu kjellr, aristath, justinahinon.
See #51526.
Built from https://develop.svn.wordpress.org/trunk@49574


git-svn-id: http://core.svn.wordpress.org/trunk@49312 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 18:36:15 +00:00
TimothyBlynJacobs 5ee48d6915 App Passwords: MOAR accessibility improvements.
Corrects the "Application Name" field's aria-describedby attribute and makes the description visible.

Props alexstine, SergeyBiryukov.
Fixes #51580.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49311 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 18:14:08 +00:00
Sergey Biryukov d772517fcc Database: Clean up the `post_category` column removed from DB schema for new installations in WordPress 2.8.
Its presence may conflict with `WP_Post::__get()`, which should generally fill the non-existent `post_category` property, but is not triggered if the column exists in the database.

Follow-up to [10895].

Props leogermani, davidbaumwald, hellofromTonya.
Fixes #51288.
Built from https://develop.svn.wordpress.org/trunk@49572


git-svn-id: http://core.svn.wordpress.org/trunk@49310 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 17:55:11 +00:00
Sergey Biryukov 250d0660b2 Build/Test Tools: Only enforce PHP extension requirements when running core tests.
This allows other users of the WordPress unit test suite framework to run their own unit tests without needing the GD extension, which should only be a requirement if running core tests.

Follow-up to [49535].

Props jamescollins.
Fixes #50640.
Built from https://develop.svn.wordpress.org/trunk@49571


git-svn-id: http://core.svn.wordpress.org/trunk@49309 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 17:25:13 +00:00
Sergey Biryukov 8e58e38ef9 Build/Tests Tools: Restore [49491], accidentally reverted in [49566].
See #39210.
Built from https://develop.svn.wordpress.org/trunk@49570


git-svn-id: http://core.svn.wordpress.org/trunk@49308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 17:15:08 +00:00
Sergey Biryukov 6ac50d705c Build/Tests Tools: Restore [49535], accidentally reverted in [49566].
See #39210.
Built from https://develop.svn.wordpress.org/trunk@49569


git-svn-id: http://core.svn.wordpress.org/trunk@49307 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 17:08:11 +00:00
antpb 522a7a5d40 Media: Allow users to switch from media grid to list mode in media library.
Fixes issue where media modal would open when switching from grid to list mode.

Props mista-flo, mukesh27.

Fixes #51396.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49306 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 15:46:07 +00:00
antpb 8efbef867c Media: Improve count in Media Library pagination.
Deleting all visible items on the last page of the media library previously left a blank page with no media items available. Using `wp_count_attachements` instead of `found_posts` solves the problem.

Props donsony, karmatosed, desrosj, mista-flo, justinahinon.

Fixes #39968.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49305 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 15:40:09 +00:00
Dominik Schilling abc9d961d5 I18N: Revert [49236] for now to investigate alternative implementations.
See #39210, #51678, #26511.
Built from https://develop.svn.wordpress.org/trunk@49566


git-svn-id: http://core.svn.wordpress.org/trunk@49304 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 14:43:09 +00:00
Sergey Biryukov 4446e597a7 Feeds: Register transient feed cache handler using the recommended method for SimplePie 1.3 or later.
This fixes a "Non-static method cannot be called statically" fatal error when calling `fetch_feed()` on PHP 8.

Follow-up to [21644], [21652], [22366], [22599].

Props dd32, afragen, Senning, markoheijnen, ComputerGuru, useStrict, Ipstenu, nacin, l3rady, HoaSi, NathanAtmoz, fabifott, jfoulquier, thefarlilacfield, subscriptiongroup, rogerlos, Mte90, mopsyd, dossy, stulab, MadtownLems, roikles, justlevine, joostdevalk, OptimizingMatters, hellofromTonya, bph, ayeshrajans, SergeyBiryukov.
Fixes #29204.
Built from https://develop.svn.wordpress.org/trunk@49565


git-svn-id: http://core.svn.wordpress.org/trunk@49303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 14:36:10 +00:00
Sergey Biryukov 9c6f41419c Coding Standards: Pass an empty string instead of `null` as the `$replacement` parameter to `_deprecated_file()`.
Follow-up to [48327].

See #50767.
Built from https://develop.svn.wordpress.org/trunk@49564


git-svn-id: http://core.svn.wordpress.org/trunk@49302 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 11:17:07 +00:00
Peter Wilson 5da8c0fceb Canonical: Prevent ID enumeration of private post slugs.
Add check to `redirect_canonical()` to ensure the destination post is not using a private post status.

Props dd32, Denis-de-Bernardy, donmhico, helen, nacin, peterwilsoncc, pishmishy, TimothyBlynJacobs, tzafrir, Viper007Bond, whyisjake.
Fixes #5272.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49301 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-12 04:16:08 +00:00
Sergey Biryukov 3a1265e188 I18N: Add trailing punctuation to some translator comments.
Follow-up to [49549].

See #51580.
Built from https://develop.svn.wordpress.org/trunk@49562


git-svn-id: http://core.svn.wordpress.org/trunk@49300 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-11 10:41:07 +00:00
Sergey Biryukov 9db9343826 Docs: Clarify `sprintf()` usage for the `before_widget` argument of `register_sidebar()`.
Follow-up to [49203], [49560].

See #19709.
Built from https://develop.svn.wordpress.org/trunk@49561


git-svn-id: http://core.svn.wordpress.org/trunk@49299 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-11 10:39:09 +00:00
Helen Hou-Sandí 19b035f04b Widgets: Do not use wrapping container in the admin.
This is due to the new `before|after_sidebar` args, which are empty by default, but can introduce markup that causes admin JS to stop working.

Also adds documentation for the `sprintf()` on `before_sidebar`.

Props audrasjb, lpointet.
See #19709.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49298 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-10 20:40:09 +00:00
Helen Hou-Sandí 135c75c396 Editor: Display short description from block directory in results.
Props dd32, ryelle.
Fixes #51212.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49297 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-10 20:26:08 +00:00
Sergey Biryukov 1f984603a2 Help/About: Add Site Health Status dashboard widget to the Help → Content tab.
Reorder the items in the help tab to align with their default position on the Dashboard screen.

Follow-up to [47063], [47300].

Props nlpro.
Fixes #51745.
Built from https://develop.svn.wordpress.org/trunk@49558


git-svn-id: http://core.svn.wordpress.org/trunk@49296 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-10 19:05:10 +00:00
Sergey Biryukov e503ee45d6 TinyMCE: Update to 4.9.11.
Changelog:
https://www.tiny.cloud/docs-4x/changelog/#version4911july132020
https://github.com/tinymce/tinymce/blob/4.x/changelog.txt

A full list of changes in this update can be found on GitHub:
https://github.com/tinymce/tinymce/compare/4.9.10...4.9.11

See #51051.
Built from https://develop.svn.wordpress.org/trunk@49557


git-svn-id: http://core.svn.wordpress.org/trunk@49295 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-10 10:44:08 +00:00
Andrew Ozz 16458d8fd2 Tests QUnit: Remove restriction on running the TinyMCE Textpattern WP plugin tests in PhantomJS.
Props @desrosj.
Fixes #42009.
Built from https://develop.svn.wordpress.org/trunk@49556


git-svn-id: http://core.svn.wordpress.org/trunk@49294 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-10 09:18:10 +00:00
antpb 64beb3ee49 Media: Removes duplicate alignment fix for browser uploader.
See #41648

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


git-svn-id: http://core.svn.wordpress.org/trunk@49293 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-09 23:43:07 +00:00
desrosj 964c353504 Tests: Remove duplicate `fields` key in `WP_Query` test.
Introduced in [46188].

See #51344.
Built from https://develop.svn.wordpress.org/trunk@49554


git-svn-id: http://core.svn.wordpress.org/trunk@49292 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-09 23:41:06 +00:00
antpb 4f2e88a574 Media: Adjusts alignment of file name text in browser uploader.
Sets a defined size for text alongside the media browser uploader button fixing alignment on popular browsers.

Props krupajnanda, mikeschroder, aaroncampbell, lucagrandicelli, andraganescu, samful, sabernhardt, andystitt829, kburgoine.
Fixes #41648

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


git-svn-id: http://core.svn.wordpress.org/trunk@49291 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-09 23:34:09 +00:00
Helen Hou-Sandí c57ce00691 Feeds: Don't treat media URLs with fragments as unique for enclosures.
Props archduck, dshanske.
Fixes #47421.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-09 20:28:07 +00:00
desrosj 8562263fd6 Build/Test Tools: Remove PHP >= 5.3 check.
WordPress no longer supports PHP < 5.6.20. This check is no longer necessary.

Fixes #51737.
Built from https://develop.svn.wordpress.org/trunk@49551


git-svn-id: http://core.svn.wordpress.org/trunk@49289 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-09 19:42:06 +00:00
antpb 9901c9a48d Media: Adjust box-sizing for audio players.
Fix cropped container around playhead time in audio player.

Props ravipatel, sabernhardt, audrasjb, SergeyBiryukov, 
Fixes #51685

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


git-svn-id: http://core.svn.wordpress.org/trunk@49288 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-09 19:34:08 +00:00
TimothyBlynJacobs 74969e7fbe App Passwords: Further accessibility improvements.
- Add a label to the readonly password input.
- Handle focus loss after revoking app passwords.
- Handle focus loss after dismissing notices.
- Mark app name as `aria-required`.
- Use `aria-label` for detailed revoke button text instead of `title`.
- Use `-1` for `tabindex` instead of `0`.

Props alexstine, afercia, sabernhardt, audrasjb, joedolson, TimothyBlynJacobs.
Fixes #51580.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49287 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-09 18:05:08 +00:00
desrosj 4040866754 Build/Test Tools: Clean up the new contributor welcome message.
Props ocean90, jeffpaul.
See #50401.
Built from https://develop.svn.wordpress.org/trunk@49548


git-svn-id: http://core.svn.wordpress.org/trunk@49286 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-09 17:31:08 +00:00
Sergey Biryukov 8114076a50 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 [48937], [48939], [48940], [48944].

See #38266.
Built from https://develop.svn.wordpress.org/trunk@49547


git-svn-id: http://core.svn.wordpress.org/trunk@49285 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-09 15:45:08 +00:00
Sergey Biryukov 5b62b44c15 Coding Standards: Use consistent formatting for error messages in `WP_Image_Editor_Imagick::write_image()` and `::strip_meta()`.
See #50767.
Built from https://develop.svn.wordpress.org/trunk@49546


git-svn-id: http://core.svn.wordpress.org/trunk@49284 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-09 15:35:05 +00:00
Sergey Biryukov 3e3328a269 General: Set `svn:eol-style` for some new files in `phpunit/includes`.
Follow-up to [48845], [49037], [49226], [49230].

See #51113.
Built from https://develop.svn.wordpress.org/trunk@49545


git-svn-id: http://core.svn.wordpress.org/trunk@49283 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-09 15:25:08 +00:00
John Blackbourn 34765ddb64 Docs: Docblock corrections relating to `WP_Post` objects.
See #51373, #50768

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


git-svn-id: http://core.svn.wordpress.org/trunk@49282 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-09 15:15:08 +00:00
Sergey Biryukov 847a2e22a0 Tests: Remove empty `export` directory.
Follow-up to [30518], [31253], [34328].

See #51344.
Built from https://develop.svn.wordpress.org/trunk@49543


git-svn-id: http://core.svn.wordpress.org/trunk@49281 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-09 15:11:08 +00:00
John Blackbourn 3688a9394e Media: Restore the ability of `WP_Image_Editor_Imagick->save()` to create a missing directory when needed.
Props eemitch, mikeschroder, hellofromTonya, p00ya, johnbillion

Fixes #51665

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


git-svn-id: http://core.svn.wordpress.org/trunk@49280 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-09 13:18:04 +00:00
Sergey Biryukov 2d8633bf22 I18N: Merge duplicate "Column" strings, remove unnecessary context.
Props ramiy, justinahinon, garrett-eclipse, audrasjb.
Fixes #47259.
Built from https://develop.svn.wordpress.org/trunk@49541


git-svn-id: http://core.svn.wordpress.org/trunk@49279 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-09 11:17:07 +00:00
Sergey Biryukov 2c5607307f Coding Standards: Adjust formatting in `WP_Block::render()` for better readability.
Follow-up to [49310], [49539].

See #51606.
Built from https://develop.svn.wordpress.org/trunk@49540


git-svn-id: http://core.svn.wordpress.org/trunk@49278 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-09 11:01:05 +00:00
Sergey Biryukov a2d42351c5 Text Changes: Unify various "Back to..." vs. "Return to..." vs. "Go to..." strings.
Standardize on "Go to..." as a more appropriate option for most cases.

Props garrett-eclipse, kharisblank, audrasjb, ramiy, valentinbora.
Fixes #47235.
Built from https://develop.svn.wordpress.org/trunk@49539


git-svn-id: http://core.svn.wordpress.org/trunk@49277 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-09 10:53:10 +00:00
Sergey Biryukov 4a18c93f42 Networks and Sites: Assign the array of site or network data returned from filters to the respective class property:
* The array of network data returned from the `networks_pre_query` filter is assigned to the `networks` property of the current `WP_Network_Query` instance.
* The array of site data returned from the `sites_pre_query` filter is assigned to the `sites` property of the current `WP_Site_Query` instance.

This avoids the performance overhead of calling `WP_Network_Query::get_networks()` or `WP_Site_Query::get_sites()` twice: first when creating the object instance, then to retrieve the filtered results.

This also makes the filters a bit more consistent with other similar filters, e.g. `posts_pre_query`, `terms_pre_query`, `comments_pre_query`, or `users_pre_query`.

Follow-up to [46086], [48990].

Props yakimun, spacedmonkey.
Fixes #51333.
Built from https://develop.svn.wordpress.org/trunk@49538


git-svn-id: http://core.svn.wordpress.org/trunk@49276 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-08 11:47:06 +00:00
Sergey Biryukov 5683c46277 Site Health: Validate the test result data format in JS before using it.
This will discard any invalid responses instead of causing fatal errors.

It also makes badges optional, on the same basis as actions are optional. They are expected, but there may be situations where they are not present.

Props Clorith, dogwithblog, kraftbj, whyisjake, SergeyBiryukov.
Fixes #50145.
Built from https://develop.svn.wordpress.org/trunk@49537


git-svn-id: http://core.svn.wordpress.org/trunk@49275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-08 09:52:10 +00:00
Sergey Biryukov c66edd0439 REST API: Use `_n()` in some error messages for proper plural forms support.
Follow-up to [47923], [49053].

Props audrasjb, tobifjellner, TimothyBlynJacobs, SergeyBiryukov.
Fixes #51727.
Built from https://develop.svn.wordpress.org/trunk@49536


git-svn-id: http://core.svn.wordpress.org/trunk@49274 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-07 21:59:11 +00:00
Sergey Biryukov ec9b010cea Build/Test Tools: Check if all the required PHP extensions are loaded before running the test suite.
Add the GD extension as a hard requirement.

This improves the reliability of the test suite and ensures that if the test infrastructure changes in the future and a platform requirement such as GD accidentally gets removed, the tests fail with an appropriate error message.

Follow-up to [48592].

Props ayeshrajans, jrf, johnbillion.
Fixes #50640.
Built from https://develop.svn.wordpress.org/trunk@49535


git-svn-id: http://core.svn.wordpress.org/trunk@49273 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-07 13:20:07 +00:00
TimothyBlynJacobs 2559fb2a8d App Passwords: Bump database version to flush rewrite rules.
Application Passwords introduced a new Rewrite Rule to handle the Authorization header on certain systems. This bumps the database version so the change is applied to sites upon upgrading to 5.6.

Fixes #51723.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49272 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-06 22:15:09 +00:00
Sergey Biryukov af95efdd34 Docs: Add a `@see` reference to `esc_url()` from `esc_url_raw()`.
Follow-up to [49512].

See #50585.
Built from https://develop.svn.wordpress.org/trunk@49513


git-svn-id: http://core.svn.wordpress.org/trunk@49268 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-06 14:16:07 +00:00
Sergey Biryukov 6dd28116a1 Docs: Improve return value description for `esc_url()`.
Add a reference to `esc_url()` from `esc_url_raw()` return value description.

Props stevenlinx, audrasjb, helen.
Fixes #50585.
Built from https://develop.svn.wordpress.org/trunk@49512


git-svn-id: http://core.svn.wordpress.org/trunk@49267 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-06 14:03:06 +00:00
Sergey Biryukov 3f7d705cfe Bundled Themes: Correct list block alignment in editor styles.
Additionally:
* Indent nested lists in list and category blocks.
* Match ordered and unordered indentation for the classic block's lists.

This applies to:
* Twenty Ten
* Twenty Eleven
* Twenty Thirteen
* Twenty Fourteen
* Twenty Fifteen
* Twenty Sixteen
* Twenty Seventeen

Props sabernhardt, amolv, kjellr, audrasjb, francina.
Fixes #51157.
Built from https://develop.svn.wordpress.org/trunk@49511


git-svn-id: http://core.svn.wordpress.org/trunk@49266 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-06 11:53:05 +00:00
Sergey Biryukov a3faece50b Twenty Twenty: Correctly indent nested unordered lists in RTL editor styles.
Props sabernhardt.
Fixes #51574.
Built from https://develop.svn.wordpress.org/trunk@49510


git-svn-id: http://core.svn.wordpress.org/trunk@49265 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-06 11:38:09 +00:00
Sergey Biryukov 42b6ece059 Docs: Fix typo in a comment in `Walker::display_element()`.
Props david.binda, sabernhardt.
Fixes #51713.
Built from https://develop.svn.wordpress.org/trunk@49509


git-svn-id: http://core.svn.wordpress.org/trunk@49264 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-05 18:46:10 +00:00
Sergey Biryukov 3426581eaa Twenty Thirteen: Correct alignment of blocks inside a `full-width` or `wide-width` group block.
Props sabernhardt.
Fixes #51440.
Built from https://develop.svn.wordpress.org/trunk@49508


git-svn-id: http://core.svn.wordpress.org/trunk@49263 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-05 15:05:07 +00:00
Sergey Biryukov eb6b93f327 Twenty Twenty: Correct heading blocks alignment in editor styles.
This explicitly sets top and bottom margins instead of defining all four sides in shorthand notation.

Props sabernhardt, Lumne.
Fixes #51148.
Built from https://develop.svn.wordpress.org/trunk@49507


git-svn-id: http://core.svn.wordpress.org/trunk@49262 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-05 15:02:10 +00:00
Sergey Biryukov ee7ff18b54 Docs: Improve documentation for `WP_Query::is_archive()` per the documentation standards.
Follow-up to [49504].

See #50545.
Built from https://develop.svn.wordpress.org/trunk@49506


git-svn-id: http://core.svn.wordpress.org/trunk@49261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-05 09:44:05 +00:00
Sergey Biryukov f22633f20b Docs: Consistently place `@see` tags after `@since` in `WP_Query` methods, per the documentation standards.
See #50768.
Built from https://develop.svn.wordpress.org/trunk@49505


git-svn-id: http://core.svn.wordpress.org/trunk@49260 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-05 09:42:10 +00:00
Helen Hou-Sandí 1a2bdd7491 Improve documentation for `is_archive()`.
Props stevenlinx.
Fixes #50545.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49259 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-04 17:03:09 +00:00
Sergey Biryukov 87cdca8cd6 Docs: Change the `@since` entry for `template` and `template_lock` post type arguments to `5.0.0`.
These arguments were introduced with the initial block editor, but not documented previously.

Follow-up to [49495].

Props TimothyBlynJacobs.
See #46261.
Built from https://develop.svn.wordpress.org/trunk@49496


git-svn-id: http://core.svn.wordpress.org/trunk@49255 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-04 02:47:05 +00:00
Sergey Biryukov 096323d8a5 Docs: Add documentation for the `template_lock` argument to `register_post_type()`.
Add a `@since` entry for `template` and `template_lock` arguments.

Follow-up to [49041], [49492], [49494].

See #46261.
Built from https://develop.svn.wordpress.org/trunk@49495


git-svn-id: http://core.svn.wordpress.org/trunk@49254 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-04 02:32:08 +00:00
Sergey Biryukov ec60115f2a Docs: Adjust documentation for some `WP_Post_Type` properties:
* Split the summary for `$template` per the documentation standards. The summary should be a single sentence.
* Change the type for `$template_lock` to `string|false`, to clarify that `true` is not supported.
* Fix typo in `$delete_with_user` description, adjust for better readability.

Follow-up to [49041], [49492].

See #46261.
Built from https://develop.svn.wordpress.org/trunk@49494


git-svn-id: http://core.svn.wordpress.org/trunk@49253 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-04 02:30:09 +00:00
Sergey Biryukov 618fb979c6 Docs: Add a reference to `wp_insert_post()` for information on the arguments accepted by `wp_update_post()`.
See #50768.
Built from https://develop.svn.wordpress.org/trunk@49493


git-svn-id: http://core.svn.wordpress.org/trunk@49252 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-04 01:39:06 +00:00
noisysocks 4be65decb7 Editor: Add explicit template and template_lock attributes
Add and document the template and template_lock attributes on WP_Post_Type that
are used by the block editor.

Props metalandcoffee.
See #46261.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49251 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-04 01:05:10 +00:00
desrosj 107f669f15 Build/Test Tools: Disable update attempts while running unit tests.
This fixes an issue introduced in [49369] that causes l10n related tests to fail when the PHPUnit test suite is run multiple times without hints of the site being under version control.

[49369] removed the `.git` folder from the ZIP artifact created during the initial setup job. This ZIP file is used by the later jobs in the workflow that run the test suite. The absence of the `.git` folder in these later jobs caused the language packs initially loaded from `phpunit/data/languages` folder to be updated asynchronously, resulting in unexpected values when running the tests a second time.

This change disables all Core auto-update and asynchronous language pack update attempts when running PHPUnit tests.

Props ocean90, SergeyBiryukov.
See #50401.
Fixes #51670.
Built from https://develop.svn.wordpress.org/trunk@49491


git-svn-id: http://core.svn.wordpress.org/trunk@49250 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-03 21:09:08 +00:00
desrosj 5392af9208 Upgrade/Install: Change the notice displayed after saving auto-update settings to `.notice-success`.
This better conveys the message of the notice and brings consistency with other success notices throughout Core.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49249 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-03 17:55:06 +00:00
John Blackbourn 3cee52b362 Docs: Add more information about how to use filters that run before WordPress initialises.
Fixes #50134

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


git-svn-id: http://core.svn.wordpress.org/trunk@49248 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-03 17:36:09 +00:00
John Blackbourn 238e69d9a6 Tests: Remove some useless assertions from the image editor tests.
In each of these instances the variable being tested is a directly instantiated object and can never be a `WP_Error`, unlike when `wp_get_image_editor()` is used.

See #51344

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


git-svn-id: http://core.svn.wordpress.org/trunk@49247 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-03 15:52:11 +00:00
Sergey Biryukov a940c08357 Docs: Document the `$linkdata` parameter of `wp_insert_link()` using hash notation.
Props stevenlinx, peterwilsoncc.
Fixes #50853.
Built from https://develop.svn.wordpress.org/trunk@49487


git-svn-id: http://core.svn.wordpress.org/trunk@49246 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-03 03:52:10 +00:00
Helen Hou-Sandí 3b64a19eeb Post-WordPress 5.6 Beta 3 version bump.
Built from https://develop.svn.wordpress.org/trunk@49486


git-svn-id: http://core.svn.wordpress.org/trunk@49245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-02 21:22:04 +00:00
Helen Hou-Sandí 2f6286db83 WordPress 5.6 Beta 3.
Built from https://develop.svn.wordpress.org/trunk@49485


git-svn-id: http://core.svn.wordpress.org/trunk@49244 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-02 20:59:07 +00:00
Sergey Biryukov 1543954adc Docs: Update description for the `$context` parameter of `sanitize_title()` and `sanitize_title_with_dashes()`.
This brings some consistency between the two DocBlocks and adjusts the latter one per the documentation standards.

Follow-up to [49482].

See #50569.
Built from https://develop.svn.wordpress.org/trunk@49484


git-svn-id: http://core.svn.wordpress.org/trunk@49243 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-02 20:20:07 +00:00
Helen Hou-Sandí a3581edd84 Upgrade/Install: Update help tab text to include major WordPress updates.
Props audrasjb.
Fixes #51653.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49242 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-02 20:16:06 +00:00
Helen Hou-Sandí f2875b6f7c Formatting: Update docs for `$context` in `sanitize_title_with_dashes()`.
Props stevenlinx, audrasjb.
Fixes #50569.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49241 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-02 20:12:06 +00:00
desrosj 6a39c891b2 Customize: Ensure menu items expand horizontally on large screens.
Props clorith, garrett-eclipse.
Fixes #51647.
Built from https://develop.svn.wordpress.org/trunk@49481


git-svn-id: http://core.svn.wordpress.org/trunk@49240 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-02 20:07:05 +00:00
Helen Hou-Sandí da4b76c6b3 Site Health: Site errors are for *this* site, not necessarily *your* site.
Props techboyg5, Clorith, audrasjb.
Fixes #51524.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49239 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-02 19:55:07 +00:00
Helen Hou-Sandí be95ec2c27 About: Optimize freedoms sprite and add 2 column layout.
Props garrett-eclipse, ryelle.
Fixes #46363.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49238 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-02 19:46:14 +00:00
desrosj e0669ddaae Bundled Themes: Sync Twenty Twenty-One with the latest changes from GitHub.
For a full list of changes since [49330], see 5759e96...e7d5991.

Props poena, luminuu, ryelle, kjellr, aristath, justinahinon, felipeelia, joostdevalk.
See #51526.
Built from https://develop.svn.wordpress.org/trunk@49478


git-svn-id: http://core.svn.wordpress.org/trunk@49237 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-02 19:45:07 +00:00
desrosj e3a467a55a Upgrade/Install: Prevent removal of additional data from plugin update info.
This switches to using `wp_parse_args()` instead of a combination of `array_merge()` and `array_intersect_key()` when ensuring that all expected default keys are present in the update information for a plugin.

This prevents non-default data returned by 3rd-party plugins from being unintentionally stripped out.

Props peterwilsoncc, chriscct7.
Fixes #51609.
Built from https://develop.svn.wordpress.org/trunk@49477


git-svn-id: http://core.svn.wordpress.org/trunk@49236 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-02 19:13:07 +00:00
Helen Hou-Sandí 409bd27659 Remove accidentally duplicated code introduced in [49475].
See #46536.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49235 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-02 19:09:09 +00:00
Helen Hou-Sandí 340c834fa3 Privacy: More precise checking of user request action names.
Props garrett-eclipse.
Fixes #46536.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49234 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-02 18:42:04 +00:00
Helen Hou-Sandí cc74786052 General: Make some inline comments more descriptive.
Props jorbin.
Fixes #51683.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49233 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-02 18:04:07 +00:00
noisysocks cfa1fb8c83 Editor: Update packages
@wordpress/block-directory@1.17.2
@wordpress/block-editor@5.1.2
@wordpress/block-library@2.26.2
@wordpress/edit-post@3.25.2
@wordpress/editor@9.24.2
@wordpress/format-library@1.25.2
@wordpress/reusable-blocks@1.0.2

Props isabel_brison.
See #51696.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49232 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-02 04:56:37 +00:00
Sergey Biryukov f39fc10544 Docs: Use a consistent plural form of "status".
Props Collizo4sky, Presskopp, davidbaumwald.
Fixes #51690.
Built from https://develop.svn.wordpress.org/trunk@49472


git-svn-id: http://core.svn.wordpress.org/trunk@49231 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-02 01:38:07 +00:00
Sergey Biryukov 89ce61835d Upgrade/Install: Switch "Check again" link on WordPress Updates screen to sentence case.
This brings some consistency with other text links on the screen, e.g. "View version details" for plugins or themes.

Follow-up to [49150].

Props afercia.
See #51523.
Built from https://develop.svn.wordpress.org/trunk@49471


git-svn-id: http://core.svn.wordpress.org/trunk@49230 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-11-02 01:17:09 +00:00
Sergey Biryukov 7941c32ad3 Twenty Sixteen: Ensure the `<nav>` elements in widgets do not affect bottom margin.
Follow-up to [49208].

Props sabernhardt.
Fixes #51445.
Built from https://develop.svn.wordpress.org/trunk@49470


git-svn-id: http://core.svn.wordpress.org/trunk@49229 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-31 02:56:05 +00:00
Sergey Biryukov 4091f41a07 Twenty Fifteen: Ensure the `<nav>` elements in widgets do not affect bottom margin.
Follow-up to [49208].

Props sabernhardt.
See #51445.
Built from https://develop.svn.wordpress.org/trunk@49469


git-svn-id: http://core.svn.wordpress.org/trunk@49228 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-31 02:54:11 +00:00
whyisjake 4b91d4e523 Upgrade/Install: During the install process, add additional checking for exising tables.
If reinstalling WordPress, there is a condition where tables would exist in the database. Ensures that when that is the case, the install process can carry along without issue.

Fixes #51676.

Props xknown, garubi, mukesh27, desrosj, johnbillion, metalandcoffee, davidbaumwald, whyisjake.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49211 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-30 17:52:07 +00:00
Peter Wilson c8d5bc3c50 Taxonomy: Revert Light-weight/partial term counts.
Partial revert of [49141], [49171], [49316].

All functional changes are removed, appropriate term counting unit tests are retained.

See #40351.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49210 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-30 04:59:08 +00:00
Sergey Biryukov 812826a231 Tests: Remove the `GLOB_BRACE` flag for `glob()` function from unit tests.
The flag was previously used in PDF preview tests when cleaning up temporary files.

As noted in the PHP documentation, the flag is not available on some non-GNU systems, like Solaris or Alpine Linux.

Follow-up to [40130].

Props amykamala, sawanoboly.
Fixes #51661.
Built from https://develop.svn.wordpress.org/trunk@49450


git-svn-id: http://core.svn.wordpress.org/trunk@49209 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-30 02:03:07 +00:00
Adam Silverstein 25918dd10b Users: Password generation - restore "Cancel" aria label after r49248.
Restore the "Cancel" button aria label to "Cancel password change" after it was inadvertently changed in r49248.

Props SergeyBiryukov.
Fixes #42852.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49151 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-29 18:43:06 +00:00
Adam Silverstein b8d1d01cc5 REST API: JS Client - improve collection route construction for empty parents.
Fix an issue where the constructed path for hierarchical collections could contain a double slash ("//") when items contained empty parents, causing an error.

Props nicomollet.
Fixes #44745.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49149 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-29 18:32:05 +00:00
desrosj 9c5173ffa6 Themes: Ensure that only privileged users can set a background image when a theme is using the deprecated custom background page.
Props xknown, zieladam, peterwilsoncc, whyisjake.
Merges [49379] to trunk.
Built from https://develop.svn.wordpress.org/trunk@49388


git-svn-id: http://core.svn.wordpress.org/trunk@49147 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-29 18:09:13 +00:00
desrosj 84a7bde414 Meta: Sanitize meta key before checking protection status.
Props zieladam, peterwilsoncc, xknown, whyisjake.
Merges [49377,49381] to trunk.
Built from https://develop.svn.wordpress.org/trunk@49387


git-svn-id: http://core.svn.wordpress.org/trunk@49146 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-29 18:08:06 +00:00
desrosj a8e86c768c Upgrade/install: Improve logic check when determining installation status.
Improve handling of ambiguous return values to determine if a blog is installed.

Props zieladam, xknown.
Merges [49377] to trunk.
Built from https://develop.svn.wordpress.org/trunk@49386


git-svn-id: http://core.svn.wordpress.org/trunk@49145 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-29 18:06:13 +00:00
desrosj d3ec258f91 XML-RPC: Return error message if attachment ID is incorrect.
Throw an error for incorrect attachment IDs when requesting a media object to ensure return signature is correct and doesn't include incorrectly typed values within the object.

Props zieladam, peterwilsoncc, whyisjake.
Merges [49376] to trunk.
See #49905.
Built from https://develop.svn.wordpress.org/trunk@49385


git-svn-id: http://core.svn.wordpress.org/trunk@49144 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-29 18:05:06 +00:00
desrosj 1050613168 Coding standards: Modify escaping functions to avoid potential false positives.
Props xknown, zieladam, peterwilsoncc.
Merges [49375] to trunk.
Built from https://develop.svn.wordpress.org/trunk@49384


git-svn-id: http://core.svn.wordpress.org/trunk@49143 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-29 18:03:11 +00:00
desrosj 025f5a62a2 Embeds: Disable embeds on deactivated Multisite sites.
Props xknown, whyisjake, zieladam, peterwilsoncc.
Merges [49374] to trunk.
Built from https://develop.svn.wordpress.org/trunk@49383


git-svn-id: http://core.svn.wordpress.org/trunk@49142 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-29 18:02:05 +00:00
desrosj cad4a1a3d7 External Libraries: Disable deserialization in Requests_Utility_FilteredIterator
Props xknown, peterwilsoncc, desrosj, dd32, whyisjake.
Merges [49373] to trunk.
Built from https://develop.svn.wordpress.org/trunk@49382


git-svn-id: http://core.svn.wordpress.org/trunk@49141 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-29 18:00:08 +00:00
desrosj fcc970a1cf XML-RPC: Improve error messages for unprivileged users.
Add specific permission checks to avoid ambiguous failure messages.

Props zieladam, peterwilsoncc, xknown, whyisjake.
Built from https://develop.svn.wordpress.org/trunk@49380


git-svn-id: http://core.svn.wordpress.org/trunk@49139 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-29 17:44:07 +00:00
desrosj 019d838b6c Build/Test Tools: Avoid logging the same debug info twice in the PHPUnit workflow.
Also includes some inline documentation fixes for workflow files.

See #50401.
Built from https://develop.svn.wordpress.org/trunk@49371


git-svn-id: http://core.svn.wordpress.org/trunk@49130 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-29 01:48:04 +00:00
Sergey Biryukov a9a1146a71 REST API: Remove accidentally duplicated key in test fixtures.
Follow-up to [49334], [49368].

See #51638.
Built from https://develop.svn.wordpress.org/trunk@49370


git-svn-id: http://core.svn.wordpress.org/trunk@49129 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-29 01:34:05 +00:00
desrosj 813fb756ae Build/Test Tools: Use `install-changed` to install NPM dependencies in GitHub Action workflows.
The `install-changed` package records a hash of the `package.json` file locally in a text file and only runs `npm install` when there are changes to account for. 

This builds on [47497], which only hashes the `package.json` file after a Grunt task is called. By using `npx install-changed` within the workflow files, the package is hashed before the first Grunt task is run.

Props ocean90.
See #50401, #49594.
Built from https://develop.svn.wordpress.org/trunk@49369


git-svn-id: http://core.svn.wordpress.org/trunk@49128 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-29 01:22:04 +00:00
Sergey Biryukov 36dcf727f4 REST API: Regenerate test fixtures after [49334].
Props garrett-eclipse.
Fixes #51638.
Built from https://develop.svn.wordpress.org/trunk@49368


git-svn-id: http://core.svn.wordpress.org/trunk@49127 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-29 01:02:06 +00:00
Sergey Biryukov bb0b36a905 Themes: Clarify the `_doing_it_wrong()` message for post formats in `add_theme_support()`.
Follow-up to [49344], [49354], [49365].

See #51390.
Built from https://develop.svn.wordpress.org/trunk@49367


git-svn-id: http://core.svn.wordpress.org/trunk@49126 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-29 00:08:06 +00:00
Sergey Biryukov 99e83a11d0 Tests: Correct post formats registration in `WP_REST_Search_Controller` tests.
When declaring theme support for the `post-formats` feature, an array of supported post formats needs to be specified.

Follow-up to [49344], [49354].

Props garrett-eclipse.
Fixes #51390.
Built from https://develop.svn.wordpress.org/trunk@49365


git-svn-id: http://core.svn.wordpress.org/trunk@49125 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-29 00:03:05 +00:00
desrosj 9b8fe28242 Build/Test Tools: Allow the desired version of PHPUnit to be passed to the local Docker environment.
This reintroduces [49358] with a modification to the `.travis.yml` file to avoid an issue with `dotenv-expand` being unable to expand variables into `process.env` only on Travis.

The `LOCAL_PHPUNIT` environment variabl allows the desired version of PHPUnit to be specified when running the PHP tests within the local Docker environment.

Because support for newer versions of PHPUnit is not backported, some versions of PHP need the ability to run multiple versions of PHPUnit for different branches. This adds the flexibility needed to use the Docker environment within those older branches to run the PHP tests.

Props johnbillion, SergeyBiryukov.
See #50042.
Built from https://develop.svn.wordpress.org/trunk@49362


git-svn-id: http://core.svn.wordpress.org/trunk@49122 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-28 23:17:23 +00:00
desrosj 76f6f20d41 Build/Test Tools: Revert [49358] to investigate failures.
Unprops desrosj.
See #50042.
Built from https://develop.svn.wordpress.org/trunk@49360


git-svn-id: http://core.svn.wordpress.org/trunk@49120 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-28 19:44:21 +00:00
whyisjake dbae445997 Embeds: Remove Facebook and Instagram as an oEmbed Source
Facebook has depracated all non-authenticated endpoints for Facebook and Instagram. 

See: https://developers.facebook.com/docs/plugins/oembed-legacy
See also: https://make.wordpress.org/core/2020/09/22/facebook-and-instagram-embeds-to-be-deprecated-october-24th/

With this change, endpoints are being removed. If a site is dependent on this feature, they need to pass either an app or client token. There are a few plugins that add this functionality.

Fixes #50861.
Props johnbillion, joyously, mkaz, dimadin, ayeshrajans, davisshaver, paaljoachim, Clorith, bridgetwillard, jb510, sippis, Clorith, TimothyBlynJacobs, desrosj, smub, audrasjb, whyisjake.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49119 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-28 19:11:06 +00:00
desrosj 41d5f153c5 Build/Test Tools: Allow the desired version of PHPUnit to be passed to the local Docker environment.
This change introduces the `LOCAL_PHPUNIT` environment variable that allows the desired version of PHPUnit to be specified when running the PHP tests within the local Docker environment.

Because support for newer versions of PHPUnit is not backported, some versions of PHP need the ability to run multiple versions of PHPUnit for different branches. This adds the flexibility needed to use the Docker environment within those older branches to run the PHP tests.

Props johnbillion.
Fixes #50042.
Built from https://develop.svn.wordpress.org/trunk@49358


git-svn-id: http://core.svn.wordpress.org/trunk@49118 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-28 19:03:25 +00:00
John Blackbourn 1aafbf6c6f Cron API: Improve the inline documentation for the args passed to the cron event scheduling functions.
Props chadreitsma, peterwilsoncc

Fixes #51605

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


git-svn-id: http://core.svn.wordpress.org/trunk@49117 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-28 18:37:07 +00:00
Sergey Biryukov e569358678 General: Ensure that filtered arguments in `get_search_form()` contain all required default values.
Props kellybleck, davidbaumwald, whyisjake, SergeyBiryukov.
Fixes #51645.
Built from https://develop.svn.wordpress.org/trunk@49355


git-svn-id: http://core.svn.wordpress.org/trunk@49115 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-28 16:57:08 +00:00
Sergey Biryukov d0268b2b69 Themes: Move the test for `post-formats` theme support to a more appropriate place.
Follow-up to [49344].

See #51390.
Built from https://develop.svn.wordpress.org/trunk@49354


git-svn-id: http://core.svn.wordpress.org/trunk@49114 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-28 15:14:10 +00:00
Sergey Biryukov e37d1acc1c Customize: Update parameter name in `api.Class.extend()`.
This makes the name consistent with the documentation and the `inherits()` function signature.

Props ribaricplusplus, davidbaumwald.
Fixes #51652.
Built from https://develop.svn.wordpress.org/trunk@49353


git-svn-id: http://core.svn.wordpress.org/trunk@49113 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-28 00:45:06 +00:00
Helen Hou-Sandí a33d6305d1 Twenty Twenty: Correct some textdomains in block patterns.
Props justinahinon.
Fixes #51648. See #51098.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49112 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 22:14:05 +00:00
Helen Hou-Sandí 4ca6722c41 Post WordPress 5.6 beta 2 version bump.
Built from https://develop.svn.wordpress.org/trunk@49351


git-svn-id: http://core.svn.wordpress.org/trunk@49111 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 22:02:08 +00:00
Helen Hou-Sandí 21f3cc781e WordPress 5.6 Beta 2.
Built from https://develop.svn.wordpress.org/trunk@49350


git-svn-id: http://core.svn.wordpress.org/trunk@49110 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 21:42:07 +00:00
Helen Hou-Sandí 14558efa83 PHPCS fixes after [49347].
See #51098.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49109 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 21:23:07 +00:00
Helen Hou-Sandí bf02276a17 Bundled Themes: Introduce block patterns for Twenty Nineteen.
Including some props I missed on the commit for Twenty Twenty, I am sorry.

Props: kjellr, beafialho, melchoyce, ryelle, jffng, bridgetwillard.
Fixes #51099.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49108 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 21:15:12 +00:00
Helen Hou-Sandí 6d3300b437 Bundled Themes: Introduce block patterns for Twenty Twenty.
Props melchoyce, Anlino, kjellr, ryelle.
Fixes #51098.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49107 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 21:01:07 +00:00
Helen Hou-Sandí 9241624e6c Menus: Better responsive display for accordion items.
This only applies to the standalone menu screen; fixes for the customizer will be handled separately.

Props audrasjb, garrett-eclipse.
See #49375.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49106 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 20:18:06 +00:00
Sergey Biryukov a6db16fad0 Upgrade/Install: Adjust a string in `core_auto_updates_settings()` for consistency.
Props audrasjb, desrosj.
See #50907.
Built from https://develop.svn.wordpress.org/trunk@49345


git-svn-id: http://core.svn.wordpress.org/trunk@49105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 20:12:06 +00:00
Helen Hou-Sandí 3fc623c202 Post Formats: You have to pass an array of supported post formats.
This shows a `_doing_it_wrong()` message and also returns false instead of true if no array of formats is passed in `add_theme_support()`, avoiding a PHP error.

Post formats maintainership comes full circle. 🙃

Props Mista-Flo, sproutchris, garrett-eclipse.
Fixes #51390.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49104 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 20:00:06 +00:00
Helen Hou-Sandí 7636806a52 Media: Fix styling for MediaElement player in media modal.
Fixes #43640.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49103 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 19:40:04 +00:00
Helen Hou-Sandí cbc1404589 External Libraries: Update jQuery Migrate to 3.3.2-pre.
This is a prerelease version to avoid some errors in 5.6 beta 2. We need to be sure that we ship with a released version by 5.6 RC.

Props mweichert.
Fixes #51621. See #50564.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49099 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 18:59:08 +00:00
Helen Hou-Sandí 85e954aa37 Login: Avoid AJAX error on login screen.
This has to do with the password generator, which does not need to generate and cache passwords in JS as that's already done in PHP.

Props adamsilverstein, sarahricker.
Fixes #51613.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49098 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 18:43:07 +00:00
Sergey Biryukov 769b29f962 Build/Test Tools: Add `Authorization` headers support to `local-env`.
This ensures that basic authorization is passed from nginx to PHP.

Props Clorith.
Fixes #51646.
Built from https://develop.svn.wordpress.org/trunk@49336


git-svn-id: http://core.svn.wordpress.org/trunk@49097 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 18:35:12 +00:00
desrosj 1dcdd946c6 Build/Test Tools: Specify a type when using `wp config set`.
This prevents an error if constants are not predefined when running the Docker install script while using older combinations of WordPress/PHP/WP-CLI.

See #48301.
Built from https://develop.svn.wordpress.org/trunk@49335


git-svn-id: http://core.svn.wordpress.org/trunk@49096 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 18:34:06 +00:00
TimothyBlynJacobs 2df94804d4 Site Health, App Passwords: Test if the Authorization header is populated correctly.
App Passwords rely on the Authorization header to transport the Basic Auth credentials. For Apache web servers, WordPress automatically includes a RewriteRule to populate the value for servers running in CGI or FastCGI that wouldn't ordinarily populate the value. 

This tests if the header is being filled with the expected values. For Apache users, we direct the user to visit the Permalinks settings to flush their permalinks. For all other users, we direct them to a help document on developer.wordpress.org.

Props Clorith, marybaum, TimothyBlynJacobs.
Fixes #51638.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 18:32:07 +00:00
Helen Hou-Sandí 219079f7a3 Privacy: Show failures before successes for all bulk actions.
Props garrett-eclipse.
See #44081, [49331].

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


git-svn-id: http://core.svn.wordpress.org/trunk@49094 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 18:19:06 +00:00
Helen Hou-Sandí f4f72498c0 Privacy: Show notices for both failed and successful bulk actions.
Props javorszky, garrett-eclipse, hellofromTonya.
Fixes #44081.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 17:47:08 +00:00
desrosj 24f6f56a71 Twenty Twenty-One: Import the latest changes.
For a full list of changes since [49320], see 461dcf9cd...5759e96.

Props poena, melchoyce, aristath, justinahinon, ryelle.
See #51526.
Built from https://develop.svn.wordpress.org/trunk@49330


git-svn-id: http://core.svn.wordpress.org/trunk@49091 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 17:07:05 +00:00
TimothyBlynJacobs 5df8bf60aa REST API: Support a broader range of JSON media types.
Previously, we only supported `application/json` which prevented using subtypes like `application/activity+json`. This allows for the REST API to `json_decode` the body of requests using a JSON subtype `Content-Type`. Additionally, `wp_die()` now properly sends the error as JSON when a JSON subtype is specified in the `Accept` header.

Props pfefferle.
Fixes #49404.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49090 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 16:44:06 +00:00
Sergey Biryukov 72cff29cb6 Posts, Post Types: Check if taxonomy is set for the `tax_input` parameter of `wp_insert_post()`.
This avoids a PHP notice when creating a post with multiple taxonomies both having a default term.

Props yakimun, szaqal21, hareesh-pillai, audrasjb.
Fixes #51320.
Built from https://develop.svn.wordpress.org/trunk@49328


git-svn-id: http://core.svn.wordpress.org/trunk@49089 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 16:42:05 +00:00
Sergey Biryukov 0a4f041f2a Tests: Rename some files and classes in `phpunit/tests/post/` per the naming conventions.
https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#naming-and-organization

Follow-up to [47780].

See #51344.
Built from https://develop.svn.wordpress.org/trunk@49327


git-svn-id: http://core.svn.wordpress.org/trunk@49088 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 16:09:07 +00:00
Sergey Biryukov 919f1cf461 Docs: Fix typo in `{$old_status}_to_{$new_status}` hook description.
See #50768.
Built from https://develop.svn.wordpress.org/trunk@49326


git-svn-id: http://core.svn.wordpress.org/trunk@49087 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 15:42:09 +00:00
Andrew Ozz 7c32cbf990 Revert the improvenents to arranging of postboxes/metaboxes, [49179]. The current patch fixes about half a dozen problems, but seems more general improvements are needed to how Screen Options work.
See #50699.
Built from https://develop.svn.wordpress.org/trunk@49325


git-svn-id: http://core.svn.wordpress.org/trunk@49086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 10:47:12 +00:00
youknowriad 3c554f366d Block Editor: Update the WordPress packages for 5.6 beta 2
It contains:

- Fix drop zone indicators for non blocks.
- Fix archives block render function.
- Code block: preserve indentation on paste.
- Turn off autocomplete for token input. 
- Fix parent post selector: ensure initial value available, search performed, all results shown. 
- Fix gallery block undo issue.

Props isabel_brison.
Fixes #51640.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 09:34:46 +00:00
Sergey Biryukov 18ee84c5c2 Customize: Ensure the New Menu section is properly rendered.
Follow-up to [30102], [49101].

Props david.binda, boldgrid, dlh, azaozz, Clorith, westonruter, hellofromTonya.
Fixes #51592.
Built from https://develop.svn.wordpress.org/trunk@49323


git-svn-id: http://core.svn.wordpress.org/trunk@49084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 02:48:06 +00:00
Sergey Biryukov 6275885400 Bundled Themes: Update latest version for `Tested up to:` in `readme.txt` files.
Props mukesh27.
Fixes #51501.
Built from https://develop.svn.wordpress.org/trunk@49322


git-svn-id: http://core.svn.wordpress.org/trunk@49083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 02:18:05 +00:00
Sergey Biryukov 0fb5ccd4d0 Docs: Add a `@global` tag for `$user_id` in `WP_Application_Passwords_List_Table::prepare_items()`.
Props mukesh27.
Fixes #51633.
Built from https://develop.svn.wordpress.org/trunk@49321


git-svn-id: http://core.svn.wordpress.org/trunk@49082 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 02:12:06 +00:00
desrosj 87b6c253b5 Twenty Twenty-One: Import the latest changes for 5.6 beta 2.
For a full list of changes since beta 1, see 9e34dca...e580895.

Props poena, melchoyce, luminuu, aristath, justinahinon, jffng, ryelle, kishanjasani, rolfsiebers.
See #51526.
Built from https://develop.svn.wordpress.org/trunk@49320


git-svn-id: http://core.svn.wordpress.org/trunk@49081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-27 02:00:07 +00:00
Helen Hou-Sandí 8b3071bc1a Administration: Accommodate long translations for "Posts" in list table headers.
This stems from longer translations on the User table, but this will apply to any posts column in a list table. Hyphenation should typically just apply to the column header, as the cell contents are just a count.

This does appear to have some browser inconsistencies, so may need further adjustment in the future.

Props audrasjb, justinahinon.
Fixes #50838.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-26 23:16:05 +00:00
Peter Wilson 6c92704e10 Taxonomy: Fix values passed to actions in `wp_modify_term_count_by_now()`.
Replace the `WP_Taxonomy` object with the taxonomy slug in the values passed to the actions `edit_term_taxonomy` and `edited_term_taxonomy` within `wp_modify_term_count_by_now()`.

Follow up to [49141], [49171].
Props Chouby, lcyh78.
Fixes #40351.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-26 23:07:06 +00:00
Sergey Biryukov 1ce2f12eaf Docs: Correct description for `wp_pre_insert_user_data` filter.
Props audrasjb.
Fixes #51637.
Built from https://develop.svn.wordpress.org/trunk@49314


git-svn-id: http://core.svn.wordpress.org/trunk@49076 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-26 22:53:06 +00:00
Sergey Biryukov cc7ba27c37 Docs: Correct DocBlock formatting for `render_block()`.
Follow-up to [49310].

See #51606.
Built from https://develop.svn.wordpress.org/trunk@49312


git-svn-id: http://core.svn.wordpress.org/trunk@49074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-26 21:55:10 +00:00
Sergey Biryukov 483b75e682 Docs: Add missing `@since` tags for properties in some block editor classes:
* `WP_Block_Pattern_Categories_Registry`
* `WP_Block_Patterns_Registry`
* `WP_Block_Supports`

Follow-up to [48156], [49226].

See #50768.
Built from https://develop.svn.wordpress.org/trunk@49311


git-svn-id: http://core.svn.wordpress.org/trunk@49073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-26 21:51:08 +00:00
youknowriad bf5917edf3 Block Editor: Fix WP_Block_Supports class compatibility with Gutenberg-provided class.
When using WordPress trunk with Gutenberg master, there's an incompatibility causing 
the dynamic block generated classes to be omitted.
This commit refactors the block supports to fix that problem.

Props nosolosw.
Fixes #51606.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-26 08:31:11 +00:00
Sergey Biryukov 4bb4107f50 General: Use correct value for the `speak` property in various CSS files.
Follow-up to [49263].

Props hareesh-pillai.
Fixes #51622.
Built from https://develop.svn.wordpress.org/trunk@49309


git-svn-id: http://core.svn.wordpress.org/trunk@49071 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-26 02:25:09 +00:00
TimothyBlynJacobs 367c97df67 REST API: Prevent PHP warning when metadata schema is missing properties.
This switches to the new `rest_default_additional_properties_to_false()` function which doesn't have this issue and deprecates the `WP_REST_Meta_Fields::default_additional_properties_to_false()` method.

Props austin880625.
Fixes #51389.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-25 20:30:08 +00:00
TimothyBlynJacobs 5f5457dff2 Build Tools: Fix running installing composer dependencies using composer 2.0.
This updates the `dealerdirect/phpcodesniffer-composer-installer` package to allow installing version `0.7.0` which supports composer 2.0.

Props itowhid06, jrf.
Fixes #51624.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49068 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-25 01:14:07 +00:00
Sergey Biryukov 7b2c3a006e Tests: Correct newly introduced `@covers` tags.
When global functions are covered, they need to be prefixed with `::` (double colon) to distinguish them from class name.

See https://phpunit.readthedocs.io/en/7.0/annotations.html#covers for more details.

Follow-up to [49000], [49171].

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


git-svn-id: http://core.svn.wordpress.org/trunk@49067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-25 00:33:04 +00:00
Sergey Biryukov 5770b676b0 Docs: Correct an example in `wp_kses_normalize_entities()` description.
Props ediamin.
Fixes #51620.
Built from https://develop.svn.wordpress.org/trunk@49304


git-svn-id: http://core.svn.wordpress.org/trunk@49066 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-25 00:14:05 +00:00
TimothyBlynJacobs 19c72d58e7 REST API, XML-RPC: Synchronise empty comment content checks.
The REST API and XML-RPC now uses the same detection methodology for empty comment content as `wp_handle_comment_submission()`. Specifically, comments now have their content trimmed and '0' is allowed.

Props jaswrks, rmccue, dd32, rachelbaker, Cawa-93, aduth, TimothyBlynJacobs.
Fixes #43177.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-24 22:46:09 +00:00
TimothyBlynJacobs 36c4c943ba REST API: Don't validate status if it hasn't changed.
In particular, this allows for sending `status=inherit` to an attachment if it's current status is `inherit`. This status would be rejected because it is an "internal" post status which isn't exposed.

As a general rule, a developer should always be able to PUT back a GET response without error.

Props dfenton, pputzer, TimothyBlynJacobs.
Fixes #40399.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49064 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-24 16:04:05 +00:00
TimothyBlynJacobs abbc108d19 REST API: Make template handling resilient against plugins setting the global post.
Plugins shouldn't be setting the global post object during a REST API request, but if they did this could cause unexpected errors when creating a post with a template.

Props Kipperlenny, TimothyBlynJacobs.
Fixes #49695.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49063 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-24 14:12:05 +00:00
TimothyBlynJacobs 3a01517c90 REST API: Reuse `namespace` property instead of the undeclared `rest_namespace`.
Props itowhid06.
Fixes #48297.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49062 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-24 13:54:06 +00:00
TimothyBlynJacobs 9baba12f00 REST API: Support generating comment up links to custom posts controllers.
The comments controller now uses the `rest_get_route_for_post` function introduced in WordPress 5.5 to generate the link. This function is filterable to allow for custom controllers to properly define their REST API route.

Props dsifford, TimothyBlynJacobs.
Fixes #44152.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-24 13:20:07 +00:00
Sergey Biryukov 4d695ba6b3 Coding Standards: Remove unused `$current_role` variable from Add New User form.
Follow-up to [9614], [28296].

Props ravipatel.
Fixes #51619.
Built from https://develop.svn.wordpress.org/trunk@49298


git-svn-id: http://core.svn.wordpress.org/trunk@49060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-24 12:49:05 +00:00
Sergey Biryukov 10091823f1 Coding Standards: Use consistent formatting for `<div class="wrap">` sections in `wp-admin/update-core.php`.
Follow-up to [28500], [28530].

Props ravipatel.
Fixes #51618.
Built from https://develop.svn.wordpress.org/trunk@49297


git-svn-id: http://core.svn.wordpress.org/trunk@49059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-24 12:33:07 +00:00
TimothyBlynJacobs 4aca25b296 REST API: Regenerate wp-api-generated.js after [49276].
See #51583.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49058 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-24 04:29:10 +00:00
TimothyBlynJacobs 2d5d7a2aaa REST API: Deprecate `WP_REST_Meta_Fields::register_field()`.
This method never worked properly and cannot be fixed due to incompatible method signatures.

Props flixos90, kadamwhite, jnylen0, TimothyBlynJacobs.
Fixes #39959.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-24 04:27:09 +00:00
TimothyBlynJacobs f6d39d1c51 App Passwords: Improve accessibility.
- Make form inputs stacked instead of inline.
- Provide a visible label for the app name.
- Add screen reader text to dismiss button.
- Make "Revoke" button label more descriptive.
- Use aria-disabled instead of disabled to avoid focus loss.
- Display password in a readonly input to assist copy and paste.
- Remove large sections of italic text.
- Use `.form-wrap` and `.form-field` to give consistent form styling.
- Improve labeling and placeholder text.

Props alexstine, georgestephanis, afercia, TimothyBlynJacobs.
Fixes #51580.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-24 03:34:06 +00:00
Sergey Biryukov d195b0dfbb Docs: Add missing duplicate hook references for `allow_(dev|minor|major)_auto_core_updates` filters.
Follow-up to [49254].

See #50907.
Built from https://develop.svn.wordpress.org/trunk@49293


git-svn-id: http://core.svn.wordpress.org/trunk@49055 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-24 00:31:05 +00:00
Sergey Biryukov bb63c1cbd9 Upgrade/Install: Account for new `WP_AUTO_UPDATE_CORE` values in auto-updates settings form.
This updates `core_auto_updates_settings()` to account for the new `beta` and `rc` values for the `WP_AUTO_UPDATE_CORE` constant.

Additionally, recognize these new values as acceptable in Site Health tests.

Follow-up to [48804], [49245], [49254].

Fixes #51319. See #50907.
Built from https://develop.svn.wordpress.org/trunk@49292


git-svn-id: http://core.svn.wordpress.org/trunk@49054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-24 00:26:05 +00:00
TimothyBlynJacobs e992757e5b App Passwords: Include site_url in the success redirect payload.
Props georgestephanis.
Fixes #51602.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-24 00:07:08 +00:00
Sergey Biryukov ce4b1cc8ba Toolbar: Keep IE 11 scrollbar on the side instead of overlapping the toolbar.
Props sabernhardt, shital-patel, y_kolev.
Fixes #48545.
Built from https://develop.svn.wordpress.org/trunk@49290


git-svn-id: http://core.svn.wordpress.org/trunk@49052 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-23 19:49:08 +00:00
Sergey Biryukov ee3dac88f0 Privacy: Use more appropriate verbiage when downloading personal data export file from a row action.
Props garrett-eclipse, bridgetwillard.
Fixes #49319.
Built from https://develop.svn.wordpress.org/trunk@49289


git-svn-id: http://core.svn.wordpress.org/trunk@49051 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-23 19:33:07 +00:00
Sergey Biryukov d9838eed62 Posts, Post Types: Set better default title for custom post types without title support.
The default title is now set to "(no title supported)" instead of "Auto Draft".

Props garrett-eclipse, rajanit2000, bridgetwillard, donmhico, nrqsnchz.
Fixes #45516.
Built from https://develop.svn.wordpress.org/trunk@49288


git-svn-id: http://core.svn.wordpress.org/trunk@49050 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-23 19:09:10 +00:00
Sergey Biryukov 36d58abc8e Help/About: Clarify that discouraging search engines does not prevent them from crawling the site.
Props carike, garrett-eclipse, hellofromTonya.
Fixes #51274.
Built from https://develop.svn.wordpress.org/trunk@49287


git-svn-id: http://core.svn.wordpress.org/trunk@49049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-23 18:07:13 +00:00
Sergey Biryukov f83aa63730 Coding Standards: Split long `printf()` calls for search results for better readability.
Follow-up to [49284].

See #37353.
Built from https://develop.svn.wordpress.org/trunk@49286


git-svn-id: http://core.svn.wordpress.org/trunk@49048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-23 17:19:14 +00:00
Aaron Campbell 608ba462dd Upgrade/Install: Improve copy for opt-in to automatic major version updates.
Props marybaum, kebbet.
See #50907.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-23 16:36:14 +00:00
Helen Hou-Sandí e0c12cc818 Administration: Unify search results message on list tables.
This wraps the search string in a `<strong>` tag, which makes easier to parse visually especially when your search string also contains double quotes.

Props Mista-Flo, mapk, sergeybiryukov.
Fixes #37353.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-23 16:01:15 +00:00
Helen Hou-Sandí 4847fb4263 Administration: Better targeting for required form field highlighting.
Previously, any `input` or `select` inside of a `.form-invalid` wrapper would get the red border highlighting, including submit buttons which was not visually correct. This now only applies to form elements with a class of `.form-required` inside of the `.form-invalid` wrapper. It also continues to apply the border to elements with both classes (`.form-invalid.form-required`) as that is how some of the admin markup is structured.

Plugin authors may need to do the same sort of class application seen in this commit, i.e. add `.form-required` to certain form elements.

Props sabernhardt, dilipbheda, helen.
Fixes #50686.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-23 15:05:09 +00:00
Sergey Biryukov 298cd04a63 Coding Standards: Update some alignment in `wp-admin/authorize-application.php` for consistency.
Save blogs count to a variable for reusing.

Follow-up to [49270].

See #51489.
Built from https://develop.svn.wordpress.org/trunk@49282


git-svn-id: http://core.svn.wordpress.org/trunk@49042 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-23 01:19:06 +00:00
Sergey Biryukov 0a70f9b004 Docs: Document the return value of `wp_prepare_attachment_for_js()` using hash notation.
Props stevenlinx, Mista-Flo, johnbillion.
Fixes #50835.
Built from https://develop.svn.wordpress.org/trunk@49281


git-svn-id: http://core.svn.wordpress.org/trunk@49041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-23 00:43:07 +00:00
desrosj 57ae91be78 Build/Test Tools: Remove debug text included in [49267].
See #50401.
Built from https://develop.svn.wordpress.org/trunk@49280


git-svn-id: http://core.svn.wordpress.org/trunk@49040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-22 18:12:01 +00:00
TimothyBlynJacobs ce34d0ab00 App Passwords: Support an app_id to uniquely identify instances of an app.
Apps may now optionally include an `app_id` parameter when directing the user to the Authorize Application screen. This allows for instances of an application to be identified and potentially revoked or blocked.

Props TimothyBlynJacobs, georgestephanis.
Fixes #51583.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-22 15:06:09 +00:00
Sergey Biryukov 83c900e8b3 Upgrade/Install: Add missing `</form>` tag in auto-updates settings form.
Props imath, ahortin, dd32, afragen.
Fixes #51598. See #50907.
Built from https://develop.svn.wordpress.org/trunk@49274


git-svn-id: http://core.svn.wordpress.org/trunk@49036 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-22 03:38:10 +00:00
TimothyBlynJacobs fe8bb3ea58 App Passwords: Fix success=false not being appended to fallback reject url.
Props TimothyBlynJacobs, georgestephanis.
Fixes #51581.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-22 02:44:05 +00:00
Peter Wilson 9dc6d6147a XML-RPC: Fix length validation of anonymous commenter's email address.
Fix the first step of validating an anonymous commenters in which the length is checked prior to running regular expressions.

Follow up to [47808].
Fixes #51595.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49033 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-22 02:42:06 +00:00
TimothyBlynJacobs 85c49351af App Passwords: Explain that apps can access to all sites in a network.
Props georgestephanis, spacedmonkey, johnjamesjacoby, SergeyBiryukov, marybaum.
Fixes #51489.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49032 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-22 02:36:11 +00:00
Sergey Biryukov cd04c0d68b Build/Test Tools: Only define `WP_PLUGIN_DIR` in when running core tests.
This takes into account non-core plugins that rely on `WP_PLUGIN_DIR` being set to the expected plugin's directory in `WP_CONTENT_DIR`, or already have the constant defined.

Follow-up to [49236].

Props pierlo.
Fixes #51594.
Built from https://develop.svn.wordpress.org/trunk@49269


git-svn-id: http://core.svn.wordpress.org/trunk@49031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-22 00:44:05 +00:00
Peter Wilson f8e9df7a95 Tests: Use shared fixtures in XML-RPC new comment unit tests.
See #51344.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49030 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-22 00:19:08 +00:00
desrosj a8abe177a4 Build/Test Tools: Pass GitHub Action related environment variables to the Docker container.
This ensures that `WP_UnitTestCase::skipOnAutomatedBranches()` has access to these variables so that time sensitive tests can be skipped when appropriate.

This also updates that logic to be more clear.

Follow up to [49264].

Props ocean90, johnbillion.
See #50401, #49050, #47767.
Built from https://develop.svn.wordpress.org/trunk@49267


git-svn-id: http://core.svn.wordpress.org/trunk@49029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-21 19:57:10 +00:00
Sergey Biryukov ecf8e59918 Docs: Add a `@since` note about `async_direct_test` key to the `site_status_tests` filter.
Follow-up to [49232].

See #51547.
Built from https://develop.svn.wordpress.org/trunk@49266


git-svn-id: http://core.svn.wordpress.org/trunk@49028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-21 14:55:09 +00:00
Sergey Biryukov bbfc20ee44 Coding Standards: Rename a variable in `wp-login.php` for consistency with other instances.
See #50767.
Built from https://develop.svn.wordpress.org/trunk@49265


git-svn-id: http://core.svn.wordpress.org/trunk@49027 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-21 14:46:05 +00:00
desrosj f9902dc742 Build/Test Tools: Skip some tests when not in the primary branch.
This skips time sensitive tests when GitHub Actions workflows are not being run on `master` branch.

See #50401, #39486.
Built from https://develop.svn.wordpress.org/trunk@49264


git-svn-id: http://core.svn.wordpress.org/trunk@49026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-21 14:07:09 +00:00
desrosj a7d6e929c9 Administration: Fix an invalid property in the Dashicons CSS file.
Props komagain.
Fixes #51587.
Built from https://develop.svn.wordpress.org/trunk@49263


git-svn-id: http://core.svn.wordpress.org/trunk@49025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-21 13:16:07 +00:00
Helen Hou-Sandí 990875a7ae Post-post WordPress 5.6 beta 1 version bump.
Built from https://develop.svn.wordpress.org/trunk@49262


git-svn-id: http://core.svn.wordpress.org/trunk@49024 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 22:23:05 +00:00
Helen Hou-Sandí a0f350b597 Post-WordPress 5.6 Beta 1 version bump.
Built from https://develop.svn.wordpress.org/trunk@49261


git-svn-id: http://core.svn.wordpress.org/trunk@49023 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 22:19:06 +00:00
Helen Hou-Sandí 7e29e531bd WordPress 5.6 Beta 1.
Built from https://develop.svn.wordpress.org/trunk@49260


git-svn-id: http://core.svn.wordpress.org/trunk@49022 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 21:47:06 +00:00
Sergey Biryukov fcc04a6a37 Coding Standards: Fix WPCS issues in [49258].
See #46619.
Built from https://develop.svn.wordpress.org/trunk@49259


git-svn-id: http://core.svn.wordpress.org/trunk@49021 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 21:20:07 +00:00
Helen Hou-Sandí e1e6e949ff Privacy: Add "Mark as completed" action.
Props garrett-eclipse, ocean90, joostdevalk, mista-flo, helen.
Fixes #46619.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49020 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 21:07:07 +00:00
TimothyBlynJacobs 7fe78e2f18 REST API: Make sure all supported JSON Schema keywords are output in the index.
Previously, only a small subset of keywords were exposed which limited the utility of `OPTIONS` requests.

Props raubvogel, TimothyBlynJacobs.
Fixes #51020.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 20:19:09 +00:00
Sergey Biryukov fbd8078d4e Comments: Add a filter for top level comments query arguments in `comments_template()`.
Props hellofromTonya, Howdy_McGee, garrett-eclipse, davidbaumwald, thomaslhotta.
Fixes #38074.
Built from https://develop.svn.wordpress.org/trunk@49256


git-svn-id: http://core.svn.wordpress.org/trunk@49018 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 20:11:06 +00:00
Helen Hou-Sandí 5b4d643d60 Privacy: Add requester IP to password reset emails.
Props garrett-eclipse, bridgetwillard, isharis, ocean90.
Fixes #43856.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49017 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 20:03:08 +00:00
Helen Hou-Sandí 9ab2f1ae3e Upgrade/Install: Add UI for opting in to core auto-updates for major versions.
Props audrasjb, karmatosed, aaroncampbell, paaljoachim, davidbaumwald.
Fixes #50907.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49016 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 19:35:06 +00:00
Helen Hou-Sandí 874b812ce3 Upgrade/Install: Don't show theme update prompts on subsites.
If you are using `wp_prepare_themes_for_js()` and relying on `updates`/`no_updates` in multisite, you will need to filter that data back in using the `wp_prepare_themes_for_js` hook.

Props pbiron, afragen.
Fixes #49831.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49015 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 19:14:09 +00:00
TimothyBlynJacobs 499e4e9053 REST API: Introduce support for batching API requests.
A new route is introduced, `batch/v1`, that accepts a list of API requests to run. Each request runs in sequence, and the responses are returned in the order they've been received.

Optionally, the `require-all-validate` validation mode can be used to first validate each request's parameters and only proceed with processing if each request validates successfully.

By default, the batch size is limited to 25 requests. This can be controlled using the `rest_get_max_batch_size` filter. Clients are strongly encouraged to discover the maximum batch size supported by the server by making an OPTIONS request to the `batch/v1` endpoint and inspecting the described arguments.

Additionally, the two new methods, `match_request_to_handler` and `respond_to_request` introduced in [48947] now have a `protected` visibility as we don't want to expose the inner workings of the `WP_REST_Server::dispatch` API.

Batching is not currently supported for GET requests.

Fixes #50244.
Props andraganescu, zieladam, TimothyBlynJacobs.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49014 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 19:10:08 +00:00
Adam Silverstein b789b4ae11 Coding Standards: Fix WPCS issues in [49248].
See #42852.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49013 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 19:07:10 +00:00
desrosj b4853c1dd9 Twenty Twenty: Use `jshint` exclude statements instead of `eslint`.
Also, exclude the `node_modules` folder within `twentytwentyone`.

See #51526.
Built from https://develop.svn.wordpress.org/trunk@49250


git-svn-id: http://core.svn.wordpress.org/trunk@49012 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 18:34:06 +00:00
Sergey Biryukov 806cfea146 Coding Standards: Fix WPCS issues in [49242].
See #50774.
Built from https://develop.svn.wordpress.org/trunk@49249


git-svn-id: http://core.svn.wordpress.org/trunk@49011 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 18:31:07 +00:00
Adam Silverstein daa977c495 Users: improve password generation feature.
On the user edit screen improve handling and clarify language: rename the "Generate Password" and "Show password" buttons to "Set New Password". Clicking it always generates a password. Also: improve inline code comments and descriptions.

Props afercia, bookdude13, michaelarestad, pento.
Fixes #42852.


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


git-svn-id: http://core.svn.wordpress.org/trunk@49010 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 18:27:13 +00:00
desrosj 0e85b07bc8 Twenty Twenty: Import the latest changes from GitHub
For a full list of changes since [49216], see dfe141276c...trunk/.

Props poena, melchoyce, luminuu, aristath, jffng, ryelle, kishanjasani, rolfsiebers, sresok, desrosj.
See #51526.
Built from https://develop.svn.wordpress.org/trunk@49247


git-svn-id: http://core.svn.wordpress.org/trunk@49009 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 18:26:06 +00:00
TimothyBlynJacobs c9f737619a REST API: Add support for the oneOf and anyOf keywords.
This allows for REST API routes to define more complex validation requirements as JSON Schema instead of procedural validation.

The error code returned from `rest_validate_value_from_schema` for invalid parameter types has been changed from the generic `rest_invalid_param` to the more specific `rest_invalid_type`.

Props yakimun, johnbillion, TimothyBlynJacobs.
Fixes #51025.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49008 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 18:24:09 +00:00
Sergey Biryukov 6e71523ead Upgrade/Install: Allow WordPress sites to opt-in to beta & RC releases.
The `WP_AUTO_UPDATE_CORE` constant now supports `beta` and `rc` values.

This makes it possible for sites to opt-in to updating to RC (or beta) releases without having to install a plugin, or run on a development version.

Props dd32, knutsp.
Fixes #51319.
Built from https://develop.svn.wordpress.org/trunk@49245


git-svn-id: http://core.svn.wordpress.org/trunk@49007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 17:56:06 +00:00
desrosj 69fea120db Build/Test Tools: Cancel previous active workflow runs for pull requests.
Because workflow results are reported for each commit, it’s important to let all runs against main and version branches to complete so that the checks are reported accurately.

When considering and reviewing pull requests, the only workflow run that matters is the most recent.

Props ocean90, helen.
See #50401.
Built from https://develop.svn.wordpress.org/trunk@49244


git-svn-id: http://core.svn.wordpress.org/trunk@49006 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 17:46:05 +00:00
Sergey Biryukov 94b088339c Upgrade/Install: Restore casting `$filter_payload` to an object in `WP_MS_Themes_List_Table::prepare_items()`.
Follow-up to [48750], [49241].

See #50875.
Built from https://develop.svn.wordpress.org/trunk@49243


git-svn-id: http://core.svn.wordpress.org/trunk@49005 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 17:44:06 +00:00
Helen Hou-Sandí c8fbc04276 Upgrade/Install: Include "from" version for plugins/themes in email.
This can help with chasing down any issues that may arise and rolling back if necessary. We hope it's not, but it might be.

Props dkotter, garrett-eclipse, pbiron, audrasjb.
Fixes #50774.

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


git-svn-id: http://core.svn.wordpress.org/trunk@49004 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 17:41:07 +00:00
Sergey Biryukov e38c5ca7d4 Upgrade/Install: Introduce a wrapper for the `auto_update_{$type}` filter checks.
This allows for cleaner checks whether auto-updates are forced for a plugin or theme.

Follow-up to [48750].

Props rebasaurus, garrett-eclipse, SergeyBiryukov.
Fixes #50875.
Built from https://develop.svn.wordpress.org/trunk@49241


git-svn-id: http://core.svn.wordpress.org/trunk@49003 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 17:39:07 +00:00
desrosj 19a4b4fee4 Twenty Thirteen: Prevent incorrect link color within the Social Icon block.
Props amolv, shital-patel, poena, davidbaumwald.
Fixes #50809.
Built from https://develop.svn.wordpress.org/trunk@49240


git-svn-id: http://core.svn.wordpress.org/trunk@49002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 17:35:06 +00:00
desrosj 8f7975cbea Emoji: Update Twemoji to version 13.0.1.
This release fixes minor issues with 8 different Emoji and revises the person/woman/man kneeling Emoji to be in a more obvious kneeling position.

🧎

These updates were pushed to a new, `13.0.1` folder on the CDN in [dotorg:16573].

For a full list of changes in this update, see https://github.com/twitter/twemoji/compare/v13.0.0...v13.0.1.

Props hareesh-pillai, otto42, desrosj.
Fixes #51356.
Built from https://develop.svn.wordpress.org/trunk@49239


git-svn-id: http://core.svn.wordpress.org/trunk@49001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 16:55:23 +00:00
Sergey Biryukov be5fb561ad Quick/Bulk Edit: Introduce `quick_edit_dropdown_authors_args` filter.
This allows for customizing the arguments used to generate the Quick Edit authors drop-down.

Additionally, pass the `$bulk` argument to the `quick_edit_dropdown_pages_args` filter, for consistency.

Props Mista-Flo, garrett-eclipse, hellofromTonya.
Fixes #47685.
Built from https://develop.svn.wordpress.org/trunk@49238


git-svn-id: http://core.svn.wordpress.org/trunk@49000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 16:40:05 +00:00
Sergey Biryukov 35681b0e9a Site Health: Introduce the `WP_Site_Health::is_development_environment()` method.
This allows Site Health tests to check if the current environment type is set to `development` or `local`.

Use the new method:
* In HTTPS tests, instead of a hardcoded check for `localhost`.
* In `WP_DEBUG` and `WP_DEBUG_DISPLAY` tests, to set the status to `recommended` instead of `critical`.

Props dkotter, Clorith, DavidAnderson, joyously, knutsp, afragen, SergeyBiryukov.
Fixes #47058.
Built from https://develop.svn.wordpress.org/trunk@49237


git-svn-id: http://core.svn.wordpress.org/trunk@48999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 16:23:07 +00:00
Dominik Schilling 173b9aa122 I18N: Introduce `WP_Textdomain_Registry` to store text domains and their language directory paths.
Previously, when using `switch_to_locale()` all current loaded text domains were unloaded and added to the `$l10n_unloaded` global. This prevented the just-in-time loading for text domains after a switch. The just-in-time loading was also only possible if the translations were stored in `WP_LANG_DIR`. Both issues have been fixed.

* Adds `WP_Textdomain_Registry` to keep track of the language directory paths for all plugins and themes.
* Updates all `load_*_textdomain()`  functions to store the path in `WP_Textdomain_Registry`.
* Adds `$reloadable` parameter to `unload_textdomain()` to define whether a text domain can be loaded just-in-time again. This is used by `WP_Locale_Switcher::load_translations()`.
* Extends `_load_textdomain_just_in_time()` to also support text domains of plugins and themes with custom language directories.
* Fixes the incorrect `test_plugin_translation_after_switching_locale_twice()` test which should have catch this issue earlier.
* Adds a new test plugin/theme to test the loading of translations with a custom language directory.
* Deprecates the now unused and private `_get_path_to_translation()` and `_get_path_to_translation_from_lang_dir()` functions.

Props yoavf, swissspidy, dd32, ocean90.
See #26511.
Fixes #39210.
Built from https://develop.svn.wordpress.org/trunk@49236


git-svn-id: http://core.svn.wordpress.org/trunk@48998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 16:05:07 +00:00
Sergey Biryukov e2e3c8ec47 General: Add `$options` parameter to JSON response functions:
* `wp_send_json()`
* `wp_send_json_success()`
* `wp_send_json_error()`

This allows for customizing the options passed to `json_encode()`.

Props eroraghav, hareesh-pillai, garrett-eclipse.
Fixes #51293.
Built from https://develop.svn.wordpress.org/trunk@49235


git-svn-id: http://core.svn.wordpress.org/trunk@48997 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 15:56:08 +00:00
Sergey Biryukov e856a91321 Media: Introduce a filter for `wp_get_attachment_image()` HTML output.
Props prionkor, antpb, donmhico, audrasjb, Mista-Flo, hellofromTonya.
Fixes #50801.
Built from https://develop.svn.wordpress.org/trunk@49234


git-svn-id: http://core.svn.wordpress.org/trunk@48996 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 15:31:06 +00:00
Sergey Biryukov ffe497bceb Docs: Use 3-digit, x.x.x style semantic versioning for `@since 5.6.0` entries in `WP_Image_Editor_Imagick`.
See #50768.
Built from https://develop.svn.wordpress.org/trunk@49233


git-svn-id: http://core.svn.wordpress.org/trunk@48995 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 14:54:04 +00:00
desrosj 8778aa8922 Site Health: Improve the reliability of asynchronous tests.
This change adds additional logic to catch HTTP failures that do not return a `WP_Error` object (for example, a wp-json REST API error error).

This also fixes instances where REST API callbacks performed from cron do not work due to a lack of authentication by introducing a direct callback route that asynchronous tests can register.

Props dd32, clorith, timothyblynjacobs.
Fixes #51547.
Built from https://develop.svn.wordpress.org/trunk@49232


git-svn-id: http://core.svn.wordpress.org/trunk@48994 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 14:50:06 +00:00
Sergey Biryukov 0287a48764 Docs: Update the `@since` note for `_media_states()`.
Follow-up to [49223].

Props mukesh27.
Fixes #42063.
Built from https://develop.svn.wordpress.org/trunk@49231


git-svn-id: http://core.svn.wordpress.org/trunk@48993 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 14:41:05 +00:00
Mike Schroder a8d8f22f4e Media: Support Stream Wrappers In `WP_Image_Editor_Imagick`
Since `WP_Image_Editor`'s introduction, stream wrappers have functioned in `WP_Image_Editor_GD`, but haven't been properly supported in `WP_Image_Editor_Imagick`.

- Detects stream wrappers and uses `file_put_contents()` along with `Imagick::read/getImageBlob()` for handling when necessary.
- Introduces private method, `WP_Image_Editor_Imagick::write_image` to handle detection and proper saving.
- Introduces `WP_Test_Stream` class for testing stream wrappers, along with new tests for Imagick's stream handling and a stream filename test.

Adds requirement for `Imagick::readImageBlob()`, available in Imagick >= 2.0.0, which aligns with the current requirement of Imagick >= 2.2.0.

Props p00ya, calin, joemcgill, pputzer, jimyaghi, mikeschroder.
Fixes #42663.
Built from https://develop.svn.wordpress.org/trunk@49230


git-svn-id: http://core.svn.wordpress.org/trunk@48992 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 14:37:05 +00:00
desrosj b2622d5d8c Site Health: Use consistent padding around header tags.
Props vinita29, clorith.
Fixes #50638.
Built from https://develop.svn.wordpress.org/trunk@49229


git-svn-id: http://core.svn.wordpress.org/trunk@48991 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 14:18:08 +00:00
desrosj 8e852e099f Build/Test Tools: Download Chromium for JS tests.
Partial revert of [49227].

See #50401.
Built from https://develop.svn.wordpress.org/trunk@49228


git-svn-id: http://core.svn.wordpress.org/trunk@48990 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 14:11:07 +00:00
desrosj 6cd09c0f64 Build/Test Tools: Download Chromium for E2E tests only.
This prevents Chromium from being downloaded in workflows where it is not required.

See #49621, #50649, #50401.
Built from https://develop.svn.wordpress.org/trunk@49227


git-svn-id: http://core.svn.wordpress.org/trunk@48989 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 13:54:08 +00:00
youknowriad d6cff7965a Block Editor: Update the WordPress Packages to the latest version.
This includes the packages that match the Gutenberg 9.2 Release.
It is going to be the last block-editor features update for WordPress 5.6.
It also updates the block-supports code base to the latest APIs.

Props isabel_brison, noisysocks, desrosj.
Fixes #51570.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48988 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 13:36:16 +00:00
desrosj d40c365a30 Coding Standards: Correct some minor coding standards issues.
Introduced in [49154], [49212], [49223], and [49224].
Built from https://develop.svn.wordpress.org/trunk@49225


git-svn-id: http://core.svn.wordpress.org/trunk@48987 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 13:29:08 +00:00
youknowriad 8fbbd54c40 Block Editor: Expose api_version in the block type and the REST endpoint.
The new block editor included in 5.6 introduces an api_version property
that indicates which block API version the block is using. 
This commits makes this property available on the block type and the endpoint.

Props TimothyBlynJacobs, gziolo.
Fixes #51529.


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


git-svn-id: http://core.svn.wordpress.org/trunk@48986 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 07:54:10 +00:00
Helen Hou-Sandí edb64a3d8e Media: Indicate if item is or was used as a site option in the details modal.
Props Mista-Flo, melchoyce.
Fixes #42063.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48985 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 03:14:06 +00:00
antpb 6b90568840 Media: Allow hiding of ‘View attachment page’ link in media modal.
If an empty string is supplied to the `attachment_link` filter the ‘View attachment page’ link will be hidden in the media modal.
Props limera1n, garrett-eclipse, joemcgill, Mista-Flo, hellofromTonya.
Fixes #48325.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48984 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 02:29:06 +00:00
Sergey Biryukov f7c520c1d5 Sitemaps: Center the container for sitemap content.
Props ramiy, swissspidy.
Fixes #50658.
Built from https://develop.svn.wordpress.org/trunk@49221


git-svn-id: http://core.svn.wordpress.org/trunk@48983 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 02:22:07 +00:00
desrosj d2fb6101c4 Bundled Themes: Make Twenty Twenty-One the default theme.
After being imported in [49216], Twenty Twenty-One can now be set as the default theme in WordPress.

See #48110.
Built from https://develop.svn.wordpress.org/trunk@49220


git-svn-id: http://core.svn.wordpress.org/trunk@48982 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 02:04:07 +00:00
Sergey Biryukov 9c82dfada2 Help/About: Serve the image on the Freedoms page locally.
Serving the files locally is beneficial for reasons of privacy and speed.

Props garrett-eclipse, pputzer, hellofromTonya.
Fixes #46363.
Built from https://develop.svn.wordpress.org/trunk@49219


git-svn-id: http://core.svn.wordpress.org/trunk@48981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 02:02:06 +00:00
Sergey Biryukov 5cbad34501 Help/About: Update Privacy page to include illustration.
This brings some consistency with the Freedoms page.

Follow-up to [43938].

Props melchoyce, garrett-eclipse, hareesh-pillai, ryelle.
Fixes #45395.
Built from https://develop.svn.wordpress.org/trunk@49218


git-svn-id: http://core.svn.wordpress.org/trunk@48980 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 01:47:06 +00:00
desrosj a4edd896b4 Bundled Themes: Add the theme screenshot for Twenty Twenty-One
Follow up to [49216].

See #51526.
Built from https://develop.svn.wordpress.org/trunk@49217


git-svn-id: http://core.svn.wordpress.org/trunk@48979 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 01:29:03 +00:00
desrosj 3ea8930f37 Bundled Themes: Import Twenty Twenty-One, the new default theme for WordPress 5.6.
Welcome to the bundled themes family!

Twenty Twenty-One is a blank canvas for your ideas, making the block editor your best brush.

Theme development to this point has taken place on GitHub. See: https://github.com/WordPress/twentytwentyone/.

Props poena, melchoyce, luminuu, elmastudio, bethsoderberg, williampatton, aristath, jffng, kjellr, jeffikus, audrasjb, fabiankaegy, mukesh27, dingo_d, kellylawrence, acosmin, whyisjake, metodiew, ryelle, nielslange, littlebigthing, mahesh901122, zebulan, kishanjasani, lukecavanagh, scruffian, abhijitrakas, utz119, sudoshreyansh, kau-boy, justinahinon, joostdevalk, bduclos, hareesh-pillai, mager19, rolfsiebers, webmigrates, sresok, guidooffermans, francina, marybaum, hareshlive, navanathbhosale, afercia, richtabor, joyously, sarahricker, nrqsnchz, glauberglauber, sabernhardt, kraftbj, ItsJonQ, joen, CTMartin0, decrecementofeliz, bhautikvirani.
See #51526.
Built from https://develop.svn.wordpress.org/trunk@49216


git-svn-id: http://core.svn.wordpress.org/trunk@48978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-20 01:14:10 +00:00
Sergey Biryukov 651f426b3a General: Remove `noreferrer` from `wp_targeted_link_rel()` and other uses.
When `noopener noreferrer` was originally added in #37941 and related tickets, the `noreferrer` bit was specifically included due to Firefox not supporting `noopener` at the time.

Since `noopener` has been supported by all major browsers for a while, it should now be safe to remove the `noreferrer` attribute from core.

Props Mista-Flo, audrasjb, joostdevalk, jonoaldersonwp, peterwilsoncc, elgameel.
Fixes #49558.
Built from https://develop.svn.wordpress.org/trunk@49215


git-svn-id: http://core.svn.wordpress.org/trunk@48977 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-19 23:39:04 +00:00
Sergey Biryukov caa75a04a8 Themes: Add a return value to `set_theme_mod()` to allow for error handling.
Props latifi, hareesh-pillai.
Fixes #51296.
Built from https://develop.svn.wordpress.org/trunk@49214


git-svn-id: http://core.svn.wordpress.org/trunk@48976 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-19 22:45:03 +00:00
Sergey Biryukov 80be8c138d Administration: Remove obsolete `.ac_results` class references.
Core does not use the jQuery.suggest plugin since [38797].

Props afercia, hareesh-pillai, garrett-eclipse.
Fixes #40260.
Built from https://develop.svn.wordpress.org/trunk@49213


git-svn-id: http://core.svn.wordpress.org/trunk@48975 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-19 22:33:08 +00:00
Helen Hou-Sandí bdfd1a954f Multisite: More specific caching for `get_dirsize`.
Instead of one cache entry for all upload folders for a site on multisite, this now caches for each folder and invalidates that cache based on context. In multisite, this should speed up `get_dirsize` calls since older directories that are much less likely to change will no longer have the size recalculated.

Props janthiel, A5hleyRich, batmoo.
Fixes #19879.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48974 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-19 21:51:06 +00:00
Sergey Biryukov 1c1aadbe54 Pings/Trackbacks: Split `do_all_pings()` into several functions:
* `do_all_pingbacks()`
* `do_all_enclosures()`
* `do_all_trackbacks()`

This allows for the specific removal/replacement of one of more services.

Props dshanske, garrett-eclipse, Mista-Flo, azaozz, hellofromTonya.
Fixes #36576.
Built from https://develop.svn.wordpress.org/trunk@49211


git-svn-id: http://core.svn.wordpress.org/trunk@48973 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-19 21:16:02 +00:00
Sergey Biryukov 18d3866ab2 Editor: Expose the `embed` core block on the server.
Props ntsekouras, gziolo.
Fixes #51531.
Built from https://develop.svn.wordpress.org/trunk@49210


git-svn-id: http://core.svn.wordpress.org/trunk@48972 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-19 20:57:07 +00:00
Sergey Biryukov e209e00734 Coding Standards: Fix WPCS issues in [49207].
See #46866.
Built from https://develop.svn.wordpress.org/trunk@49209


git-svn-id: http://core.svn.wordpress.org/trunk@48971 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-19 20:45:06 +00:00
Sergey Biryukov 3d02b5b585 Bundled Themes: Declare support for the `html5` feature `navigation-widgets`.
Widgets that output a list of links are now wrapped within `<nav>` elements to improve semantics and accessibility.

The `<nav>` elements are native landmark regions, which helps assistive technology users to navigate through them.

Follow-up to [48349], [49177].

Props hareesh-pillai, justinahinon, afercia, williampatton.
Fixes #51445.
Built from https://develop.svn.wordpress.org/trunk@49208


git-svn-id: http://core.svn.wordpress.org/trunk@48970 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-19 20:32:05 +00:00
antpb 9556c08b35 Media: Add 'Uploaded to' for individual media items in the media editor.
Adds a link in the media editor showing which post a media item was uploaded to.
Props karmatosed, garrett-eclipse, Mista-Flo, SergeyBiryukov, joemcgill, hellofromTonya.
Fixes #46866.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48969 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-19 20:29:05 +00:00
Sergey Biryukov fbc1622741 Coding Standards: Use more specific checks for `$wpdb->get_row()` results.
If `$wpdb->get_row()` is successful and the `$output` parameter has not been set, the output will be an instance of `stdClass`, so test to confirm that instead of testing against "not null".

This affects:
* `wpmu_validate_user_signup()`
* `wpmu_validate_blog_signup()`

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


git-svn-id: http://core.svn.wordpress.org/trunk@48968 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-19 20:20:04 +00:00
antpb 9d13ae60e4 Media: Indicate if media is header video in media library.
This introduces a label to indicate if a piece of media is being used as a video header in the media library.
Props desrosj, Mista-Flo, mikeschroder.
Fixes #42929.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48967 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-19 18:32:07 +00:00
desrosj 570a4e8872 Build/Test Tools: Improve the clarity for PHPUnit workflow strategy.
This change makes better use of the job strategy matrix for workflows. By using `include`, the memcached and test reporting job can be configured more clearly.

Props ocean90.
See #50401.
Built from https://develop.svn.wordpress.org/trunk@49204


git-svn-id: http://core.svn.wordpress.org/trunk@48966 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-19 18:24:10 +00:00
Sergey Biryukov 19545d255c Widgets: Introduce `before_sidebar` and `after_sidebar` arguments for `register_sidebar()`.
Props deepaklalwani, flixos90, christophherr, dgwyer, markoheijnen, morganestes, audrasjb.
Fixes #19709.
Built from https://develop.svn.wordpress.org/trunk@49203


git-svn-id: http://core.svn.wordpress.org/trunk@48965 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-19 15:40:09 +00:00
Sergey Biryukov 272df00b17 Embeds: Only catch clicks from the primary mouse button in the click handler, without any modifier keys.
This ensures that Ctrl/Cmd + click to open a link in the embed iframe in a new tab works as expected.

Props timhavinga, garrett-eclipse, smerriman, swissspidy, johnbillion, Mte90, iandunn, azaozz, afercia, audrasjb, SergeyBiryukov.
Fixes #39097.
Built from https://develop.svn.wordpress.org/trunk@49202


git-svn-id: http://core.svn.wordpress.org/trunk@48964 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-19 13:36:08 +00:00
Sergey Biryukov 13b1b4bed3 Docs: Add a `@deprecated` note to `WP_Community_Events::format_event_data_time()`.
Follow-up to [49146].

See #51130.
Built from https://develop.svn.wordpress.org/trunk@49201


git-svn-id: http://core.svn.wordpress.org/trunk@48963 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-19 13:22:07 +00:00
Peter Wilson a08fd6ff6f Canonical: Support multiple post types in `redirect_guess_404_permalink()`.
Prevent `redirect_guess_404_permalink()` from throwing a notice when multiple post types are included in the `post_type` query.

Props junaidbhura.
Fixes #43056.


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


git-svn-id: http://core.svn.wordpress.org/trunk@48962 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-18 23:23:05 +00:00
Sergey Biryukov 2716cc8048 Networks and Sites: Introduce `network_site_info_form` action.
The action fires at the end of the site info form in network admin, and complements the existing `network_site_new_form` action.

Props virgodesign.
Fixes #50704.
Built from https://develop.svn.wordpress.org/trunk@49199


git-svn-id: http://core.svn.wordpress.org/trunk@48961 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-18 21:17:05 +00:00
John Blackbourn 1bcda42567 Media: Add an `image_sideload_extensions` filter to the list of allowed file extensions when sideloading an image from a URL.
Props paulschreiber, hellofromTonya

Fixes #50695

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


git-svn-id: http://core.svn.wordpress.org/trunk@48960 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-18 21:06:05 +00:00
John Blackbourn 727922c8eb Docs: Further corrections and promotions for docblocks relating to `object` types.
See #50768

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


git-svn-id: http://core.svn.wordpress.org/trunk@48959 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-18 20:53:08 +00:00
John Blackbourn b2515abd45 Docs: Improve the docs for the globals that are used in the actions and filters API.
See #50531, #50768

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


git-svn-id: http://core.svn.wordpress.org/trunk@48958 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-18 19:19:06 +00:00
John Blackbourn afbfe981fc Media: Add an audio and video player to the media manager modal.
This introduces a means of playing existing audio and video files while browsing them prior to selecting them for use.

Props antpb, Mista-Flo, garrett-eclipse, mapk

Fixes #43640

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


git-svn-id: http://core.svn.wordpress.org/trunk@48957 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-18 17:39:07 +00:00
Sergey Biryukov 1faa241fb6 Code Modernization: Use `instanceof` instead of a comparison with `get_class()`.
Includes adjusting external libraries which are no longer maintained externally.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-18 17:33:07 +00:00
Sergey Biryukov 0e3147c40e Coding Standards: Replace alias PHP functions with the canonical names.
Using the canonical function name for PHP functions is strongly recommended, as aliases may be deprecated or removed without (much) warning.

This replaces all uses of the following:
* `join()` with `implode()`
* `sizeof()` with `count()`
* `is_writeable()` with `is_writable()`
* `doubleval()` with a `(float)` cast

In part, this is a follow-up to #47746.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48955 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-18 17:27:06 +00:00
Sergey Biryukov b6f0882ddd Coding Standards: Use `self` when appropriate.
* `WP_List_Table::get_default_primary_column_name()` is a protected method, so calling it statically with the class name is bad practice.
* Similarly, this applies when calling a private constructor in `WP_Screen::get()`.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48954 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-18 17:18:07 +00:00
John Blackbourn a01f94cad8 Administration: Allow `WP_List_Table::get_bulk_items()` to receive a nested array in order to output optgroups.
The allowed format for bulk actions is now an associative array where each element represents either a top level option value and label, or an array representing an optgroup and its options.

For a standard option, the array element key is the field value and the array element value is the field label.

For an optgroup, the array element key is the label and the array element value is an associative array of options as above.

Props goldenapples, mattkeys, valentinbora, davidbaumwald

Fixes #19278

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


git-svn-id: http://core.svn.wordpress.org/trunk@48952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-18 16:22:10 +00:00
Drew Jaynes 68cff74f62 Docs: Clarify documentation for what the 'count' orderby argument represents in `WP_Term_Query`.
Props jeremyescott.
Fixes #44443.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48951 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-18 08:23:06 +00:00
Sergey Biryukov 120291367a Formatting: Deprecate `wp_slash_strings_only()` in favor of `wp_slash()`.
The reason for introducing `wp_slash_strings_only()` in [46454] was to keep non-string values untouched.

Later, `wp_slash()` itself was updated in [48433] to prevent changing non-string values.

To avoid confusion, `wp_slash_strings_only()` is now deprecated.

Props ayeshrajans, ocean90.
Fixes #50635.
Built from https://develop.svn.wordpress.org/trunk@49188


git-svn-id: http://core.svn.wordpress.org/trunk@48950 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-18 06:57:04 +00:00
Sergey Biryukov 2f5aa85065 Comments: Hide the link to the initial parent comment in the reply heading when replying to another comment.
This ensures that the reply heading is updated correctly on single post URLs with the `?replytocom` query argument.

Follow-up to [47506], [48876], [48904].

Props mailnew2ster, wpamitkumar, audrasjb, desrosj, SergeyBiryukov.
Fixes #51175.
Built from https://develop.svn.wordpress.org/trunk@49187


git-svn-id: http://core.svn.wordpress.org/trunk@48949 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-18 06:41:04 +00:00
Sergey Biryukov 5892cd545e Code Modernization: Remove unnecessary reference sign from `PO::export_entry()` definition.
This fixes a PHP 8 "argument must be passed by reference, value given" error when using `array_map()` in `PO::export_entries()`.

Object variables in PHP 5+ contain a reference to the object, and it's the reference that's passed around.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48948 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-18 06:29:05 +00:00
Sergey Biryukov e2d191f710 Revisions: Explicitly declare the `Text_Diff::_getTempDir()` method as `static`.
This fixes a "Non-static method cannot be called statically" fatal error on PHP 8.

Props jrf.
Fixes #51559.
Built from https://develop.svn.wordpress.org/trunk@49185


git-svn-id: http://core.svn.wordpress.org/trunk@48947 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-17 16:36:07 +00:00
Sergey Biryukov 30d9432760 Code Modernization: Use explicit visibility for class property declarations.
Using `var` or only `static` to declare a class property is PHP 4 code.

This updates the codebase to use explicit visibility modifiers introduced in PHP 5.

Props jrf.
Fixes #51557. See #22234.
Built from https://develop.svn.wordpress.org/trunk@49184


git-svn-id: http://core.svn.wordpress.org/trunk@48946 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-17 16:26:09 +00:00
John Blackbourn c16ae60deb Docs: Fix and upgrade various `object` docblock notations.
See #50768

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


git-svn-id: http://core.svn.wordpress.org/trunk@48945 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-17 16:05:09 +00:00
Sergey Biryukov 9d6a2d1c33 Feeds: Fix "Only variables should be passed by reference" PHP notice in `atomlib.php`.
Props jrf.
Fixes #51558.
Built from https://develop.svn.wordpress.org/trunk@49182


git-svn-id: http://core.svn.wordpress.org/trunk@48944 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-17 15:45:06 +00:00
John Blackbourn 5a573f28f2 Docs: Miscellaneous docblock fixes.
See #50768

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


git-svn-id: http://core.svn.wordpress.org/trunk@48943 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-17 14:54:05 +00:00
John Blackbourn ee96f93558 Administration: Fix a coding standards issue after [49179].
See #50699

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


git-svn-id: http://core.svn.wordpress.org/trunk@48942 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-17 12:34:08 +00:00
Andrew Ozz 59c45c41e4 Fix and improve arranging of postboxes/metaboxes:
- Enable arranging only when the Screen Options tab is open.
- Prevent accidental/unintended dragging. Seen it happen mostly on laptops when using the mousepad/trackpad.
- Improve discoverability and usefulness by always showing the "drop zones" outline when postboxes are draggable/arrangeable.
- Add some (brief) explanation to the Screen Options tab helping the user understand what options are available and how to change them. This is especially helpful for screen reader users to give an idea how to use the screen options and what to expect.
- Fix/enhance some of the code in `postbox.js` and make it coding standards compliant.

See #50699.
Built from https://develop.svn.wordpress.org/trunk@49179


git-svn-id: http://core.svn.wordpress.org/trunk@48941 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-17 10:00:06 +00:00
Sergey Biryukov c5f1d21020 Administration: Wrap the list table items count to a new line on small screens.
This avoids overlapping with action buttons and brings some consistency to bottom paddings across various screens.

Props passoniate, afercia, anuj2, rolfsiebers, uxkai, ireneyoast, thijsvanloef, hellofromTonya, audrasjb, helen, SergeyBiryukov.
Fixes #49246.
Built from https://develop.svn.wordpress.org/trunk@49178


git-svn-id: http://core.svn.wordpress.org/trunk@48940 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-17 01:13:06 +00:00
Sergey Biryukov 6dba11fb82 Accessibility: Widgets: Conditionally wrap the tag cloud widget in a `<nav>` element.
If the theme declares support for the `html5` feature `navigation-widgets`, the tag cloud widget is now wrapped in a `<nav>` element to improve semantics and accessibility.

The `<nav>` elements are native landmark regions, which helps assistive technology users to navigate through them.

Follow-up to [48349] for other widgets.

Props audrasjb, justinahinon, ravipatel.
Fixes #51455. See #48170.
Built from https://develop.svn.wordpress.org/trunk@49177


git-svn-id: http://core.svn.wordpress.org/trunk@48939 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-16 18:32:06 +00:00
desrosj fd1c2cb401 External Libraries: Update the SimplePie library to version 1.5.6.
This version fixes a handful of PHP 8 compatibility issues.

A full list of changes included in this update can be found on GitHub: https://github.com/simplepie/simplepie/compare/1.5.5...1.5.6.

Props jrf, ayeshrajans.
Fixes #51521.
Built from https://develop.svn.wordpress.org/trunk@49176


git-svn-id: http://core.svn.wordpress.org/trunk@48938 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-16 17:20:07 +00:00
desrosj c72bd8c75c Build/Test Tools: Specify the full working directory for PHPCS
Props ocean90.
See #50401.
Built from https://develop.svn.wordpress.org/trunk@49175


git-svn-id: http://core.svn.wordpress.org/trunk@48937 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-16 17:14:06 +00:00
Mike Schroder 9cdd649768 Media: Work around `use-cropbox` bug in Ghostscript 8.70
Wraps `Imagick::readImage()` for PDFs with exception handling, trying again without `use-cropbox` if this fails.

Introduces `WP_Image_Editor_Imagick::pdf_load_source()`.

Works around a known issue in Ghostscript 8.70 (fixed in 8.71) that results in a stack underflow.
While it only affects this version, it remains a common version found on hosts, and prevented some PDF thumbnails from being generated.

See this Ghostscript bug for more details: https://bugs.ghostscript.com/show_bug.cgi?id=690676

Props azaozz, joseaneto, cranewest, dantahoua, n5hzr, mikeschroder.
Fixes #48853.
Built from https://develop.svn.wordpress.org/trunk@49174


git-svn-id: http://core.svn.wordpress.org/trunk@48936 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-16 10:48:07 +00:00
Sergey Biryukov 6c13cdd533 Docs: Add `@since` tags for the `fire_after_hooks` parameter of `wp_insert_post()`, `wp_update_post()`, and `wp_insert_attachment()`.
Document the parameter as optional.

Follow-up to [49172].

See #45114.
Built from https://develop.svn.wordpress.org/trunk@49173


git-svn-id: http://core.svn.wordpress.org/trunk@48935 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-16 09:40:10 +00:00
Peter Wilson 32d193f96f REST API, Posts: Add a hook to fire once a post, its terms and meta update.
Introduces the action `wp_after_insert_post` inside a wrapper function of the same name. This hook allows plugin developers to access a posts full data (including its terms and meta data) regardless of the workflow used to save it.

A new parameter is introduced to `wp_insert_post()` to indicate whether the hook should be fired within the function call or will be fired afterward.

Props aristath, Collizo4sky, danielbachhuber, joyously, kadamwhite, kraftbj, markparnell, mikeschroder, noisysocks, peterwilsoncc, SergeyBiryukov, talldanwp, thewebprincess, TimothyBlynJacobs.
Fixes #45114.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-16 03:34:08 +00:00
Peter Wilson cd8b13842f Taxonomy: Fix warnings thrown by custom term count callbacks.
Add a `use` to a closure to avoid an undefined variable throwing a warning. Adds unit tests to ensure the custom callbacks run as expected when defined.

Follow up to [49141].
Props ocean90, dd32.
Fixes #40351.


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


git-svn-id: http://core.svn.wordpress.org/trunk@48933 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-16 02:43:06 +00:00
Sergey Biryukov 81ce3c1335 Privacy: Denote removed suggested privacy policy text in a more noticeable way.
Props garrett-eclipse, sabernhardt, audrasjb.
Fixes #51435.
Built from https://develop.svn.wordpress.org/trunk@49170


git-svn-id: http://core.svn.wordpress.org/trunk@48932 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-16 01:29:09 +00:00
desrosj 00725c7015 Build/Test Tools: Change the event that triggers the “Welcome” workflow.
When a contributor opens their first pull request to `wordpress-develop`, the “Welcome” workflow runs and leaves a comment with guidance, helpful information, and resources.

However, because a workflow run triggered by the `pull_request` event runs against the workflow and code from the merge commit, the needed context and permissions to comment on the pull request are missing. By changing the trigger event to `pull_request_target`, the workflow runs against the workflow and code in the base of the pull request and is able to comment on when appropriate.

See #50401.
Built from https://develop.svn.wordpress.org/trunk@49169


git-svn-id: http://core.svn.wordpress.org/trunk@48931 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-16 00:39:08 +00:00
desrosj 4aa3f160e7 Build/Test Tools: Do not cancel previous workflow runs.
When a workflow is cancelled, it’s marked as a failure. This is not ideal because the commit attached to the workflow run will appear as though it introduced a problem, but this may not be true.

Because GitHub Actions work a bit differently than Travis builds, it’s unlikely that the same bottleneck will be encountered in workflows.

This change removes all workflow job steps that cancel previous workflows.

See #50401.
Built from https://develop.svn.wordpress.org/trunk@49168


git-svn-id: http://core.svn.wordpress.org/trunk@48930 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-16 00:27:05 +00:00
Sergey Biryukov df51aa9b6f Upgrade/Install: Check if plugin or theme update results are available before applying the notification filters.
This avoids a PHP notice for an undefined index of either `plugin` or `theme` in the `auto_{plugin|theme}_update_send_email` filter hook.

Props afragen, audrasjb.
Fixes #51400.
Built from https://develop.svn.wordpress.org/trunk@49166


git-svn-id: http://core.svn.wordpress.org/trunk@48928 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-15 23:27:03 +00:00
desrosj 3c1961faa1 External Libraries: Update React, ReactDOM and Lodash.
This updates:
- `react` and `react-dom` from `16.9.0` to `16.13.1`.
- `lodash from `4.17.15` to `4.17.19`.

Props isabel_brison.
Fixes #51505.
Built from https://develop.svn.wordpress.org/trunk@49165


git-svn-id: http://core.svn.wordpress.org/trunk@48927 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-15 23:08:26 +00:00
Sergey Biryukov 82e4f7ed8f Bootstrap/Load: Don't assume `WP_CONTENT_DIR` is defined.
When the `mysql` extention isn't loaded and a custom db dropin is not in place, we give folks a nice error. However, we can't assume that the `WP_CONTENT_DIR` constant is set yet since this runs before we define default constants.

This fixes a PHP 8 error.

Props jorbin.
Merges [49161] to trunk.
See #50913.
Built from https://develop.svn.wordpress.org/trunk@49163


git-svn-id: http://core.svn.wordpress.org/trunk@48925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-15 21:16:10 +00:00
desrosj 91d8b30824 Build/Test Tools: Introduce GitHub Action workflows.
This change introduces 6 different workflows accounting for all of the testing and analysis currently performed in Travis CI & Appveyor:

- Checking PHP & JS coding standards are followed
- Running the end-to-end test suite.
- Running QUnit tests on JavaScript files.
- Scanning for PHP compatibility issues with supported version.
- Running the PHPUnit test suite.
- Verifying NPM related tasks do not cause errors on Windows.

Additionally, a seventh workflow is included that will leave a "welcome" comment when a contributor opens their first pull request to the `wordpress-develop` mirror.

These workflows are currently in an experimental phase. For that reason, Travis CI and Appveyor will continue to run until all of the bugs can be worked out.

Props ayeshrajans, helen, ocean90, desrosj.
See #50401.
Built from https://develop.svn.wordpress.org/trunk@49162


git-svn-id: http://core.svn.wordpress.org/trunk@48924 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-15 19:42:09 +00:00
Sergey Biryukov f0ac0275e8 Comments: Further remove unnecessary context switch in `Walker_Comment`.
Follow-up to [49157].

See #51533.
Built from https://develop.svn.wordpress.org/trunk@49160


git-svn-id: http://core.svn.wordpress.org/trunk@48922 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-15 15:26:05 +00:00
Sergey Biryukov 3b7a8a7eca Twenty Nineteen: Remove extra space from the comment link in `TwentyNineteen_Walker_Comment`.
Fixes #51533.
Built from https://develop.svn.wordpress.org/trunk@49159


git-svn-id: http://core.svn.wordpress.org/trunk@48921 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-15 15:24:08 +00:00
Sergey Biryukov 2d6ec60e04 Twenty Twenty: Remove extra space from the comment link in `TwentyTwenty_Walker_Comment`.
See #51533.
Built from https://develop.svn.wordpress.org/trunk@49158


git-svn-id: http://core.svn.wordpress.org/trunk@48920 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-15 15:13:07 +00:00
Sergey Biryukov c7d43b7f57 Comments: Remove extra space from the comment link in `Walker_Comment`.
Props poena, mukesh27, SergeyBiryukov.
See #51533.
Built from https://develop.svn.wordpress.org/trunk@49157


git-svn-id: http://core.svn.wordpress.org/trunk@48919 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-15 15:07:09 +00:00
TimothyBlynJacobs a91cc19c1c REST API: Exclude custom site health capability check on multisite.
Super admins will always pass capability checks.

Follow up to [49154], [49155].
See #48105.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48918 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-15 02:28:05 +00:00
TimothyBlynJacobs 1ec225ee3f REST API: Grant super admin to site health test user.
The current user needs to be a super admin to access Site Health on multisite.

Follow up to [49154].
See #48105.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48917 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-15 02:13:04 +00:00
TimothyBlynJacobs 039ce3f16f Site Health, REST API: Move async tests to REST API endpoints.
This provides more flexibility when writing tests and benefits from running in a front-end context which is necessary for some tests like checking that updates are supported. Additionally, this provides a more robust interface for developers who want to integrate with Site Health tests.

Because the `wp/v2` endpoint is reserved for modeling core entities, site health is registered in its own `wp-site-health/v1` namespace.

The existing ajax actions have been maintained for backward compatibility.

Props Clorith, chrisvanpatten, afragen, pokhriyal, TimothyBlynJacobs.
Fixes #48105.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48916 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-15 02:00:08 +00:00
Sergey Biryukov 22c86907c4 Docs: Improve description of the `$email` parameter in `email_exists()`.
Follow-up to [49148].

Props garrett-eclipse.
See #51379.
Built from https://develop.svn.wordpress.org/trunk@49153


git-svn-id: http://core.svn.wordpress.org/trunk@48915 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-15 00:16:08 +00:00
iandunn 8d2beacd45 Community Events: Update timezone-related `@since` tags to `5.5.2`.
r49145 and r49146 were originally planned for 5.6 when they were committed, but are now planned for 5.5.2.

See #51130.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48914 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-14 21:35:05 +00:00
Dominik Schilling c6f7e0f155 I18N: Use `wp.i18n` for translatable strings in `wp-admin/js/dashboard.js`.
* Deprecate the `l10n` property on `communityEventsData`.
* Introduce `version` parameter for `deprecateL10nObject` and backfill the version for deprecated objects in 5.5.0.
* Add a noop version of `deprecateL10nObject` for QUnit testing.

Fixes #51498.
Built from https://develop.svn.wordpress.org/trunk@49151


git-svn-id: http://core.svn.wordpress.org/trunk@48913 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-14 21:13:08 +00:00
Helen Hou-Sandí 8ce5e19a65 Updates: Reduce secondary buttons for less visual complexity.
Props audrasjb, karmatosed.
Fixes #51523.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48912 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-14 20:27:09 +00:00
Helen Hou-Sandí 0e4d84b105 Admin Menu: Better wrapping for long menu item names.
Props munyagu, jagirbaheshwp, harshbarach, pratikkry, hareesh-pillai, naveenkharwar, mukesh27, chetan200891, dushanthi, worldweb, audrasjb, afercia, amolv, iqbalbary, davidbaumwald, sabernhardt, johnjamesjacoby, garrett-eclipse, garrett-eclipse.
Fixes #42201.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48911 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-14 19:53:08 +00:00
Sergey Biryukov 118b9aea4d Users: Introduce `email_exists` filter, to complement `username_exists`.
Props garrett-eclipse, apermo, mukesh27, Mista-Flo, sebastian.pisula, mikelopez.
Fixes #51379. See #35509.
Built from https://develop.svn.wordpress.org/trunk@49148


git-svn-id: http://core.svn.wordpress.org/trunk@48910 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-14 19:04:08 +00:00
iandunn bb67dde689 Community Events: Apply coding standards.
The previous commits intentionally didn't include these, because it would have added an unreasonable amount of diff noise.

See #51130

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


git-svn-id: http://core.svn.wordpress.org/trunk@48909 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-14 18:23:04 +00:00
iandunn 5bf0005827 Community Events: Display dates and times in the user's time zone.
Fixes #51130
Props sippis, hlashbrooke, audrasjb, Rarst, iandunn

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


git-svn-id: http://core.svn.wordpress.org/trunk@48908 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-14 18:21:06 +00:00
iandunn 5d42748c18 Community Events: Trim events by Unix timestamp for accuracy.
The `date` and `end_date` fields are ''WP'' timestamps representing the venue's local time. As of meta:changeset:10270 (#meta4480), new `start_unix_timestamp` and `end_unix_timestamp` values are available, providing a proper ''Unix'' timestamp in the  UTC timezone. Using those is more precise, and removes the time window where the event has expired but still appears in the Events Widget.

To simplify the function, it now only accepts and returns the events themselves, rather than the entire response body.

See #51130
See #meta4480
Related: https://make.wordpress.org/core/2019/09/23/date-time-improvements-wp-5-3/

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


git-svn-id: http://core.svn.wordpress.org/trunk@48907 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-14 18:19:10 +00:00
Sergey Biryukov 542d13830b General: Move `wp_array_get()` next to `wp_array_slice_assoc()`, for a bit more consistent placement.
Follow-up to [49135], [49143].

See #51461.
Built from https://develop.svn.wordpress.org/trunk@49144


git-svn-id: http://core.svn.wordpress.org/trunk@48906 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-14 02:16:08 +00:00
Sergey Biryukov 620c069fe8 General: Move `wp_array_get()` from a separate file to `wp-includes/functions.php`, for consistency.
Add missing `@since` tag, adjust the DocBlock per the documentation standards.

Follow-up to [49135].

Props isabel_brison, ocean90.
Fixes #51461.
Built from https://develop.svn.wordpress.org/trunk@49143


git-svn-id: http://core.svn.wordpress.org/trunk@48905 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-14 02:10:04 +00:00
Sergey Biryukov a706c4505e Administration: Make sure list table row actions in Extended view stay visible when a single row gets focus.
Follow-up to [48398], [48423], [48424], [48450], [48670].

Props ryelle.
Fixes #51516. See #49715.
Built from https://develop.svn.wordpress.org/trunk@49142


git-svn-id: http://core.svn.wordpress.org/trunk@48904 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-14 02:02:06 +00:00
Peter Wilson fa5a6c8622 Taxonomy: Improve performance of term recounting database queries.
When modifying terms assigned to an object, replace full term recounts with incrementing/decrementing the count as appropriate. This provides a significant performance boost on sites with a high number of term/object relationships and/or posts.

Introduces the functions `wp_increment_term_count()`, `wp_decrement_term_count()`, `wp_modify_term_count_by()` and `wp_modify_term_count_by_now()` for updating the term count.

Introduces the function `_wp_prevent_term_counting()` for preventing double counting on posts that are about to transition.

Adds the parameter `update_count_by_callback` to `register_taxonomy()` to allow developers to use a custom callback for incrementing or decrementing a term count.

Props boonebgorges, davidbaumwald, hellofromTonya, johnbillion, lcyh78, mattoperry, peterwilsoncc, rebasaurus, whyisjake.
Fixes #40351.


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


git-svn-id: http://core.svn.wordpress.org/trunk@48903 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-14 00:51:06 +00:00
Sergey Biryukov 8859aea3e2 Tests: Correct the message in a sitemaps test for getting a URL list for a custom taxonomy that is not publicly queryable.
Follow-up to [48474].

See #51344, #50607.
Built from https://develop.svn.wordpress.org/trunk@49140


git-svn-id: http://core.svn.wordpress.org/trunk@48902 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-14 00:27:07 +00:00
Dominik Schilling 4dfe5ecfe1 Users: Enable Application Passwords for local development environments, even if HTTPS is not available.
This will make testing the new feature easier since the local development environment is only accessible via HTTP by default.
Also update docs to link to the relevant filters.

See #42790.
Fixes #51503.
Built from https://develop.svn.wordpress.org/trunk@49139


git-svn-id: http://core.svn.wordpress.org/trunk@48901 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-13 20:10:04 +00:00
Dominik Schilling 7137daec42 Administration: Restore alternative admin menu position for menu items with the same position value as an existing menu item.
Reverts parts of [49108].

Props johnjamesjacoby.
Fixes #42918.
Built from https://develop.svn.wordpress.org/trunk@49138


git-svn-id: http://core.svn.wordpress.org/trunk@48900 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-13 19:59:08 +00:00
Sergey Biryukov 6fe59c4bdc Sitemaps: Check the result of `get_term_link()` when collecting the URLs in `WP_Sitemaps_Taxonomies::get_url_list()`.
This avoids a PHP warning during sitemap generation if `get_term_link()` returns an error, e.g. due to term ID being shared between multiple taxonomies.

Additionally, pass the `$taxonomy` argument to `get_term_link()` to properly disambiguate the call.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48899 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-13 15:04:07 +00:00
Sergey Biryukov 1ef20f8638 External Libraries: Upgrade PHPMailer to version 6.1.8.
For a full list of changes in this update, see the PHPMailer GitHub:
https://github.com/PHPMailer/PHPMailer/compare/v6.1.7...v6.1.8

Props ayeshrajans.
Fixes #51502.
Built from https://develop.svn.wordpress.org/trunk@49136


git-svn-id: http://core.svn.wordpress.org/trunk@48898 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-13 14:00:10 +00:00
jorgefilipecosta b667105f60 Editor: update packages; Port block supports to WordPress core.
The following package versions were changed:
@wordpress/a11y: 2.11.0 -> 2.13.0
@wordpress/annotations: 1.20.4 -> 1.22.0
@wordpress/api-fetch: 3.18.0 -> 3.20.0
@wordpress/autop: 2.9.0 -> 2.10.0
@wordpress/blob: 2.9.0 -> 2.10.0
@wordpress/block-directory: 1.13.7 -> 1.16.0
@wordpress/block-editor: 4.3.7 -> 5.0.0
@wordpress/block-library: 2.22.7 -> 2.25.0
@wordpress/block-serialization-default-parser: 3.7.0 -> 3.8.0
@wordpress/blocks: 6.20.3 -> 6.23.0
@wordpress/components: 10.0.6 -> 11.0.0
@wordpress/compose: 3.19.3 -> 3.21.0
@wordpress/core-data: 2.20.3 -> 2.23.0
@wordpress/data: 4.22.3 -> 4.24.0
@wordpress/data-controls: 1.16.3 -> 1.18.0
@wordpress/date: 3.10.0 -> 3.12.0
@wordpress/deprecated: 2.9.0 -> 2.10.0
@wordpress/dom: 2.13.1 -> 2.15.0
@wordpress/dom-ready: 2.10.0 -> 2.11.0
@wordpress/e2e-test-utils: 4.11.2 -> 4.14.0
@wordpress/edit-post: 3.21.7 -> 3.24.0
@wordpress/editor: 9.20.7 -> 9.23.0
@wordpress/element: 2.16.0 -> 2.18.0
@wordpress/escape-html: 1.9.0 -> 1.10.0
@wordpress/format-library: 1.22.7 -> 1.24.0
@wordpress/hooks: 2.9.0 -> 2.10.0
@wordpress/html-entities: 2.8.0 -> 2.9.0
@wordpress/i18n: 3.14.0 -> 3.16.0
@wordpress/icons: 2.4.0 -> 2.7.0
@wordpress/is-shallow-equal: 2.1.0 -> 2.3.0
@wordpress/keyboard-shortcuts: 1.9.3 -> 1.11.0
@wordpress/keycodes: 2.14.0 -> 2.16.0
@wordpress/library-export-default-webpack-plugin: 1.7.0 -> 1.9.0
@wordpress/list-reusable-blocks: 1.21.6 -> 1.23.0
@wordpress/media-utils: 1.15.0 -> 1.17.0
@wordpress/notices: 2.8.3 -> 2.10.0
@wordpress/nux: 3.20.6 -> 3.22.0
@wordpress/plugins: 2.20.3 -> 2.22.0
@wordpress/primitives: 1.7.0 -> 1.9.0
@wordpress/priority-queue: 1.7.0 -> 1.9.0
@wordpress/redux-routine: 3.10.0 -> 3.12.0
@wordpress/rich-text: 3.20.4 -> 3.22.0
@wordpress/scripts: 12.1.1 -> 12.3.0
@wordpress/server-side-render: 1.16.6 -> 1.18.0
@wordpress/shortcode: 2.9.0 -> 2.11.0
@wordpress/token-list: 1.11.0 -> 1.13.0
@wordpress/url: 2.17.0 -> 2.19.0
@wordpress/viewport: 2.21.3 -> 2.23.0
@wordpress/warning: 1.2.0 -> 1.3.0
@wordpress/wordcount: 2.10.0 -> 2.12.0

Props isabel_brison, youknowriad, mcsf.
Fixes #51461.
Built from https://develop.svn.wordpress.org/trunk@49135


git-svn-id: http://core.svn.wordpress.org/trunk@48897 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-13 13:10:30 +00:00
Andrew Ozz 2c5953e876 Add `svn:eol-style native` to new files.
See #50564.
Built from https://develop.svn.wordpress.org/trunk@49134


git-svn-id: http://core.svn.wordpress.org/trunk@48896 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-13 09:20:06 +00:00
TimothyBlynJacobs ba5b09af09 REST API: Add HTTP/1.0 emulation to wp.apiRequest().
This allows for making REST API calls with the PUT and DELETE HTTP methods that may be blocked or unsupported by some server configurations.

Props yakimun.
Fixes #43605.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48895 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-12 20:11:06 +00:00
TimothyBlynJacobs 49a399db05 REST API: Introduce search post format handler.
This allows for clients to search the used post formats via the /wp/v2/search endpoint by using a type=post-format query parameter.
Fixes #51459.
Props andraganescu, zieladam, noisysocks, TimothyBlynJacobs.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48894 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-12 19:54:05 +00:00
Sergey Biryukov e36a4a7db9 Rewrite Rules: Add missing newline to the `HTTP_AUTHORIZATION` rewrite rule.
Follow-up to [49109].

Props nendeb55, georgestephanis, johnbillion.
Fixes #51495. See #42790.
Built from https://develop.svn.wordpress.org/trunk@49131


git-svn-id: http://core.svn.wordpress.org/trunk@48893 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-12 19:10:07 +00:00
Sergey Biryukov 69217eb85b Docs: Correct comments in `wpmu_new_site_admin_notification()` per the documentation standards.
See #42134.
Built from https://develop.svn.wordpress.org/trunk@49130


git-svn-id: http://core.svn.wordpress.org/trunk@48892 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-12 15:47:11 +00:00
jorgefilipecosta 1c7ebdab9f Add wp-packages-update command to update WordPress packages.
This ticket exposes the packages-update script implemented at https://github.com/WordPress/gutenberg/pull/19448 on WordPress core.
By running "npm run wp-packages-update" all the WordPress packages are updated to the latest version. The command is very useful when updating the Gutenberg editor core exposes.

Props isabel_brison.
Fixes #51491.
Built from https://develop.svn.wordpress.org/trunk@49129


git-svn-id: http://core.svn.wordpress.org/trunk@48891 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-12 12:01:09 +00:00
John Blackbourn 33070fb7d2 Media: Allow the `gallery_shortcode()` and `get_image_tag()` functions to correctly accept an array of image dimensions.
These functions did previously accept an array of image dimensions but their class attributes were not properly constructed.

Fixes #51362

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


git-svn-id: http://core.svn.wordpress.org/trunk@48890 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-11 20:01:06 +00:00
John Blackbourn e11accb411 Networks and Sites: Extract into a new function the email that gets sent to the network administrator when a new site is created, and introduce filters to disable and modify its
contents.

* The `send_new_site_email` filter can be used to disable this email.
* The `new_site_email` filter can be used to modify its contents.

Props Dhruvin, Dharm1025, dharmin16, jipmoors

Fixes #42134

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


git-svn-id: http://core.svn.wordpress.org/trunk@48889 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-11 19:29:08 +00:00
Sergey Biryukov 8d945f4811 Tests: Use `assertSame()` in `test_edit_user_blank_password()`, for consistency with other assertions.
Follow-up to [49118].

See #42766, #38266.
Built from https://develop.svn.wordpress.org/trunk@49126


git-svn-id: http://core.svn.wordpress.org/trunk@48888 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-11 15:51:06 +00:00
John Blackbourn bd1fa2d998 Posts, Post Types: Switch to restoring posts to `draft` status by default when they are untrashed.
This allows for edits to be made to a restored post before it goes live again. This also prevents scheduled posts being published unexpectedly if they are untrashed after their originally scheduled date.

The old behaviour of restoring untrashed posts to their original status can be reinstated using the `wp_untrash_post_set_previous_status()` helper function.

Also fixes an issue where the incorrect post ID gets passed to hooks if no post ID is passed to the function.

Props harrym, bananastalktome, jaredcobb, chriscct7, melchoyce, johnbillion, pankajmohale

Fixes #23022

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


git-svn-id: http://core.svn.wordpress.org/trunk@48887 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-11 13:39:07 +00:00
Sergey Biryukov 9bfc867e66 Docs: Correct comments in `test_wp_add_dashboard_widget()` per the documentation standards.
See #42791.
Built from https://develop.svn.wordpress.org/trunk@49124


git-svn-id: http://core.svn.wordpress.org/trunk@48886 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-11 02:37:07 +00:00
John Blackbourn da04189357 Administration: Allow context and priority to be specified when adding dashboard widgets.
Props davidjlaietta, soulseekah, johnbillion

Fixes #42791

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


git-svn-id: http://core.svn.wordpress.org/trunk@48885 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-10 20:40:05 +00:00
John Blackbourn cdd8b2cbfa Site Health: Remove an unused function that was erroneously added when the site health feature was introduced.
This function was and is never used as the `is_in_debug_mode` check is a direct one.

Fixes #50282

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


git-svn-id: http://core.svn.wordpress.org/trunk@48884 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-10 20:24:03 +00:00
John Blackbourn a7fafb3a1b Build/Test Tools: Set the local development environment to a `local` environment type by default.
Props igorradovanov, TimothyBlynJacobs

Fixes #50903

See #33161

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


git-svn-id: http://core.svn.wordpress.org/trunk@48883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-10 20:15:04 +00:00
John Blackbourn 905460bd5e Docs: Standardise the type name for booleans and integers.
This brings these docs inline with the documentation standards.

Props ravipatel, justinahinon

Fixes #51426

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


git-svn-id: http://core.svn.wordpress.org/trunk@48882 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-10 20:02:05 +00:00
John Blackbourn 6b7ba33d68 Docs: Fix the types for some properties and parameters that use the generic `object` type.
See #50768

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


git-svn-id: http://core.svn.wordpress.org/trunk@48881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-10 19:14:04 +00:00
Adam Silverstein e3d280ffd8 Users: prevent saving empty passwords, trim space from password ends on save.
Fix an issue where users could save a password with only spaces, or spaces at the beginning or end of their password, preventing them from logging in.

Props ronakganatra, 1naveengiri, ajensen, oolleegg55, bookdude13, nrqsnchz, aristath.
Fixes #42766.


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


git-svn-id: http://core.svn.wordpress.org/trunk@48880 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-10 16:51:07 +00:00
Sergey Biryukov 3e10f5a7e8 Tests: Update third-party video URLs in unit tests with more permanent videos.
This brings some consistency to the YouTube and Vimeo URLs used for tests:

* For YouTube, use the video of WordPress 5.0 release.
* For Vimeo, use one of the official test videos.

Props garrett-eclipse, dd32.
Fixes #51487. See #meta5467.
Built from https://develop.svn.wordpress.org/trunk@49117


git-svn-id: http://core.svn.wordpress.org/trunk@48879 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-10 01:39:11 +00:00
John Blackbourn c1401d7009 General: Docblock improvements for the `WP_Error` class.
Props garrett-eclipse

See #38777

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


git-svn-id: http://core.svn.wordpress.org/trunk@48878 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-09 22:30:04 +00:00
John Blackbourn 543b14ed0a General: Introduce the ability to merge multiple `WP_Error` objects into one another, and to store more than one item of data for an error.
This allows multiple errors to be instantiated independently but collected into one without having to manually combine their properties.

Props rmccue, dlh, TimothyBlynJacobs

Fixes #38777

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


git-svn-id: http://core.svn.wordpress.org/trunk@48877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-09 22:22:05 +00:00
iandunn 92dacfafaf Dashboard: Show `2` w.org news items to preserve clustered posts.
These days there are often 2 posts published close to each other, like a release announcement and a Month In WordPress post. When that happens, the earlier post is often pushed out of the widget before many people have had a chance to see it.

Ideally, the number of total items would remain at `4`, to reduce visual clutter. Implementing a conditional item would require a significant refactor, though. Increasing the total number of items to `5` is a practical compromise.

Props hlashbrooke, tellyworth.
Fixes #43441.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-09 16:07:07 +00:00
Sergey Biryukov c628344422 Accessibility: Widgets: Add a "Cancel" link when editing a widget in accessibility mode.
This allows the user to go back without saving any changes to the widget.

Props garrett-eclipse, audrasjb, afercia.
Fixes #49354.
Built from https://develop.svn.wordpress.org/trunk@49113


git-svn-id: http://core.svn.wordpress.org/trunk@48875 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-09 15:53:08 +00:00
Sergey Biryukov 7a622f6ffd Tests: Use consistent wording for the `$position` parameter in `add_submenu_page()` tests.
This replaces the instances of `$priority` with `$position`, to match the actual parameter name and avoid confusion.

Follow-up to [46197].

See #51344, #39776.
Built from https://develop.svn.wordpress.org/trunk@49112


git-svn-id: http://core.svn.wordpress.org/trunk@48874 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-09 13:29:06 +00:00
Sergey Biryukov 4419f9b889 Docs: Correct description for `wp_set_comment_status` hook.
The action fires immediately after transitioning a comment's status from one to another in the database and removing the comment from the object cache, but prior to all status transition hooks.

Props davidbaumwald, henry.wright.
Fixes #51481.
Built from https://develop.svn.wordpress.org/trunk@49111


git-svn-id: http://core.svn.wordpress.org/trunk@48873 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-09 01:28:04 +00:00
Sergey Biryukov 5affd982a0 I18N: Add missing placeholders in some translator comments.
Follow-up to [49109].

See #42790.
Built from https://develop.svn.wordpress.org/trunk@49110


git-svn-id: http://core.svn.wordpress.org/trunk@48872 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-09 01:06:03 +00:00
TimothyBlynJacobs d5ebe12f11 REST API: Introduce Application Passwords for API authentication.
In WordPress 4.4 the REST API was first introduced. A few releases later in WordPress 4.7, the Content API endpoints were added, paving the way for Gutenberg and countless in-site experiences. In the intervening years, numerous plugins have built on top of the REST API. Many developers shared a common frustration, the lack of external authentication to the REST API.

This commit introduces Application Passwords to allow users to connect to external applications to their WordPress website. Users can generate individual passwords for each application, allowing for easy revocation and activity monitoring. An authorization flow is introduced to make the connection flow simple for users and application developers.

Application Passwords uses Basic Authentication, and by default is only available over an SSL connection.

Props georgestephanis, kasparsd, timothyblynjacobs, afercia, akkspro, andraganescu, arippberger, aristath, austyfrosty, ayesh, batmoo, bradyvercher, brianhenryie, helen, ipstenu, jeffmatson, jeffpaul, joostdevalk, joshlevinson, kadamwhite, kjbenk, koke, michael-arestad, Otto42, pekz0r, salzano, spacedmonkey, valendesigns.
Fixes #42790.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-08 22:14:06 +00:00
Sergey Biryukov 897f004a9c General: Replace older-style PHP type conversion functions with type casts.
This improves performance, readability, and consistency throughout core.

* `intval()` → `(int)`
* `strval()` → `(string)`
* `floatval()` → `(float)`

Props ayeshrajans.
Fixes #42918.
Built from https://develop.svn.wordpress.org/trunk@49108


git-svn-id: http://core.svn.wordpress.org/trunk@48870 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-08 21:15:13 +00:00
Sergey Biryukov f25804699f Build/Test Tools: Add missing `<ul>` tag in `tests/qunit/index.html`.
Props ravipatel, JeffPaul.
Fixes #51473.
Built from https://develop.svn.wordpress.org/trunk@49107


git-svn-id: http://core.svn.wordpress.org/trunk@48869 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-08 18:29:07 +00:00
Sergey Biryukov 5f2f199a75 Twenty Ten: Docs: Fix typo in `twentyten_custom_excerpt_more()` DocBlock.
Update `@return` tag for `twentyten_auto_excerpt_more()` for consistency with Twenty Eleven.

See #51477, #50768.
Built from https://develop.svn.wordpress.org/trunk@49106


git-svn-id: http://core.svn.wordpress.org/trunk@48868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-08 09:26:02 +00:00
Sergey Biryukov 37c3854083 Twenty Eleven: Docs: Add missing `@return` type for `twentyeleven_auto_excerpt_more()`.
Props ravipatel.
Fixes #51477.
Built from https://develop.svn.wordpress.org/trunk@49105


git-svn-id: http://core.svn.wordpress.org/trunk@48867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-08 09:23:07 +00:00
noisysocks 92f3ef5980 Tests: Fix dependency tests
Fixes test_block_styles_for_editing_with_theme_support and
test_block_styles_for_viewing_with_theme_support by partially reverting [49102]
and only calling wp_should_load_block_editor_scripts_and_styles() when on an
admin screen.

Props TimothyBlynJacobs.
See #51330.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48866 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-08 03:36:04 +00:00
TimothyBlynJacobs f5c67c386f REST API: Introduce search term handler.
This allows for clients to search the available terms via the `/wp/v2/search` endpoint by using a `type=term` query parameter.

Fixes #51458.
Props andraganescu, zieladam, noisysocks, TimothyBlynJacobs.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48865 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-08 01:32:05 +00:00
noisysocks 0dc073e589 Editor: Only call should_load_block_editor_scripts_and_styles on admin screens
Do not call the should_load_block_editor_scripts_and_styles filter on non-admin
screens. This makes it less likely that one will accidentally call
get_current_screen() when it doesn't exist.

Follow-up to [49080].
Props noahtallen.
See #51330.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48864 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-08 01:21:07 +00:00
Andrew Ozz 5cee7eced0 Update jQuery step two:
- Add jquery-migrate.js v.3.3.1 to core and load it in debug mode when `SCRIPT_DEBUG` is true.
- Add jquery.min.js, update jquery.js to 3.5.1 non-minified. This should help when debugging.
- Rebuild jQuery UI 1.12.1 and add it to core.
- Fix/adjust tests to match the above changes.

See #50564.
Built from https://develop.svn.wordpress.org/trunk@49101


git-svn-id: http://core.svn.wordpress.org/trunk@48863 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-07 16:33:25 +00:00
desrosj 0c64f0c663 Build/Test Tools: Ensure arguments are passed correctly for `test:php-composer` commands.
Follow-up to [49099].

Props swissspidy.
See #51456.
Built from https://develop.svn.wordpress.org/trunk@49100


git-svn-id: http://core.svn.wordpress.org/trunk@48862 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-07 13:21:04 +00:00
desrosj 6af2d1f4a5 Build/Test Tools: Add NPM script for using the Composer installed version of PHPUnit.
The `test:php` NPM script runs the PHP test suite using the system installed version of PHPUnit. In some cases, the version of PHPUnit installed through Composer may be preferred.

Currently, this is true when running the test suite using PHP 8. In order to add support for PHP 8 while maintaining compatibility for PHP 5.6.20, PHPUnit 7.x must be used. But, some modifications are required to be compatible with PHP 8 (see [49037], [48957]).

This change introduces the `test:php-composer` NPM script, which will run the test suite using the composer installed version.

Props desrosj, SergeyBiryukov.
Fixes #51456.
Built from https://develop.svn.wordpress.org/trunk@49099


git-svn-id: http://core.svn.wordpress.org/trunk@48861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-07 13:10:05 +00:00
Sergey Biryukov 520be16b6e Docs: Add missing `@return` tag for `wp_xmlrpc_server::_is_greater_than_one()`.
Props ankitmaru.
Fixes #51465.
Built from https://develop.svn.wordpress.org/trunk@49098


git-svn-id: http://core.svn.wordpress.org/trunk@48860 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-07 11:02:03 +00:00
Sergey Biryukov a6ef541df0 Coding Standards: Add missing space in `js/_enqueues/lib/comment-reply.js`.
Props saqibameen, hareesh-pillai, imath, davidbaumwald.
Fixes #43907.
Built from https://develop.svn.wordpress.org/trunk@49097


git-svn-id: http://core.svn.wordpress.org/trunk@48859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-07 10:38:08 +00:00
Sergey Biryukov aef2b539cd Docs: Correct `@since` version for `add_allowed_options()`.
Follow-up to [48121].

Props coffee2code.
Fixes #51450.
Built from https://develop.svn.wordpress.org/trunk@49096


git-svn-id: http://core.svn.wordpress.org/trunk@48858 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-06 15:55:05 +00:00
Sergey Biryukov 2670a6ad14 Docs: Synchronize descriptions of some query functions and their counterpart methods in `WP` and `WP_Query` classes:
* `set_query_var()`
* `get_query_var()`
* `get_queried_object()`
* `get_queried_object_id()`

Switch to third-person singular verbs, per the documentation standards.

See #50768, #42783.
Built from https://develop.svn.wordpress.org/trunk@49095


git-svn-id: http://core.svn.wordpress.org/trunk@48857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-06 08:59:04 +00:00
noisysocks 088aa1e864 Docs: Improve set_query_var() inline docs.
Makes the inline docs for set_query_var() consistent with the inline docs for
get_query_var().

See #42783.
Props stevenlinx, markparnell.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48856 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-06 05:40:11 +00:00
noisysocks 274cb9718d Editor: Rename _should_load_block_editor_scripts_and_styles to wp_should_load_block_editor_scripts_and_styles
Follow-up to [49080].
Props zieladam, frank-klein.
See #51330.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-06 04:18:10 +00:00
Sergey Biryukov dc7bda9620 Docs: Add brackets to function names in some `@see` tags, for consistency.
Props ravipatel, davidbaumwald.
Fixes #51441.
Built from https://develop.svn.wordpress.org/trunk@49092


git-svn-id: http://core.svn.wordpress.org/trunk@48854 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-05 14:03:02 +00:00
Sergey Biryukov bea55db921 Docs: Add missing `@return` tag to `Language_Pack_Upgrader::check_package()`.
Synchronize documentation of the `::check_package()` method between `Plugin_Upgrader`, `Theme_Upgrader`, and `Language_Pack_Upgrader`.

Props ankitmaru, mukesh27, desrosj.
Fixes #51448.
Built from https://develop.svn.wordpress.org/trunk@49091


git-svn-id: http://core.svn.wordpress.org/trunk@48853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-05 13:44:11 +00:00
Sergey Biryukov 1651342d2b Privacy: Improve clarity of privacy error strings.
Primarily this adds "user privacy" to the strings for privacy requests, so they are more easily distinguished from other system actions within logs.

Props garrett-eclipse, carike, birgire.
Fixes #51351.
Built from https://develop.svn.wordpress.org/trunk@49090


git-svn-id: http://core.svn.wordpress.org/trunk@48852 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-04 03:23:09 +00:00
Sergey Biryukov 0f13b2c268 Docs: Add `@since` notes for the `$id` parameter of REST API search controller accepting a string.
Follow-up to [49088].

See #51131.
Built from https://develop.svn.wordpress.org/trunk@49089


git-svn-id: http://core.svn.wordpress.org/trunk@48851 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-03 01:22:11 +00:00
TimothyBlynJacobs e9b5b1a5bc REST API: Allow for string ids in the search controller.
Previously, the search controller infrastructure required that the id property was an integer. This prevents data models that use a string id from utilizing the search infrastructure.

This commit lifts the restraint that search handlers return integer ids. This will allow for the Post Formats search handler coming in 5.6 to use slugs instead of creating fake ids.

Props stoyangeorgiev.
Fixes #51131.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48850 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-02 17:47:09 +00:00
Adam Silverstein f426a1fa04 Media: clear inputs after cropping on attachment details screen.
Clear the crop selection input fields after the crop action is complete. 
Fixes unexpected re-cropping behavior if the crop button was clicked more than once.

Props davidbinda.
Fixes #30155.


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


git-svn-id: http://core.svn.wordpress.org/trunk@48849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-02 15:11:06 +00:00
Sergey Biryukov f880f14080 Coding Standards: Make checks for an empty post in `wp-includes/post.php` more consistent.
See #50767.
Built from https://develop.svn.wordpress.org/trunk@49086


git-svn-id: http://core.svn.wordpress.org/trunk@48848 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-02 12:37:06 +00:00
Helen Hou-Sandí b6641140fd Tests: Fix a linting error in a test.
See #50679.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48847 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-01 21:44:09 +00:00
Helen Hou-Sandí b108d4db71 Media: Don't unnecessarily check for a valid attachment before getting meta.
This makes `wp_get_attachment_metadata()` run significantly faster. See ticket for benchmarking.

Props Tkama, donmhico.
Fixes #50679.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48846 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-01 17:55:06 +00:00
Helen Hou-Sandí e9d572f431 WP Date: Add timezone abbreviation to wp-date settings.
Props mkaz.
Fixes #50624.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48845 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-01 17:43:08 +00:00
TimothyBlynJacobs 69b9b23c49 REST API: Support the patternProperties JSON Schema keyword.
Props yakimun.
Fixes #51024.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48844 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-01 02:49:12 +00:00
Sergey Biryukov 0d52ba511c Docs: Add missing `@since` entry for `_should_load_block_editor_scripts_and_styles()`.
Follow-up to [49080].

See #51330.
Built from https://develop.svn.wordpress.org/trunk@49081


git-svn-id: http://core.svn.wordpress.org/trunk@48843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-01 01:14:04 +00:00
noisysocks 96f963a2b9 Editor: Add should_load_block_editor_scripts_and_styles
Adds a new should_load_block_editor_scripts_and_styles filter which can be used
by plugins including Gutenberg to more precisely customise when block editor
scripts and styles should be loaded by script-loader.php. Previously, plugins
had to fiddle with $current_screen->is_block_editor(). 

Props zieladam.
See #51330.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48842 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-01 00:39:04 +00:00
Sergey Biryukov ca7063fd60 Script Loader: Update versions for MediaElement.js and related files.
Follow-up to [49070].

See #51315.
Built from https://develop.svn.wordpress.org/trunk@49079


git-svn-id: http://core.svn.wordpress.org/trunk@48841 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-10-01 00:04:05 +00:00
John Blackbourn 1079647d30 Docs: Various docblock improvements related to user and site signup functionality.
See #50768

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


git-svn-id: http://core.svn.wordpress.org/trunk@48840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-30 21:54:07 +00:00
Sergey Biryukov f7ba7c931c Build/Test Tools: Remove PHP 8 from allowed failures.
With all known unit test issues now addressed, WordPress 5.6 aims to support PHP 8 as much as possible.

See #50913, #50902.
Built from https://develop.svn.wordpress.org/trunk@49077


git-svn-id: http://core.svn.wordpress.org/trunk@48839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-30 16:05:06 +00:00
Sergey Biryukov 829fc28a93 Code Modernization: Ignore the `_multiwidget` property when collecting widget numbers in `WP_Customize_Manager::import_theme_starter_content()`.
PHP 8 changes the way string to number comparisons are performed: https://wiki.php.net/rfc/string_to_number_comparison

In particular, when calling `max()` on an array with numeric values and a non-numeric string, in PHP 8 the string is returned instead of a number.

For `::import_theme_starter_content()`, this resulted in retrieving the `_multiwidget` property instead of the maximum widget number for a particular type.

By explicitly ignoring the `_multiwidget` property, we make sure to retrieve the correct widget number value.

Follow-up to [48960], [49043].

See #50913.
Built from https://develop.svn.wordpress.org/trunk@49076


git-svn-id: http://core.svn.wordpress.org/trunk@48838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-30 15:46:08 +00:00
Sergey Biryukov 09570be924 Docs: Fix typos in some DocBlocks in `js/_enqueues/wp/api.js`.
Additionally, rename a variable for clarity.

Props mukesh27.
Fixes #51420.
Built from https://develop.svn.wordpress.org/trunk@49075


git-svn-id: http://core.svn.wordpress.org/trunk@48837 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-30 13:54:06 +00:00
Sergey Biryukov 36c3a480c8 Build/Test Tools: Comment out the `xdebug` group test run for PHP 8 for now.
Xdebug supports PHP 8 only from version 3.0, which is not released yet.

Once Xdebug 3.0 is released and included in the Docker image, this should be uncommented again.

Follow-up to [48957], [49037].

See #50913, #50902.
Built from https://develop.svn.wordpress.org/trunk@49074


git-svn-id: http://core.svn.wordpress.org/trunk@48836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-30 13:14:04 +00:00
Sergey Biryukov bdccfa3a03 Code Modernization: Check if the file to retrieve metadata from in `get_file_data()` was successfully opened.
This avoids a fatal error on PHP 8 caused by passing a `false` value to `fread()`, instead of a file resource.

See #50913.
Built from https://develop.svn.wordpress.org/trunk@49073


git-svn-id: http://core.svn.wordpress.org/trunk@48835 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-30 12:20:03 +00:00
Sergey Biryukov e43ff0e991 Code Modernization: Return `false` from `wpdb::query()` if the query was filtered to an empty string using the `query` filter.
This avoids a fatal error on PHP 8 caused by passing an empty string to `mysqli_query()`, and maintains the current behaviour.

Follow-up to [48980], [48981].

See #50913, #50639.
Built from https://develop.svn.wordpress.org/trunk@49072


git-svn-id: http://core.svn.wordpress.org/trunk@48834 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-30 12:09:08 +00:00
Sergey Biryukov b3b8942dfc Docs: Correct description for `wp_ajax_update_widget()`.
Follow-up to [28355].

Props burhandodhy, sabernhardt.
Fixes #44583.
Built from https://develop.svn.wordpress.org/trunk@49071


git-svn-id: http://core.svn.wordpress.org/trunk@48833 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-30 09:44:09 +00:00
desrosj f3168fa073 External Libraries: Update MediaElementJS to version 4.2.16.
This change brings a handful of bug fixes made since the previous update in [46436]. For a full list of changes included, see https://github.com/mediaelement/mediaelement/compare/4.2.13...4.2.16.

Props mukesh27, hareesh-pillai, SergeyBiryukov.
Fixes #51315.
Built from https://develop.svn.wordpress.org/trunk@49070


git-svn-id: http://core.svn.wordpress.org/trunk@48832 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-29 15:53:06 +00:00
Sergey Biryukov d660801d27 Tests: Require `imagejpeg()` function in Ajax media editing tests.
This outputs a proper message if the requirement is not met, instead of an obscure failure further in the test.

These tests rely on multiple resized copies of a test JPEG image being generated and available.

Follow-up to [49010], [49024], [49025], [49045], [49050], [49052].

See #50639, #50640.
Built from https://develop.svn.wordpress.org/trunk@49069


git-svn-id: http://core.svn.wordpress.org/trunk@48831 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-29 14:16:07 +00:00
Sergey Biryukov 12a36355e6 Code Modernization: Remove a single trailing percent sign before calling `sprintf()` on the `$default` parameter in `get_theme_mod()`.
This avoids a "Missing format specifier at end of string" fatal error on PHP 8, and maintains the current behaviour.

See #50913.
Built from https://develop.svn.wordpress.org/trunk@49068


git-svn-id: http://core.svn.wordpress.org/trunk@48830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-29 10:03:08 +00:00
Sergey Biryukov 41681b29b0 Posts, Post Types: Avoid a PHP notice in `wp_get_shortlink()` if the post type is no longer registered.
Props apedog.
Fixes #51376.
Built from https://develop.svn.wordpress.org/trunk@49067


git-svn-id: http://core.svn.wordpress.org/trunk@48829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-28 11:53:08 +00:00
Sergey Biryukov f1f579199b Docs: Clarify the `false` return value of `get_post_type_archive_link()` and `get_post_type_archive_feed_link()`.
See #50768.
Built from https://develop.svn.wordpress.org/trunk@49066


git-svn-id: http://core.svn.wordpress.org/trunk@48828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-28 11:12:03 +00:00
Sergey Biryukov 249451fe08 Docs: Correct formatting for the `autosave()` function return value in `js/_enqueues/wp/autosave.js`.
Props dilipbheda, mukesh27.
Fixes #51401.
Built from https://develop.svn.wordpress.org/trunk@49065


git-svn-id: http://core.svn.wordpress.org/trunk@48827 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-28 10:46:05 +00:00
Sergey Biryukov 2cbcc5d548 Media: Make the "Copy URL" button implementation more consistent with other instances in core:
* Make the "Copied!" text green.
* Make the button verbiage clear that it's copied "to clipboard".

Props garrett-eclipse, mukesh27.
Fixes #51355.
Built from https://develop.svn.wordpress.org/trunk@49064


git-svn-id: http://core.svn.wordpress.org/trunk@48826 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-27 20:48:05 +00:00
TimothyBlynJacobs bed5797cf6 REST API: Support the multipleOf JSON Schema keyword.
Props yakimun.
Fixes #51022.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-27 19:03:05 +00:00
Sergey Biryukov 6bdbb8b25c Media: Check if the item is defined before setting the `skipHistory` property in media frame router.
This avoids a JS error when refreshing the "Attachment details" modal for an item that is not currently queried.

Follow-up to [41021].

Props Mista-Flo, mukesh27.
Fixes #51395.
Built from https://develop.svn.wordpress.org/trunk@49062


git-svn-id: http://core.svn.wordpress.org/trunk@48824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-27 08:50:06 +00:00
Sergey Biryukov c298458751 Docs: Add missing `@return` tags for some `WP_Automatic_Updater` methods:
* `::is_vcs_checkout()`
* `::should_update()`
* `::send_core_update_notification_email()`

Props ankitmaru, mukesh27.
Fixes #51385.
Built from https://develop.svn.wordpress.org/trunk@49061


git-svn-id: http://core.svn.wordpress.org/trunk@48823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-27 08:36:06 +00:00
Sergey Biryukov d36da091c4 Taxonomy: Restore documentation for the `taxonomy` parameter of `wp_list_categories()`.
The parameter's default value is different from the one in `WP_Term_Query::__construct()`, and should be documented accordingly.

This also clarifies that the `taxonomy` parameter of `wp_list_categories()` only accepts a string, not an array.

Follow-up to [40903], [41767], [45894], [45895].

Props grapplerulrich, mukesh27, TimothyBlynJacobs, SergeyBiryukov.
Fixes #51378. See #47896.
Built from https://develop.svn.wordpress.org/trunk@49060


git-svn-id: http://core.svn.wordpress.org/trunk@48822 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-27 08:19:04 +00:00
Sergey Biryukov 5c3a734df0 Docs: Correct description for the `taxonomy` parameter of `wp_dropdown_categories()`.
Follow-up to [40903], [41767].

Props grapplerulrich, mukesh27, TimothyBlynJacobs.
See #51378.
Built from https://develop.svn.wordpress.org/trunk@49059


git-svn-id: http://core.svn.wordpress.org/trunk@48821 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-27 07:49:06 +00:00
Sergey Biryukov a8b070b56b Docs: Fix typo in a comment in `js/media/routers/manage.js`.
Props mukesh27, garrett-eclipse.
Fixes #51397.
Built from https://develop.svn.wordpress.org/trunk@49058


git-svn-id: http://core.svn.wordpress.org/trunk@48820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-27 07:38:05 +00:00
Sergey Biryukov bf2edf9cab External Libraries: Backport a commit from sodium_compat trunk to fix a PHP 8 error.
This addresses an "Undefined constant `MB_OVERLOAD_STRING`" fatal error in the `ParagonIE_Sodium_Core_Util::isMbStringOverride()` method.

In PHP 8, the `MB_OVERLOAD_STRING` constant has been removed, along with the `mbstring` function overloading feature.

Fixes #51399.
Built from https://develop.svn.wordpress.org/trunk@49057


git-svn-id: http://core.svn.wordpress.org/trunk@48819 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-27 05:17:05 +00:00
Sergey Biryukov 67752b98e0 Upgrade/Install: Update sodium_compat to v1.13.0.
This includes a few autoloader fixes and improvements.

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

See #51399.
Built from https://develop.svn.wordpress.org/trunk@49056


git-svn-id: http://core.svn.wordpress.org/trunk@48818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-27 04:46:05 +00:00
TimothyBlynJacobs 0db3f859ea Add ircs and irc6 to the list of allowed protocols.
This adds support for the secure and ipv6 variants of the already allowed irc protocol.

Props arealnobrainer, markparnell, ctmartin.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48817 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-26 21:02:04 +00:00
TimothyBlynJacobs bf397c8d89 REST API: Correct @since version after [49053].
See #51023.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-26 18:56:04 +00:00
TimothyBlynJacobs 9951662ebb REST API: Support the minProperties and maxProperties JSON Schema keywords.
Props yakimun.
Fixes #51023.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48815 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-26 18:20:07 +00:00
Sergey Biryukov c9def12900 Tests: Require `imagejpeg()` function in `WP_Widget_Media_Image::render_media()` test.
This outputs a proper message if the requirement is not met, instead of an obscure failure further in the test.

This test relies on multiple resized copies of a test JPEG image being generated and available.

Follow-up to [49010], [49024], [49025], [49045], [49050].

See #50639, #50640.
Built from https://develop.svn.wordpress.org/trunk@49052


git-svn-id: http://core.svn.wordpress.org/trunk@48814 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-26 14:52:07 +00:00
Sergey Biryukov 2e56bb91a8 Tests: Correct assertion in `WP_Test_REST_Comments_Controller::check_comment_data()`.
`author_avatar_urls` should be present in the comment data array keys, not values.

The test only passed accidentally due to `assertContains()` not performing a strict type check.

See #38266, #50913.
Built from https://develop.svn.wordpress.org/trunk@49051


git-svn-id: http://core.svn.wordpress.org/trunk@48813 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-26 03:14:07 +00:00
Sergey Biryukov cd1f30e28d Tests: Require `imagejpeg()` function in one more media test.
This outputs a proper message if the requirement is not met, instead of an obscure failure further in the test.

This test relies on multiple resized copies of a test JPEG image being generated and available.

Follow-up to [49010], [49024], [49025], [49045].

See #50639, #50640.
Built from https://develop.svn.wordpress.org/trunk@49050


git-svn-id: http://core.svn.wordpress.org/trunk@48812 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-26 02:34:06 +00:00
Sergey Biryukov 346794bc57 Upload: Add a check in `wp_check_filetype_and_ext()` to account for CSV files having the `application/csv` MIME type.
Previously, the PHP Fileinfo extension used to detect CSV files as `text/plain`.

In PHP 8, this has changed, and CSV files are detected as `application/csv`.

Follow-up to [44438].

See #50913.
Built from https://develop.svn.wordpress.org/trunk@49049


git-svn-id: http://core.svn.wordpress.org/trunk@48811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-26 01:11:09 +00:00
John Blackbourn eaf325e386 Upgrade/Install: Introduce the `wp_installed_email` filter for filtering the contents of the email sent when WordPress is installed, without needing to override the `wp_new_blog_notification()` pluggable function.
Props Dharm1025, nikolam, johnbillion

Fixes #42133

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


git-svn-id: http://core.svn.wordpress.org/trunk@48810 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-25 22:33:08 +00:00
Sergey Biryukov fe9e57c1c3 Tests: Require `imagejpeg()` function in some REST API attachments controller tests.
This outputs a proper message if the requirement is not met, instead of an obscure failure further in the test.

These tests rely on multiple resized copies of a test JPEG image being generated and available.

Follow-up to [49010], [49024], [49025], [49045].

See #50639, #50640.
Built from https://develop.svn.wordpress.org/trunk@49047


git-svn-id: http://core.svn.wordpress.org/trunk@48809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-25 02:23:04 +00:00
Sergey Biryukov 5d31e4368e Tests: Correct the check for image sizes in some REST API attachments controller tests.
If the sizes data could not be retrieved, the controller returns an empty object instead of an array.

This makes sure that the value is in fact an array before proceeding, and outputs a proper message in case of failure, instead of an obscure PHP error further in the test.

Follow-up to [49044].

See #50913, #51393.
Built from https://develop.svn.wordpress.org/trunk@49046


git-svn-id: http://core.svn.wordpress.org/trunk@48808 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-25 02:11:03 +00:00
Sergey Biryukov 0485a4ad01 Tests: Require `imagejpeg()` function in some more media tests.
This outputs a proper message if the requirement is not met, instead of an obscure PHP error further in the test.

These tests rely on multiple resized copies of a test JPEG image being generated and available.

Follow-up to [49010], [49024], [49025].

See #50639, #50640.
Built from https://develop.svn.wordpress.org/trunk@49045


git-svn-id: http://core.svn.wordpress.org/trunk@48807 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-25 01:45:04 +00:00
Sergey Biryukov 312f42f375 Tests: Check if image sizes were successfully retrieved in some REST API attachments controller tests.
This outputs a proper message in case of failure, instead of an obscure PHP error further in the test.

Props TimothyBlynJacobs.
See #50913, #51393.
Built from https://develop.svn.wordpress.org/trunk@49044


git-svn-id: http://core.svn.wordpress.org/trunk@48806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-25 01:31:04 +00:00
Sergey Biryukov 4f8f42747f Code Modernization: Correct the check for `parent` argument in `wp_insert_term()` and `wp_update_term()`.
PHP 8 changes the way string to number comparisons are performed: https://wiki.php.net/rfc/string_to_number_comparison

In particular, checking if a non-empty, non-numeric string is greater than zero in PHP 8 evaluates to `true`, not `false`.

For `wp_insert_term()`, this resulted in a "Parent term does not exist" error for a non-numeric string, instead of discarding the value.

By explicitly casting the value to `int`, we make sure to compare both values as numbers, rather than a string and a number.

Follow-up to [29196], [29830], [29867].

See #50913.
Built from https://develop.svn.wordpress.org/trunk@49043


git-svn-id: http://core.svn.wordpress.org/trunk@48805 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-25 00:04:04 +00:00
Sergey Biryukov cfe5b1c9f2 Docs: Add a `@since` note to `wp_privacy_exports_dir` and `wp_privacy_exports_url` filters about exports using relative paths since WordPress 5.5.
When changing exports location via these filters, make sure to migrate the files to the new directory, to avoid breaking any existing exports.

Follow-up to [48127], [48330].

Props garrett-eclipse.
Fixes #51361.
Built from https://develop.svn.wordpress.org/trunk@49042


git-svn-id: http://core.svn.wordpress.org/trunk@48804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-24 05:00:06 +00:00
noisysocks 8fa8aad136 Documentation: Add 'template' arg documentation
Add inline documentation for the 'template' arg accepted by
register_post_type().

Props milana_cap.
See #46261.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48803 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-24 03:12:04 +00:00
noisysocks 41b456eca9 Editor: Hide Screen Options tab from block editor
The block editor provides its own interface for managing screen options, so we
can safely hide Screen Options tab found in the top right of the page.

Props aduth.
See #46157.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48802 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-24 03:00:08 +00:00
Sergey Biryukov c10acd850e Build/Test Tools: Use trunk revision 2387243 of the WordPress Importer plugin.
This revision includes a change to only call `libxml_disable_entity_loader()` in PHP < 8, in order for unit tests in the `import` group to pass on PHP 8.

This function has been deprecated in PHP 8.0 because in libxml 2.9.0, external entity loading is disabled by default, so this function is no longer needed to protect against XXE attacks.

Follow-up to [46542], [48789].

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


git-svn-id: http://core.svn.wordpress.org/trunk@48801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-23 18:39:07 +00:00
Sergey Biryukov 5c1889f3d8 Docs: Remove obsolete `$wpdb` global reference from `get_site_by_path()`.
Follow-up to [37628].

Props ravivaddweb, mukesh27.
Fixes #51380.
Built from https://develop.svn.wordpress.org/trunk@49038


git-svn-id: http://core.svn.wordpress.org/trunk@48800 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-23 14:11:07 +00:00
Sergey Biryukov a610519297 Tests: Backport two changes from PHPUnit 9.3:
* Replace the `Match` interface with `ParametersMatch`, to avoid parse errors due to `match` being a reserved keyword in PHP 8.
* Replace `ReflectionParameter::getClass()` usage, which is deprecated in PHP 8.

This allows tests relying on the `getMockForAbstractClass()` and `getMockBuilder()` methods to run again on PHP 8.

When the test suite is updated for compatibility with PHPUnit 9.x, these overrides can be removed.

Follow-up to [48972].

See #50913, #50902.
Built from https://develop.svn.wordpress.org/trunk@49037


git-svn-id: http://core.svn.wordpress.org/trunk@48799 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-23 13:54:07 +00:00
Sergey Biryukov d4a319c453 Users: Check if the user ID passed as `selected` to `wp_dropdown_users()` corresponds to an existing user.
This avoids a few PHP notices if the `include_selected` parameter was specified and a non-existing user ID was passed.

Props campusboy1987.
Fixes #51370.
Built from https://develop.svn.wordpress.org/trunk@49036


git-svn-id: http://core.svn.wordpress.org/trunk@48798 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-23 00:27:07 +00:00
desrosj a16faa6989 Privacy: Ensure bulk action related strings end with periods.
Props garrett-eclipse, mukesh27.
Fixes #51371.
Built from https://develop.svn.wordpress.org/trunk@49035


git-svn-id: http://core.svn.wordpress.org/trunk@48797 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-22 18:40:04 +00:00
desrosj 6ff2fbb6cd External Libraries: Upgrade PHPMailer to version 6.1.7.
For a full list of changes in this update, see the PHPMailer GitHub: https://github.com/PHPMailer/PHPMailer/compare/v6.1.6...v6.1.7.

Props ayeshrajans, jrf.
Fixes #51311.
Built from https://develop.svn.wordpress.org/trunk@49034


git-svn-id: http://core.svn.wordpress.org/trunk@48796 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-22 18:37:08 +00:00
Sergey Biryukov b7431cfa83 Tests: Use consistent trailing punctuation in `fail()` messages.
See #51344.
Built from https://develop.svn.wordpress.org/trunk@49033


git-svn-id: http://core.svn.wordpress.org/trunk@48795 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-22 12:34:04 +00:00
Sergey Biryukov d9346ea967 Tests: Check if image metadata for a particular size was successfully retrieved in some media tests.
This outputs a proper message in case of failure, instead of an obscure PHP error further in the test.

See #50913.
Built from https://develop.svn.wordpress.org/trunk@49032


git-svn-id: http://core.svn.wordpress.org/trunk@48794 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-22 12:32:07 +00:00
TimothyBlynJacobs 883ace38f1 REST API: Regenerate test fixtures after [48982].
Props garrett-eclipse.
Fixes #50805.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48793 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-21 22:54:06 +00:00
Sergey Biryukov 5d99107bf3 Tests: Fix typo in some `markTestSkipped()` messages.
See #51344.
Built from https://develop.svn.wordpress.org/trunk@49030


git-svn-id: http://core.svn.wordpress.org/trunk@48792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-21 20:20:07 +00:00
John Blackbourn 175c2c5b7c Users: Introduce the `invited_user_email` filter for filtering the contents of the email sent when an existing user is invited to a site on Multisite.
Props contact-banker, anand.au14, nikolam, johnbillion

Fixes #42132

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


git-svn-id: http://core.svn.wordpress.org/trunk@48791 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-21 17:16:07 +00:00
John Blackbourn aef504acfd Docs: Correct the indentation for some array type docs.
See #50768

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


git-svn-id: http://core.svn.wordpress.org/trunk@48790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-21 16:46:06 +00:00
Sergey Biryukov 790983eca4 Tests: Use consistent trailing punctuation in `markTestSkipped()` messages.
See #51344.
Built from https://develop.svn.wordpress.org/trunk@49027


git-svn-id: http://core.svn.wordpress.org/trunk@48789 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-21 14:07:05 +00:00
Sergey Biryukov 29c0edfbba Privacy: Check if the accumulated data in `wp_privacy_process_personal_data_export_page()` is not empty.
This avoids an error on PHP 8 caused by passing an empty string to `array_merge()`, instead of an array.

See #50913.
Built from https://develop.svn.wordpress.org/trunk@49026


git-svn-id: http://core.svn.wordpress.org/trunk@48788 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-21 13:51:03 +00:00
Sergey Biryukov a95e9a91da Tests: Convert a few more `function_exists()` and `extension_loaded()` checks to `@requires` annotations.
This better utilizes the PHPUnit native functionality.

Follow-up to [49024].

See #50639, #50640.
Built from https://develop.svn.wordpress.org/trunk@49025


git-svn-id: http://core.svn.wordpress.org/trunk@48787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-21 13:27:02 +00:00
Sergey Biryukov 1e39e21616 Tests: Convert the checks for `imagejpeg()` function availability to use the `@requires` annotation.
This better utilizes the PHPUnit native functionality.

Props ayeshrajans, jrf, johnbillion.
Fixes #50639. See #50640.
Built from https://develop.svn.wordpress.org/trunk@49024


git-svn-id: http://core.svn.wordpress.org/trunk@48786 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-21 11:36:04 +00:00
Sergey Biryukov 6e5ca746e1 General: Give the `$is` variable in `is_wp_error()` a more descriptive name.
Follow-up to [49022].

See #40568.
Built from https://develop.svn.wordpress.org/trunk@49023


git-svn-id: http://core.svn.wordpress.org/trunk@48785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-21 11:13:05 +00:00
John Blackbourn 964d0784be General: Introduce the `wp_error_added` and `wp_error_checked` actions.
These actions allow debugging tools to track `WP_Error` instances as they're created and subsequently passed between functions which check for error objects.

Props Shelob9, Mte90, TimothyBlynJacobs, johnbillion

Fixes #40568


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


git-svn-id: http://core.svn.wordpress.org/trunk@48784 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 17:44:07 +00:00
John Blackbourn aba2165aae Media: Standardise the description for image size parameters.
This brings continuity to all the image related functions and filters which accept or pass a size parameter.

Props dilipbheda, johnbillion

Fixes #47364

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


git-svn-id: http://core.svn.wordpress.org/trunk@48783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 16:23:07 +00:00
John Blackbourn 0b2e31a7f8 Docs: Inline documentation improvements for media related functions and hooks.
See #47364, #50768

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


git-svn-id: http://core.svn.wordpress.org/trunk@48782 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 15:55:10 +00:00
Sergey Biryukov 2884b7b1b7 Media: Return a `WP_Error` from `WP_Image_Editor_GD::load()` if file contents could not be retrieved.
This avoids an error on PHP 8 caused by calling `imagecreatefromstring()` on an empty result.

See #50913.
Built from https://develop.svn.wordpress.org/trunk@49019


git-svn-id: http://core.svn.wordpress.org/trunk@48781 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 14:28:05 +00:00
Sergey Biryukov 8752dbaaba Tests: Correctly unset non-supported image editor engines in some image tests.
Follow-up to [49009], [49014].

See #50639, #50640.
Built from https://develop.svn.wordpress.org/trunk@49018


git-svn-id: http://core.svn.wordpress.org/trunk@48780 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 14:15:03 +00:00
John Blackbourn 43b11121de Media: Correct some types for attachment ID parameters passed to functions and filters.
See #47364, #50768 

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


git-svn-id: http://core.svn.wordpress.org/trunk@48779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 14:05:05 +00:00
John Blackbourn e22107ce4e Media: Correct some types in docblocks for filters related to thumbnails.
Props dilipbheda

See #47364, #50768

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


git-svn-id: http://core.svn.wordpress.org/trunk@48778 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 13:40:04 +00:00
Sergey Biryukov e6fd778208 Tests: Use more specific assertions in `Tests_Image_Functions::test_load_directory()`.
This avoids an error on PHP 8 caused by calling `get_resource_type()` on a string.

See #50913.
Built from https://develop.svn.wordpress.org/trunk@49015


git-svn-id: http://core.svn.wordpress.org/trunk@48777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 13:33:04 +00:00
Sergey Biryukov a29b071f80 Tests: Optimize some image tests to avoid checking for image editor engines availability twice.
Follow-up to [49009].

See #50639, #50640.
Built from https://develop.svn.wordpress.org/trunk@49014


git-svn-id: http://core.svn.wordpress.org/trunk@48776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 13:27:05 +00:00
John Blackbourn 7d61c45afc I18N: Add a language icon next to the Default Language network option.
Fixes #51359

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


git-svn-id: http://core.svn.wordpress.org/trunk@48775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 13:18:05 +00:00
John Blackbourn ecfff6fe80 Media: Correct the image thumbnail logic in media templates.
This ensures the correct data properties are checked before displaying image thumbnails.

Props chetan200891

Fixes #49655

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


git-svn-id: http://core.svn.wordpress.org/trunk@48774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 13:15:04 +00:00
John Blackbourn 123806ff28 Themes: Remove the ability to delete themes from the single site Appearance screen on Multisite installations.
This brings theme deletion inline with plugin deletion and theme and plugin editing, which can only be performed from within Network Admin.

Props Mista-Flo, williampatton, johnbillion

Fixes #41441

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


git-svn-id: http://core.svn.wordpress.org/trunk@48773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 12:03:05 +00:00
Sergey Biryukov e8f35359d7 Tests: Consistently require `imagejpeg()` function in `image_make_intermediate_size()` tests.
This outputs a proper message if the requirement is not met, instead of an obscure PHP error further in the test.

See #50639, #50640.
Built from https://develop.svn.wordpress.org/trunk@49010


git-svn-id: http://core.svn.wordpress.org/trunk@48772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 03:33:05 +00:00
Sergey Biryukov 795e4ebd31 Tests: Skip some image tests if neither GD nor Imagick image editor engines are supported on the system.
The explicit message brings some consistency with other image editor tests, specifically the ones using the `WP_Image_UnitTestCase` class.

Previously, the tests were marked as "risky" in that scenario, due to performing no assertions.

See #50639, #50640.
Built from https://develop.svn.wordpress.org/trunk@49009


git-svn-id: http://core.svn.wordpress.org/trunk@48771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 02:47:05 +00:00
Sergey Biryukov 8791de899a Coding Standards: Fix WPCS issue in [49007].
See #50913.
Built from https://develop.svn.wordpress.org/trunk@49008


git-svn-id: http://core.svn.wordpress.org/trunk@48770 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 01:18:04 +00:00
Sergey Biryukov 9e3b5d2f12 Tests: Fix the failures in REST API `format` keyword validation tests on PHP 8.
The tests ensure that `rest_sanitize_value_from_schema()` and `rest_validate_value_from_schema()` throw an "undefined offset" notice when the required `type` schema keyword is not passed.

In PHP 8, that notice is now a warning, so the tests need to be adjusted accordingly.

Follow-up to [48300], [48993].

See #50913.
Built from https://develop.svn.wordpress.org/trunk@49007


git-svn-id: http://core.svn.wordpress.org/trunk@48769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-20 00:57:06 +00:00
Sergey Biryukov 4ae2bafafd Tests: Add missing `@covers` tags for files in `phpunit/tests/functions/`.
Props pbearne, jrf.
See #39265.
Built from https://develop.svn.wordpress.org/trunk@49006


git-svn-id: http://core.svn.wordpress.org/trunk@48768 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-19 15:54:03 +00:00
Sergey Biryukov 9bb4b76044 Tests: Speed up slashed data tests by reusing some more shared fixtures.
Follow-up to [35249], [49003].

See #51344.
Built from https://develop.svn.wordpress.org/trunk@49005


git-svn-id: http://core.svn.wordpress.org/trunk@48767 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-19 11:12:04 +00:00
Sergey Biryukov b27ebaa269 Coding Standards: Give the `$id` variable in slashed data tests a more descriptive name.
See #50767, #51344.
Built from https://develop.svn.wordpress.org/trunk@49004


git-svn-id: http://core.svn.wordpress.org/trunk@48766 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-19 10:55:05 +00:00
Sergey Biryukov 54fe0e0698 Tests: Speed up slashed data tests by reusing shared fixtures.
Follow-up to [35249].

See #51344.
Built from https://develop.svn.wordpress.org/trunk@49003


git-svn-id: http://core.svn.wordpress.org/trunk@48765 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-19 10:36:03 +00:00
Sergey Biryukov c50c266e51 Tests: Speed up tests for `wp_allow_comment()` by reusing shared fixtures.
Props frank-klein.
Fixes #51216.
Built from https://develop.svn.wordpress.org/trunk@49002


git-svn-id: http://core.svn.wordpress.org/trunk@48764 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-19 09:27:06 +00:00
Sergey Biryukov f2a2ffbf2c Tests: Simplify the logic in `WP_UnitTestCase_Base::setUpBeforeClass()` and `::tearDownAfterClass()`.
See #51344.
Built from https://develop.svn.wordpress.org/trunk@49001


git-svn-id: http://core.svn.wordpress.org/trunk@48763 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-19 09:13:07 +00:00
Peter Wilson b1505c2d9c Posts, Post Types: Ensure default terms are added by `wp_publish_post()`.
Transitioning posts from `auto-draft` to `publish` via `wp_publish_post()` could result in published posts without the default category or custom taxonomy default terms.

Props frank-klein, TimothyBlynJacobs, peterwilsoncc.
Fixes #51292.


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


git-svn-id: http://core.svn.wordpress.org/trunk@48762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-19 01:22:08 +00:00
Sergey Biryukov 88ea2929b7 Tests: Simplify `PluralFormsTest::test_exceptions()`.
Previously, the test had to use an older pattern for catching the generic `Exception` exceptions for compatibility with PHPUnit 3.6 on PHP 5.2.

Now that WordPress supports PHPUnit 5.4 as the minimum version, the `expectException()` method can be used directly.

Follow-up to [41725], [41730].

See #51344.
Built from https://develop.svn.wordpress.org/trunk@48999


git-svn-id: http://core.svn.wordpress.org/trunk@48761 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-18 14:13:03 +00:00
Sergey Biryukov 0e0c620dee Docs: Update the code example in `WP_Ajax_UnitTestCase::dieHandler()` DocBlock to use `expectException()`.
Follow-up to [48996], [48997].

See #51344.
Built from https://develop.svn.wordpress.org/trunk@48998


git-svn-id: http://core.svn.wordpress.org/trunk@48760 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-18 13:55:04 +00:00
Sergey Biryukov b69db72a08 Tests: Switch Ajax tests to use the `expectException()` method directly, instead of the `WP_UnitTestCase_Base::setExpectedException()` wrapper.
This brings some consistency with other tests.

Follow-up to [48996].

See #51344.
Built from https://develop.svn.wordpress.org/trunk@48997


git-svn-id: http://core.svn.wordpress.org/trunk@48759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-18 13:50:04 +00:00
Sergey Biryukov e42779f9a0 Tests: Consistently use the `expectException()` method instead of the older `@expectedException` annotation.
See https://thephp.cc/news/2016/02/questioning-phpunit-best-practices

The method is available since PHPUnit 5.2, and WordPress currently supports PHPUnit 5.4 as the minimum version.

Follow-up to [48993].

See #51344.
Built from https://develop.svn.wordpress.org/trunk@48996


git-svn-id: http://core.svn.wordpress.org/trunk@48758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-18 13:24:07 +00:00
Sergey Biryukov 68d3c5ca56 Docs: Add a `@since` note about `adjacent_posts_rel_link_wp_head()` no longer being used in core.
Follow-up to [48966].

Props jnylen0.
See #39111.
Built from https://develop.svn.wordpress.org/trunk@48995


git-svn-id: http://core.svn.wordpress.org/trunk@48757 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-18 11:06:04 +00:00
Sergey Biryukov 0cdab6e91d Docs: Add a `@since` note for the `recovery_mode_email` filter about the `$email` argument now including the `attachments` key.
Follow-up to [48964].

See #51276.
Built from https://develop.svn.wordpress.org/trunk@48994


git-svn-id: http://core.svn.wordpress.org/trunk@48756 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-18 11:03:02 +00:00
Sergey Biryukov 6f4de5f31a Tests: Fix the failure in `test_get_weekday_undefined_index()` on PHP 8.
The test ensures that `WP_Locale::get_weekday()` throws an "undefined offset" notice when called with an incorrect `$weekday_number` parameter.

In PHP 8, that notice is now a warning, so the test needs to be adjusted accordingly.

See #50913.
Built from https://develop.svn.wordpress.org/trunk@48993


git-svn-id: http://core.svn.wordpress.org/trunk@48755 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-18 10:58:03 +00:00
Sergey Biryukov ddefc9ee9a Twenty Twenty: Update the URL for PHP date formats table in translator comments.
Follow-up to [48991].

Props hareesh-pillai, mukesh27, iandunn.
Fixes #51335. See #51332.
Built from https://develop.svn.wordpress.org/trunk@48992


git-svn-id: http://core.svn.wordpress.org/trunk@48754 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-18 10:44:04 +00:00
Sergey Biryukov d5b8d282e8 Docs: Update the URL for PHP date formats table in translator comments.
Props hareesh-pillai, iandunn.
Fixes #51332.
Built from https://develop.svn.wordpress.org/trunk@48991


git-svn-id: http://core.svn.wordpress.org/trunk@48753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-18 10:37:08 +00:00
Sergey Biryukov e1a05a42d3 Comments: Assign the array of comment data returned from the `comments_pre_query` filter to the `comments` property of the current `WP_Comment_Query` instance.
This avoids the performance overhead of calling `WP_Comment_Query::get_comments()` twice: first when creating the object instance, then to retrieve the filtered results.

This also makes the filter a bit more consistent with other similar filters, e.g. `posts_pre_query`, `terms_pre_query`, or `users_pre_query`.

Follow-up to [46086].

Props dinhtungdu, imath, spacedmonkey, adamsilverstein, SergeyBiryukov.
Fixes #50521.
Built from https://develop.svn.wordpress.org/trunk@48990


git-svn-id: http://core.svn.wordpress.org/trunk@48752 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-17 19:55:08 +00:00
antpb 541796de46 Media: Allow contextually generated images to show in Media Library grid view.
In grid view, contextually generated or cropped media is filtered out causing page numbering to be offset and incorrect. This also impacted any media utilizing `media-models.js`.
Props webmandesign, audrasjb, afercia, pbiron, mista-flo.
Fixes #46127, #50410, #47215.


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


git-svn-id: http://core.svn.wordpress.org/trunk@48751 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-17 14:42:04 +00:00
Sergey Biryukov 359119a31e Tests: Move the `data_wp_site_query_meta_query()` data provider next to the test it's used in.
See #50767.
Built from https://develop.svn.wordpress.org/trunk@48988


git-svn-id: http://core.svn.wordpress.org/trunk@48750 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-17 11:30:02 +00:00
Sergey Biryukov 226dc9fc2c Docs: Correct comments in `comments_pre_query`, `networks_pre_query`, and `sites_pre_query` tests.
Follow-up to [44983], [46086].

See #50768.
Built from https://develop.svn.wordpress.org/trunk@48987


git-svn-id: http://core.svn.wordpress.org/trunk@48749 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-17 11:20:04 +00:00
Sergey Biryukov e01409866e Docs: Reformat `comments_pre_query`, `networks_pre_query`, `sites_pre_query` DocBlocks for better readability.
See #50768.
Built from https://develop.svn.wordpress.org/trunk@48986


git-svn-id: http://core.svn.wordpress.org/trunk@48748 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-17 11:10:03 +00:00
Sergey Biryukov b66ff2f68d Docs: Fix typo in `*_pre_query` filter DocBlocks.
See #50768.
Built from https://develop.svn.wordpress.org/trunk@48985


git-svn-id: http://core.svn.wordpress.org/trunk@48747 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-17 10:45:03 +00:00
Sergey Biryukov 06e53b90a1 Docs: Correct the parameter type for `networks_pre_query` filter.
The filter should return the network count as an integer if `$this->query_vars['count']` is set.

Follow-up to [46100].

See #50768, #47599.
Built from https://develop.svn.wordpress.org/trunk@48984


git-svn-id: http://core.svn.wordpress.org/trunk@48746 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-17 10:37:05 +00:00
Sergey Biryukov ac00862f44 Formatting: Make sure `links_add_target()` adds the `target` attribute to the correct tag.
Previously, the attribute could unintentionally be added to a tag that starts with the same characters, e.g. `<aside>` instead of `<a>`.

Props antonlukin.
Fixes #51313.
Built from https://develop.svn.wordpress.org/trunk@48983


git-svn-id: http://core.svn.wordpress.org/trunk@48745 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-17 10:14:07 +00:00
Helen Hou-Sandí 75262781d9 i18n: Ensure block type strings in the REST API end with a full stop.
Props ramiy, justinahinon.
Fixes #50805.


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


git-svn-id: http://core.svn.wordpress.org/trunk@48744 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-16 19:23:07 +00:00
Sergey Biryukov eef2e5c85c Code Modernization: Return an empty string from `wpdb::prepare()` if there are not enough arguments to match the placeholders.
This avoids a fatal error on PHP 8 caused by passing mismatched arguments to `vsprintf()`, and maintains the current behaviour.

Follow-up to [48979], [48980].

See #50913, #50639.
Built from https://develop.svn.wordpress.org/trunk@48981


git-svn-id: http://core.svn.wordpress.org/trunk@48743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-16 02:29:06 +00:00
Sergey Biryukov 9734ed5673 Code Modernization: Return an empty string from `wpdb::_real_escape()` if a non-scalar value is passed.
This avoids a fatal error on PHP 8 caused by passing a non-string value to ` mysqli_real_escape_string()`, and maintains the current behaviour.

See #50913, #50639.
Built from https://develop.svn.wordpress.org/trunk@48980


git-svn-id: http://core.svn.wordpress.org/trunk@48742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-16 01:48:10 +00:00
Sergey Biryukov b37e0cec1b Tests: Revert [48973].
These tests ensure that a `_doing_it_wrong()` notice is thrown when `wpdb::prepare()` is called incorrectly, but also that the function will still handle the provided input as correctly as possible.

Disabling these tests on PHP 8 hides a problem, i.e. the function will no longer throw a notice and handle things correctly, it will now cause a white screen of death due to a fatal error.

That is a backward compatibility break, and `wpdb::prepare()` should be updated instead to maintain the original behaviour on PHP 8.

Props jrf, ayeshrajans.
See #50913, #50639.
Built from https://develop.svn.wordpress.org/trunk@48979


git-svn-id: http://core.svn.wordpress.org/trunk@48741 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-16 01:35:09 +00:00
Sergey Biryukov 3838ecccdd Build/Test Tools: Restore the `QUnit` global in JSHint config for QUnit.
Follow-up to [47512], [48977].

See #51312, #37117.
Built from https://develop.svn.wordpress.org/trunk@48978


git-svn-id: http://core.svn.wordpress.org/trunk@48740 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-15 10:09:07 +00:00
Sergey Biryukov 79ab76f5d8 Build/Test Tools: Remove unused legacy globals from JSHint config for QUnit.
Follow-up to [47512].

Props TimoTijhof.
Fixes #51312. See #37117.
Built from https://develop.svn.wordpress.org/trunk@48977


git-svn-id: http://core.svn.wordpress.org/trunk@48739 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-15 10:04:05 +00:00
Sergey Biryukov 042bdf66fd Docs: Document the usage of `$wpdb` global in `wp_delete_attachment_files()`.
Props jontyravi.
Fixes #51309.
Built from https://develop.svn.wordpress.org/trunk@48976


git-svn-id: http://core.svn.wordpress.org/trunk@48738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-14 13:43:04 +00:00
Sergey Biryukov d1dbc3c69d Docs: Document the usage of `$wpdb` global in `wp_get_post_autosave()`.
Follow-up to [48422].

Props ravivaddweb.
Fixes #51308. See #34560.
Built from https://develop.svn.wordpress.org/trunk@48975


git-svn-id: http://core.svn.wordpress.org/trunk@48737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-14 13:37:06 +00:00
Sergey Biryukov f851814996 Tests: Correct assertion in `Tests_DB::test_prepare_incorrect_arg_count()`.
On failure, `wpdb::prepare()` returns either an empty string or `null`, not `false`.

The test only passed accidentally due to `assertEquals()` not performing a strict type check.

Follow-up to [41662].

See #38266.
Built from https://develop.svn.wordpress.org/trunk@48974


git-svn-id: http://core.svn.wordpress.org/trunk@48736 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-13 15:21:06 +00:00
Sergey Biryukov 7e2c6d63b7 Tests: Require PHP less than 8.0 for some `wpdb` tests.
These tests ensure that `wpdb::prepare()` throws a `_doing_it_wrong()` notice when called with an incorrect number of arguments, or with arguments of a wrong type.

PHP 8 introduces similar error messages natively, making these tests redundant on PHP 8.0 or later.

Follow-up to [41470], [41662].

See #50913.
Built from https://develop.svn.wordpress.org/trunk@48973


git-svn-id: http://core.svn.wordpress.org/trunk@48735 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-13 02:49:06 +00:00
Sergey Biryukov a2947f7054 Tests: Replace the native PHPUnit `getMockForAbstractClass()` and `getMockBuilder()` methods.
This avoids parse errors in PHPUnit internals due to `match` being a reserved keyword in PHP 8.

To run on PHP 8, the tests relying on these methods require PHPUnit 9.3 or later.

When the test suite is updated for compatibility with PHPUnit 9.x, these overrides can be removed.

See #50913, #50902.
Built from https://develop.svn.wordpress.org/trunk@48972


git-svn-id: http://core.svn.wordpress.org/trunk@48734 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-13 02:38:07 +00:00
Sergey Biryukov 282c813259 Coding Standards: Explicitly declare the `$wp_version` global used in some core files.
Props jaydeep-rami, sabernhardt.
Fixes #44932.
Built from https://develop.svn.wordpress.org/trunk@48971


git-svn-id: http://core.svn.wordpress.org/trunk@48733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-12 00:12:08 +00:00
Sergey Biryukov f29d62012d Coding Standards: Use strict comparison in `wp-admin/includes/class-wp-plugin-install-list-table.php`.
See #50767.
Built from https://develop.svn.wordpress.org/trunk@48970


git-svn-id: http://core.svn.wordpress.org/trunk@48732 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-11 01:05:08 +00:00
Helen Hou-Sandí 4e5211a691 REST API: Include attribute name in schema validation error message.
Props bobbingwide.
Fixes #51231.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-10 16:34:11 +00:00
Sergey Biryukov e36c7f0ba0 Coding Standards: Use strict comparison in `wp-admin/includes/class-wp-plugins-list-table.php`.
See #50767.
Built from https://develop.svn.wordpress.org/trunk@48968


git-svn-id: http://core.svn.wordpress.org/trunk@48730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-10 14:23:08 +00:00
Sergey Biryukov 7dada5df2f Coding Standards: Use strict comparison in `wp-admin/includes/class-wp-ms-themes-list-table.php`.
See #50767.
Built from https://develop.svn.wordpress.org/trunk@48967


git-svn-id: http://core.svn.wordpress.org/trunk@48729 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-10 14:21:09 +00:00
John Blackbourn 526f0d01d4 Posts, Post Types: Don't output the adjacent posts `rel` link by default.
This has a considerable performance impact on sites which don't otherwise show previous and next post links, and has no SEO benefit.

Props joostdevalk, swissspidy, johnbillion

Fixes #39111
Built from https://develop.svn.wordpress.org/trunk@48966


git-svn-id: http://core.svn.wordpress.org/trunk@48728 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-09 21:34:08 +00:00
Helen Hou-Sandí 447b526379 Privacy: Remove extraneous colon from settings screen.
Props vinita29, garrett-eclipse.
Fixes #50414.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48727 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-09 19:43:08 +00:00
desrosj 8e9e942215 Site Health: Allow attachments to be added to recovery mode emails.
The `wp_mail()` function has the ability to add attachments to emails. There is currently no way to add attachments to the recovery mode email sent out to site admins when a PHP error is encountered on their site.

This change adds that ability through the use of the `recovery_mode_email` filter, allowing developers to use the full capabilities of `wp_mail()`.

Props desrosj, timothyblynjacobs.
Fixes #51276.
Built from https://develop.svn.wordpress.org/trunk@48964


git-svn-id: http://core.svn.wordpress.org/trunk@48726 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-09 16:21:06 +00:00
desrosj 04c8217724 Administration: Add the `aria-hidden` attribute to admin menu icons.
The admin menu icons are included as a visual element to support the text links. Without the `aria-hidden=“true”` attribute, they are also exposed to assistive technologies (which can process icon fonts in unpredictable ways).

This change improves the experience for multiple types of assistive technologies, including screen reading and voice control software. With `aria-hidden=“true”` added, the icons will not be read, and a user can now trigger a click of a top level admin menu item with commands such as “click posts”, or “click plugins”.

Props joedolson, afercia, audrasjb, adriantirusli.
Fixes #51012.
Built from https://develop.svn.wordpress.org/trunk@48963


git-svn-id: http://core.svn.wordpress.org/trunk@48725 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-09 16:15:06 +00:00
desrosj 5be5b975c3 Docs: Improve the `recovery_mode_email` inline docs.
See #51267, #50768.
Built from https://develop.svn.wordpress.org/trunk@48962


git-svn-id: http://core.svn.wordpress.org/trunk@48724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-09 15:48:07 +00:00
Sergey Biryukov 649348cf5b Code Modernization: Remove unnecessary reference sign from `get_comment()` definition.
This fixes a PHP 8 "argument must be passed by reference, value given" error when using `array_map( 'get_comment', ... )`.

Object variables in PHP 5+ contain a reference to the object, and it's the reference that's passed around.

Note: This reverts [48838], which is now redundant.

Follow-up to a similar change for `get_post()` in [21572].

See #50913.
Built from https://develop.svn.wordpress.org/trunk@48961


git-svn-id: http://core.svn.wordpress.org/trunk@48723 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-09 03:55:07 +00:00
Sergey Biryukov 7c60a660f1 Code Modernization: Correct the check for negative post IDs in `WP_Query::parse_query()` to work as expected on PHP 8.
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 less than zero in PHP 8 evaluates to `true`, not `false`.

For `WP_Query`, this resulted in unintentionally returning a 404 error for most of front-end requests, instead of the relevant content.

By explicitly casting the value to `int`, we make sure to compare both values as numbers, rather than a string and a number.

Follow-up to [38288].

Props trepmal.
See #50913.
Built from https://develop.svn.wordpress.org/trunk@48960


git-svn-id: http://core.svn.wordpress.org/trunk@48722 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-09 02:35:06 +00:00
Sergey Biryukov 17a4c20d55 Comments: Check if a valid comment ID was passed when editing a comment.
This avoids a PHP notice after submitting the Edit Comment form.

Props regan.khadgi.
Fixes #51263.
Built from https://develop.svn.wordpress.org/trunk@48958


git-svn-id: http://core.svn.wordpress.org/trunk@48720 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-08 13:41:08 +00:00
Sergey Biryukov ed86c0da6c Build/Test Tools: Allow unit tests to run on PHP 8 in full.
PHP 8 introduces a new control structure called `match`, which makes `match` a reserved keyword in PHP 8.

One of the PHPUnit dependencies declares a class named `Match`, which triggered a fatal error before PHPUnit could even start.

To be able to use PHPUnit 7.x on PHP 8 and run the tests, core needs a new version of that dependency, which is now installed using Composer.

This is the simplest way to get things working again and start addressing the individual test failures.

Additionally, various test runs on PHP 8 on Travis are now performed individually instead of being chained, so that failures outside of WP scope don't block further execution.

Props jrf, jorbin, pento.
See #50902.
Built from https://develop.svn.wordpress.org/trunk@48957


git-svn-id: http://core.svn.wordpress.org/trunk@48719 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-07 19:23:05 +00:00
Sergey Biryukov f01b307dc1 Tests: Replace a few instances of `assertNotEquals()` with `assertNotFalse()`.
See #38266.
Built from https://develop.svn.wordpress.org/trunk@48954


git-svn-id: http://core.svn.wordpress.org/trunk@48716 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-07 04:13:09 +00:00
Sergey Biryukov d52809e5f1 Tests: Remove the polyfill for `assertNotFalse()`.
`assertNotFalse()` is available in PHPUnit since version 4.0.

The polyfill was introduced back when WordPress still supported PHP 5.2 and PHPUnit 3.6.x, and is now redundant.

Follow-up to [39919], [45058], [47880].

See #38266.
Built from https://develop.svn.wordpress.org/trunk@48953


git-svn-id: http://core.svn.wordpress.org/trunk@48715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-07 03:28:04 +00:00
Sergey Biryukov cb67321277 Tests: Add a polyfill for `assertEqualsWithDelta()` to `WP_UnitTestCase` and use it where appropriate.
`assertEqualsWithDelta()` was added in PHPUnit 7.5, while WordPress still supports PHPUnit 5.4.x as the minimum version.

See #38266.
Built from https://develop.svn.wordpress.org/trunk@48952


git-svn-id: http://core.svn.wordpress.org/trunk@48714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-07 03:14:04 +00:00
TimothyBlynJacobs 55c21acc9f REST API: Extract `WP_REST_Controller::get_endpoint_args_for_item_schema()` to a standalone function.
This method is useful whenever a JSON Schema needs to be converted to a format suitable for argument validation with `WP_REST_Request`. Moving the logic into a standalone function allows developers to use it outside of the `WP_REST_Controller` context.

Props pentatonicfunk.
Fixes #50876. 

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


git-svn-id: http://core.svn.wordpress.org/trunk@48713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-07 02:37:07 +00:00
Sergey Biryukov 6cbbd32eb5 Tests: Add a test case for storing `false` in the cache.
Follow-up to [20089], [48949].

See #38266.
Built from https://develop.svn.wordpress.org/trunk@48950


git-svn-id: http://core.svn.wordpress.org/trunk@48712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-06 04:25:04 +00:00
Sergey Biryukov b4e2dc1331 Tests: Correct assertion in `Tests_Cache::test_add_get_null()`.
It is possible to store `null` in the cache without it being converted to an empty string.

Follow-up to [20089].

Props johnbillion, SergeyBiryukov.
See #38266.
Built from https://develop.svn.wordpress.org/trunk@48949


git-svn-id: http://core.svn.wordpress.org/trunk@48711 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-06 03:37:04 +00:00
Sergey Biryukov 628a149789 Tests: Correct assertion in `Tests_Cache::test_miss()`.
On failure to retrieve contents, `WP_Object_Cache::get()` returns `false`, not `null`.

The test only passed accidentally due to `assertEquals()` not performing a strict type check.

Props johnbillion.
See #38266.
Built from https://develop.svn.wordpress.org/trunk@48948


git-svn-id: http://core.svn.wordpress.org/trunk@48710 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-06 02:53:08 +00:00
TimothyBlynJacobs a63708debf REST API: Refactor `WP_REST_Server::dispatch()` to make internal logic reusable.
#50244 aims to introduce batch processing in the REST API. An important feature is the ability to enforce that all requests have valid data before executing the route callbacks in "pre-validate" mode.

This necessitates splitting `WP_REST_Server::dispatch()` into two methods so the batch controller can determine the request handler to perform pre-validation and then respond to the requests.

The two new methods, `match_request_to_handler` and `respond_to_request`, have a public visibility, but are marked as `@access private`. This is to allow for iteration on the batch controller to happen in the Gutenberg repository. Developers should not rely upon these methods, their visibility may change in the future.

See #50244.
Props andraganescu, zieladam, TimothyBlynJacobs.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48709 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-05 21:52:07 +00:00
Sergey Biryukov 93b8183327 Media: In `wp_ajax_image_editor()`, check if the `error` property exists before accessing it.
This avoids a PHP notice when editing an image.

Follow-up to [48375].

Props Mista-Flo.
Fixes #51251.
Built from https://develop.svn.wordpress.org/trunk@48946


git-svn-id: http://core.svn.wordpress.org/trunk@48708 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-05 18:12:08 +00:00
TimothyBlynJacobs f43ca27db9 REST API: Support a route-level validation callback.
Most request data is validated on a per-parameter basis. Often, however, additional validation is needed that operates on the entire request object. Currently, this is done in the route callback and often in the `prepare_item_for_database` method specifically.

#50244 aims to introduce batch processing in the REST API. An important feature is the ability to enforce that all requests have valid data before executing the route callbacks in "pre-validate" mode.

This patch introduces support for calling a `validate_callback` after all parameter validation has succeeded. That allows moving more validation outside of the route callback and into `WP_REST_Request` which will improve "pre-validate" support.

Props TimothyBlynJacobs, zieladam.
Fixes #51255.
See #50244.



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


git-svn-id: http://core.svn.wordpress.org/trunk@48707 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-05 18:09:06 +00:00
Sergey Biryukov 63b15a6fd6 Tests: Replace a few more instances of `assertEquals()` with `assertSame()`.
These were previously missed due to incorrect capitalization.

Follow-up to [48937], [48939], [48940].

See #38266.
Built from https://develop.svn.wordpress.org/trunk@48944


git-svn-id: http://core.svn.wordpress.org/trunk@48706 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-05 16:49:07 +00:00
Sergey Biryukov e05edbcd53 Comments: Rename `WP_Comments_List_Table::comment_status_dropdown()` to `::comment_type_dropdown()`.
This better reflects the purpose of the method, which doesn't have anything to do with a comment status.

Follow-up to [48521].

Props davidbaumwald, johnbillion, SergeyBiryukov.
Fixes #51248.
Built from https://develop.svn.wordpress.org/trunk@48943


git-svn-id: http://core.svn.wordpress.org/trunk@48705 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-05 00:33:05 +00:00
Sergey Biryukov dd03a5a156 Docs: Further correct placement for `wp_editor_expand` filter DocBlock.
This ensures that the filter is only applied if the conditions before it are evaluated to true.

Follow-up to [48714].

Props johnbillion.
See #50768.
Built from https://develop.svn.wordpress.org/trunk@48942


git-svn-id: http://core.svn.wordpress.org/trunk@48704 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-04 21:48:07 +00:00
John Blackbourn d0a32c5111 Docs: Various docblock corrections and improvements.
See #50768
Built from https://develop.svn.wordpress.org/trunk@48941


git-svn-id: http://core.svn.wordpress.org/trunk@48703 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-04 20:41:07 +00:00
Sergey Biryukov 7ad3a59ca4 Tests: Replace a few more instances of `assertEquals()` with `assertSame()`.
These were previously missed due to incorrect capitalization.

Follow-up to [48937], [48939].

See #38266.
Built from https://develop.svn.wordpress.org/trunk@48940


git-svn-id: http://core.svn.wordpress.org/trunk@48702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-04 07:38:06 +00:00
Sergey Biryukov fab9a6e435 Tests: Introduce `assertSameSets()` and `assertSameSetsWithIndex()`, and use them where appropriate.
This ensures that not only the array values being compared are equal, but also that their type is the same.

These new methods replace most of the existing instances of `assertEqualSets()` and `assertEqualSetsWithIndex()`.

Going forward, stricter type checking by using `assertSameSets()` or `assertSameSetsWithIndex()` should generally be preferred, to make the tests more reliable.

Follow-up to [48937].

See #38266.
Built from https://develop.svn.wordpress.org/trunk@48939


git-svn-id: http://core.svn.wordpress.org/trunk@48701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-04 07:02:05 +00:00
Sergey Biryukov 6d0491119e Administration: Give the `$error` variable in `wp-admin/admin-header.php` a more descriptive name.
This avoids a conflict with the same global variable used elsewhere, e.g. in Theme Editor.

Follow-up to [48850].

Props vinayak.anivase.
Fixes #51219.
Built from https://develop.svn.wordpress.org/trunk@48938


git-svn-id: http://core.svn.wordpress.org/trunk@48700 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-03 01:43:07 +00:00
Sergey Biryukov 831c62ea8e Tests: First pass at using `assertSame()` instead of `assertEquals()` in most of the unit 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.

Props johnbillion, jrf, SergeyBiryukov.
See #38266.
Built from https://develop.svn.wordpress.org/trunk@48937


git-svn-id: http://core.svn.wordpress.org/trunk@48699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-02 00:37:09 +00:00
Sergey Biryukov 675f4fa43a General: Set `svn:eol-style` for `phpunit/includes/normalize-xml.xsl`.
Follow-up to [48072], [48845].

See #51113.
Built from https://develop.svn.wordpress.org/trunk@48931


git-svn-id: http://core.svn.wordpress.org/trunk@48693 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-01 16:50:09 +00:00
Sergey Biryukov 593624f182 General: Correct reversed `svn:auto-props` for `.mo` and `.po` files.
* `.mo` files are binary and should have `svn:mime-type=application/octet-stream`.
* `.po` files are text and should have `svn:eol-style=native`, same as `.pot` files.

Follow-up to [46636], [48845].

See #51113.
Built from https://develop.svn.wordpress.org/trunk@48930


git-svn-id: http://core.svn.wordpress.org/trunk@48692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-01 16:40:08 +00:00
Sergey Biryukov 0418dad234 Docs: Synchronize the description of the `$format` parameter in various date/time functions for posts and comments.
See #50768.
Built from https://develop.svn.wordpress.org/trunk@48929


git-svn-id: http://core.svn.wordpress.org/trunk@48691 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-09-01 00:43:06 +00:00
Sergey Biryukov 2df5ec1234 Tests: Move the tests for `get_the_modified_time()` to a more appropriate place.
Add some new tests to better cover the functionality, for consistency with `get_the_date()` and `get_the_time()`.

Follow-up to [48911], [48912], [48918].

Props wittich.
Fixes #51184.
Built from https://develop.svn.wordpress.org/trunk@48924


git-svn-id: http://core.svn.wordpress.org/trunk@48686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-31 22:43:05 +00:00
Sergey Biryukov 68dfbf51d9 Script Loader: Add backward compatibility for JavaScript i18n globals and properties deprecated in WordPress 5.5.
The recommended approach for any plugins using these globals or properties is to switch to the newer `wp.i18n` functions.

In the meantime, this ensures that accessing any of these globals does not break the rest of the code on the page, and an appropriate warning message is logged to the JavaScript console.

Follow-up to: https://core.trac.wordpress.org/query?summary=~wp.i18n&milestone=5.5

Props omarreiss, peterwilsoncc, kbjohnson90, johnbillion, TimothyBlynJacobs, joostdevalk, ocean90, desrosj, SergeyBiryukov.
Fixes #51123.
Built from https://develop.svn.wordpress.org/trunk@48923


git-svn-id: http://core.svn.wordpress.org/trunk@48685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-31 20:30:03 +00:00
Sergey Biryukov d3abb209e1 Date/Time: In `get_the_date()` and related functions, pass the original, unmodified `$format` value to the filters.
Additionally, simplify the `$format` argument checks for consistency with similar checks in `get_the_modified_date()` and `get_the_modified_time()`.

Follow-up to [48912].

Props Rarst.
See #51184.
Built from https://develop.svn.wordpress.org/trunk@48918


git-svn-id: http://core.svn.wordpress.org/trunk@48680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-31 18:30:05 +00:00
Sergey Biryukov d4d3e23ad0 Themes: Normalize the installed theme path in `Theme_Installer_Skin::do_overwrite()` before comparing with the uploaded theme.
This ensures that the data for the currently installed theme is picked up properly when uploading a theme update on Windows.

Follow-up to [48390].

Props bobbingwide, wpamitkumar, mukesh27.
Fixes #51182.
Built from https://develop.svn.wordpress.org/trunk@48913


git-svn-id: http://core.svn.wordpress.org/trunk@48675 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-31 17:11:04 +00:00
Sergey Biryukov aec28121b3 Date/Time: Make sure `get_the_date()` and related functions return correct time if the format was specified as `false`.
Technically, the `$format` argument should always be a string, but passing `false` used to work before [47808], so this restores backward compatibility.

The list of affected functions:
* `get_the_date()`
* `get_the_time()`
* `get_comment_date()`
* `get_comment_time()`

Props wittich, Rarst, akabarikalpesh, SergeyBiryukov.
Fixes #51184.
Built from https://develop.svn.wordpress.org/trunk@48912


git-svn-id: http://core.svn.wordpress.org/trunk@48674 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-31 15:58:04 +00:00
Sergey Biryukov e501d8ead8 Tests: Bring some consistency to Date/Time tests:
* Move some tests from `post.php` to a more appropriate location in the `date` directory.
* Rename `date/postTime.php` to `date/getPostTime.php` to match the function name.

Props Rarst.
See #51184.
Built from https://develop.svn.wordpress.org/trunk@48911


git-svn-id: http://core.svn.wordpress.org/trunk@48673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-31 15:35:05 +00:00
Sergey Biryukov ee33a7b019 Docs: Add a `@since` note to the `display_post_states` filter to clarify that it is now also applied in the Customizer context.
If any admin functions are used within the filter, their existence should be checked with `function_exists()` before being used.

Follow-up to [47763], [48620].

Props audrasjb, garrett-eclipse, Howdy_McGee, dlh, khag7, SergeyBiryukov.
Fixes #51081.
Built from https://develop.svn.wordpress.org/trunk@48910


git-svn-id: http://core.svn.wordpress.org/trunk@48672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-31 13:32:04 +00:00
Sergey Biryukov 94555079eb Docs: Clarify the usage of `null` for `auto_update_{$type}` filter.
The value is internally used to detect whether nothing has hooked into this filter.

Props audrasjb, pbiron, johnbillion, SergeyBiryukov.
Fixes #50848.
Built from https://develop.svn.wordpress.org/trunk@48909


git-svn-id: http://core.svn.wordpress.org/trunk@48671 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-31 13:20:07 +00:00
Sergey Biryukov 06fc8fa3f5 Tests: Reset the `$wp_sitemap` global after each test, so that sitemaps are re-initialized when the next test runs.
This ensures consistent results in query var tests, regardless of whether they are run in isolation or as part of a larger group of tests.

Props pbiron, peterwilsoncc.
Fixes #51154.
Built from https://develop.svn.wordpress.org/trunk@48908


git-svn-id: http://core.svn.wordpress.org/trunk@48670 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-31 03:59:05 +00:00
Sergey Biryukov ccd5fc2c8f Tests: Move the tests for `selected()` and `checked()` to a more appropriate place.
Convert the tests to use data providers.

Props wittich.
Fixes #51166.
Built from https://develop.svn.wordpress.org/trunk@48907


git-svn-id: http://core.svn.wordpress.org/trunk@48669 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-30 01:36:08 +00:00
Sergey Biryukov be4ad8548c Administration: Correct the padding for "Warning: these pages should not be the same" messages on Reading Settings screen.
Replace the legacy `.error` class with a more appropriate `.notice-warning`.

Props musicaljoeker, shital-patel, man4toman, garrett-eclipse, SergeyBiryukov.
Fixes #50766.
Built from https://develop.svn.wordpress.org/trunk@48906


git-svn-id: http://core.svn.wordpress.org/trunk@48668 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-29 00:42:05 +00:00
Sergey Biryukov af523447f4 Media: Make the `is_gd_image()` function available on front end.
This avoids a fatal error if a plugin calls image creation or editing functions like `wp_imagecreatetruecolor()` outside of the admin.

Follow-up to [48798]

Props BackuPs.
Fixes #51174. See #50833.
Built from https://develop.svn.wordpress.org/trunk@48905


git-svn-id: http://core.svn.wordpress.org/trunk@48667 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-28 16:45:06 +00:00
Sergey Biryukov 12b68c6671 Comments: Check if reply heading text node exists before accessing its property in `comment-reply.js`.
Follow-up to [47506], [48876].

Props johannadevos, mailnew2ster.
Fixes #38009.
Built from https://develop.svn.wordpress.org/trunk@48904


git-svn-id: http://core.svn.wordpress.org/trunk@48666 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-28 13:12:06 +00:00
Sergey Biryukov 71ffaac835 Docs: Correct formatting of the `auto_theme_update_send_email` filter DocBlock.
Synchronize description of the `$enabled` parameter with the `auto_plugin_update_send_email` filter.

Follow-up to [48889].

See #50768, #50988.
Built from https://develop.svn.wordpress.org/trunk@48903


git-svn-id: http://core.svn.wordpress.org/trunk@48665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-28 02:38:05 +00:00
Sergey Biryukov 308f752596 Upgrade/Install: Only display the auto-update links on the Network Admin > Themes screen for themes that support the feature.
Follow-up to [48669], [48688].

Props afragen, pbiron, audrasjb, desrosj, SergeyBiryukov.
Fixes #51129.
Built from https://develop.svn.wordpress.org/trunk@48899


git-svn-id: http://core.svn.wordpress.org/trunk@48661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-27 22:24:07 +00:00
Sergey Biryukov 3cd1c953b2 Script Loader: Disable concatenation for scripts with translations to ensure they are printed in the right order.
Props herregroen, ocean90, desrosj, mikeyarce, bobbingwide, audrasjb, johnbillion.
Fixes #50999.
Built from https://develop.svn.wordpress.org/trunk@48897


git-svn-id: http://core.svn.wordpress.org/trunk@48659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-27 21:58:04 +00:00
Sergey Biryukov c19f5ae907 Bootstrap/Load: Check if the `__()` function is available in `wp_get_environment_type()`.
The function would not exist in `SHORTINIT` mode.

Follow-up to [48894].

See #50992.
Built from https://develop.svn.wordpress.org/trunk@48895


git-svn-id: http://core.svn.wordpress.org/trunk@48657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-27 21:39:05 +00:00
Sergey Biryukov da19724be9 Bootstrap/Load: Remove the ability to alter the list of environment types in `wp_get_environment_type()`.
The intention of `wp_get_environment_type()` is to provide a consistent means of identifying the environment type, not of identifying a specific environment.

Actual environments should fit within one of the existing types: `local`, `development`, `staging`, or `production`. That should cover the types that plugins and themes might be concerned about when toggling functionality. 

Props johnbillion, joostdevalk, TimothyBlynJacobs, jeremyfelt, batmoo, claytoncollie, Clorith, markjaquith, garrett-eclipse, GaryJ, elrae.
Fixes #50992.
Built from https://develop.svn.wordpress.org/trunk@48894


git-svn-id: http://core.svn.wordpress.org/trunk@48656 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-27 21:32:08 +00:00
Sergey Biryukov bf2b283b6b Tests: Update `wp_add_inline_script()` unit tests to account for the `jquery` handle being an alias for `jquery-core` again.
Follow-up to [48323], [48324], [48890].

Props davidbaumwald, audrasjb.
See #50919.
Built from https://develop.svn.wordpress.org/trunk@48892


git-svn-id: http://core.svn.wordpress.org/trunk@48654 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-27 20:54:07 +00:00
Sergey Biryukov 4c4952d3f9 Script Loader: Change the `jquery` handle back to an alias for `jquery-core`.
This ensures that `wp_localize_script( 'jquery', ... )` continues to work as expected, since `WP_Scripts::localize()` rewrites the `jquery` handle to `jquery-core` internally.

Follow-up to [48323].

Props mukesh27, rajeshsingh520, johnbillion, TimothyBlynJacobs, TobiasBg.
Fixes #50919.
Built from https://develop.svn.wordpress.org/trunk@48890


git-svn-id: http://core.svn.wordpress.org/trunk@48652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-27 20:33:04 +00:00
desrosj 2aba7550c4 Upgrade/Install: Pass details about the specific plugin and theme updates attempted to filters.
This adds an additional parameter to the `auto_plugin_update_send_email` and `auto_theme_update_send_email` filters to provide the additional context of which updates were attempted and their outcome. This will help plugin and theme auto-update emails to be better tailored to a site owner’s liking.

Props audrasjb, Paddy Landau, desrosj.
Fixes #50988.
Built from https://develop.svn.wordpress.org/trunk@48888


git-svn-id: http://core.svn.wordpress.org/trunk@48650 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-27 19:27:03 +00:00
desrosj b0fd7c18e8 Build/Test Tools: Update the package lock file.
Follow up to [48884].
See #51151.
Built from https://develop.svn.wordpress.org/trunk@48886


git-svn-id: http://core.svn.wordpress.org/trunk@48648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-27 18:58:06 +00:00
jorgefilipecosta e9e6e0dbe6 Editor: update packages.
The following package versions were changed:
@wordpress/block-directory: 1.13.6 -> 1.13.7
@wordpress/block-editor: 4.3.6 -> 4.3.7
@wordpress/block-library: 2.22.6 -> 2.22.7
@wordpress/components: 10.0.5 -> 10.0.6
@wordpress/edit-post: 3.21.6 -> 3.21.7
@wordpress/editor: 9.20.6 -> 9.20.7
@wordpress/format-library: 1.22.6 -> 1.22.7
@wordpress/list-reusable-blocks: 1.21.5 -> 1.21.6
@wordpress/nux: 3.20.5 -> 3.20.6
@wordpress/server-side-render: 1.16.5 -> 1.16.6
Includes PR WordPress/gutenberg#24828

Props nosolosw, desrosj, SergeyBiryukov, youknowriad.
Fixes: #51151.
Built from https://develop.svn.wordpress.org/trunk@48884


git-svn-id: http://core.svn.wordpress.org/trunk@48646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-27 16:36:39 +00:00
TimothyBlynJacobs ae5fb83507 REST API: Fix multi-type schemas with integer fields.
In [48306] support for multi-typed schemas was improved to first detect the data type of the value before applying further validation. The `integer` data type was detected using the new `rest_is_integer` function. This function used logic, however, that assumed that the value had already passed an `is_numeric` check. This meant that if `integer` and `string` were both acceptable types, the value would always be considered an `integer` causing the later accurate type validation to fail.

This commit fixes the `rest_is_integer` logic to include an `is_numeric` check.

Props rtagliento.
Fixes #51146.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48643 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-27 02:57:03 +00:00
Sergey Biryukov 604b273c0f Taxonomy: Make sure `wp_terms_checklist()` and `Walker_Category_Checklist::start_el()` properly handle an array of strings as `selected_cats` or `popular_cats` values.
Even with these values documented as an array of integers, they can technically also accept an array of strings, e.g. as form results.

Add a unit test.

Props brianhogg, TimothyBlynJacobs, SergeyBiryukov.
Fixes #51137.
Built from https://develop.svn.wordpress.org/trunk@48880


git-svn-id: http://core.svn.wordpress.org/trunk@48642 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-27 02:48:06 +00:00
Sergey Biryukov 95c2f6d67f Tests: Update one more test to account for lazy-loading being disabled for custom logos by default.
Follow-up to [48870], [48874].

Props desrosj.
See #50933.
Built from https://develop.svn.wordpress.org/trunk@48878


git-svn-id: http://core.svn.wordpress.org/trunk@48640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-27 02:03:02 +00:00
Sergey Biryukov e85d243d81 Comments: Correct the check for reply element existence in `comment-reply.js`.
`document.getElementById()` returns `null` if no matching element was found, so the previous comparison didn't work as expected.

Follow-up to [47506].

Props mailnew2ster, sarahricker.
Fixes #38009.
Built from https://develop.svn.wordpress.org/trunk@48876


git-svn-id: http://core.svn.wordpress.org/trunk@48638 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-27 01:59:09 +00:00
Sergey Biryukov c015f95eee Tests: Update unit tests to account for lazy-loading being disabled for custom logos by default.
Follow-up to [48870].

See #50933.
Built from https://develop.svn.wordpress.org/trunk@48874


git-svn-id: http://core.svn.wordpress.org/trunk@48636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-27 01:55:04 +00:00
Peter Wilson 2db137784b Sitemaps: Prevent incorrect redirection of paged sitemap requests.
Update `redirect_canonical()` to account for custom pagination and URL format used by sitemaps in order to follow standard practices.

Introduce the function `get_sitemap_url()` to simplify getting the index and provider URLs as needed.

Props jonathanstegall, pbiron, GamerZ, salvoaranzulla, peterwilsoncc.
Fixes #50910.


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


git-svn-id: http://core.svn.wordpress.org/trunk@48634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-27 01:30:04 +00:00
desrosj a861ce1b5f Media: Disable lazy-loading for custom logos by default.
Custom site logos are most commonly displayed above the fold, so lazy-loading is unnecessary.

Props demetris, khag7, johnbillion, rebasaurus, audrasjb.
Fixes #50933.
Built from https://develop.svn.wordpress.org/trunk@48870


git-svn-id: http://core.svn.wordpress.org/trunk@48632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-27 01:07:11 +00:00
Sergey Biryukov aa803be1ec Upgrade/Install: Make the check for empty `home` option in `__get_option()` more resilient.
This addresses a regression in [47808], where the `home` check expected an empty string to use `siteurl` as a fallback, but `wpdb::get_var()` returns `null` if the option is empty.

Props fjarrett.
Fixes #51011.
Built from https://develop.svn.wordpress.org/trunk@48868


git-svn-id: http://core.svn.wordpress.org/trunk@48630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-26 16:57:16 +00:00
Sergey Biryukov 9700ca0f55 Quick/Bulk Edit: Revert [48134] to address the bottom "Bulk actions" dropdown not functioning properly on Posts and Users list tables.
A better solution for the original issue will be explored in a future release.

Props audrasjb, garrett-eclipse, webzunft, Krstarica, chunkysteveo, SergeyBiryukov.
Fixes #50882, #50998. See #46872.
Built from https://develop.svn.wordpress.org/trunk@48866


git-svn-id: http://core.svn.wordpress.org/trunk@48628 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-26 14:18:04 +00:00
Sergey Biryukov 868d48e773 Editor: Remove some hardcoded text color values from patterns that have body text with no specific background color.
This ensures that the patterns respect the theme's default color for body text and avoids contrast issues, particularly in dark themes.

Props nrqsnchz, mapk, fullofcaffeine.
Fixes #50892.
Built from https://develop.svn.wordpress.org/trunk@48864


git-svn-id: http://core.svn.wordpress.org/trunk@48626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-26 13:34:03 +00:00
Sergey Biryukov 8c2c812cf9 Administration: Remove non-color related styling from Modern color scheme.
Color schemes should only affect colors, to avoid diverging from a consistent and predictable layout, especially if core CSS rules subsequently change.

Follow-up to [48277], [48286], [48345].

Props Joen, johnbillion, afercia, johnjamesjacoby.
Fixes #51127. See #50504.
Built from https://develop.svn.wordpress.org/trunk@48862


git-svn-id: http://core.svn.wordpress.org/trunk@48624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-26 13:19:08 +00:00
Sergey Biryukov 3a85c4741b Twenty Twenty: Add context to adjectives and homonyms.
This allows for better localization in languages where adjectives are translated differently depending on which noun they modify, or when a different translation is required for a noun vs. a verb.

Props dimadin, justinahinon.
Fixes #49797.
Built from https://develop.svn.wordpress.org/trunk@48861


git-svn-id: http://core.svn.wordpress.org/trunk@48623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-26 01:35:11 +00:00
Sergey Biryukov 93f7b7fa81 Editor: Make some hardcoded strings in block patterns translatable.
Follow-up to [48726].

Props justinahinon, audrasjb, nabilmoqbel, tobifjellner, yoavf, ramiy.
Fixes #50845.
Built from https://develop.svn.wordpress.org/trunk@48859


git-svn-id: http://core.svn.wordpress.org/trunk@48621 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-25 12:40:08 +00:00
Sergey Biryukov c53b456cfc Tests: Clean up some existing `@covers` tags.
The `()` at the end is unnecessary and disregarded by PHPUnit, so can be removed.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-25 00:59:06 +00:00
Sergey Biryukov 8169ae35a0 Bootstrap/Load: Add `local` environment type to `wp_get_environment_type()`.
This gives developers a better control over their existing development workflow and ensures that `local` is not the exact same as `development` if it does not need to be.

Props claytoncollie, johnbillion, jeremyfelt, kreppar, dushakov, TimothyBlynJacobs, Ipstenu, khag7, knutsp, Clorith, markjaquith, joostdevalk, SergeyBiryukov.
Fixes #51064.
Built from https://develop.svn.wordpress.org/trunk@48856


git-svn-id: http://core.svn.wordpress.org/trunk@48618 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-24 22:32:05 +00:00
Sergey Biryukov 0c8644c071 Docs: Improve documentation for `wp_lazy_loading_enabled()` per the documentation standards.
See #50768.
Built from https://develop.svn.wordpress.org/trunk@48855


git-svn-id: http://core.svn.wordpress.org/trunk@48617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-24 22:16:06 +00:00
Sergey Biryukov c3a7d6c379 Docs: Add a `@since` note about the `$srcset` and `$sizes` attributes added to `wp_get_attachment_image()`.
Follow-up to [34855].

See #51122.
Built from https://develop.svn.wordpress.org/trunk@48853


git-svn-id: http://core.svn.wordpress.org/trunk@48615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-24 22:12:03 +00:00
Sergey Biryukov 147ed6ebdb Docs: Add documentation and a `@since` note about the `loading` attribute added to `wp_get_attachment_image()`.
Follow-up to [48272].

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


git-svn-id: http://core.svn.wordpress.org/trunk@48614 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-24 22:04:04 +00:00
Sergey Biryukov 5ce95b7c88 Administration: Don't print the `.php-error` class in the admin header for PHP notices in `wp-config.php`.
Any notices in that file happen before `WP_DEBUG` takes effect,	and should not be displayed with the `error_reporting` level previously set in `wp-load.php`.

Adding the class when there is no notice displayed results in extra padding under the admin bar, which should be avoided.

Follow-up to [20102], [21025], [26620], [47745].

Props akissz, tw2113, laxman-prajapati, sabernhardt, johnbillion, SergeyBiryukov.
Fixes #51073.
Built from https://develop.svn.wordpress.org/trunk@48850


git-svn-id: http://core.svn.wordpress.org/trunk@48612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-24 10:48:06 +00:00
Sergey Biryukov 4b28c4804d Tests: Correct a number of malformed `@covers` tags.
As per the documentation of the `@covers` tag, global functions being covered should be prefixed with `::`. Also, the `()` after the function name is redundant.

Follow-up to [39918].

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


git-svn-id: http://core.svn.wordpress.org/trunk@48610 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-23 17:26:04 +00:00
Sergey Biryukov 6c0ead3e97 Build/Test Tools: Update code coverage setup in the `phpunit.xml.dist` file to point to the `build` directory.
This makes the configuration consistent with the `WP_RUN_CORE_TESTS` constant being set to `1` in the same config file.

Additionally, update the list to be in line with the current codebase, excluding the plugins and themes bundled with WordPress core from being considered for code coverage.

Note: If you have a local `phpunit.xml` file that changes the `WP_RUN_CORE_TESTS` constant to `0`, you should also - in the same file - change the code coverage setup to use the `src` directory.

Follow-up to [42665], [43311].

Props jrf, mmarco9.
See #50267.
Built from https://develop.svn.wordpress.org/trunk@48847


git-svn-id: http://core.svn.wordpress.org/trunk@48609 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-23 17:24:05 +00:00
Sergey Biryukov b0041bd4a1 Tests: Update `wp-api-generated.js` to reflect the new "Reusable Blocks" post type label.
Follow-up to [48829].

See #50755.
Built from https://develop.svn.wordpress.org/trunk@48846


git-svn-id: http://core.svn.wordpress.org/trunk@48608 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-23 14:40:06 +00:00
Sergey Biryukov f53cc9e0c8 General: Ensure `svn:eol-style` is consistently set for all recently added files.
Fixes #51113.
Built from https://develop.svn.wordpress.org/trunk@48845


git-svn-id: http://core.svn.wordpress.org/trunk@48607 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-23 14:36:06 +00:00
Sergey Biryukov 9606340d0f Tests: Clear any previous term IDs from the metadata lazyloader queue in term meta lazy-loading test.
This fixes random test failures when one of the term IDs from previous tests coincides with the orphan term ID from this test that should not be lazy-loaded.

Follow-up to [34529], [36566].

Fixes #51109.
Built from https://develop.svn.wordpress.org/trunk@48844


git-svn-id: http://core.svn.wordpress.org/trunk@48606 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-23 03:48:05 +00:00
Sergey Biryukov 5fc75503e4 Docs: Update the description for the `$legacy` parameter of `wp_count_terms()` for consistency with `get_terms()`.
Follow-up to [48840].

See #36399.
Built from https://develop.svn.wordpress.org/trunk@48843


git-svn-id: http://core.svn.wordpress.org/trunk@48605 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-23 00:08:06 +00:00
Sergey Biryukov ee0943482f REST API: In `WP_REST_Block_Directory_Controller::get_items()`, make sure the blocks data for a plugin is not empty before proceeding.
This avoids a PHP notice if the API returns a plugin with empty data for `blocks` key.

Props khag7, TwentyZeroTwo, justinahinon, TimothyBlynJacobs, dd32, SergeyBiryukov.
Fixes #51018.
Built from https://develop.svn.wordpress.org/trunk@48842


git-svn-id: http://core.svn.wordpress.org/trunk@48604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-22 01:54:11 +00:00
Sergey Biryukov 23b4fd4a86 Editor: Use `wp_add_inline_script()` instead of `wp_localize_script()` to pass the `_wpMetaBoxUrl` value to the `wp-editor` script.
This fixes a PHP 8 "Only the first byte will be assigned to the string offset" warning on Edit Post screen.

The correct usage of `wp_localize_script()` is to pass an array of data, not a string.

Fixes #51108.
Built from https://develop.svn.wordpress.org/trunk@48841


git-svn-id: http://core.svn.wordpress.org/trunk@48603 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-22 00:04:06 +00:00
Felix Arntz 5918f7e11d Taxonomy: Allow for `wp_count_terms( $args )` signature, making passing a taxonomy optional.
This brings `wp_count_terms()` in line with other taxonomy functions such as `get_terms()` which technically no longer require a taxonomy. Similar to the previously modified functions, no deprecation warning is triggered when using the legacy signature.

Fixes #36399.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-21 22:32:06 +00:00
Sergey Biryukov 40ea11468b Code Modernization: Fix PHP 8 "ArgumentCountError: array_merge() does not accept unknown named parameters" fatal error in `retrieve_widgets()`.
As per the documentation of `call_user_func_array()`, the `$param_arr` should be a (numerically) indexed array, not a string-keyed array.

As we can use the spread operator in PHP 5.6+, there isn't really any need to use `call_user_func_array()` anyhow, we can call the `array_merge()` function directly.

The caveat to this is that the spread operator only works on numerically indexed arrays, so we need to wrap the `$sidebars_widgets` variable in a call to `array_values()` when using the spread operator.

Using `array_values()` in the existing `call_user_func_array()` call would also have solved this, but the solution now proposed, has the added benefit of getting rid of the overhead of `call_user_func_array()`.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-21 21:51:03 +00:00
Sergey Biryukov 7ba8aa2bb4 Code Modernization: Fix PHP 8 "argument must be passed by reference, value given" error in `WP_Comment_Query::get_comments()`.
The WP native `get_comment()` function expects the first argument `$comment` to be passed by reference.

The PHP `array_map()` function, however, passes by value, not by reference, resulting in an "arguments must be passed by reference, value given" error.

The PHP native `array_walk()` function does pass by reference. Using this prevents the error on PHP 8 and maintains the existing behaviour on PHP < 8.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-21 21:34:03 +00:00
Sergey Biryukov 6766375f84 Twenty Nineteen: Remove trailing commas after selectors in `style-editor.scss`.
Remove one empty CSS block.

Props justinahinon.
Fixes #51095.
Built from https://develop.svn.wordpress.org/trunk@48837


git-svn-id: http://core.svn.wordpress.org/trunk@48599 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-21 15:42:05 +00:00
Sergey Biryukov 0c0e39d8bf Privacy: Avoid a PHP 7.4 notice in `WP_Privacy_Policy_Content::text_change_check()`.
When iterating over the items stored in '_wp_suggested_privacy_policy_content` meta value for the Privacy Policy page, make sure the item is an array before accessing its properties.

Props treibstoff.
Fixes #51084.
Built from https://develop.svn.wordpress.org/trunk@48836


git-svn-id: http://core.svn.wordpress.org/trunk@48598 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-21 01:13:05 +00:00
Sergey Biryukov 25b0783629 Docs: Correct references to `WP_Filesystem_Base` methods in various DocBlocks.
Props pbiron.
Fixes #51087.
Built from https://develop.svn.wordpress.org/trunk@48835


git-svn-id: http://core.svn.wordpress.org/trunk@48597 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-21 00:43:05 +00:00
Sergey Biryukov 1a230a752a Customize: Add `/` character to `<img>` tag in `WP_Customize_Manager` and `WP_Customize_Header_Image_Control` JS templates.
While this has no effect on void elements in HTML5, it fixes a minor inconsistency with the rest of core.

Props laxman-prajapati.
Fixes #51077.
Built from https://develop.svn.wordpress.org/trunk@48834


git-svn-id: http://core.svn.wordpress.org/trunk@48596 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-20 13:13:10 +00:00
Sergey Biryukov ebf80f8e01 Docs: Update documentation for `get_custom_logo()` and `the_custom_logo()` to mention the `unlink-homepage-logo` theme feature.
Follow-up to [48039], [48283], [48749], [48757], [48758].

Props sabernhardt.
Fixes #51075.
Built from https://develop.svn.wordpress.org/trunk@48832


git-svn-id: http://core.svn.wordpress.org/trunk@48594 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-20 10:41:06 +00:00
Sergey Biryukov 53399672b8 Coding Standards: Fix WPCS issue in [48830].
See #51044.
Built from https://develop.svn.wordpress.org/trunk@48831


git-svn-id: http://core.svn.wordpress.org/trunk@48593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-19 16:35:03 +00:00
Sergey Biryukov 821c1c8095 Tests: Update unit tests to account for `comment_agent` and `comment_author_IP` values being passed to the `preprocess_comment` filter.
See #51044.
Built from https://develop.svn.wordpress.org/trunk@48830


git-svn-id: http://core.svn.wordpress.org/trunk@48592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-19 16:08:06 +00:00
desrosj 4ad0086a2a Editor: Update the post type labels for the reusable blocks post type.
Previously, the labels for the reusable block post type were just “block”. The document settings tab in the block editor has been changed to use the post type label specified instead to be more specific. Changing the reusable block post type labels to “reusable block” prevents two “Block” tabs from showing in the editor.

Props desaiuditd, peterwilsoncc.
Fixes #50755.
Built from https://develop.svn.wordpress.org/trunk@48829


git-svn-id: http://core.svn.wordpress.org/trunk@48591 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-19 13:40:12 +00:00
Sergey Biryukov 2326c8196d Docs: Add a `@since` note to `register_rest_route()` about the `_doing_it_wrong()` notice when the required `permission_callback` argument is not set.
Follow-up to [48526].

Props psykro.
Fixes #51060.
Built from https://develop.svn.wordpress.org/trunk@48827


git-svn-id: http://core.svn.wordpress.org/trunk@48589 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-19 12:31:08 +00:00
Sergey Biryukov d7c0343d5f Docs: Improve description for `WP_Admin_Bar::add_group()`.
Props stevenlinx.
Fixes #50779.
Built from https://develop.svn.wordpress.org/trunk@48826


git-svn-id: http://core.svn.wordpress.org/trunk@48588 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-19 02:46:04 +00:00
Sergey Biryukov 216c1e01b4 Bundled Themes: Correct punctuation in "Your comment is awaiting moderation" string.
Props llizard, mayankmajeji.
Fixes #49867.
Built from https://develop.svn.wordpress.org/trunk@48825


git-svn-id: http://core.svn.wordpress.org/trunk@48587 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-19 02:28:13 +00:00
Sergey Biryukov 800f43ebbe Comments: Correct punctuation in "Your comment is awaiting moderation" string in `Walker_Comment`.
Props llizard.
See #49867.
Built from https://develop.svn.wordpress.org/trunk@48824


git-svn-id: http://core.svn.wordpress.org/trunk@48586 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-19 02:27:08 +00:00
Sergey Biryukov c66d70f2a5 Comments: Revert unintended changes from [48822].
See #51044.
Built from https://develop.svn.wordpress.org/trunk@48823


git-svn-id: http://core.svn.wordpress.org/trunk@48585 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-19 01:59:04 +00:00
Sergey Biryukov 3e16f7510a Comments: Make sure the comment data passed to the `preprocess_comment` filter includes the `comment_agent` and `comment_author_IP` values.
Props zodiac1978, SergeyBiryukov.
Fixes #51044.
Built from https://develop.svn.wordpress.org/trunk@48822


git-svn-id: http://core.svn.wordpress.org/trunk@48584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-19 01:57:08 +00:00
Sergey Biryukov 8b3a813e1a Plugins: Avoid a PHP notice if the `update-supported` key in plugin data is not set.
Props sanzeeb3.
Fixes #51052.
Built from https://develop.svn.wordpress.org/trunk@48820


git-svn-id: http://core.svn.wordpress.org/trunk@48582 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-18 20:38:09 +00:00
desrosj 106a6ba9e1 Build/Test Tools: Update several NPM dependencies.
These updates were applied by running `npm audit fix`.

See #50769.
Built from https://develop.svn.wordpress.org/trunk@48818


git-svn-id: http://core.svn.wordpress.org/trunk@48580 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-18 15:18:02 +00:00
Sergey Biryukov 13647464a5 Formatting: Make the check for empty text in `wp_trim_excerpt()` more resilient.
This addresses a regression in [47808], which caused excerpts to be generated from post content if an empty string is passed, but not for other values considered empty, e.g. `null` or `false`.

Props riaanlom, laxman-prajapati, SergeyBiryukov.
Fixes #51042.
Built from https://develop.svn.wordpress.org/trunk@48817


git-svn-id: http://core.svn.wordpress.org/trunk@48579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-18 15:10:04 +00:00
Sergey Biryukov 7a8df073cd Docs: Correct alignment for some DocBlocks in `WP_Query::get_posts()`.
See #50768.
Built from https://develop.svn.wordpress.org/trunk@48816


git-svn-id: http://core.svn.wordpress.org/trunk@48578 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-18 12:39:03 +00:00
Sergey Biryukov 26cf7ec46d Docs: Add a `@since` note to `get_the_archive_title()` about the title part being wrapped in a `<span>` element.
Follow-up to [48294].

Props justinahinon, audrasjb.
Fixes #51050.
Built from https://develop.svn.wordpress.org/trunk@48814


git-svn-id: http://core.svn.wordpress.org/trunk@48576 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-18 12:05:09 +00:00
Sergey Biryukov 7d0d6672c4 Accessibility: Toolbar: Don't output the "Skip to toolbar" link in modern themes that support the `wp_body_open` action.
The links is unnecessary there, as the toolbar is the first thing in the DOM within the `<body>` element.

For themes that don't implement the `wp_body_open` action yet and render the admin bar in the footer, the "Skip to toolbar" link with `tabindex="1"` is still necessary, to ensure it's the first focusable element in the page.

Props sarahricker, afercia, erikjandelange, audrasjb.
Fixes #50702.
Built from https://develop.svn.wordpress.org/trunk@48812


git-svn-id: http://core.svn.wordpress.org/trunk@48574 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-17 14:26:07 +00:00
Sergey Biryukov fdeba269ca Help/About: Fix typo and remove trailing spaces from some strings.
Props mukesh27, casiepa, davidbaumwald.
Fixes #51028.
Built from https://develop.svn.wordpress.org/trunk@48809


git-svn-id: http://core.svn.wordpress.org/trunk@48571 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-17 02:12:04 +00:00
Sergey Biryukov e50ac120a3 Site Health: Ensure that the tests returned by `WP_Site_Health::get_tests()` always have the required array keys: `direct` and `async`.
This avoids PHP notices if these keys were accidentally removed using the `site_status_tests` filter.

Props khag7, Ov3rfly, desrosj, Clorith.
Fixes #50858.
Built from https://develop.svn.wordpress.org/trunk@48808


git-svn-id: http://core.svn.wordpress.org/trunk@48570 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-17 02:03:04 +00:00
Sergey Biryukov d9135ad9d0 Site Health: Add site environment type to the debug information.
Follow-up to [47919], [48188], [48372].

Props joostdevalk, Clorith.
Fixes #50887.
Built from https://develop.svn.wordpress.org/trunk@48802


git-svn-id: http://core.svn.wordpress.org/trunk@48564 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-16 18:27:04 +00:00
Sergey Biryukov 7cb2ca73a2 Site Health: Rename the `$upload_max_size` variable to `$upload_max_filesize`, for consistency with the PHP setting name.
Follow-up to [48535], [48538], [48539], [48544], [48800].

See #50945.
Built from https://develop.svn.wordpress.org/trunk@48801


git-svn-id: http://core.svn.wordpress.org/trunk@48563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-16 17:54:05 +00:00
Sergey Biryukov 88e668d8e6 Site Health: Only display the warning about the `post_max_size` PHP value when it's lower than `upload_max_filesize`.
Previously, the warning was displayed even if the value was higher than `upload_max_filesize`, which made the report inaccurate, as these values don't necessarily have to match.

Props oakesjosh, jeroenrotty, desrosj, Clorith.
Fixes #50945.
Built from https://develop.svn.wordpress.org/trunk@48800


git-svn-id: http://core.svn.wordpress.org/trunk@48562 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-16 17:48:08 +00:00
Sergey Biryukov 54184bf872 Docs: Fix typo in the `$image` parameter description in `is_gd_image()`.
Follow-up to [48798].

See #50833.
Built from https://develop.svn.wordpress.org/trunk@48799


git-svn-id: http://core.svn.wordpress.org/trunk@48561 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-16 14:02:03 +00:00
Sergey Biryukov 12c8f0e678 Code Modernization: Introduce `is_gd_image()` to check for PHP 8 `GdImage` object instances.
In PHP 8, the GD extension uses `GdImage` objects instead of resources for its underlying data structures.

This updates the existing `is_resource()` calls for image resources in core to accomodate for `GdImage` instances as well.

Props ayeshrajans, jrf.
Fixes #50833.
Built from https://develop.svn.wordpress.org/trunk@48798


git-svn-id: http://core.svn.wordpress.org/trunk@48560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-16 13:33:09 +00:00
Sergey Biryukov a5edb2a8a1 Filesystem API: Use correct variable when closing the file handle in `WP_Filesystem_FTPext::get_contents()`.
Props gothick@gothick.org.uk.
Fixes #51029.
Built from https://develop.svn.wordpress.org/trunk@48797


git-svn-id: http://core.svn.wordpress.org/trunk@48559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-15 20:56:02 +00:00
TimothyBlynJacobs e1da1ae3e4 REST API: Add uniqueItems as a permitted endpoint argument JSON Schema keyword.
Support for the `uniqueItems` keyword was added in [48357], but wasn't included in the list of permitted keywords for `WP_REST_Controller::get_endpoint_args_for_item_schema()`. This prevented the keyword from being automatically supported if specified in a controller's item schema.

Fixes #51021.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48558 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-15 16:11:07 +00:00
Sergey Biryukov b29ea455e8 Menus: Make the `$object_id` parameter of `_wp_delete_post_menu_item()` required, for consistency with `_wp_delete_tax_menu_item()`.
The function is private (only intended for core usage) and is hooked to the `delete_post` action, which always passes a non-zero post ID.

Follow-up to [14295], [48794].

See #50343.
Built from https://develop.svn.wordpress.org/trunk@48795


git-svn-id: http://core.svn.wordpress.org/trunk@48557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-15 13:45:06 +00:00
Sergey Biryukov d3a3862248 Code Modernization: Fix PHP 8 deprecation notices for optional function parameters declared before required parameters.
As it already was not possible to pass the required parameters without also passing the optional one anyway, removing the default value for the (not so) optional parameters should not affect backward compatibility.

This change affects three functions in core:

* `get_comment_delimited_block_content()`
* `do_enclose()`
* `_wp_delete_tax_menu_item()`

Props jrf, ayeshrajans, desrosj.
Fixes #50343.
Built from https://develop.svn.wordpress.org/trunk@48794


git-svn-id: http://core.svn.wordpress.org/trunk@48556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-15 13:40:03 +00:00
Sergey Biryukov 756de63216 Docs: Document the parameters of `wp_get_associated_nav_menu_items()` as optional.
See #50768.
Built from https://develop.svn.wordpress.org/trunk@48793


git-svn-id: http://core.svn.wordpress.org/trunk@48555 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-15 13:12:06 +00:00
Sergey Biryukov 440eb31bb7 Site Health: Recognize `define( 'WP_AUTO_UPDATE_CORE', 'minor' )` as an acceptable value.
Previously, it was only incidentally recognized as valid due to a loose comparison with `true`.

With the strict comparison added to `WP_Site_Health_Auto_Updates::test_constants()`, this was no longer the case.

Follow-up to [47841].

Props sterndata, mukesh27, avixansa, desrosj, SergeyBiryukov.
Fixes #50912.
Built from https://develop.svn.wordpress.org/trunk@48792


git-svn-id: http://core.svn.wordpress.org/trunk@48554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-14 20:39:08 +00:00
Sergey Biryukov 27c5f5f1ab Tests: Consistently unregister custom settings after performing assertions in `WP_Test_REST_Settings_Controller`.
This ensures that those settings don't leak to other tests.

Props david.binda, TimothyBlynJacobs, SergeyBiryukov.
Fixes #50986.
Built from https://develop.svn.wordpress.org/trunk@48791


git-svn-id: http://core.svn.wordpress.org/trunk@48553 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-14 16:35:06 +00:00
Sergey Biryukov 703be7e1f3 Code Modernization: Change `create_function()` in `phpunit/includes/plural-form-function.php` to closure.
`create_function()` has been deprecated in PHP >= 7.2 and removed in PHP 8.

The only instance left in core was used in a test that was being skipped on PHP >= 7.2. This allows the test to run again.

Follow-up to [41722], [41730].

Props jrf.
Fixes #50899.
Built from https://develop.svn.wordpress.org/trunk@48790


git-svn-id: http://core.svn.wordpress.org/trunk@48552 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-13 12:34:10 +00:00
Sergey Biryukov 07ec574a54 Code Modernization: Only call `libxml_disable_entity_loader()` in PHP < 8.
This function has been deprecated in PHP 8.0 because in libxml 2.9.0, external entity loading is disabled by default, so this function is no longer needed to protect against XXE attacks.

Props jrf.
Fixes #50898.
Built from https://develop.svn.wordpress.org/trunk@48789


git-svn-id: http://core.svn.wordpress.org/trunk@48551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-12 15:25:03 +00:00
Sergey Biryukov 3ccc91894b Code Modernization: Remove `final` keyword from private methods.
Declaring a `private` method as `final` is an oxymoron, as `private` methods cannot be overloaded anyway.

Using `final private function...` will generate a warning in PHP 8.

Props jrf.
Fixes #50897.
Built from https://develop.svn.wordpress.org/trunk@48788


git-svn-id: http://core.svn.wordpress.org/trunk@48550 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-12 15:05:08 +00:00
desrosj dc63fb7c85 Help/About: Final adjustments to the 5.5 About page.
- Final CDN asset URLs.
- Some minor color adjustments.

Props ryelle, marybaum, davidbaumwald, audrasjb, estelaris, afercia, cbringmann, andreamiddleton, desrosj, SergeyBiryukov, ocean90, nrqsnchz, spacedmonkey, whyisjake, man4toman.
Fixes #50416.
Built from https://develop.svn.wordpress.org/trunk@48783


git-svn-id: http://core.svn.wordpress.org/trunk@48545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-11 16:53:09 +00:00
Sergey Biryukov 1f85e7484f Docs: Consistently use third-person singular verbs for various filter descriptions, per the documentation standards.
See #50768.
Built from https://develop.svn.wordpress.org/trunk@48782


git-svn-id: http://core.svn.wordpress.org/trunk@48544 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-11 00:34:08 +00:00
Sergey Biryukov 4da5577136 Docs: Update documentation for `get_{$meta_type}_metadata` filter for consistency with `default_{$meta_type}_metadata`.
Follow-up to [48777].

See #50891.
Built from https://develop.svn.wordpress.org/trunk@48778


git-svn-id: http://core.svn.wordpress.org/trunk@48540 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-10 15:50:04 +00:00
whyisjake 52df01d961 Options, Meta APIs: Update the docs around default metadata values.
Add a missing @since value for 5.5 and potential default filter names.

Fixes #50891.
Props johnbillion.


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


git-svn-id: http://core.svn.wordpress.org/trunk@48539 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-10 15:42:04 +00:00
desrosj 14d561ac57 Bundled Themes: Bump theme versions ahead of WordPress 5.5.
The following theme versions will be released in coordination with WordPress 5.5:
- Twenty Ten: 3.1
- Twenty Eleven: 3.5
- Twenty Twelve: 3.2
- Twenty Thirteen: 3.1
- Twenty Fourteen: 2.9
- Twenty Fifteen: 2.7
- Twenty Sixteen: 2.2
- Twenty Seventeen: 2.4
- Twenty Nineteen: 1.7
- Twenty Twenty: 1.5

Props whyisjake, desrosj.
Fixes #50769.
Built from https://develop.svn.wordpress.org/trunk@48775


git-svn-id: http://core.svn.wordpress.org/trunk@48537 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-10 15:32:05 +00:00
desrosj 5a6fef41f3 Build/Test Tools: Update `elliptic` in Twenty Twenty.
See #50769.
Built from https://develop.svn.wordpress.org/trunk@48774


git-svn-id: http://core.svn.wordpress.org/trunk@48536 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-10 15:19:03 +00:00
ellatrix 3bf88764f1 Editor: update packages
Fixes #50888

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


git-svn-id: http://core.svn.wordpress.org/trunk@48534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-10 14:18:33 +00:00
Sergey Biryukov 9214595e90 I18N: Fix typo in a screen reader text string on the About page.
Follow-up to [48729].

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


git-svn-id: http://core.svn.wordpress.org/trunk@48532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-10 13:15:04 +00:00
Sergey Biryukov 113acf42d5 I18N: Add a `class_exists()` check to `Plural_Forms` class for consistency with other POMO library classes.
Follow-up to [41722].

Fixes #50881.
Built from https://develop.svn.wordpress.org/trunk@48769


git-svn-id: http://core.svn.wordpress.org/trunk@48531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-10 11:33:09 +00:00
Sergey Biryukov 18cd7519e1 I18N: Fix typo in a string in `rest_validate_value_from_schema()`.
Props pedromendonca.
Fixes #50879.
Built from https://develop.svn.wordpress.org/trunk@48767


git-svn-id: http://core.svn.wordpress.org/trunk@48529 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-09 02:00:04 +00:00
Sergey Biryukov 5c0361aeb1 Coding Standards: Remove a few more extra brackets from some conditions in `wp-admin/includes/plugin.php`.
Follow-up to [48764].

See #50767.
Built from https://develop.svn.wordpress.org/trunk@48766


git-svn-id: http://core.svn.wordpress.org/trunk@48528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-09 01:56:05 +00:00
Sergey Biryukov 350ad6141e Coding Standards: Use consistent formatting for translator comments in `wp-includes/rest-api.php`.
See #50767.
Built from https://develop.svn.wordpress.org/trunk@48765


git-svn-id: http://core.svn.wordpress.org/trunk@48527 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-09 01:46:07 +00:00
Sergey Biryukov 004e3f897f Coding Standards: Fix WPCS issues in `wp-admin/includes/plugin.php`.
Includes minor code layout fixes for better readability.

Props rnaby for initial patch.
See #50767, #43848.
Built from https://develop.svn.wordpress.org/trunk@48764


git-svn-id: http://core.svn.wordpress.org/trunk@48526 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-08 21:04:04 +00:00
Sergey Biryukov f5a4ac614e Coding Standards: Simplify some parts of `user_can_access_admin_page()` for better readability.
Props rnaby, valentinbora, khag7.
Fixes #43848.
Built from https://develop.svn.wordpress.org/trunk@48762


git-svn-id: http://core.svn.wordpress.org/trunk@48524 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-08 20:24:05 +00:00
Sergey Biryukov 1e5b6101e7 Help/About: Update videos and their descriptions on the About page.
Follow-up to [48675], [48686], [48721], [48729], [48730], [48736].

Props ryelle, marybaum, estelaris, desrosj, joen, afercia.
See #50416.
Built from https://develop.svn.wordpress.org/trunk@48761


git-svn-id: http://core.svn.wordpress.org/trunk@48523 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-08 14:16:02 +00:00
Sergey Biryukov 132942b9fa Docs: Document the return value of `get_settings_errors()` using hash notation.
Props stevenlinx, webdevmattcrom, atachibana.
Fixes #42786.
Built from https://develop.svn.wordpress.org/trunk@48760


git-svn-id: http://core.svn.wordpress.org/trunk@48522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-08 12:39:06 +00:00
whyisjake 649ab58d96 Themes: Update the `test_theme_supports_custom_logo` to check for the `unlink-homepage-logo` property.
See #37011, [48757].
Props TimothyBlynJacobs, whyisjake.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48520 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-07 20:44:05 +00:00
Sergey Biryukov 7690f48cec Themes: Add `unlink-homepage-logo` to the `create_initial_theme_features()` registration for the `custom-logo` theme feature.
Follow-up to [48039], [48283], [48749].

Props TimothyBlynJacobs.
Fixes #37011.
Built from https://develop.svn.wordpress.org/trunk@48757


git-svn-id: http://core.svn.wordpress.org/trunk@48519 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-07 19:43:05 +00:00
Andrew Ozz 283f841dac Script Loader: Remove the `jquery-migrate-compat-5.5` temporary script handle for now. Can be re-added later if there is a compelling use case. For now it doesn't seem necessary.
See #37110.
Built from https://develop.svn.wordpress.org/trunk@48754


git-svn-id: http://core.svn.wordpress.org/trunk@48516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-07 18:30:06 +00:00
Sergey Biryukov ddcf09ace3 Script Loader: Add a temporary `jquery-migrate-compat-5.5` script handle.
This is intended as an easy way for plugins and themes to still be able to load jQuery with jQuery Migrate in WordPress 5.5.

Once jQuery is updated to 3.x, this temporary script handle will be removed. This means plugins and themes still using it at that point will fail to load their scripts (as a dependency will be missing), but will not cause "fatal errors" breaking the rest of JS.

Follow-up to [48323], [48324].

Props azaozz, desrosj, apedog, Clorith, jorbin.
Fixes #37110.
Built from https://develop.svn.wordpress.org/trunk@48753


git-svn-id: http://core.svn.wordpress.org/trunk@48515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-07 16:51:06 +00:00
Sergey Biryukov 961f455a00 Comments: Update DB version number used to trigger the upgrade routine for changing the `comment_type` DB field value in comments table.
Follow-up to [47597], [47626], [48225], [48227], [48748].

Props desrosj.
See #49236.
Built from https://develop.svn.wordpress.org/trunk@48751


git-svn-id: http://core.svn.wordpress.org/trunk@48513 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-07 16:32:03 +00:00
Sergey Biryukov 6b5e748dee Docs: Correct usage of the dynamic `auto_update_{$type}` filter.
This ensures that the canonical name of the filter is used in Site Health debug data, as well as on plugin and theme screens, so the developer reference site remains correct.

Props johnbillion.
Fixes #50868.
Built from https://develop.svn.wordpress.org/trunk@48750


git-svn-id: http://core.svn.wordpress.org/trunk@48512 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-07 16:14:03 +00:00
Sergey Biryukov df6e548b14 Accessibility: Themes: Only unlink custom logo on the home page if the theme declares support for that.
To accommodate for the change, the `custom-logo` theme feature now accepts the `unlink-homepage-logo` parameter.

If and when the logo is linked on the home page, the link has the `aria-current` attribute for better accessibility.

Follow-up to [48039], [48283].

Props sabernhardt, audrasjb, johnstonphilip, demetris.
Fixes #37011.
Built from https://develop.svn.wordpress.org/trunk@48749


git-svn-id: http://core.svn.wordpress.org/trunk@48511 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-07 15:26:03 +00:00
Sergey Biryukov c64297ce61 Comments: Update comment cache in the upgrade routine for changing the `comment_type` DB field value in comments table.
This ensures that comment object cache is cleared after changing the comment type to `comment` instead of an empty string.

Add a unit test for `_wp_batch_update_comment_type()`.

Follow-up to [47597], [47626], [48225], [48227].

Props imath, westonruter.
Fixes #49236.
Built from https://develop.svn.wordpress.org/trunk@48748


git-svn-id: http://core.svn.wordpress.org/trunk@48510 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-07 14:29:02 +00:00
Sergey Biryukov 5221a27593 Site Health: Consistently pass an object to the `auto_update_{$type}` filter in Site Health debug data.
Previously, some instances of the filter received an array from a plugin or theme update response, potentially triggering PHP notices.

Props bpayton, pbiron.
Fixes #50852.
Built from https://develop.svn.wordpress.org/trunk@48745


git-svn-id: http://core.svn.wordpress.org/trunk@48507 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-07 13:28:05 +00:00
Sergey Biryukov 68dd986b07 Tests: Correct duplicate array keys in `Tests_Kses::test_wp_filter_post_kses_address()`.
Previously, only the last `style` value was actually tested.

Props ediamin.
Fixes #50860.
Built from https://develop.svn.wordpress.org/trunk@48744


git-svn-id: http://core.svn.wordpress.org/trunk@48506 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-06 13:28:05 +00:00
Sergey Biryukov 3a32284b26 Posts, Post Types: Use a consistent wording in messages about a locked post.
Props ramiy.
Fixes #50859.
Built from https://develop.svn.wordpress.org/trunk@48743


git-svn-id: http://core.svn.wordpress.org/trunk@48505 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-06 13:14:08 +00:00
Sergey Biryukov 7e1e4f379a Site Health: Check if `session_status()` exists before calling it.
Props bgermann.
Fixes #50862.
Built from https://develop.svn.wordpress.org/trunk@48742


git-svn-id: http://core.svn.wordpress.org/trunk@48504 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-06 00:25:07 +00:00
Sergey Biryukov ee213e333b Comments: Remove a few more unnecessary instances of `esc_html()` in `WP_Comments_List_Table::comment_status_dropdown()`.
Core translations are considered safe, and these labels are not escaped in any other instances.

Follow-up to [48521], [48722], [48724].

See #40188, #50815.
Built from https://develop.svn.wordpress.org/trunk@48741


git-svn-id: http://core.svn.wordpress.org/trunk@48503 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-05 13:53:06 +00:00
Sergey Biryukov 2f878f1e74 Help/About: Correct header spacing on shorter screens after removing the musician name.
Remove some unnecessary CSS.

Follow-up to [48730].

Props ryelle.
See #50416.
Built from https://develop.svn.wordpress.org/trunk@48736


git-svn-id: http://core.svn.wordpress.org/trunk@48498 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-04 18:11:09 +00:00
Sergey Biryukov aaf49752b2 Plugins: Move the "Successfully installed the plugin" string to the correct `Plugin_Upgrader` method.
The string refers to the installation, and belongs in the `::install_strings()` method, not in `::upgrade_strings()`.

Props sswebster, nateinaction, SergeyBiryukov.
Fixes #50837.
Built from https://develop.svn.wordpress.org/trunk@48734


git-svn-id: http://core.svn.wordpress.org/trunk@48496 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-04 17:54:04 +00:00
whyisjake b84d7f1fd3 Site Health: Display auto-update properly for plugins that don't support auto-updates.
Properly filter `auto_update_plugin` when displaying the table.

Fixes #50822.
Props Gwendydd, pbiron, audrasjb, SergeyBiryukov, whyisjake.


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


git-svn-id: http://core.svn.wordpress.org/trunk@48493 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-04 17:37:02 +00:00
desrosj fa9b043313 Help/About: Remove “Musician Name” placeholder.
The musician name is traditionally not included on the About page due to i18n concerns regarding last minute changes.

Props audrasjb, SergeyBiryukov.
See #50416.
Built from https://develop.svn.wordpress.org/trunk@48730


git-svn-id: http://core.svn.wordpress.org/trunk@48492 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-04 17:35:06 +00:00
desrosj 527ca5ff78 Help/About: String updates and accessibility improvements to the 5.5 About page.
Props ryelle, nrqsnchz, desrosj, audrasjb, marybaum, spacedmonkey, SergeyBiryukov, estelaris, afercia, ocean90.
See #50416.
Built from https://develop.svn.wordpress.org/trunk@48729


git-svn-id: http://core.svn.wordpress.org/trunk@48491 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-04 17:26:03 +00:00
Sergey Biryukov a9da1150ee Editor: Make some hardcoded strings in block patterns translatable.
Props ocean90, youknowriad.
Fixes #50842.
Built from https://develop.svn.wordpress.org/trunk@48726


git-svn-id: http://core.svn.wordpress.org/trunk@48488 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-04 17:01:05 +00:00
ellatrix 69370fa0da Editor: update JS packages
Fixes #50844.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48487 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-04 16:48:43 +00:00
Sergey Biryukov 315db55458 Comments: Restore the `::has_items()` call in `WP_Comments_List_Table::extra_tablenav()` for now, until unit tests are updated accordingly.
Follow-up to [48722].

Fixes #40188. See #50815.
Built from https://develop.svn.wordpress.org/trunk@48724


git-svn-id: http://core.svn.wordpress.org/trunk@48486 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-04 16:26:03 +00:00
Sergey Biryukov b615c45103 Comments: Use the existing static variable instead of calling `::has_items()` again in `WP_Comments_List_Table::extra_tablenav()`.
Additionally, removed unnecessary `esc_html()` on the Filter button label. Core translations are considered safe, and this label is not escaped in any other instance.

Props whyisjake, SergeyBiryukov.
Fixes #40188.
Built from https://develop.svn.wordpress.org/trunk@48722


git-svn-id: http://core.svn.wordpress.org/trunk@48484 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-04 15:58:06 +00:00
whyisjake 500c0118d4 Help/About: String update for 5.5 release.
We don't use hyphens for the [block editor](https://make.wordpress.org/core/handbook/best-practices/spelling/).

See #50416.
Props davidbaumwald, marybaum, desrosj.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48483 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-04 15:56:02 +00:00
ellatrix f85fe2882a Editor: update JS packages
Fixes #50841.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48481 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-04 13:43:40 +00:00
Andrea Fercia efdd927b48 Accessibility: Administration: Address backward compatibility concerns for the sortable postboxes areas after [48340].
Fixes #49288.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48479 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-04 13:17:02 +00:00
Sergey Biryukov b1c6077591 Media: Remove extra space from the `width` attribute in `wp_playlist_shortcode()` output.
Props hvar.
Fixes #50840.
Built from https://develop.svn.wordpress.org/trunk@48716


git-svn-id: http://core.svn.wordpress.org/trunk@48478 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-04 12:47:06 +00:00
Sergey Biryukov e2c8e2fa5a Administration: Allow `wp_credits()` to accept `$version` and `$locale` parameters.
This can be helpful for plugin developers to get credits information for older versions or different locales.

Props ramiy.
Fixes #35910.
Built from https://develop.svn.wordpress.org/trunk@48715


git-svn-id: http://core.svn.wordpress.org/trunk@48477 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-03 12:53:08 +00:00
Sergey Biryukov 016df3b6c6 Docs: Correct placement for `wp_editor_expand` filter DocBlock.
See #50768.
Built from https://develop.svn.wordpress.org/trunk@48714


git-svn-id: http://core.svn.wordpress.org/trunk@48476 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-03 12:11:06 +00:00
Sergey Biryukov 8ff7595ae9 Permalinks: Don't show "You should update your `.htaccess` file now" message when saving permalink settings on Multisite.
Multisite routing is taken care of by WordPress, not by the web server.

Follow-up to [13706], [37747], [38066].

Props boonebgorges.
Fixes #39547.
Built from https://develop.svn.wordpress.org/trunk@48713


git-svn-id: http://core.svn.wordpress.org/trunk@48475 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-02 12:57:08 +00:00
Sergey Biryukov 0a76cb6240 Permalinks: Simplify the logic for displaying "You should update your `.htaccess` file now" message.
See #39547, #50834.
Built from https://develop.svn.wordpress.org/trunk@48712


git-svn-id: http://core.svn.wordpress.org/trunk@48474 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-02 12:51:03 +00:00
Sergey Biryukov c9cf1ba365 Docs: Correct formatting for a comment in `wp-admin/options-permalink.php`.
Previously committed in [48694], accidentally reverted in [48710].

See #50768.
Built from https://develop.svn.wordpress.org/trunk@48711


git-svn-id: http://core.svn.wordpress.org/trunk@48473 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-02 12:39:07 +00:00
Sergey Biryukov 38f653b639 Permalinks: Correct the check whether `.htaccess` update is required when saving permalink settings.
The check should be performed after the permalink structure update, not before.

Fixes #50834.
Built from https://develop.svn.wordpress.org/trunk@48710


git-svn-id: http://core.svn.wordpress.org/trunk@48472 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-02 12:36:02 +00:00
Sergey Biryukov 85c38d54e6 Upgrade/Install: Show the installed WordPress version number on WordPress Updates screen if there is a newer version available.
This makes it easier for a user to know how significant of an update the change might be, and helps them make an informed decision about how to proceed.

Props tmdesigned, dd32, circlecube, dkarfa, hakre, scribu, MadtownLems, markshep, nbachiyski, dmchale, miqrogroove, ovann86, danieltj, sterndata, seanpaulrasmussen, mrgrt, Commeuneimage, dpacks, puneetsahalot, jonoaldersonwp, SergeyBiryukov.
Fixes #15101. See #35554, #47848.
Built from https://develop.svn.wordpress.org/trunk@48709


git-svn-id: http://core.svn.wordpress.org/trunk@48471 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-01 19:46:04 +00:00
Sergey Biryukov 90672b07ab HTTP: Update the Root Certificate bundle.
Keep 1024-bit legacy root certificates re-added in [35919], except for those already expired, for compatibility with older OpenSSL versions.

Props barry, ayeshrajans, desrosj, whyisjake.
See #50828.
Built from https://develop.svn.wordpress.org/trunk@48707


git-svn-id: http://core.svn.wordpress.org/trunk@48469 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-01 14:09:06 +00:00
Aaron Jorbin 8fb366a83b Build/Test Tools: Update grunt-patch-wordpress
See: #50769

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


git-svn-id: http://core.svn.wordpress.org/trunk@48467 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-31 18:35:23 +00:00
whyisjake 224fdb27b8 Upgrade/Install: Ensure the proper count of plugins that have auto-update enabled.
As certain plugins may not support updates, this count needs to accurately reflect that in the navbar.

Fixes 50808.
Props knutsp, audrasjb, pbiron, dd32, apedog, afragen, chriscct7, garyc40, whyisjake, SergeyBiryukov.

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


git-svn-id: http://core.svn.wordpress.org/trunk@48465 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-31 17:21:04 +00:00
whyisjake b4497ef13f Upgrade/Install: Allow for WordPress.org to remotely disable auto-updates for plugins/themes
As auto-updates are rolled out across WordPress.org, the API response can modulate the response, ensuring that a rolled out could be stalled or staggered if needed for security or performance reasons.

Fixes #50824.
Props dd32, whyisjake, SergeyBiryukov.


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


git-svn-id: http://core.svn.wordpress.org/trunk@48463 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-31 17:03:05 +00:00
Sergey Biryukov 3f83523b4e Editor: Correctly back up the global `$post` in `wp-admin/edit-form-blocks.php`.
To create a copy of the object, instead of a reference to the same object, the `clone` keyword should be used.

Props scarolan.
Fixes #50775.
Built from https://develop.svn.wordpress.org/trunk@48700


git-svn-id: http://core.svn.wordpress.org/trunk@48462 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-31 14:00:05 +00:00
Sergey Biryukov 07b4429203 Widgets: Use correct escaping function in `WP_Widget_Archives::widget()`.
Props chintan1896, afercia.
See #50826.
Built from https://develop.svn.wordpress.org/trunk@48699


git-svn-id: http://core.svn.wordpress.org/trunk@48461 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-31 13:15:05 +00:00
whyisjake 078db63c4b Upgrade/Install: Pass the plugin file path into the `plugin_auto_update_debug_string` filter.
Adds better tooling for when user specific plugins can be updated, but platform specific ones cannot.

Fixes #50821.
Props bpayton, pbiron, audrasjb, SergeyBiryukov, whyisjake. 


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


git-svn-id: http://core.svn.wordpress.org/trunk@48458 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-30 21:50:02 +00:00
John Blackbourn 782f05d2c5 Docs: Various fixes and improvements to inline documentation.
See #49572
Built from https://develop.svn.wordpress.org/trunk@48695


git-svn-id: http://core.svn.wordpress.org/trunk@48457 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-30 19:14:03 +00:00
Sergey Biryukov 629af79b24 Docs: Correct formatting for a comment in `wp-admin/options-permalink.php`.
See #50768.
Built from https://develop.svn.wordpress.org/trunk@48694


git-svn-id: http://core.svn.wordpress.org/trunk@48456 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-30 14:02:04 +00:00
Sergey Biryukov cf137e7c1b Comments: Pass the `$which` parameter to the `manage_comments_nav` action.
This brings some consistency with the  `manage_users_extra_tablenav` and `manage_users_extra_tablenav` actions.

Props Tkama, wpgurudev.
Fixes #50736.
Built from https://develop.svn.wordpress.org/trunk@48693


git-svn-id: http://core.svn.wordpress.org/trunk@48455 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-30 13:27:04 +00:00