Commit Graph

17525 Commits

Author SHA1 Message Date
Sergey Biryukov
712f548664 Site Health: Fix some typos in the test for plugin and theme auto-updates.
Follow-up to [48548], [48558], [48559].

See #50662.

git-svn-id: https://develop.svn.wordpress.org/trunk@48560 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-22 00:15:33 +00:00
Sergey Biryukov
874e6afdca Site Health: Correct inverted logic for themes in the test for plugin and theme auto-updates.
Follow-up to [48548], [48558].

See #50662.

git-svn-id: https://develop.svn.wordpress.org/trunk@48559 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-22 00:13:21 +00:00
Sergey Biryukov
8cbd2ca439 Site Health: Add the test for plugin and theme auto-updates to WP_Site_Health::get_tests().
This ensures that the test actually runs.

Follow-up to [48548].

See #50662.

git-svn-id: https://develop.svn.wordpress.org/trunk@48558 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-22 00:05:45 +00:00
Sergey Biryukov
f840dabcc6 Widgets: Make sure image widgets with custom image size render captions.
Props kasparsd, JavierCasares, audrasjb.
Fixes #50160.

git-svn-id: https://develop.svn.wordpress.org/trunk@48557 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 23:12:22 +00:00
Sergey Biryukov
3da487037d REST API: Use consistent error messages when managing network plugins.
Props ramiy.
Fixes #50729.

git-svn-id: https://develop.svn.wordpress.org/trunk@48556 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 21:59:46 +00:00
Timothy Jacobs
df8399dce5 REST API: Optimize rest_filter_response_by_context performance.
In [47758] a new function `rest_filter_response_by_context` was introduced to expand the JSON schema features supported by the context filtering mechanism.

This commit improves the performance of that function by eliminating repetitive comparisons and loops. Additionally, it improves multi-type support for object + array types.

Fixes #50700.
Props dlh.


git-svn-id: https://develop.svn.wordpress.org/trunk@48555 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 21:20:22 +00:00
Sergey Biryukov
b11757e4ed Site Health: Use a consistent label for theme auto-updates in debug data.
Props audrasjb.
Fixes #50728.

git-svn-id: https://develop.svn.wordpress.org/trunk@48554 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 21:04:57 +00:00
Sergey Biryukov
26362089c5 Sitemaps: Rename wp_register_sitemap() to wp_register_sitemap_provider().
Follow-up to [48536], [48540], [48541].

Props pbiron.
Fixes #50724.

git-svn-id: https://develop.svn.wordpress.org/trunk@48553 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 20:13:59 +00:00
Sergey Biryukov
44335fdc43 Site Health: Simplify the logic for displaying whether auto-updates are enabled for plugins and themes.
Remove some extra variables.

Follow-up to [48546], [48549].

See #50663.

git-svn-id: https://develop.svn.wordpress.org/trunk@48552 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 18:42:24 +00:00
Jake Spurlock
9875847c9e WordPress 5.5 Beta 3 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@48551 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 17:54:05 +00:00
Jake Spurlock
f3a6fc5716 WordPress 5.5 Beta 3.
git-svn-id: https://develop.svn.wordpress.org/trunk@48550 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 17:30:06 +00:00
Sergey Biryukov
6440e85a2c Site Health: Rename the filters added in [48546] for clarity.
See #50663.

git-svn-id: https://develop.svn.wordpress.org/trunk@48549 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 17:06:55 +00:00
Jake Spurlock
5e14b1b5fd Site Health: Add tests to check for potential issues with plugin and theme auto-updates.
Fixes #50662.
Props desrosj, audrasjb.


git-svn-id: https://develop.svn.wordpress.org/trunk@48548 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 17:06:00 +00:00
Sergey Biryukov
ffef4daf88 Media: Pass the attachment ID to the wp_image_file_matches_image_meta filter.
Props spacedmonkey.
Fixes #50722.

git-svn-id: https://develop.svn.wordpress.org/trunk@48547 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 16:52:48 +00:00
Jake Spurlock
11fe34deb8 Site Health: Add auto-update information to for plugins and themes.
New filters:

* `plugin_auto_update_debug_str`
* `theme_auto_update_debug_str`

Fixes #50663.
Props pbiron, audrasjb, davidbaumwald.


git-svn-id: https://develop.svn.wordpress.org/trunk@48546 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 16:52:47 +00:00
Sergey Biryukov
e10083b7de I18N: Add context to some theme strings for consistency.
Props ramiy, ocean90.
Fixes #50709.

git-svn-id: https://develop.svn.wordpress.org/trunk@48545 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 16:31:06 +00:00
Sergey Biryukov
0da858ffae Site Health: Rename upload_max array key in file upload checks to max_effective_size for clarity.
Follow-up to [48535].

See #50038.

git-svn-id: https://develop.svn.wordpress.org/trunk@48544 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 16:18:53 +00:00
Pascal Birchler
7bcdf886c0 Sitemaps: Replace wp_sitemaps_register_providers filter with more suitable wp_sitemaps_add_provider filter.
The previous filter failed the goal of allowing developers to filter all providers before they are registered, since it only filtered the built-in ones.

The more specific `wp_sitemaps_add_provider` filter enables exactly that, as it filters every sitemap provider right before it is added to the sitemaps registry.

Props pbiron, pfefferle, Chouby, swissspidy.
Fixes #50660.

git-svn-id: https://develop.svn.wordpress.org/trunk@48543 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 16:12:49 +00:00
Jonathan Desrosiers
bea9ce74a7 Administration: Ensure SVG icons in admin menus are correctly colored.
Props ryelle.
Fixes #50555.

git-svn-id: https://develop.svn.wordpress.org/trunk@48542 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 16:08:44 +00:00
Sergey Biryukov
8c7fe179da Sitemaps: Rename wp_get_sitemaps_providers() to wp_get_sitemap_providers().
Follow-up to [48536], [48540].

Props pbiron, swissspidy, SergeyBiryukov.
See #50724.

git-svn-id: https://develop.svn.wordpress.org/trunk@48541 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 16:04:35 +00:00
Pascal Birchler
83b94f5cd6 Sitemaps: Rename wp_get_sitemaps() to wp_get_sitemaps_providers()
Following [48536], rename the function to match the rest of the sitemaps logic.

Also eliminates some dead code after [48523].

Props pbiron.
See #50724. See #50643.

git-svn-id: https://develop.svn.wordpress.org/trunk@48540 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 15:55:21 +00:00
Sergey Biryukov
3269e83801 Site Health: Move post_max_size and upload_max_filesize out of a translatable string in file upload checks.
Simplify some other strings, use a consistent format for translator comments.

Follow-up to [48535].

See #50038.

git-svn-id: https://develop.svn.wordpress.org/trunk@48539 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 15:51:22 +00:00
Sergey Biryukov
0d956d4013 Site Health: Remove parse_ini_size(), use the existing wp_convert_hr_to_bytes() function instead.
Follow-up to [48535].

See #50038.

git-svn-id: https://develop.svn.wordpress.org/trunk@48538 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 15:38:40 +00:00
Jonathan Desrosiers
09754a7cdd Editor: Ensure the required assets for the block directory are enqueued.
This fixes an issue where the block directory appears unstyled due to the stylesheets not being enqueued.

Props ryelle, timothyblynjacobs, earnjam.
Fixes #50661.

git-svn-id: https://develop.svn.wordpress.org/trunk@48537 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 15:36:17 +00:00
Sergey Biryukov
383540b7c4 Sitemaps: Rename 'sitemap' to 'provider' in WP_Sitemaps_Registry class.
This class is for registering sitemap providers, not individual sitemaps.

Props swissspidy.
Fixes #50724.

git-svn-id: https://develop.svn.wordpress.org/trunk@48536 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 15:27:48 +00:00
Jake Spurlock
5ffe591bec Site Health: Include new tests to check for the ability to upload files.
Several new checks:

* `max_file_uploads`
* `file_uploads`
* `post_max_size`
* `upload_max_filesize`
* `upload_max`
* `max_file_uploads`

In addition, new function `parse_ini_size()` that converts shorthand byte strings to bytes. Useful for size comparisons.

Fixes #50038.
Props dd32, donmhico, JavierCasares, SergeyBiryukov, ayeshrajans, Clorith, ipstenu, sabernhardt, whyisjake.


git-svn-id: https://develop.svn.wordpress.org/trunk@48535 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 15:19:58 +00:00
Sergey Biryukov
3ef1fa5c6d Site Health: Use consistent error messages when switching plugin or theme auto-updates on or off.
Props ramiy.
Fixes #50721.

git-svn-id: https://develop.svn.wordpress.org/trunk@48534 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 14:40:43 +00:00
Sergey Biryukov
cfb25b2e48 Block Editor: Move the add_action() call for _register_core_block_patterns_and_categories() above check_theme_switched().
Follow-up to [48492], [48531].

See #50669.

git-svn-id: https://develop.svn.wordpress.org/trunk@48533 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 14:35:13 +00:00
Pascal Birchler
38cade3b07 Sitemaps: Correctly enforce maximum number of sitemaps in index.
Before this change, the limit of 50k entries was enforced for the number of providers, not the amount of sitemaps all providers add to the index in total.

Props pbiron, swissspidy.
Fixes #50666.

git-svn-id: https://develop.svn.wordpress.org/trunk@48532 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 13:55:45 +00:00
Sergey Biryukov
fd9f7232e5 Block Editor: Move the add_action() call for _register_core_block_patterns_and_categories() to wp-includes/default-filters.php.
Follow-up to [48492].

Props desrosj.
Fixes #50669.

git-svn-id: https://develop.svn.wordpress.org/trunk@48531 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 13:13:54 +00:00
Sergey Biryukov
99f5b6019a Mail: Make sure the PHPMailer class is only required once if a plugin requires wp-includes/class-phpmailer.php directly.
Follow-up to [48033].

Props david.binda.
Fixes #50716. See #41750.

git-svn-id: https://develop.svn.wordpress.org/trunk@48530 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 12:56:40 +00:00
Sergey Biryukov
ea352ee2ab Docs: Improve description for edit_post().
Props stevenlinx.
Fixes #50713.

git-svn-id: https://develop.svn.wordpress.org/trunk@48529 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 12:47:58 +00:00
Sergey Biryukov
0f86642b82 Site Health: Correct the message for snoozed email verifications.
Follow-up to [48522].

Fixes #48333.

git-svn-id: https://develop.svn.wordpress.org/trunk@48528 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 12:35:32 +00:00
Ella van Durpe
69ec4264dc Editor: update packages for Beta 3
Fixes #50712.



git-svn-id: https://develop.svn.wordpress.org/trunk@48527 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 12:12:43 +00:00
Timothy Jacobs
74cc64d74e REST API: Issue a _doing_it_wrong when registering a route without a permission callback.
The REST API treats routes without a permission_callback as public. Because this happens without any warning to the user, if the permission callback is unintentionally omitted or misspelled, the endpoint can end up being available to the public. Such a scenario has happened multiple times in the wild, and the results can be catostrophic when it occurs.

For REST API routes that are intended to be public, it is recommended to set the permission callback to the `__return_true` built in function.

Fixes #50075.
Props rmccue, sorenbronsted, whyisjake, SergeyBiryukov, TimothyBlynJacobs.


git-svn-id: https://develop.svn.wordpress.org/trunk@48526 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 12:01:10 +00:00
Andrew Ozz
fcc52436cb REST API, Media: Add X-WP-Upload-Attachment-ID HTTP header to enable retrying of post-processing of edited images if the server runs out of resources. This is the same as after uploading a new image, will do up to five additional requests to let the server create all image sub-sizes.
Fixes #50711.

git-svn-id: https://develop.svn.wordpress.org/trunk@48525 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 02:59:00 +00:00
Jake Spurlock
60d339cfde Sitemaps: Ensure correct HTTP status when sitemaps are disabled
If sitemaps are disabled, previously there would be a rewrite rule for the sitemap endpoint. This endpoint would display the homepage since there was a rewrite rule. Now, Sitemaps are loaded, and the proper HTTP headers are returned.

Fixes #50643.
Props swissspidy, kraftbj, donmhico.



git-svn-id: https://develop.svn.wordpress.org/trunk@48523 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 00:55:20 +00:00
Jake Spurlock
bd67e31f4b Site Health: Ensure that there is a human readable time for snoozed email verifications.
This will be the time the was proposed, added to the reminder interval.

Fixes #48333.
Props SergeyBiryukov, desrosj.



git-svn-id: https://develop.svn.wordpress.org/trunk@48522 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 00:41:35 +00:00
Jake Spurlock
4ba60208d4 Comments: Don't show the filter/pagination actions if there are no comments to list.
It doesn't make sense to be able to filter the comments list table when there are are no (trashed/spam) comments available.

Fixes #40188.
Props swissspidy, Jim_Panse, menakas, akbarhusen429, dinhtungdu, birgire, SergeyBiryukov, davidbaumwald, rebasaurus, whyisjake.



git-svn-id: https://develop.svn.wordpress.org/trunk@48521 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-21 00:27:46 +00:00
Sergey Biryukov
5674e7e085 I18N: Add context to some plugin and theme strings for consistency.
Props ramiy, audrasjb.
Fixes #50710.

git-svn-id: https://develop.svn.wordpress.org/trunk@48520 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-20 23:12:33 +00:00
Sergey Biryukov
364759ecb2 I18N: Mark the strings with plugin and theme names in email notifications for translation.
Follow-up to [48517].

See #50350.

git-svn-id: https://develop.svn.wordpress.org/trunk@48519 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-20 21:23:26 +00:00
Andrew Ozz
8406d5104c REST API, Media: Fix/improve the inline docs and name of the new wp_edited_image_metadata filter.
Props desrosj, azaozz.

See #44405.

git-svn-id: https://develop.svn.wordpress.org/trunk@48518 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-20 21:02:13 +00:00
Jonathan Desrosiers
83e78d8cdd Administration: Include the new plugin and theme versions in email notifications.
This helps administrators keep track of which versions of plugins and themes are running on their site when auto-updates occur.

Props audrasjb, pbiron.
Fixes #50350.

git-svn-id: https://develop.svn.wordpress.org/trunk@48517 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-20 18:26:18 +00:00
Jonathan Desrosiers
e80b4f64bf Build/Test Tools: Update NPM packages in Twenty Nineteen.
This updates three packages:
- `@wordpress/browserslist-config` from `2.5.0` to `2.7.0`
- `autoprefixer` from `9.6.0` to `9.8.5`.
- `chokidar-cli` from `2.0.0` to `2.1.0`

See #49768.

git-svn-id: https://develop.svn.wordpress.org/trunk@48515 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-20 13:39:34 +00:00
Jonathan Desrosiers
167a8769e7 Bundled Themes: Rebuild Twenty Nineteen’s RTL stylesheet.
This adds the changes from [48073] to the `style-rtl.css` file.

See #45912.

git-svn-id: https://develop.svn.wordpress.org/trunk@48514 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-20 13:27:58 +00:00
Jonathan Desrosiers
b98a607ca5 Embeds: Correct the version number when Hulu was deprecated.
Follow up of [48512]
See #50676.

git-svn-id: https://develop.svn.wordpress.org/trunk@48513 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-20 13:12:22 +00:00
Jonathan Desrosiers
0713ca14f9 Embeds: Remove Hulu from the list of supported oEmbed providers.
The oEmbed service for Hulu no longer works and appears to have been silently disabled.

Props tacitonic, talldanwp, youknowriad, bph.
Fixes #50676.

git-svn-id: https://develop.svn.wordpress.org/trunk@48512 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-20 13:10:36 +00:00
Sergey Biryukov
0c19e1abd0 Docs: Improve description for add_user_to_blog().
Props stevenlinx.
Fixes #50701.

git-svn-id: https://develop.svn.wordpress.org/trunk@48511 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-20 11:52:59 +00:00
Andrew Ozz
030f2a4eee Media: Migrate the data from the attachment post of the parent image when saving an edited image. Copy:
- `post_title`,
- `post_content` (image description),
- `post_excerpt` (image caption as saved in the DB),
- `_wp_attachment_image_alt` meta (alt text for the img tag as saved in the DB).

Props spacedmonkey, joedolson, TimothyBlynJacobs, azaozz.
Fixes #50675.

git-svn-id: https://develop.svn.wordpress.org/trunk@48510 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-19 21:17:55 +00:00
Andrew Ozz
b39df4606a Upgrade/install: Fix/clarify the "Upload in a zip format" string.
Props greenshady, mariovalney.
See #9757.

git-svn-id: https://develop.svn.wordpress.org/trunk@48509 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-19 17:09:43 +00:00
John Blackbourn
d10a86ad1d Docs: Miscellaneous docblock corrections.
See #49572

git-svn-id: https://develop.svn.wordpress.org/trunk@48508 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-18 22:09:57 +00:00
Sergey Biryukov
9331f7a73f Coding Standards: Use strict comparison in wp-includes/wp-db.php.
Props jenilk.
Fixes #49453.

git-svn-id: https://develop.svn.wordpress.org/trunk@48507 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-18 11:37:59 +00:00
Jonathan Desrosiers
d54b8f7335 Administration: Reverse the arrow direction for database import/export icons.
In [48456], database import and export icons were introduced. However, the arrows were pointing in the wrong directions. This reverses the arrows to be pointing correctly based on the action described in the name.

Props johnbillion, joen, desrosj, empireoflight.
Fixes #49913.

git-svn-id: https://develop.svn.wordpress.org/trunk@48506 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-17 17:09:37 +00:00
Sergey Biryukov
3b5d373043 Options, Meta APIs: Reorder the parameters of default_{$meta_type}_metadata filter.
This brings consistency with the `get_{$meta_type}_metadata` filter and more closely matches the `get_metadata_default()` function signature.

Follow-up to [48502].

Props spacedmonkey.
See #43941.

git-svn-id: https://develop.svn.wordpress.org/trunk@48505 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-17 15:14:00 +00:00
Sergey Biryukov
2d0e9b1057 Docs: Correct documentation for the $meta_key parameter of get_metadata_default().
The parameter is required, not optional.

Follow-up to [48502].

See #43941.

git-svn-id: https://develop.svn.wordpress.org/trunk@48504 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-17 13:47:23 +00:00
Jake Spurlock
1c1a9de834 Plugins: Update the height of the Install Now button for new plugins.
Due to Thickbox shenanigans, the buttons height needed to be shrunk a little to center properly in the iframe.

Fixes #49828.

Props ibachal, Otto42, afercia.


git-svn-id: https://develop.svn.wordpress.org/trunk@48503 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-17 06:27:09 +00:00
Timothy Jacobs
d525642dd1 Meta: Reorder the get_metadata_default() signature to match get_metadata().
The order of parameters in `get_metadata_default()` did not match the signature of `get_metadata()`. This could be confusing for developers who are familiar with the existing metadata API.

Fixes #43941.
Props SergeyBiryukov, spacedmonkey, johnjamesjacoby.


git-svn-id: https://develop.svn.wordpress.org/trunk@48502 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-17 02:57:04 +00:00
Jake Spurlock
f75522ecfc Build/Test Tools: Bump lodash in twentytwenty as part of a security audit.
lodash: 4.17.15 👉 4.17.19

See #49768.
Props: dependabot.



git-svn-id: https://develop.svn.wordpress.org/trunk@48501 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-16 22:22:05 +00:00
Jake Spurlock
162afe2451 Administration: Fix an index inconsistency in get_admin_page_title() function.
Ensure that `get_admin_page_title()` returns a value from pages registered using `add_menu_page()`.

Fixes #46081.

Props grapestain, valentinbora, SergeyBiryukov, audrasjb.



git-svn-id: https://develop.svn.wordpress.org/trunk@48500 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-16 22:13:54 +00:00
Andrew Ozz
0aab2584a0 REST API: Prevent attachment ID/image source mismatch when editing an image.
Fixes #50565.

git-svn-id: https://develop.svn.wordpress.org/trunk@48498 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-16 21:54:37 +00:00
Jake Spurlock
082cb0ab20 Posts, Post Types: Ensure that all post stati are countable in wp_count_posts.
When `wp_count_posts()` is cached, it does so with all statuses defaulted to 0. The problem is however, if this is called before all plugins have registered their desired statuses, they won't have that default.

Fixes #49685.

Props obliviousharmony, SergeyBiryukov.



git-svn-id: https://develop.svn.wordpress.org/trunk@48497 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-16 21:42:48 +00:00
Jake Spurlock
ceccb7b3b1 Feeds: Ensure that galleries can be output as a list of links in feeds.
Adjusts the gallery shortcode handler to check for the `link` attribute when outputting to a feed.

Fixes #22101.

Props ifrins, mdgl, SergeyBiryukov, chriscct7, stevenkword, iworks, DrewAPicture, birgire, whyisjake.


git-svn-id: https://develop.svn.wordpress.org/trunk@48496 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-16 21:29:05 +00:00
Jake Spurlock
0fa4801a88 Coding Standards: Update the docblock to remove superflous since.
The `@deprecated` DocBlock tag should start with the version followed by the description of what to use instead.

Fixes #44959.

Props keesiemeijer, sabernhardt.



git-svn-id: https://develop.svn.wordpress.org/trunk@48495 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-16 21:10:03 +00:00
Riad Benguella
5b9b012e53 Block Editor: Remove the gutenberg domain name from the block-patterns.php file
Props SergeyBiryukov.
Fixes #50669.


git-svn-id: https://develop.svn.wordpress.org/trunk@48494 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-16 14:11:40 +00:00
Sergey Biryukov
da730fce4d Upgrade/Install: Check if the theme installer skin's overwrite property exists in Theme_Upgrader::install_strings().
This ensures consistency with `Plugin_Upgrader::install_strings()` and resolves an issue caused by the property not existing in other upgrader implementations.

Props schlessera, azaozz.
See #50670.

git-svn-id: https://develop.svn.wordpress.org/trunk@48493 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-16 13:17:13 +00:00
Riad Benguella
bd63261888 Block Editor: Add theme support flag to opt-out of Core Block Patterns.
WordPress Core comes by default with a number of block patterns and a frequent request was to be able to opt-out of the Core block patterns. 
You can now opt-out using remove_theme_support( 'core-block-patterns' )

Props desrosj, nosolosw.
Fixes #50669.


git-svn-id: https://develop.svn.wordpress.org/trunk@48492 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-16 11:48:49 +00:00
Sergey Biryukov
b001723394 Docs: Add return value description for register_theme_directory().
Props stevenlinx.
Fixes #50665.

git-svn-id: https://develop.svn.wordpress.org/trunk@48491 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-15 12:08:32 +00:00
Sergey Biryukov
caefeeea17 Docs: Link to add_theme_support() for the list of supported theme features in current_theme_supports() and related functions.
Props stevenlinx.
Fixes #50657.

git-svn-id: https://develop.svn.wordpress.org/trunk@48490 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-15 11:21:23 +00:00
Jake Spurlock
afb11188d2 Post 5.5 Beta 2 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@48482 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-14 17:39:48 +00:00
Jake Spurlock
8921997100 WordPress 5.5 Beta 2.
git-svn-id: https://develop.svn.wordpress.org/trunk@48481 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-14 17:00:11 +00:00
Sergey Biryukov
c843cf19c3 Taxonomy: Make some adjustments to handling default terms for custom taxonomies:
* Move default term assignment from `wp_set_object_terms()` to `wp_insert_post()`.
* Make sure the passed taxonomy list overwrites the existing list if not empty.
* Remove the default term option on `unregister_taxonomy()`.
* Prevent deletion of the default term in `wp_delete_term()`.

Props enrico.sorcinelli, TimothyBlynJacobs.
See #43517.

git-svn-id: https://develop.svn.wordpress.org/trunk@48480 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-14 16:39:44 +00:00
Andrea Fercia
9181ecff85 Accessibility: Security: Improves the accessible audible messages for Plugins & Themes Auto-Updates.
- changes the politeness level of the two error messages introduced in [47835] to `assertive`
- remove unnecessary `polite` parameters as that's the default value

See #50512, #50052.



git-svn-id: https://develop.svn.wordpress.org/trunk@48479 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-14 15:44:16 +00:00
Sergey Biryukov
74b985fd7d Docs: Synchronize description for the $allowed_html parameter of various KSES functions.
Follow-up to [43016].

Props Christian1012, jdgrimes, markparnell.
Fixes #39542. See #33801.

git-svn-id: https://develop.svn.wordpress.org/trunk@48478 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-14 12:39:16 +00:00
Jonathan Desrosiers
7bdff387e2 General: Rename the $new_whitelist_options global variable.
This change renames `$new_whitelist_options` to `$new_allowed_options`. This makes the variable’s purpose more clear, and promotes using more inclusive language.

For backwards compatibility, the new variable is passed by reference to the old one.

Follow up to [48121].

Props ayeshrajans, desrosj, jorbin, SergeyBiryukov.
See #50413.
Fixes #50434.

git-svn-id: https://develop.svn.wordpress.org/trunk@48477 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-14 12:31:22 +00:00
swissspidy
0ee9100e6d Sitemaps: Ensure entry for ‘page’ post type sitemap in index.
If there are no pages and no static homepage, there will still be one sitemap including the homepage URL.

This change ensures that this sitemap is correctly listed in the sitemap index.

Props Chouby, pacifika, elrae.
Fixes #50571.

git-svn-id: https://develop.svn.wordpress.org/trunk@48476 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-14 12:24:02 +00:00
John Blackbourn
7d5b488b3b Docs: Improve docs for arguments that accept a numerically indexed array of associative arrays.
See #49572

git-svn-id: https://develop.svn.wordpress.org/trunk@48475 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-14 12:08:28 +00:00
Pascal Birchler
efb0b58598 Sitemaps: Exclude post types and taxonomies that are not publicly queryable.
Props Cybr.
Fixes #50607.

git-svn-id: https://develop.svn.wordpress.org/trunk@48474 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-14 11:54:49 +00:00
John Blackbourn
fa9e258750 Docs: Correct and improve inline docs for parameters that accept a callback function.
See #49572

git-svn-id: https://develop.svn.wordpress.org/trunk@48473 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-14 11:54:26 +00:00
Pascal Birchler
585f623b4d Sitemaps: Add missing slash when calling home_url() for consistency.
Props Chouby.
Fixes #50570.

git-svn-id: https://develop.svn.wordpress.org/trunk@48472 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-14 11:52:43 +00:00
Pascal Birchler
649b7aae92 Sitemaps: Add wrapping <div> around sitemap in stylesheet.
This makes it easier to style the sitemap and for example center the entire content area.

Props ramiy.
Fixes #50622.

git-svn-id: https://develop.svn.wordpress.org/trunk@48471 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-14 11:43:54 +00:00
Pascal Birchler
cf4897f5d8 Sitemaps: Pass full paths to home_url() calls.
This makes it easier for plugins using the `home_url` filter to detect sitemap URLs.

Props Chouby.
Fixes #50592.

git-svn-id: https://develop.svn.wordpress.org/trunk@48470 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-14 11:41:47 +00:00
Ella van Durpe
479a125882 Editor: update packages for beta 2
Fixes #50651.



git-svn-id: https://develop.svn.wordpress.org/trunk@48469 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-14 11:36:39 +00:00
Sergey Biryukov
63ad9247c1 Privacy: Set the direction for the "Username or email address" field on privacy screens to LTR.
This is consistent with other email inputs across the admin.

Follow-up to [27743], [42967].

Props man4toman, sushyant.
Fixes #50625.

git-svn-id: https://develop.svn.wordpress.org/trunk@48468 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-14 11:15:28 +00:00
Sergey Biryukov
a128b52eb0 Docs: Improve description for get_blog_post().
Props stevenlinx.
Fixes #50655.

git-svn-id: https://develop.svn.wordpress.org/trunk@48467 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-14 11:05:01 +00:00
Andrew Ozz
719dcd244a Administration: Attempt to even-out the new Up/Down arrows in metabox headings and make them look a bit better. Also group them a little closer together in an attempt to reduce confusion of having two down arrows next to one another. Move the focus outline to the button instead of only the icon.
Fixes #39074.

git-svn-id: https://develop.svn.wordpress.org/trunk@48465 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-14 01:35:47 +00:00
John Blackbourn
f36c42c700 Docs: Miscellaneous docblock corrections and improvements.
See #49572

git-svn-id: https://develop.svn.wordpress.org/trunk@48462 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-13 22:08:16 +00:00
Jake Spurlock
c3cdd9c962 Customize: Ensure that widgets and nav-menus can be closed after entering content.
Previously, the ⌧ button would close the search panel, or remove the results. This restores that, in addition pressing escape will do the same.

Fixes #48198.

Props garrett-eclipse, tobifjellner, afercia, JavierCasares.



git-svn-id: https://develop.svn.wordpress.org/trunk@48461 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-13 20:13:49 +00:00
Andrea Fercia
81364742b1 Accessibility: Improve reordering of the post boxes in the block editor meta boxes area.
Follow-up to [48373].
- ignores hidden "sortables" areas 
- hides the reorder buttons when there's only one post box 
- makes the reorder buttons slightly bigger to match the side of the toggle button

Fixes #39074.


git-svn-id: https://develop.svn.wordpress.org/trunk@48460 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-13 18:01:31 +00:00
Jake Spurlock
a932bb3851 Bundled Themes: Add custom color pallettes for block editor.
Gutenberg 7.9 added support for themes to bundle their own custom styles in to the editor. These changes have been added to 2010 - 2016.

See #50120. 

Props kjellr, sabernhardt, ianbelanger. 



git-svn-id: https://develop.svn.wordpress.org/trunk@48459 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-13 17:06:57 +00:00
Sergey Biryukov
6cba6fdc08 Docs: Improve description of the $text parameter in cancel_comment_reply_link().
Props stevenlinx.
Fixes #50642.

git-svn-id: https://develop.svn.wordpress.org/trunk@48457 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-13 14:40:27 +00:00
Jonathan Desrosiers
6cf53ad3bf Administration: Update Dashicons to the latest version.
This update introduces the following new icons:

- `.dashicons-align-pull-left (f10a)`
- `.dashicons-align-pull-right (f10b)`
- `.dashicons-block-default (f12b)`
- `.dashicons-cloud-saved (f137)`
- `.dashicons-cloud-upload (f13b)`
- `.dashicons-columns (f13c)`
- `.dashicons-cover-image (f13d)`
- `.dashicons-embed-audio (f13e)`
- `.dashicons-embed-generic (f13f)`
- `.dashicons-embed-photo (f144)`
- `.dashicons-embed-post (f146)`
- `.dashicons-embed-video (f149)`
- `.dashicons-exit (f14a)`
- `.dashicons-html (f14b)`
- `.dashicons-info-outline (f14c)`
- `.dashicons-insert-after (f14d)`
- `.dashicons-insert-before (f14e)`
- `.dashicons-remove (f14f)`
- `.dashicons-shortcode (f150)`
- `.dashicons-table-col-after (f151)`
- `.dashicons-table-col-before (f152)`
- `.dashicons-table-col-delete (f15a)`
- `.dashicons-table-row-after (f15b)`
- `.dashicons-table-row-before (f15c)`
- `.dashicons-table-row-delete (f15d)`
- `.dashicons-saved (f15e)`
- `.dashicons-airplane (f15f)`
- `.dashicons-amazon (f162)`
- `.dashicons-bank (f16a)`
- `.dashicons-beer (f16c)`
- `.dashicons-bell (f16d)`
- `.dashicons-calculator (f16e)`
- `.dashicons-coffee (f16f)`
- `.dashicons-database-add (f170)`
- `.dashicons-database-export (f17a)`
- `.dashicons-database-import (f17b)`
- `.dashicons-database-remove (f17c)`
- `.dashicons-database-view (f17d)`
- `.dashicons-database (f17e)`
- `.dashicons-drumstick (f17f)`
- `.dashicons-edit-page (f186)`
- `.dashicons-food (f187)`
- `.dashicons-fullscreen-alt (f188)`
- `.dashicons-fullscreen-exit-alt (f189)`
- `.dashicons-games (f18a)`
- `.dashicons-google (f18b)`
- `.dashicons-hourglass (f18c)`
- `.dashicons-linkedin (f18d)`
- `.dashicons-money-alt (f18e)`
- `.dashicons-open-folder (f18f)`
- `.dashicons-pdf (f190)`
- `.dashicons-pets (f191)`
- `.dashicons-pinterest (f192)`
- `.dashicons-printer (f193)`
- `.dashicons-privacy (f194)`
- `.dashicons-reddit (f195)`
- `.dashicons-spotify (f196)`
- `.dashicons-superhero-alt (f197)`
- `.dashicons-superhero (f198)`
- `.dashicons-twitch (f199)`
- `.dashicons-whatsapp (f19a)`
- `.dashicons-youtube (f19b)`
- `.dashicons-car (f16b)`
- `.dashicons-podio (f19c)`
- `.dashicons-xing (f19d)`


This update is the final planned update of the Dashicons font. Moving forward, the more modern approach of using SVG icons directly (as the block editor currently does) will be explored. More information on the future of Dashicons can be found on the Make Design blog: https://make.wordpress.org/design/2020/04/20/next-steps-for-dashicons/.

Props joen, johnjamesjacoby, empireoflight, youknowriad, netweb, zodiac1978, desrosj, automaton, chrisvanpatten.
Fixes #49913.

git-svn-id: https://develop.svn.wordpress.org/trunk@48456 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-13 14:24:06 +00:00
Sergey Biryukov
4171c2485c Upgrade/Install: Simplify compatibility checks for uploaded plugins and themes for better readability.
Use `$new_plugin_data` and `$new_theme_data` as a shorthand for the corresponding `$this->upgrader` properties.

Follow-up to [48390], [48448].

Props afragen.
See #9757.

git-svn-id: https://develop.svn.wordpress.org/trunk@48455 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-13 13:33:32 +00:00
Andrew Ozz
dd50193d6a Media: Fix wp_image_file_matches_image_meta() to also match when the original image URL is used.
Also refreshes and fixes some of the unit tests for media, and replaces test-image-large.png with test-image-large.jpg which is larger to allow testing of `original_image` in the image meta.

Fixes #50628.



git-svn-id: https://develop.svn.wordpress.org/trunk@48454 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-12 21:18:38 +00:00
Andrew Ozz
daf168c088 Upgrade/Install: Use wp_strip_all_tags() for the fields in the compare table on the "Update theme/plugin from uploaded zip" screen. Some may contain HTML.
See #9757.

git-svn-id: https://develop.svn.wordpress.org/trunk@48453 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-12 19:59:00 +00:00
Timothy Jacobs
adcf3d88b4 REST API: Add Content-Disposition, Content-MD5 and X-WP-Nonce as allowed cors headers.
The Content-Disposition and Content-MD5 headers allow for easier file uploading across domains by using a File/Blob object directly. The X-WP-Nonce header is allowed for making cross-origin and same-origin authenticated requests consistent.

Additionally a filter is introduced, "rest_allowed_cors_headers", to simplify the process of allowing additional request headers.

Props rmccue, TimothyBlynJacobs.
Fixes #41696.


git-svn-id: https://develop.svn.wordpress.org/trunk@48452 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-12 19:35:55 +00:00
Sergey Biryukov
26c296c397 Plugins: Make delete plugin message less scary.
This adds a check if the plugin actually has an uninstall routine before saying that its data will be deleted too.

Props samful, joostdevalk, joyously, Chouby, SergeyBiryukov.
Fixes #50346.

git-svn-id: https://develop.svn.wordpress.org/trunk@48451 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-12 13:20:58 +00:00
Sergey Biryukov
cece47bd39 Administration: Restore the excerpt key for the Extended view mode for backward compatibility for now.
Props Offereins.
See #49715.

git-svn-id: https://develop.svn.wordpress.org/trunk@48450 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-12 11:34:18 +00:00
Sergey Biryukov
f051ed3ffb Docs: Add a @since entry for the $hook_extra parameter added to WP_Upgrader::download_package().
Follow-up to [48399].

See #49686.

git-svn-id: https://develop.svn.wordpress.org/trunk@48449 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-12 11:00:16 +00:00
Sergey Biryukov
51e92ced21 Upgrade/Install: Use is_php_version_compatible() and is_wp_version_compatible() in plugin and theme requirement checks.
Follow-up to [48390].

Props afragen.
See #9757.

git-svn-id: https://develop.svn.wordpress.org/trunk@48448 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-12 10:53:36 +00:00
Sergey Biryukov
b161e126a0 I18N: Move the "WordPress Backups" support URL to its own translatable string.
Follow-up to [48390].

See #9757.

git-svn-id: https://develop.svn.wordpress.org/trunk@48447 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-12 10:32:57 +00:00
Sergey Biryukov
8c2443d171 Docs: Miscellaneous DocBlock corrections for plugin and theme updates.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48446 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-12 01:17:51 +00:00
SergeyBiryukov
9d30b02ed1 Administration: Handle the result of Plugin_Upgrader::bulk_upgrade() for a plugin that is already at the latest version in the same way it is handled for themes.
This corrects a fragile check of the result in `wp_ajax_update_plugin()` that depended on the internal array pointer, and brings some consistency with `wp_ajax_update_theme()`.

Follow-up to [37714], [48401].
See #50448.

git-svn-id: https://develop.svn.wordpress.org/trunk@48445 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-12 01:14:01 +00:00
Sergey Biryukov
7cf1e60543 Docs: Improve documentation for sanitize_user(), sanitize_title(), sanitize_title_with_dashes().
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48444 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-12 01:11:35 +00:00
Sergey Biryukov
4d964a8cf2 Docs: Synchronize @since notes for add_magic_quotes() and wp_slash().
Follow-up to [48205], [48433].

See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48441 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-11 22:46:27 +00:00
Sergey Biryukov
7137014901 Bootstrap/Load: Adjust the logic in add_magic_quotes() for better readability.
Follow-up to [48205].

See #48605.

git-svn-id: https://develop.svn.wordpress.org/trunk@48440 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-11 22:42:35 +00:00
Sergey Biryukov
a9368a89e5 Menus: Simplify the test for wp_update_nav_menu_item() with special characters in category name.
The `menu-item-title` value is saved as a `post_title` property, so the resulting property can be checked directly, without a callback.

Follow-up to [48416].

See #48011.

git-svn-id: https://develop.svn.wordpress.org/trunk@48439 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-11 21:46:29 +00:00
Sergey Biryukov
d5cfd5c63c Revisions: Restore the return value of wp_get_post_autosave() to the documented type of WP_Post for backward compatibility.
Follow-up to [48422].

See #34560.

git-svn-id: https://develop.svn.wordpress.org/trunk@48438 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-11 21:13:56 +00:00
Timothy Jacobs
8f39f8ebb7 REST API: Sanitize block renderer attributes.
In [48069] the Block Renderer was changed to register a single route for all dynamic blocks. Validation was dynamically applied based on the requested block, but sanitization was not. This commit adds the same sanitization back to the block attributes.

Props manooweb.
Fixes #50620. See #48079.


git-svn-id: https://develop.svn.wordpress.org/trunk@48437 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-11 20:32:19 +00:00
Sergey Biryukov
c42b6b5ddb Revisions: Replace array_shift() with reset() in register_and_do_post_meta_boxes() for better performance.
Follow-up to [31829], [48422].

See #34560.

git-svn-id: https://develop.svn.wordpress.org/trunk@48436 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-11 12:28:07 +00:00
Sergey Biryukov
b4232b7de7 Coding Standards: Use strict type check for in_array() in wp-includes/feed.php.
Additionally:
* Correct inline comments per the documentation standards.
* Correct the `@ticket` reference in `tests/feed/atom.php`.

Follow-up to [48429].

See #33591.

git-svn-id: https://develop.svn.wordpress.org/trunk@48435 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-11 12:12:46 +00:00
Jake Spurlock
21273c3c49 Formatting: Prevent wp_slash from returning non-strings as strings.
If a bool/float/int is passed into wp_slash it will be coerced into a string.

This changes the behavior to only slash strings. At the same time, handles recursion a little nicer by calling array_map for arrays.

Fixes #42195, #24106.

Props johnbillion, andizer, jrf, ryotasakamoto, SergeyBiryukov, donmhico, TobiasBg, markoheijnen, ryan, nacin, devesine, whyisjake.



git-svn-id: https://develop.svn.wordpress.org/trunk@48433 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-11 00:11:57 +00:00
Jake Spurlock
d42bdcb877 Formatting: Improve the docblock for sanitize_title().
Since sanitize title is largely used for html attributes, or post slugs, make note that accents will be removed and that the string will be limited to alphanumeric characters, underscores, and dashes.

Fixes #33756.
Props ericlewis, swissspidy, wonderboymusic, psdtohtmlguru, DrewAPicture, SergeyBiryukov, sjmur, gma992, shulard, ebinnion, whyisjake.



git-svn-id: https://develop.svn.wordpress.org/trunk@48432 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-10 23:26:31 +00:00
Andrew Ozz
5d85a53292 Media: Tiny logic fix in wp_image_file_matches_image_meta() after [48329]. No need to look in sizes if the full size image path/URL matches.
See #50543.

git-svn-id: https://develop.svn.wordpress.org/trunk@48430 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-10 23:04:08 +00:00
Jake Spurlock
4337c258dc Feeds: Ensure that enclosures produce valid XML.
Metadata that is stored on newlines has the possibility of missing values, so rather then coercing values, we can check for them and then implicity set the values.

Fixes #33591.
Props jonnybot, stevenkword, vtieu, birgire, SergeyBiryukov, davidbaumwald, rebasaurus, whyisjake.



git-svn-id: https://develop.svn.wordpress.org/trunk@48429 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-10 22:21:22 +00:00
Sergey Biryukov
99499966cf Themes: Correct closing tag for the "Enable auto-updates" button in the JS template for theme auto-update setting.
Follow-up to [48418].

See #50516.

git-svn-id: https://develop.svn.wordpress.org/trunk@48428 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-10 22:01:57 +00:00
Sergey Biryukov
d0b6778654 Docs: Improve description for the JS function that hides the update button for expired plugin or theme uploads.
Add missing `@since` tag.

Follow-up to [48417].

See #50612.

git-svn-id: https://develop.svn.wordpress.org/trunk@48427 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-10 21:13:25 +00:00
Sergey Biryukov
72d5862069 Docs: Improve @return tags for various conditional tags.
Props stevenlinx, SergeyBiryukov.
Fixes #50626.

git-svn-id: https://develop.svn.wordpress.org/trunk@48426 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-10 20:21:01 +00:00
Sergey Biryukov
a7a91ba8dc Sitemaps: Remove some extra space from WP_Sitemaps_Stylesheet::get_stylesheet_css().
Follow-up to [48414].

See #50449.

git-svn-id: https://develop.svn.wordpress.org/trunk@48425 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-10 16:10:07 +00:00
Sergey Biryukov
5e160ea4a9 Administration: Bring some consistency to handling list table view modes.
* Remove duplicate variables and DocBlocks.
* Add missing description for the `$mode` global.
* Use sentence case for "Compact view" and "Extended view" labels.

Follow-up to [48398], [48423].

Props afercia, Offereins, SergeyBiryukov.
See #49715.

git-svn-id: https://develop.svn.wordpress.org/trunk@48424 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-10 16:02:00 +00:00
Sergey Biryukov
6c4f6693e5 Administration: Make some adjustments to WP_Screen::render_view_mode():
* Restore the `$mode` global for backward compatibility.
* Remove redundant check, as `$mode` is already set at this point, and already defaults to `list` via `get_user_setting()`'s second argument.
* Use sentence case for "View mode" and "Extended view" labels.

Follow-up to [48398].

See #49715.

git-svn-id: https://develop.svn.wordpress.org/trunk@48423 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-10 16:00:42 +00:00
Adam Silverstein
4adb926ce8 Revisions: optimize performance when post has large number of revisions.
Improve speed and reduce the memory footprint when loading posts with many revisions.

* Use a direct query in `wp_get_post_autosave` to avoid loading all revisions.
* Query for IDs vs full objects in `register_and_do_post_meta_boxes`.

Props pdfernhout, johnnyb, miqrogroove, ocean90, senatorman, DBrumbaugh10Up, martijn-van-der-kooij, pavelevap, mackensen, mikeyarce, whyisjake.
Fixes #34560.



git-svn-id: https://develop.svn.wordpress.org/trunk@48422 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-10 15:12:00 +00:00
Sergey Biryukov
73d3e9cfd9 Coding Standards: Use strict comparison in WP_List_Util::filter().
Correct comments per the documentation standards.

See #49542, #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48421 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-10 12:44:38 +00:00
Sergey Biryukov
7b27f3f00a Docs: Correct documentation for customize_controls_head hook and _customizer_mobile_viewport_meta() function.
Follow-up to [48412].

See #47369.

git-svn-id: https://develop.svn.wordpress.org/trunk@48420 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-10 11:34:41 +00:00
Jake Spurlock
26e29a513a Administration: Better align labels on the discussion options page.
The labels for Comment Moderation, and Comment Blocklist are now aligned properly with the adjacent text.

Fixes #37384.
Props ankit-k-gupta, karmatosed, FolioVision, desrosj, valentinbora, samful, whyisjake.


git-svn-id: https://develop.svn.wordpress.org/trunk@48419 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-10 06:46:03 +00:00
Jake Spurlock
1b251feeec Upgrade/Install: Use ARIA button class on plugin and theme auto-updates action links
According to the [accesability guidelines](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/accessibility/#semantics-for-controls), the control should be a link when JavaScript is not available and a button the rest of the time.

In addition, handlers were added for spacebar usage, and some changes to the a11y speak verbiage.

Fixes #50516.
Props ryokuhi, audrasjb, afercia, whyisjake/




git-svn-id: https://develop.svn.wordpress.org/trunk@48418 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-10 06:16:06 +00:00
Jake Spurlock
bf93e9699f Upgrade/Install: Ensure cleanup after canceled update.
Ensure that the uploaded zip is hidden from the media library, where a task will remove failed installs after two hours.

Fixes #50612.

Props psykro, desrosj, joyously, azaozz, noisysocks, whyisjake. 


git-svn-id: https://develop.svn.wordpress.org/trunk@48417 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-10 06:06:46 +00:00
Jake Spurlock
3667d18943 Menus: Ensure that category menus with special characters can be updated.
Slashes and HTML encoding could cause some menus not to be updated.

Fixes #48011.

Props zaheerahmad, achyuthajoy, desrosj, pento, SergeyBiryukov, donmhico, audrasjb, birgire, mikeschroder.



git-svn-id: https://develop.svn.wordpress.org/trunk@48416 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-10 05:58:49 +00:00
Jake Spurlock
80e2a20c53 Coding Standards: Some missed code formatting.
Unprops: whyisjake.



git-svn-id: https://develop.svn.wordpress.org/trunk@48415 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-10 00:59:58 +00:00
Jake Spurlock
36f9f6c70d Sitemaps: Add better support for RTL sites.
While the URLs are intended to be machine readable, they should always be LTR, while other data would be RTL in the sitemap.

Fixes #50449.

Props joyously, SergeyBiryukov, pbiron. apedog, ramiy.



git-svn-id: https://develop.svn.wordpress.org/trunk@48414 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-10 00:48:54 +00:00
Jake Spurlock
0802e754a2 Formatting: Ensure that wp_filter_object_list() will return an array when being passed an object with magic methods.
Fixes #50095.

Props johnjamesjacoby.


git-svn-id: https://develop.svn.wordpress.org/trunk@48413 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-10 00:29:48 +00:00
Jake Spurlock
0999a01956 Administration: Remove multiple viewport meta tags from mobile pages.
In addition, add the `wp_admin_viewport_meta()` function, paired to the `admin_viewport_meta` filter to control attributes of the meta tag.

Fixes #47369.
Props BettyJJ, mukesh27, SergeyBiryukov, ajayghaghretiya1, msaggiorato, talldanwp, davidbaumwald, donmhico, audrasjb.



git-svn-id: https://develop.svn.wordpress.org/trunk@48412 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-09 23:27:28 +00:00
Sergey Biryukov
9683101398 Docs: Synchronize and correct documentation for various metadata functions and filters.
Follow-up to [47390], [47611], [48192], [48402].

See #49572, #43941, #45464.

git-svn-id: https://develop.svn.wordpress.org/trunk@48411 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-09 11:24:43 +00:00
Sergey Biryukov
c3993eb19d Widgets: Adjust formatting for displaying the closing </nav> tag in widgets for consistency with the opening tag.
Follow-up to [48349].

See #48170.

git-svn-id: https://develop.svn.wordpress.org/trunk@48410 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-08 13:42:30 +00:00
Sergey Biryukov
c66bdb8b5a Widgets: Correct the logic for displaying the after_widget parameter of the Archives widget.
Follow-up to [48349].

Props mukesh27, joyously.
Fixes #50609.

git-svn-id: https://develop.svn.wordpress.org/trunk@48409 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-08 13:26:20 +00:00
Sergey Biryukov
8b89be2676 Docs: Miscellaneous DocBlock corrections.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48408 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-08 13:13:50 +00:00
Sergey Biryukov
de37c09c7b Docs: Further improve documentation for have_posts() and have_comments().
Follow-up to [48406]

Props stevenlinx.
See #50610.

git-svn-id: https://develop.svn.wordpress.org/trunk@48407 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-08 11:13:22 +00:00
Sergey Biryukov
3dc074ed1d Docs: Improve documentation for have_posts(), have_comments(), and their WP_Query counterparts.
Props stevenlinx.
Fixes #50610.

git-svn-id: https://develop.svn.wordpress.org/trunk@48406 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-08 11:09:08 +00:00
Sergey Biryukov
e76307655d Upgrade/Install: Prevent the upgrade routine for updating the comment_type field in the comments table from running twice.
Follow-up to [47597], [48400].

See #50413, #49236.

git-svn-id: https://develop.svn.wordpress.org/trunk@48405 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-08 10:56:22 +00:00
Sergey Biryukov
660fc1703d Post WordPress 5.5 Beta 1 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@48404 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 21:51:26 +00:00
Sergey Biryukov
a99e0fd425 WordPress 5.5 Beta 1.
git-svn-id: https://develop.svn.wordpress.org/trunk@48403 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 20:59:16 +00:00
Timothy Jacobs
612eeb92a8 REST API, Meta: Introduce support for default metadata values.
The `register_meta()` API now officially supports specifying a default metadata value. When `get_metadata()` is called for a meta key that does not yet exist for the object, this default value will be returned instead of an empty string.

A new function is introduced `get_metadata_raw` to retrieve the raw metadata value from the database, without applying the registered default.

Props spacedmonkey, flixos90, rmccue, kadamwhite, mnelson4, johnbillion, chrisvanpatten, TimothyBlynJacobs.
Fixes #43941.



git-svn-id: https://develop.svn.wordpress.org/trunk@48402 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 20:45:55 +00:00
Jonathan Desrosiers
dd64c95f65 Administration: Fix failing tests as a result of [48397].
Because of changes to how PHP handles arrays used in `foreach()` loops in PHP >= 7.0, [48397] resulted in a failing test for PHP 5.6.

This calls `reset()` after using the `$results` array in the `foreach()` to ensure the array is treated the same and as expected.

Props azaozz, desrosj, SergeyBiryukov, xknown.
See #50448.

git-svn-id: https://develop.svn.wordpress.org/trunk@48401 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 20:36:41 +00:00
Jonathan Desrosiers
7d3b647a16 Upgrade/Install: Prevent some 5.5.0 upgrade routines from running twice.
This will prevent the options renamed for 5.5.0 from being converted twice. If a new update routine is added before 5.5 is released, the option values would be erased for anyone running `trunk` or nightlies without this change.

Props azaozz, desrosj, SergeyBiryukov, whyisjake.
Fixes #50413.

git-svn-id: https://develop.svn.wordpress.org/trunk@48400 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 19:19:03 +00:00
Jonathan Desrosiers
61803a37a4 Upgrade/Install: Add hook_extra parameter to the upgrader_pre_download filter.
This provides additional context to code running on this hook, including which plugin or theme update will be downloaded. It also brings consistency to this filter with others throughout the upgrade process.

Props obliviousharmony, desrosj.
Fixes #49686.

git-svn-id: https://develop.svn.wordpress.org/trunk@48399 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 19:13:30 +00:00
Jake Spurlock
86ffb51a33 Administration: Introduce extensibility to posts and comments list table views, for accessibility purposes.
At default, expands the excerpt view to become an extended view. Includes a new `table_view_mode` filter to allow further configuration.

Fixes #49715.
Props joedolson, audrasjb, afercia, whyisjake.



git-svn-id: https://develop.svn.wordpress.org/trunk@48398 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 19:10:46 +00:00
Jonathan Desrosiers
bfb896ce08 Administration: Prevent repeat emails for identical plugin or theme auto-update attempt failures.
This change adds a throttle mechanism to plugin and theme auto-update failure emails using similar logic to the email sent for a Core auto-update.

The first time a plugin or theme auto-update fails, the package and `new_version` will be tracked in the `auto_plugin_theme_update_emails` option. An email for this specific update attempt will not be resent.

However, if this update fails again and non-repeat failures or successful updates are also present, then the failure information will be included in that email (an email needs to be sent for the new events regardless).

Props johnbillion, arpitgshah, desrosj, audrasjb, pbiron, earnjam.
Fixes #50448.

git-svn-id: https://develop.svn.wordpress.org/trunk@48397 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 18:58:32 +00:00
Dominik Schilling
a7dc1bbef1 I18N: Use wp.i18n for translatable strings in wp-admin/js/set-post-thumbnail.js.
This removes the usage of `wp_localize_script()` for passing translations to the script and instead adds the translatable strings in the script directly through the use of `wp.i18n` and its utilities.

Props swissspidy, ocean90.
See #20491.
Fixes #50605.

git-svn-id: https://develop.svn.wordpress.org/trunk@48396 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 18:53:50 +00:00
Dominik Schilling
25417b5d49 I18N: Use wp.i18n for translatable strings in wp-admin/js/comment.js.
This removes the usage of `wp_localize_script()` for passing translations to the script and instead adds the translatable strings in the script directly through the use of `wp.i18n` and its utilities.

Props swissspidy, ocean90.
See #20491.
Fixes #50604.

git-svn-id: https://develop.svn.wordpress.org/trunk@48395 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 18:38:20 +00:00
Dominik Schilling
189f23fd27 I18N: Use wp.i18n for translatable strings in wp-admin/js/nav-menu.js.
This removes the usage of `wp_localize_script()` for passing translations to the script and instead adds the translatable strings in the script directly through the use of `wp.i18n` and its utilities.

Props swissspidy, ocean90.
See #20491.
Fixes #50603.

git-svn-id: https://develop.svn.wordpress.org/trunk@48394 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 18:28:41 +00:00
Sergey Biryukov
3591f4eba9 Comments: Allow passing a custom class to the form container element in comment_form().
Props cjbj, yahil, mayankmajeji, andraganescu, SergeyBiryukov.
Fixes #41009.

git-svn-id: https://develop.svn.wordpress.org/trunk@48393 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 18:27:03 +00:00
Dominik Schilling
f0c4b2c12e I18N: Use wp.i18n for translatable strings in wp-admin/js/plugin-install.js.
This removes the usage of `wp_localize_script()` for passing translations to the script and instead adds the translatable strings in the script directly through the use of `wp.i18n` and its utilities.

Props swissspidy, ocean90.
See #20491.
Fixes #50602.

git-svn-id: https://develop.svn.wordpress.org/trunk@48392 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 18:13:14 +00:00
Dominik Schilling
849e7bfdc8 I18N: Use wp.i18n for translatable strings in wp-admin/js/inline-edit-post.js and wp-admin/js/inline-edit-tax.js.
This removes the usage of `wp_localize_script()` for passing translations to the scripts and instead adds the translatable strings in the scripts directly through the use of `wp.i18n` and its utilities.

Props swissspidy, ocean90.
See #20491.
Fixes #50601.

git-svn-id: https://develop.svn.wordpress.org/trunk@48391 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 18:00:37 +00:00
Andrew Ozz
289c28637c Upgrade/install: Allow plugin and theme updates from a uploaded .zip file.
Props mariovalney, cyberhobo, imath, shaunandrews, mariovalney, earnjam, desrosj, dd32, folletto, swissspidy, melchoyce, pento, joshuawold, psykro, clorith, ahortin, galbaras, pingram3541, joyously, doobeedoo, karmatosed, poena, whyisjake, earnjam, sergeybiryukov, audrasjb, azaozz.

Fixes #9757.

git-svn-id: https://develop.svn.wordpress.org/trunk@48390 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 17:47:37 +00:00
Andrea Fercia
2bdd712204 Accessibility: Widgets: Further improve spacing between Widgets checkboxes and radio buttons in the admin interface.
Follow-up to [47598]:
- further improves the spacing after [47598] by better scoping the CSS to avoid layout glitches for custom widgets
- changes the RSS widget form to wrap the checkboxes in one single paragraph

Ideally, multiple related checkboxes and radio buttons should be grouped within a fieldset element with a legend. This will be addressed in a new Trac ticket.

Props mukesh27, SergeyBiryukov, sabernhardt.
Fixes #49228.


git-svn-id: https://develop.svn.wordpress.org/trunk@48389 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 17:27:38 +00:00
Andrea Fercia
233dc322bf Docs: Reference the documentation of the new navigation_widgets_format filter instead of repeating it.
Follow-up to [48349].

Props johnbillion.
Fixes #48170.


git-svn-id: https://develop.svn.wordpress.org/trunk@48388 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 17:04:05 +00:00
Dominik Schilling
8c42273b7a I18N: Use wp.i18n for translatable strings in wp-admin/js/widgets.js.
This removes the usage of `$scripts->add_inline_script()` for passing translations to the script and instead adds the translatable strings in the script directly through the use of `wp.i18n` and its utilities.

Fixes #50600.

git-svn-id: https://develop.svn.wordpress.org/trunk@48387 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 16:59:22 +00:00
Andrew Ozz
7377c28728 Media, REST API: Allow media edit endpoint to find remote files.
Props jonsurrell.
Fixes #50595.

git-svn-id: https://develop.svn.wordpress.org/trunk@48386 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 16:49:30 +00:00
Dominik Schilling
dd353bf815 I18N: Use wp.i18n for translatable strings in wp-admin/js/post.js.
This removes the usage of `wp_localize_script()` for passing translations to the script and instead adds the translatable strings in the script directly through the use of `wp.i18n` and its utilities.

Props swissspidy, ocean90.
See #20491.
Fixes #50599.

git-svn-id: https://develop.svn.wordpress.org/trunk@48385 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 16:47:14 +00:00
Dominik Schilling
b24fbd088b I18N: Use wp.i18n for translatable strings in wp-admin/js/media.js.
This removes the usage of `wp_localize_script()` for passing translations to the script and instead adds the translatable strings in the script directly through the use of `wp.i18n` and its utilities.

Props swissspidy, ocean90.
See #20491.
Fixes #50597.

git-svn-id: https://develop.svn.wordpress.org/trunk@48384 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 16:12:14 +00:00
Dominik Schilling
e39812fe53 I18N: Use wp.i18n for translatable strings in wp-admin/js/color-picker.js.
This removes the usage of `wp_localize_script()` for passing translations to the script and instead adds the translatable strings in the script directly through the use of `wp.i18n` and its utilities.

Props swissspidy, ocean90.
See #20491.
Fixes #50596.

git-svn-id: https://develop.svn.wordpress.org/trunk@48383 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 16:07:25 +00:00
Timothy Jacobs
9c4288687e REST API: Use new rest_get_route_for_post() in the post search handler.
In [48273] the rest_get_route_for_post function was introduced. This simplifies determining the REST API route for any given post object and adds a filter for custom controllers.

Props ravatparmar.
Fixes #50529.


git-svn-id: https://develop.svn.wordpress.org/trunk@48381 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 15:29:22 +00:00
John Blackbourn
f4b381b640 Administration: Reinstate the description for the admin_xml_ns hook which was accidentally removed in [47771].
See #46015.

git-svn-id: https://develop.svn.wordpress.org/trunk@48380 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 14:55:51 +00:00
Ella van Durpe
84d3fe2b67 Editor: update packages
Fixes #50589.



git-svn-id: https://develop.svn.wordpress.org/trunk@48379 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 14:41:35 +00:00
Sergey Biryukov
d2ec3ab82d Themes: Allow passing a custom class to post and comment pagination functions.
This affects:
* `get_the_post_navigation()`
* `get_the_posts_navigation()`
* `get_the_posts_pagination()`
* `get_the_comments_navigation()`
* `get_the_comments_pagination()`

Props jfarthing84, markparnell, davidbaumwald, SergeyBiryukov.
Fixes #39378.

git-svn-id: https://develop.svn.wordpress.org/trunk@48378 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 14:13:37 +00:00
John Blackbourn
5f88132794 Docs: Correct some @since entries added in 5.5.
See #49572

git-svn-id: https://develop.svn.wordpress.org/trunk@48377 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 14:12:38 +00:00
Riad Benguella
286aae8b64 Administration: Fix remove links color.
Fix regression introduced in [48332] where the specificity
of the admin scheme link colors was higher than the remove link colors.

Props afercia.
Fixes #50536.


git-svn-id: https://develop.svn.wordpress.org/trunk@48376 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 13:45:30 +00:00
Andrea Fercia
ab3ce946c9 Accessibility: Media: Improve accessibility of the status and error messages in the Image Editor.
- improves focus management by moving focus to the notices, if any, or to the first "tabbable" element
- this avoids a focus loss and helps Braille-only and screen magnification users to be aware of the messages
- adds an ARIA role `alert` to all the notices 
- uses `wp.a11y.speak()` to announce messages to assistive technology
- this way, all visual users will see the messages while assistive technology users will get an audible message
- uses `wp.i18n` for translatable strings in `wp-admin/js/image-edit.js`

Props anevins, ryanshoover, antpb, SergeyBiryukov, afercia.
See #20491.
Fixes #47147.


git-svn-id: https://develop.svn.wordpress.org/trunk@48375 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 13:43:43 +00:00
Sergey Biryukov
41e572858d Plugins: Make sure the HTML ID attributes in plugin action links are unique.
Follow-up to [47588].

Props mukesh27, roytanck, SergeyBiryukov.
Fixes #49916.

git-svn-id: https://develop.svn.wordpress.org/trunk@48374 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 13:41:30 +00:00
Andrea Fercia
337b3295fe Accessibility: Allow post boxes on the Dashboard and Classic Editor pages to be reordered by using the keyboard.
So far, it has been possible to rearrange into a new order the post boxes (also known as "widgets" on the Dashboard and "meta boxes" on the Edit post page) only by using a pointing device, for example a mouse.

This change adds new controls and functionality to allow the boxes to be rearranged also with the keyboard. Additionally, audible messages are sent to the admin ARIA live region to notify screen reader users of the reorder action result.

Props joedolson, anevins, antpb, audrasjb, xkon, MarcoZ, karmatosed, afercia.
Fixes #39074.


git-svn-id: https://develop.svn.wordpress.org/trunk@48373 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 12:58:10 +00:00
Sergey Biryukov
30201a396f Bootstrap/Load: Set WP_DEBUG to true by default on development environments.
Props johnbillion, kraftbj, Clorith, joostdevalk, dlh.
Fixes #33161.

git-svn-id: https://develop.svn.wordpress.org/trunk@48372 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 12:55:26 +00:00
Riad Benguella
f3d3e1df31 Customizer: Adapt the colors to the selected admin scheme colors.
Uses the $highlight-color variable to override the hardcoded colors used in the customizer UI.

Props dlh, joen.
Fixes #50547.


git-svn-id: https://develop.svn.wordpress.org/trunk@48371 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 11:28:12 +00:00
Sergey Biryukov
4e78b0acd9 Themes: Allow template loading functions to pass additional arguments to the template via the $args parameter.
This affects:
* `get_header()`
* `get_footer()`
* `get_sidebar()`
* `get_template_part()`
* `locate_template()`
* `load_template()`

Note: `get_search_form()` already passes additional arguments to the template as of [44956].

Props enrico.sorcinelli, sc0ttkclark, scribu, nacin, wonderboymusic, GeertDD, beatpanda, amaschas, mintindeed, ysalame, caiocrcosta, bigdawggi, julianm, eddiemoya, shawnz, sayedwp, shamai, mboynes, mihai2u, guidobras, Mte90, apedog, stuffradio, overclokk, johnbillion, joyously, afercia, audrasjb, justlevine, SergeyBiryukov.
See #21676.

git-svn-id: https://develop.svn.wordpress.org/trunk@48370 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 11:00:21 +00:00
Sergey Biryukov
3eb2bd9f5b Upload: Introduce pre_wp_unique_filename_file_list filter to allow for short-circuiting the scandir() call in wp_unique_filename().
This allows plugins to override the file fetching behavior to provide performance improvements for large directories.

Props joehoyle.
Fixes #50587.

git-svn-id: https://develop.svn.wordpress.org/trunk@48369 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 10:18:25 +00:00
Andrea Fercia
7348112444 Accessibility: Improve color contrast for the blue links :hover state.
For a number of years, WordPress has been using a `#00a0d2` blue shade for the links `:hover` state. This blue shade doesn't have a sufficient color contrast with the various (too many) background colors used in the admin interface.

The new `#006799` blue shade is part of the official WordPress color palette and does have a sufficient color contrast with most of the admin backgrounds.

Props ryokuhi, audrasjb, joedolson, mapk.
See #47682.


git-svn-id: https://develop.svn.wordpress.org/trunk@48368 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 10:09:23 +00:00
Sergey Biryukov
6bc5b06d20 REST API: Correct the check for $version argument in rest_handle_doing_it_wrong().
Move `WP_REST_Response` and `WP_Error` class names out of the translatable string.

Follow-up to [48327], [48361].

See #36271.

git-svn-id: https://develop.svn.wordpress.org/trunk@48367 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 09:54:27 +00:00
Sergey Biryukov
b88a906e5e Docs: Miscellaneous DocBlock corrections.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48365 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 09:28:19 +00:00
Sergey Biryukov
67a72d98d9 Docs: Improve DocBlocks in wp-includes/nav-menu-template.php per the documentation standards.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48364 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 09:26:16 +00:00
Sergey Biryukov
2784518869 Site Health: Correct translator comment for the message displayed after clicking "remind me later" on the admin email confirmation.
Adjust the logic for displaying the message for better readability.

Follow-up to [48359].

See #48333.

git-svn-id: https://develop.svn.wordpress.org/trunk@48363 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 09:19:00 +00:00
Andrea Fercia
f76d103e0f Administration: Fix typo in forms.css after [46866].
A stray `e` made browsers ignore a CSS ruleset preventing select elements from changing color on hover.

Props ryokuhi.
See #48420.
Fixes #50580.


git-svn-id: https://develop.svn.wordpress.org/trunk@48362 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 07:03:30 +00:00
Jake Spurlock
7166def7ec REST API: Trigger _doing_it_wrong() if wp_send_json() is used on a REST API request
In addition to triggering the `_doing_it_wrong()` logging, also adds a `X-WP-DoingItWrong` header.

Fixes #36271.

Props rmccue, TimothyBlynJacobs.



git-svn-id: https://develop.svn.wordpress.org/trunk@48361 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 04:59:51 +00:00
Jake Spurlock
bbe94ef0fd Administration: Ensure that disabled buttons look disabled.
This change removes the disabled state from the admin scheme specific styles.

Fixes #48709.

Props drw158, SergeyBiryukov, afercia, kennethroberson5556, melchoyce, joedolson, valentinbora, audrasjb, larrach, nrqsnchz, youknowriad.



git-svn-id: https://develop.svn.wordpress.org/trunk@48360 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 04:19:38 +00:00
Jake Spurlock
f86dd5c6ce Site Health: Ensure that the user will be notified after a successful snooze action.
After clicking remind me later, the user is shown an admin notification.

Fixes #48333.

Props desrosj, sathyapulse, Clorith, azaozz, audrasjb, afragen, whyisjake.
 


git-svn-id: https://develop.svn.wordpress.org/trunk@48359 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 03:57:17 +00:00
Jake Spurlock
0dcbb5b02d Coding standards: Fix a few phpcs errors to get tests passing.
See [48356], #43517.


git-svn-id: https://develop.svn.wordpress.org/trunk@48358 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 03:53:14 +00:00
Timothy Jacobs
41912bcece REST API: Add support for the uniqueItems keyword.
Props sorenbronsted.
Fixes #48821.


git-svn-id: https://develop.svn.wordpress.org/trunk@48357 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 03:20:34 +00:00
Jake Spurlock
abfd9441b7 Taxonomy: Add support for default terms for custom taxonomies.
The new default_term argument is added to `register_taxonomy()` allowing a user to define the default term `name` and optionally `slug` and `description`. 

Fixes #43517.

Props enrico.sorcinelli, SergeyBiryukov, desrosj, davidbaumwald, whyisjake.



git-svn-id: https://develop.svn.wordpress.org/trunk@48356 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-07 00:53:41 +00:00
Jake Spurlock
4736a74c48 Bundled theme: Ensure appropriate title for author archives for that don't have posts.
Rather then displaying `Author: `, show `Nothing Found`.

Fixes #50421.

Props SGr33n, williampatton, ianbelanger, rebasaurus, priyomukul, virginienacci, audrasjb.



git-svn-id: https://develop.svn.wordpress.org/trunk@48355 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-06 23:10:45 +00:00
Jake Spurlock
a8edf650dd Administration: Move more table strings to sentence casing.
WordPress as a project has moved largely to sentence casing for UI elements in the admin. This commit moves several string$

* Move to trash
* Mark as spam
* Permanently delete comment
* Approve comment
* In response to
* Bulk actions
* Not spam
* Sumitted on
* Delete permanently
* Add media
* Upload files
* Upload images
* Add media
* Bulk select
* Restore from trash
* Search media
* Attachment details
* Create gallery
* Edit gallery
* Cancel gallery
* Add to gallery
* Image details
* Replace image
* Cancel edit
* Edit image
* Choose image
* Select and crop
* Skip cropping
* Crop image
* Audio details
* Replace audio
* Add audio source
* Video details
* Replace video
* Add video source
* Select poster image
* Add subtitles
* Create audio playlist
* Edit audio playlist.
* Cancel audio playlist
* Create video playlist
* Edit video playlist
* Add to video playlist
* Filter media


Fixes #40244.
Props afercia, bhargavbhandari90, rcutmore, webzunft, manojlovic, jeremyfelt, desrosj, lschuyler, SergeyBiryukov, whyisjake. 



git-svn-id: https://develop.svn.wordpress.org/trunk@48352 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-06 21:50:23 +00:00
Dominik Schilling
aad703799a I18N: Fix typo in [48348].
Props swizzzpidy.
See #50578.

git-svn-id: https://develop.svn.wordpress.org/trunk@48351 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-06 21:32:15 +00:00
Dominik Schilling
7a59fefb21 I18N: Use wp.i18n for translatable strings in wp-admin/js/tags-box.js and wp-admin/js/tags-suggest.js.
This removes the usage of `wp_localize_script()` for passing translations to the script and instead adds the translatable strings in the script directly through the use of `wp.i18n` and its utilities.

Props swissspidy, ocean90.
See #20491.
Fixes #50579.

git-svn-id: https://develop.svn.wordpress.org/trunk@48350 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-06 20:58:06 +00:00
Andrea Fercia
9e29ffdd33 Accessibility: Widgets: Add theme support to make widgets output list of links wrapped within a <nav> element.
Widgets that output list of links can now be wrapped within `<nav>` elements to improve semantics and accessibility.

The `<nav>` elements are also native landmark regions, which helps assistive technology users to navigate through them. Themes can opt-in to this new behavior by declaring support for the new `html5` feature `navigation-widgets`.

Props joedolson, simonjanin, audrasjb, afercia.
Fixes #48170.


git-svn-id: https://develop.svn.wordpress.org/trunk@48349 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-06 20:42:14 +00:00
Dominik Schilling
538ba85172 I18N: Use wp.i18n for translatable strings in wp-admin/js/edit-comments.js.
This removes the usage of `wp_localize_script()` for passing translations to the script and instead adds the translatable strings in the script directly through the use of `wp.i18n` and its utilities.

Props swissspidy, ocean90.
See #20491.
Fixes #50578.

git-svn-id: https://develop.svn.wordpress.org/trunk@48348 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-06 20:15:46 +00:00
Dominik Schilling
0d00b776ec I18N: Use wp.i18n for translatable strings in wp-admin/js/tags.js.
This removes the usage of `wp_localize_script()` for passing translations to the script and instead adds the translatable strings in the script directly through the use of `wp.i18n` and its utilities.

Props swissspidy, ocean90.
See #20491.
Fixes #50577.

git-svn-id: https://develop.svn.wordpress.org/trunk@48347 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-06 19:45:04 +00:00
Dominik Schilling
70cb267fde I18N: Use wp.i18n for translatable strings in wp-admin/js/theme-plugin-editor.js.
This removes the usage of `wp_localize_script()` for passing translations to the script and instead adds the translatable strings in the script directly through the use of `wp.i18n` and its utilities.

Fixes #50576.

git-svn-id: https://develop.svn.wordpress.org/trunk@48346 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-06 19:33:54 +00:00
Jonathan Desrosiers
b84d8e4d09 Coding Standards: Correct two coding standards issues introduced in [48277] and [48334].
See #50504, #50550.

git-svn-id: https://develop.svn.wordpress.org/trunk@48345 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-06 19:21:33 +00:00
Jonathan Desrosiers
bf7ba4dc5b Docs: Correct instances of “auto update” with “auto-update” for consistency.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48344 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-06 19:13:26 +00:00
Jonathan Desrosiers
b9d9968ae9 Docs: Correct typo introduced in [48288].
See #42775.

git-svn-id: https://develop.svn.wordpress.org/trunk@48343 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-06 19:08:22 +00:00
Riad Benguella
fcad7cfb90 Administration: Adapts the secondary buttons colors to the admin schemes.
The admin schemes that don't meet the contrast guidelines are excluded from this change.

Props mapk, michaelarestad, mcsf, ocean90.
Closes #50537.


git-svn-id: https://develop.svn.wordpress.org/trunk@48342 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-06 18:58:52 +00:00
Andrea Fercia
0fa6c2190a Accessibility: Administration: Improve the sortable postboxes areas on the Dashboard and Classic Editor pages.
- makes the postboxes areas in the Dashboard visible also on large screens 
- uses a more meaningful text when all postboxes areas are empty instead of "Drag boxes here"
- restores the ability to drag boxes to the "advanced" area in the Classic Editor page
- makes the postboxes areas in the Classic Editor page visible while dragging so that users have a clue what the available areas are
- improves the color contrast of the postboxes areas while dragging
- uses `wp.i18n` for translatable strings in `wp-admin/js/postbox.js`

Props xkon, karmatosed, audrasjb, ocean90, joedolson, afercia, azaozz.
See #20491.
Fixes #49288, #47541.


git-svn-id: https://develop.svn.wordpress.org/trunk@48340 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-06 18:01:55 +00:00
Sergey Biryukov
b0039629b3 Coding Standards: Fix JSHint issue in js/_enqueues/lib/auth-check.js
See #49573.

git-svn-id: https://develop.svn.wordpress.org/trunk@48339 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-06 16:25:24 +00:00
Andrew Ozz
9f8a9a3239 Heartbeat: Do not disable the login prompts when the user needs to log in again but has closed the log in modal. Add a 5 minutes timeout before asking them to log in again.
Props dsixinetu, adamsilverstein, azaozz.
Fixes #49573.

git-svn-id: https://develop.svn.wordpress.org/trunk@48337 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-06 16:12:24 +00:00
Riad Benguella
46971a83ec Block Editor: Requires title and content when registering block patterns.
Props poena.
See #50550.


git-svn-id: https://develop.svn.wordpress.org/trunk@48336 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-06 12:02:45 +00:00
Riad Benguella
454ef1f091 Block Editor: Remove the Testimonials block pattern.
This ensures we have the same patterns used in the Gutenberg plugin.

Props poena.
See #50550.


git-svn-id: https://develop.svn.wordpress.org/trunk@48335 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-06 11:17:45 +00:00
Riad Benguella
388dd08736 Block Editor: Add the initial set of block patterns.
Included patterns:

text-two-columns
two-buttons
two-images
text-two-columns-with-images
text-three-columns-buttons
large-header
large-header-paragraph
three-buttons
quote
testimonials

Props mcsf, nrqsnchz.
See #50550.


git-svn-id: https://develop.svn.wordpress.org/trunk@48334 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-06 10:48:35 +00:00
Riad Benguella
8119c5ed77 Administration: Fix link colors for admin schemes that personalize it using the $link SASS variable.
The new "moderne" admin scheme color personalizes the link color using the $link SASS variable.
The link color doesn't apply consistently in the admin to all links, especiall button links.

Fixes #50536.


git-svn-id: https://develop.svn.wordpress.org/trunk@48332 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-06 09:23:04 +00:00
Sergey Biryukov
13dee8f174 Privacy: Simplify the logic for updating the meta values for personal data export requests from absolute to relative paths.
Follow-up to [48127].

See #44038.

git-svn-id: https://develop.svn.wordpress.org/trunk@48330 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-06 00:32:15 +00:00
Andrew Ozz
27ccafd0e9 Media:
- Introduce `wp_image_file_matches_image_meta()` utility function to check whether the image meta (retrieved by attachment ID) matches an image path or URI. A mismatch may happen in some cases, for example after the posts have been exported from one website and imported in another.
- Add unit tests for the new function.
- Improve `wp_image_src_get_dimensions()` a bit and use the new function to prevent these edge cases.

Fixes #50543.

git-svn-id: https://develop.svn.wordpress.org/trunk@48329 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-05 23:30:36 +00:00
Sergey Biryukov
530eedb538 Query: Make sure the found_posts property of WP_Query is always an integer, to match the documented type.
This makes the property consistent with similar properties of other classes:
* `WP_Comment_Query::$found_comments`
* `WP_Network_Query::$found_networks`
* `WP_Site_Query::$found_sites`
* `WP_User_Query::$total_users`

Props birgire, PressLabs.
Fixes #42469.

git-svn-id: https://develop.svn.wordpress.org/trunk@48328 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-05 21:32:26 +00:00
Sergey Biryukov
09921a5283 Plugins: Consistently use an empty string as the default value for $replacement and $message parameters in:
* `_deprecated_function()`
* `_deprecated_constructor()`
* `_deprecated_file()`
* `_deprecated_argument()`
* `_deprecated_hook()`
* `apply_filters_deprecated()`
* `do_action_deprecated()`

This matches the documented type of `string` for these parameters and removes unnecessarily strict `! is_null()` checks.

Follow-up to [46792].

Props jignesh.nakrani, renathoc, SergeyBiryukov.
Fixes #49698.

git-svn-id: https://develop.svn.wordpress.org/trunk@48327 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-05 21:07:48 +00:00
Sergey Biryukov
b1b1b08e43 Plugins: Use include_once instead of include in uninstall_plugin(), in case the plugin file is already included.
Props valchovski, pcfreak30.
Fixes #47796.

git-svn-id: https://develop.svn.wordpress.org/trunk@48326 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-05 20:30:18 +00:00
Andrew Ozz
ca54987591 External Libraries: First step of updating jQuery. Disable jQuery Migrate 1.4.1, keep jQuery at 1.12.4-wp, and UI at 1.11.4. Also keep the jquery-core script handle for full backwards compatibility.
Props jorbin, adamsilverstein, westonruter, retlehs, pento, onokazu, galbaras, netweb, zakkath, dmethvin, LittleBigThing, markgoho, iandunn, remzicavdar, bigcloudmedia, jacklinkers, levdbas, a4jpcom, azaozz.

See #37110.

git-svn-id: https://develop.svn.wordpress.org/trunk@48323 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-05 18:26:24 +00:00
Sergey Biryukov
b5b613f8bb XML-RPC: Explicitly unset the reference to the parser resource after calling xml_parser_free() to avoid memory leaks in PHP 7.0.0 or higher.
Props procifer, ayeshrajans.
Fixes #49700.

git-svn-id: https://develop.svn.wordpress.org/trunk@48322 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-05 15:20:16 +00:00
Sergey Biryukov
e3df130089 Options, Meta APIs: Introduce register_setting and unregister_setting actions.
Props Howdy_McGee, Pionect.
Fixes #37245.

git-svn-id: https://develop.svn.wordpress.org/trunk@48321 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-05 15:05:02 +00:00
Sergey Biryukov
fcafa02a04 Docs: Improve documentation for various option functions.
Props andfinally, david.binda, SergeyBiryukov.
Fixes #49566.

git-svn-id: https://develop.svn.wordpress.org/trunk@48320 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-05 14:44:37 +00:00
Dominik Schilling
0df921c96d Administration: Add delete_count to wp_removable_query_args().
It's a single-use URL parameter that does not need to be passed to canonical URLs in the admin.

Props opurockey.
Fixes #50464.

git-svn-id: https://develop.svn.wordpress.org/trunk@48319 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-05 13:55:46 +00:00
Dominik Schilling
d65c0a770c Posts: Provide a HiDPI version for the avatar used in post locked dialogs.
Props wpdesk, audrasjb, ocean90.
Fixes #39633.

git-svn-id: https://develop.svn.wordpress.org/trunk@48318 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-05 12:58:20 +00:00
Sergey Biryukov
ff1bf05b69 Administration: Bring the update nag in line with other admin notices.
In addition to more consistent display, this gives it a visible border on the About page.

Props desrosj, nikhilbhansi, afercia, SergeyBiryukov.
Fixes #50372.

git-svn-id: https://develop.svn.wordpress.org/trunk@48316 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-05 11:55:14 +00:00
Dominik Schilling
2a22dcf8a6 Multisite: Delete the signup entry when a user is deleted from the database.
When a user has registered with incorrect data and got the account deleted immediately, it currently wasn't possible to register with the same login or email address again due to the existing signup entry. They had to wait for two days until the entry gets automatically deleted. Now the associated signup entry gets deleted as part of the account deletion.

Fixes #43232.

git-svn-id: https://develop.svn.wordpress.org/trunk@48315 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-05 11:19:35 +00:00
Sergey Biryukov
f5dcde26e5 Taxonomy: Introduce saved_term and saved_{$taxonomy} actions to complement created_term and created_{$taxonomy}.
This allows for hooking into both the create and update events with a single callback, in the same way that is already possible for posts via the `save_post` and `save_post_{$post->post_type}` actions.

Props dlh.
Fixes #48416.

git-svn-id: https://develop.svn.wordpress.org/trunk@48314 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-05 11:11:46 +00:00
Dominik Schilling
d0f4f20df5 Users: Pass the WP_User object to the wpmu_delete_user, delete_user, and deleted_user actions.
See #43232.

git-svn-id: https://develop.svn.wordpress.org/trunk@48313 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-05 10:55:18 +00:00
Sergey Biryukov
2fba7f5a68 Posts, Post Types: Clarify some "Error in deleting" messages, use more specific strings for attachments.
Props dingo_d.
See #50546.

git-svn-id: https://develop.svn.wordpress.org/trunk@48312 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-05 10:38:24 +00:00
Dominik Schilling
16dc354833 Administration: Make all color schemes available when running from /src.
To run WordPress from /src you have to use the `--dev` flag which also builds the color scheme stylesheets thus the restriction is no longer required.

See #44492.
Fixes #50558.

git-svn-id: https://develop.svn.wordpress.org/trunk@48311 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-05 10:38:18 +00:00
Sergey Biryukov
34730d2ea0 Post Thumbnails: Change the return value of get_post_thumbnail_id() for a non-existing post to false instead of an empty string.
This further makes the function more consistent with `get_the_ID()` or `wp_get_post_parent_id()`, both returning `false` for a non-existing post.

Additionally, document that `get_post_thumbnail_id()` returns `0` if the thumbnail image is not set.

Follow-up to [47160].

Props theMikeD, dingo_d, netpassprodsr, SergeyBiryukov.
Fixes #49832. See #40096.

git-svn-id: https://develop.svn.wordpress.org/trunk@48310 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-05 10:15:40 +00:00
Andrea Fercia
2d36a7640a Docs: Replace @returns tag in media/views/attachment/details.js with @return.
Per the documentation standards, `@returns` is an unsupported synonym, `@return` should be used instead.

Follow-up to [46800], [48232].
See #49572.


git-svn-id: https://develop.svn.wordpress.org/trunk@48309 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-05 08:01:51 +00:00
Timothy Jacobs
8082c60b5f REST API: Remove specific multi-type schema handling from the themes controller.
Multi-type schema handling was improved in [48306]. In particular, it now allows for sanitizing a multi-typed value that wouldn't validate. Removing this handling will make 3rd party registered theme features more robust.

Fixes #50562.


git-svn-id: https://develop.svn.wordpress.org/trunk@48308 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-05 01:04:30 +00:00
Timothy Jacobs
798cd1e20b REST API: Correct the return type of rest_sanitize_value_from_schema.
Fixes #45486.
Props birgire, Jean-David, mukesh27, priyankkpatel.


git-svn-id: https://develop.svn.wordpress.org/trunk@48307 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-05 00:17:54 +00:00
Timothy Jacobs
205eb1abc9 REST API: Make multi-typed schemas more robust.
A multi-type schema is a schema where the `type` keyword is an array of possible types instead of a single type. For instance, `[ 'object', 'string' ]` would allow objects or string values.

In [46249] basic support for these schemas was introduced. The validator would loop over each schema type trying to find a version that matched. This worked for valid values, but for invalid values it provided unhelpful error messages. The sanitizer also had its utility restricted.

In this commit, the validators and sanitizers will first determine the best type of the passed value and then apply the schema with that set type. In the case that a value could match multiple types, the schema of the first matching type will be used.

To maintain backward compatibility, if unsupported schema types are used, the value will always pass validation. A doing it wrong notice is issued in this case.

Fixes #50300.
Props pentatonicfunk, dlh, TimothyBlynJacobs.


git-svn-id: https://develop.svn.wordpress.org/trunk@48306 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-05 00:13:37 +00:00
Sergey Biryukov
83f8654283 Login and Registration: Set a more appropriate page title for the "check your email" step of new user registration or password reset.
Follow-up to [48304].

See #40605, #41514.

git-svn-id: https://develop.svn.wordpress.org/trunk@48305 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-04 22:01:08 +00:00
Sergey Biryukov
319f864625 Login and Registration: Hide the login form on the "check your email" step of new user registration or password reset.
This aims to reduce some confusion and make it clearer that the email should be checked before attempting to log in right away.

Props rianrietveld, pratik028, bdbch, johnbillion, hankthetank, yashrs, williampatton, audrasjb, bmartinent, florianatwhodunit, henry.wright, birgire, SergeyBiryukov.
Fixes #40605, #41514.

git-svn-id: https://develop.svn.wordpress.org/trunk@48304 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-04 21:56:54 +00:00
Sergey Biryukov
6dda17adbe Login and Registration: Remove newpass value handling in wp-login.php.
This value is never set as of [15710].

See #40605.

git-svn-id: https://develop.svn.wordpress.org/trunk@48303 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-04 21:13:56 +00:00
Sergey Biryukov
c9b4885dc8 Docs: Correct spelling of "backward compatibility" per the Core Contributor Handbook glossary.
Follow-up to [45232].

See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48302 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-04 20:40:21 +00:00
Sergey Biryukov
719cf5650a Coding Standards: Wrap some long lines in wp-admin/js/site-health.js per the JS coding standards for better readability.
See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@48301 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-04 19:54:39 +00:00
Timothy Jacobs
fe2ceeada4 REST API: Only validate the format keyword if the type is a string.
This allows for using multi-type support with a string that has a format. For backwards compatibility support, the format validation will still apply if the type is not specified, or it is invalid.

Two new doing it wrong notices are issued when omitting a type, or using an invalid type.

Props ryotsun.
Fixes #50189.


git-svn-id: https://develop.svn.wordpress.org/trunk@48300 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-04 19:51:10 +00:00
Sergey Biryukov
ee57798a7f Customize: Correct the check for rendered widgets in WP_Customize_Widgets::is_widget_rendered().
Make the structure of `::$rendered_sidebars` and `::$rendered_widgets` properties consistent.

This resolves an issue with every widget being marked as inactive by default on the Widgets panel.

Props dlh, afercia, SergeyBiryukov.
Fixes #50508.

git-svn-id: https://develop.svn.wordpress.org/trunk@48299 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-04 19:33:06 +00:00
Sergey Biryukov
48df288566 Docs: Replace @returns tag in wp-admin/js/post.js with @return.
Per the documentation standards, `@returns` is an unsupported synonym, `@return` should be used instead.

Follow-up to [46800], [48232].

See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48298 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-04 19:07:38 +00:00
Sergey Biryukov
39d4214826 Coding Standards: Rename functions in wp-admin/js/site-health.js per the JS coding standards.
See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@48297 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-04 19:07:10 +00:00
Sergey Biryukov
480dbc89c6 Media: Add heic extension to wp_get_ext_types(), for consistency with wp_get_mime_types().
Follow-up to [48288].

Props imath.
Fixes #50557. See #42775.

git-svn-id: https://develop.svn.wordpress.org/trunk@48296 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-04 17:07:34 +00:00
Timothy Jacobs
d241ab3b55 Script Loader: Add id attributes to script assets.
This commit adds a unique ID attribute to script loader generated <script> tags as well as related <script> tags for inline JavaScript, translations, or parameters.

This is a first step in adding support for lazy loading scripts and styles, but for now is only used to assist in debugging generated output.

Props dd32, spacedmonkey.
See #48654.


git-svn-id: https://develop.svn.wordpress.org/trunk@48295 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-04 16:52:49 +00:00
Dominik Schilling
6d3cedcc61 Themes: Introduce get_the_archive_title_prefix filter for changing the prefix used for archive titles.
In `get_the_archive_title()` split the internal `$title` variable into `$title` and `$prefix`. By using the new `get_the_archive_title_prefix` filter the prefix can now wrapped with custom elements or removed completely by using

{{{
add_filter( 'get_the_archive_title_prefix', '__return_empty_string' );
}}}

Also, wrap the title part with a `span` element and pass the original title and prefix to the existing `get_the_archive_title` filter, allowing further customization to the archive titles.

Props Kaira, milindmore22, shireling, grapplerulrich, audrasjb, desrosj, Confridin, ramiy, ocean90.
Fixes #31237.
Fixes #38545.

git-svn-id: https://develop.svn.wordpress.org/trunk@48294 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-04 14:43:32 +00:00
Andrea Fercia
70f1b3c10c Accessibility: Improve the focus style for Windows High Contrast mode in various parts of the admin interface.
Continues the introduction in core of new focus styles dedicated to Windows High Contrast mode. The new styles use a transparent CSS outline.
This change covers some parts of the interface for the meta boxes, Widgets, and the Customizer.

Props joedolson, kjellr, antpb, mikeschroder, Hareesh Pillai.
See #41286, #45910.
Fixes #47117.


git-svn-id: https://develop.svn.wordpress.org/trunk@48293 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-04 10:42:41 +00:00
Sergey Biryukov
8720355f87 Administration: Use HTTPS for XHTML Friends Network URL.
Props raajtram, jrf, passoniate, bookdude13, sabernhardt, audrasjb.
Fixes #48002.

git-svn-id: https://develop.svn.wordpress.org/trunk@48292 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-04 09:31:43 +00:00
Timothy Jacobs
e51a554f5d REST API: Introduce endpoint for editing images.
To facilitate inline image editing in Gutenberg, a new endpoint at wp/v2/media/<id>/edit has been introduced. This is functionally similar to the existing ajax image editor, however the REST API editor creates a new attachment record instead of updating an existing attachment.

Fixes #44405.
Props ajlende, ellatrix, spacedmonkey, azaozz.



git-svn-id: https://develop.svn.wordpress.org/trunk@48291 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-04 04:13:17 +00:00
Sergey Biryukov
c2d5f9515d Bundled Themes: Use HTTPS for XHTML Friends Network URL.
Props raajtram, jrf, passoniate, bookdude13, sabernhardt, audrasjb.
See #48002.

git-svn-id: https://develop.svn.wordpress.org/trunk@48290 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-03 23:40:45 +00:00
Sergey Biryukov
7d149b678b General: Use HTTPS for the Web Address field example on Edit Link screen.
Props raajtram, jrf, passoniate, bookdude13, sabernhardt, audrasjb.
See #48002.

git-svn-id: https://develop.svn.wordpress.org/trunk@48289 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-03 23:34:56 +00:00
Andrew Ozz
1285255381 Media: Show an error message when a .heic file is uploaded that this type of files cannot be displayed in a web browser and suggesting to convert to JPEG. The message is shown by using filters, plugins that want to handle uploading of .heic files can remove it.
Props mattheweppelsheimer, mikeschroder, jeffr0, andraganescu, desrosj, azaozz.
Fixes #42775.

git-svn-id: https://develop.svn.wordpress.org/trunk@48288 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-03 23:13:30 +00:00
Sergey Biryukov
ce09e3c87b Text Changes: Remove use of "normal" in user-facing output.
This clarifies some messages referring to Site Health checks and maintenance mode, and makes them more accurate.

Props dartiss.
Fixes #50549.

git-svn-id: https://develop.svn.wordpress.org/trunk@48287 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-03 21:57:51 +00:00
Dominik Schilling
5b270df345 I18N: Use wp.i18n for translatable strings in wp-includes/js/wp-auth-check.js.
This removes the usage of `wp_localize_script()` for passing translations to the script and instead adds the translatable strings in the script directly through the use of `wp.i18n` and its utilities.

Props swissspidy, ocean90.
See #20491.
Fixes #50553.

git-svn-id: https://develop.svn.wordpress.org/trunk@48285 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-03 19:03:23 +00:00
Sergey Biryukov
a0891d732e Privacy: Hide views that have a count of 0 on privacy request tables, for consistency with other list tables.
Props pbiron, garrett-eclipse, mapk, melchoyce, estelaris.
Fixes #47495.

git-svn-id: https://develop.svn.wordpress.org/trunk@48284 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-03 16:26:57 +00:00
Andrea Fercia
88c91eeaa6 Accessibility: Themes: Use a default empty alt attribute for the non-linked custom logo on the home page.
After [48039] it became clear that the non-linked custom logo on the home page needs an empty alt attribute, as in most of the cases the logo is decorative and doesn't need its purpose to be described.

This change outputs an empty alt attribute by default for the custom logo on the home page. If necessary, it is possible to use the new 'get_custom_logo_image_attributes' filter to manipulate the default attributes for the logo image and set an alt attribute.

Props FlorianBrinkmann, Soean, sabernhardt, audrasjb, SergeyBiryukov, samful, knutsp.
See #36640.
Fixes #37011.


git-svn-id: https://develop.svn.wordpress.org/trunk@48283 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-03 12:56:43 +00:00
Pascal Birchler
65a6412681 Sitemaps: Do not unnecessarily call WP_Query::get_posts() in posts provider.
The posts have already been fetched at this point, no need to do it again.

Props Chouby.
Fixes #50463.

git-svn-id: https://develop.svn.wordpress.org/trunk@48282 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-03 12:01:46 +00:00
Andrea Fercia
950b6ed272 Accessibility: Plugins: Accessibility and CSS improvements for the Plugins pages.
- improves checkboxes alignment on the "Plugins" page table in the responsive view 
- improves spacing between form controls on the "Add Plugins" page in the responsive view 
- the layout of the "filter bar" on the "Add Plugins" page is now based on CSS Flexbox 
- removes italic type from a paragraph in the "Favorites" page

Props passoniate, garethgillman, maxpertici, audrasjb, sabernhardt, afercia.
See #47327.
Fixes #49231.


git-svn-id: https://develop.svn.wordpress.org/trunk@48281 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-03 08:49:23 +00:00