Commit Graph

10215 Commits

Author SHA1 Message Date
Sergey Biryukov 97a336a03c Site Health: Do not trigger the fatal error handler while updates are being installed.
Triggering the error handler during updates may cause false positives. For example, updates may temporarily "fail" while files are moved around, but work fine once completed. Sending emails about temporary failures would just be confusing to the recipient.

Props Clorith, airamerica.
Fixes #48964.

git-svn-id: https://develop.svn.wordpress.org/trunk@47768 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-06 14:36:47 +00:00
Jake Spurlock 0a8365be5a Code standards: Drop a newline in the customizer to comply with WordPress Coding Standards
Extends [47763] and #46829.


git-svn-id: https://develop.svn.wordpress.org/trunk@47764 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-05 21:58:12 +00:00
Jake Spurlock 8338f44306 Menus: Denote the special pages in the Customizer menu editor.
The special pages here are the pages that are used for the Privacy Policy, Home, and the Posts page.

Fixes #46829.
Props garrett-eclipse, audrasjb.


git-svn-id: https://develop.svn.wordpress.org/trunk@47763 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-05 21:15:49 +00:00
Sergey Biryukov 0206900cff Canonical: Only redirect non-existing page requests to the post permalink if the post is found.
Follow-up to [47760].

See #45337, #40773, #28081, #11694.

git-svn-id: https://develop.svn.wordpress.org/trunk@47761 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-04 10:47:05 +00:00
Sergey Biryukov de14ea86bf Canonical: Redirect paged requests for a static page assigned as the "Posts page".
This avoids displaying duplicate content of the home page under different URLs with appended page numbers.

This change only affects the `<!--nextpage-->` pagination (`page` query variable) and not the regular multiple posts pagination (`paged` query variable).

The posts page does not support the `<!--nextpage-->` pagination, so requests for invalid page numbers should be redirected to the page permalink, applying the logic previously implemented for single posts or pages.

Follow-up to [34492], [47727].

Props jeremyfelt, sachit.tandukar, SergeyBiryukov.
Fixes #45337. See #40773, #28081, #11694.

git-svn-id: https://develop.svn.wordpress.org/trunk@47760 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-04 10:40:06 +00:00
Sergey Biryukov 54c8470bd6 Coding Standards: Fix WPCS issues in `wp-includes/canonical.php`.
Reformat long conditions and dense code blocks for better readability.

See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@47759 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-04 09:03:11 +00:00
Timothy Jacobs 8153d15f09 REST API: Support more JSON Schemas when filtering a response by context.
The array type, multi-types, and the additional properties keyword are now supported. Additionally, the filter recurses to an infinite depth.

Fixes #48819.


git-svn-id: https://develop.svn.wordpress.org/trunk@47758 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-04 02:44:44 +00:00
Timothy Jacobs 5460e0df1e REST API: Accept POST requests in the block renderer endpoint.
Rendering a block is idempotent, so a GET is the most natural request method. However, the maximum length of URLs prevented blocks with large attributes from being rendered.

Props ryankienstra.
Fixes #49680.


git-svn-id: https://develop.svn.wordpress.org/trunk@47756 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-03 22:56:01 +00:00
Timothy Jacobs 6ab90a209d REST API: Validate that the oembed url parameter is a string.
This prevents a PHP warning from being issued by esc_url_raw when a non-string value is provided.

Props dd32.
Fixes #49991.


git-svn-id: https://develop.svn.wordpress.org/trunk@47755 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-03 22:40:53 +00:00
John Blackbourn 7d24075a26 Docs: Misc docblock corrections and improvements.
See #49572

git-svn-id: https://develop.svn.wordpress.org/trunk@47754 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-03 19:36:06 +00:00
Timothy Jacobs ef05acdfaa REST API: Support the uuid JSON Schema format.
This accepts a uuid of any version. A future commit could add support for restricting uuids to a specific version.

Props johnwatkins0.
Fixes #50053.


git-svn-id: https://develop.svn.wordpress.org/trunk@47753 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-03 19:18:40 +00:00
Sergey Biryukov 5dbed96333 Docs: Further update inline documentation for the `wpdb` class per the documentation standards.
Restore some previous edits from [46696], [47060], [47122], [47230] that were accidentally reverted in [47740].

See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@47749 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-03 11:43:14 +00:00
John Blackbourn 84772cc608 Media: Ensure a consistent structure for the array returned by `wp_get_attachment_image_src()`.
The array returned by this function previously included a fourth element only when an intermediate image size was used. This change ensures a consistent structure in the returned array regardless of the function's internal behaviour.

Props wido, joemcgill, johnbillion

Fixes #46113

git-svn-id: https://develop.svn.wordpress.org/trunk@47748 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-02 22:55:17 +00:00
John Blackbourn 4889e7a8d2 Menus: Allow empty taxonomy terms to be surfaced when searching for items.
This brings the behaviour inline with that of browsing terms or using the All Items tab, which correctly shows empty terms.

Props birgire, audrasjb

Fixes #45298

git-svn-id: https://develop.svn.wordpress.org/trunk@47747 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-02 22:34:50 +00:00
John Blackbourn c570d4409f Docs: Update inline documentation for the wpdb class.
Props theMikeD

Fixes #49477

git-svn-id: https://develop.svn.wordpress.org/trunk@47740 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-02 17:23:28 +00:00
Sergey Biryukov b7a8094d32 Query: Simplify the logic in `WP::handle_404()` to allow for easier modifications.
See #45337.

git-svn-id: https://develop.svn.wordpress.org/trunk@47738 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-02 08:46:39 +00:00
Jonathan Desrosiers 7e0a63f8c5 General: More PHP compatibility adjustments.
In this round:
- Removed references to `safe_mode` in `class-php3.php`. This was removed in PHP 5.4.
- Add inline exclude comments for compatibility checks in getID3.

Follow up of [47735-47736].

See #49922.

git-svn-id: https://develop.svn.wordpress.org/trunk@47737 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-01 20:10:58 +00:00
Jonathan Desrosiers 627b93f54d General: Fix typo within `phpcs:ignore` inline comment.
Follow up of [47735].

See #49922.

git-svn-id: https://develop.svn.wordpress.org/trunk@47736 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-01 19:34:05 +00:00
Jonathan Desrosiers 8e2de8212b General: Fix various issues flagged by the PHPCompatibilityWP PHPCS ruleset.
As part of the continued effort to improve PHP compatibility, the following improvments are being made:

- Removing deprecated PHP `safe_mode` checks not found in bundled external libraries.
- Change the remaining `while` loops using `each()` to `foreach` loops.
- Prevent false positives from being flagged for the `sodium_compat` library being caused by loading this in a non-standard way.
- Add inline comments to not flag deprecated PHP directives in the getID3 library.

Props desrosj, earnjam, dryanpress.
See #49922.

git-svn-id: https://develop.svn.wordpress.org/trunk@47735 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-01 19:05:04 +00:00
Jonathan Desrosiers d12ad5050b External Libraries: Update the SimplePie library to the latest version (1.5.5).
This brings SimplePie in sync with the most up to date version, 1.5.5.

This update brings many bug fixes, small enhancements, and PHP compatibility fixes for newer versions of PHP.

For a full list of changes, see https://github.com/simplepie/simplepie/blob/master/CHANGELOG.md#155-may-1-2020.

Props dshanske, slushman, etruel, wpshades, dmenard, desrosj, hareesh-pillai, stevenkword, jrf, Ipstenu, johnbillion.
Fixes #36669.

git-svn-id: https://develop.svn.wordpress.org/trunk@47733 602fd350-edb4-49c9-b593-d223f7449a82
2020-05-01 14:24:42 +00:00
Sergey Biryukov af596bcc5b Canonical: Redirect paged requests for non-paginated posts to the post permalink.
This avoids displaying duplicate content of the same post under different URLs and ensures the canonical URL is correct.

Previously, requests for invalid page numbers were only redirected to the post permalink if the post was actually paginated using the `<!--nextpage-->` marker.

Follow-up to [34492].

Props jeremyfelt, prografika, sachit.tandukar, subrataemfluence, hronak, ekatherine, henry.wright, chesio, dd32, SergeyBiryukov.
Fixes #40773. See #45337, #28081, #11694.

git-svn-id: https://develop.svn.wordpress.org/trunk@47727 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-30 12:03:11 +00:00
Sergey Biryukov 514f7c4cc9 Docs: Correct `@since` versions, remove duplicate comment.
Follow-up to [47633].

git-svn-id: https://develop.svn.wordpress.org/trunk@47663 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-29 17:23:21 +00:00
Jake Spurlock 74d6f9613b Formatting: Expand `sanitize_file_name` to have better support for utf8 characters.
Props: xknown, peterwilsoncc.


git-svn-id: https://develop.svn.wordpress.org/trunk@47638 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-29 15:38:43 +00:00
Jake Spurlock 935ab39e8e Cache API: Ensure proper escaping around the stats method in the cache API.
Props: nickdaugherty, batmoo, whyisjake, westi.


git-svn-id: https://develop.svn.wordpress.org/trunk@47637 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-29 15:34:55 +00:00
Jake Spurlock ec05c8b897 Block Editor: Coding standards, properly escape class names.
Props: aduth, noisysocks, pento, talldanwp, jorgefilipecosta, whyisjake, ellatrix, ehti.


git-svn-id: https://develop.svn.wordpress.org/trunk@47636 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-29 15:32:19 +00:00
Jake Spurlock 8e11facb67 Query: Ensure that only a single post can be returned on date/time based queries.
Props: sstoqnov, peterwilsoncc.


git-svn-id: https://develop.svn.wordpress.org/trunk@47635 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-29 15:26:56 +00:00
Jake Spurlock 4354d1fc5c User: Invalidate `user_activation_key` on password update.
Props: sstoqnov, sergeybiryukov.



git-svn-id: https://develop.svn.wordpress.org/trunk@47634 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-29 15:23:37 +00:00
Jake Spurlock cfb690cb8e Customize: Add additional filters to Customizer to prevent JSON corruption.
This solution extends the wp_insert_post_data filter to pass in addition to the slashed/sanitized/processed data, and the slashed/sanitized/unprocessed data, to also pass the initial slashed/unsanitized/unprocessed data which was passed into wp_insert_post(). This then allows plugins to have complete control over how sanitization is performed based on the post type.

Props westonruter, peterwilsoncc, sstoqnov, whyisjake, xknown.
 


git-svn-id: https://develop.svn.wordpress.org/trunk@47633 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-29 15:12:50 +00:00
Sergey Biryukov 3d932981e2 Docs: Correct `@return` type for `WP_Theme::get_post_templates()`.
The method returns an array of strings, not a single string.

Props mayankmajeji, salvatore.formisano.
Fixes #50020.

git-svn-id: https://develop.svn.wordpress.org/trunk@47631 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-28 15:00:30 +00:00
Timothy Jacobs 86cbde382a REST API: Support the (min|max)Length JSON Schema keywords.
Props sorenbronsted.
Fixes #48820.


git-svn-id: https://develop.svn.wordpress.org/trunk@47627 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-27 02:27:02 +00:00
Sergey Biryukov 3a229d0b47 Comments: Ensure that inserting a comment with an empty type results in correct `comment` type.
Add unit tests for `wp_handle_comment_submission()` and `wp_insert_comment()` receiving an empty type.

Follow-up to [47597].

Props ocean90, imath.
Fixes #49236.

git-svn-id: https://develop.svn.wordpress.org/trunk@47626 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-26 13:42:03 +00:00
Sergey Biryukov aff2844d75 Comments: Restore inclusion of an empty comment type when building the `WHERE` clause in `WP_Comment_Query::get_comment_ids()`.
This ensures that `get_comments( array( 'type' => 'comment' ) )` still includes comments that have not yet migrated to the `comment` type.

Follow-up to [47597].

Props ocean90.
See #49236.

git-svn-id: https://develop.svn.wordpress.org/trunk@47625 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-26 13:12:04 +00:00
Sergey Biryukov c117fbe0cf Upgrade/Install: Introduce `wp_in_maintenance_mode()`, a helper function to check if WordPress is currently in maintenance mode.
Props Clorith.
Fixes #49959.

git-svn-id: https://develop.svn.wordpress.org/trunk@47623 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-25 20:18:00 +00:00
Sergey Biryukov 055d1c6749 Code Modernization: Remove error suppression from `parse_url()` calls.
Previously, the `@` operator was used to prevent possible warnings emitted by `parse_url()` in PHP < 5.3.3 when URL parsing failed.

Now that the minimum version of PHP required by WordPress is 5.6.20, this is no longer needed.

Props netpassprodsr, Howdy_McGee.
Fixes #49980. See #24780.

git-svn-id: https://develop.svn.wordpress.org/trunk@47617 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-24 07:26:57 +00:00
Jonathan Desrosiers 2b5b39931c Bootstrap/Load: Deprecate `wp_unregister_GLOBALS()`.
The `register_globals` directive in PHP was deprecated in version 5.3 and removed entirely in 5.4.

Now that WordPress only supports PHP 5.6.20 and newer, the `wp_unregister_GLOBALS()` function can be deprecated.

Props ayeshrajans, desrosj, SergeyBiryukov.
Fixes #49938.

git-svn-id: https://develop.svn.wordpress.org/trunk@47612 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-22 15:40:41 +00:00
Sergey Biryukov 3659b767f1 Docs: Synchronize parameter documentation for various metadata functions, update per the documentation standards.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@47611 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-22 10:29:34 +00:00
Sergey Biryukov b6391847b4 Docs: Document the default value of `$single` and `$prev_value` parameters in various metadata functions.
Props denisco.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@47610 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-22 09:38:12 +00:00
Sergey Biryukov 2e126bda26 External Libraries: Revert [47603].
With the Docker image for PHP 7.4 updated to stable version, this should no longer be necessary.

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

Props ocean90.
Fixes #49945.

git-svn-id: https://develop.svn.wordpress.org/trunk@47604 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-20 15:39:40 +00:00
Sergey Biryukov a7624a3c43 External Libraries: Comment out magic quote functions in getID3().
For some reason, the `version_compare()` check does not work as expected on Travis.

Follow-up to [46113], [47601].

See #49945.

git-svn-id: https://develop.svn.wordpress.org/trunk@47603 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-20 12:10:49 +00:00
Sergey Biryukov 5f03485bc7 External Libraries: Backport a commit from getID3() trunk to fix a PHP 7.4+ notice.
This addresses a "Trying to access array offset on value of type bool" notice in the `getid3_mp3::MPEGaudioHeaderValid()` method.

Props schlessera.
Fixes #49945.

git-svn-id: https://develop.svn.wordpress.org/trunk@47602 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-20 11:32:37 +00:00
Sergey Biryukov 02e17123f9 External Libraries: Update getID3() to 1.9.19.
Changelog: https://github.com/JamesHeinrich/getID3/compare/v1.9.18...v1.9.19

Props ayeshrajans, schlessera.
See #49945.

git-svn-id: https://develop.svn.wordpress.org/trunk@47601 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-20 11:11:48 +00:00
Sergey Biryukov 5d5e3439e4 Users: Change "Your Profile" and "My Profile" links in admin menu and toolbar to just "Profile" for consistency.
Props donmhico, bcworkz, seanchayes, mikeschroder, garrett-eclipse, akhileshsabharwal, ScottSmith, nacin, jenmylo, afercia, swissspidy, felix-edelmann, helen, melchoyce, karmatosed.
Fixes #26769.

git-svn-id: https://develop.svn.wordpress.org/trunk@47600 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-20 08:37:31 +00:00
Sergey Biryukov d5a7a3a45d Comments: Use `comment` instead of an empty string for the `comment_type` DB field value in comments table.
This is the first step to bring support for custom comment types into WordPress.

Add a scheduled upgrade routine to update the type value for existing comments, in batches of 100 at a time.

Props imath, aaroncampbell, jeremyfelt, dshanske.
Fixes #49236.

git-svn-id: https://develop.svn.wordpress.org/trunk@47597 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-17 19:33:52 +00:00
Sergey Biryukov bee5595311 Coding Standards: Format the markup of widget forms in a more consistent manner.
See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@47593 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-17 09:36:25 +00:00
Dominik Schilling 165bcc506d Posts, Post Types: Pass the post object to the `before_delete_post`, `delete_post`, `deleted_post`, and `after_delete_post` actions.
Props jadpm.
Fixes #30940.

git-svn-id: https://develop.svn.wordpress.org/trunk@47582 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-14 19:24:49 +00:00
Sergey Biryukov 4d601e57b6 Docs: Add a `@since` note for un-deprecated `category_link` and `tag_link` filters.
Follow-up to [47576].

See #49759.

git-svn-id: https://develop.svn.wordpress.org/trunk@47578 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-14 08:13:18 +00:00
Jake Spurlock 7d4a746f27 Taxonomy: Un-depracate `category_link` and `tag_link` filters.
Depracating these filter might have been an accident, so let's restore.

Props SergeyBiryukov, audrasjb, peterwilsoncc.
Fixes #49759. 


git-svn-id: https://develop.svn.wordpress.org/trunk@47576 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-14 00:31:18 +00:00
Sergey Biryukov 286d672389 Themes: Block theme activation if it requires a higher version of PHP or WordPress.
Introduce `validate_theme_requirements()` for validating a theme's WordPress and PHP version requirements.

Follow-up to [44978] and [45546] for plugins.

Props afragen, audrasjb, SergeyBiryukov.
See #43992.

git-svn-id: https://develop.svn.wordpress.org/trunk@47573 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-13 15:26:37 +00:00
Sergey Biryukov d5df031e6f Privacy: Add an indication when the Copy action in Privacy Policy Guide is complete.
This adds a "Copied!" text near the "Copy this section to clipboard" button to provide direct feedback that the action was completed.

Props garrett-eclipse, nickylimjj, xkon, desrosj, birgire.
Fixes #44588.

git-svn-id: https://develop.svn.wordpress.org/trunk@47572 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-12 14:24:38 +00:00
K. Adam White 3abe80eea1 REST API: Handle parameter types consistently within set_param().
A request has multiple parameter types, including "query" and "json." Updating a parameter could previously modify a key's value in the wrong parameter type, leading to confusing and self-contradictory response objects.

Props mnelson4, TimothyBlynJacobs, vagios, jnylen0.
Fixes #40838.


git-svn-id: https://develop.svn.wordpress.org/trunk@47559 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-09 19:28:58 +00:00
Sergey Biryukov d8c502e966 Coding Standards: Use strict type check for `in_array()` and `array_search()`.
This addresses all the remaining `WordPress.PHP.StrictInArray.MissingTrueStrict` issues in core.

Includes minor code layout fixes for better readability.

Follow-up to [47550].

See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@47557 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-09 15:41:04 +00:00
Sergey Biryukov adda585fb8 Privacy: Make the deprecated `wp_get_user_request_data()` function available on front end.
Previously, it was accidentally made available only in admin context.

Follow-up to [44606], [47245].

Props garrett-eclipse, johnjamesjacoby, r-a-y, Dono12.
Fixes #49802.

git-svn-id: https://develop.svn.wordpress.org/trunk@47555 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-08 18:31:21 +00:00
Andrew Ozz 7b5d78f82f Media: Enable lazy-loading of images by automatically adding the new `loading="lazy"` attribute to image tags on the front-end.
- Introduces `wp_lazy_loading_enabled()`, `wp_filter_content_tags()`, `wp_img_tag_add_loading_attr()`, and `wp_img_tag_add_srcset_and_sizes_attr()` functions.
- Introduces `wp_lazy_loading_enabled`, `wp_img_tag_add_loading_attr`, and `wp_img_tag_add_srcset_and_sizes_attr` filters.

Props flixos90, addyosmani, mor10, swissspidy, pierlo, westonruter, spacedmonkey, mikeschroder, jonoaldersonwp, peterwilsoncc, narwen, jeffpaul, OptimizingMatters, futtta, mukeshpanchal27, azaozz.

Fixes #44427.

git-svn-id: https://develop.svn.wordpress.org/trunk@47554 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-08 00:53:18 +00:00
Sergey Biryukov 4b79e69d89 Users: Pass the ID of the user that was logged out to the `wp_logout` action.
Props donmhico, figureone, TimothyBlynJacobs, rebasaurus.
Fixes #49533.

git-svn-id: https://develop.svn.wordpress.org/trunk@47553 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-07 16:12:22 +00:00
Sergey Biryukov 0b4e2c4604 Coding Standards: Use strict type check for `in_array()` and `array_search()` where strings are involved.
This reduces the number of `WordPress.PHP.StrictInArray.MissingTrueStrict` issues from 486 to 50.

Includes minor code layout fixes for better readability.

See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@47550 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-05 03:00:44 +00:00
Andrew Ozz 2e589142eb Media: Remove `display: none;` from the (visually hidden) `<input type="file">` button used in Plupload to select files for uploading. Fixes selecting files in Edge <= 44 and iOS Safari.
Props treecutter, johnbillion, pbiron, isabel_brison, Ipstenu, azaozz.
Fixes #49753 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@47549 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-04 22:52:30 +00:00
K. Adam White b5117e1ad5 REST API: Fix revisions controller get_item permission check.
r45812 incorrectly introduced a delete_post permissions check into the get_item method, breaking some plugins which requested revisions when generating previews.

Props sorenbronsted, yohannp, TimothyBlynJacobs.
Fixes #49645.


git-svn-id: https://develop.svn.wordpress.org/trunk@47547 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-03 19:38:15 +00:00
Sergey Biryukov dfa959bbd5 Docs: Use third-person singular verbs for function descriptions in `wp-includes/category-template.php`, per the documentation standards.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@47545 602fd350-edb4-49c9-b593-d223f7449a82
2020-04-02 15:49:53 +00:00
John Blackbourn fe18be23fd Comments: Ensure all elements in the array returned by `get_comment_count()` are integers.
Previously elements would be a mixture of strings and integers depending on their numeric value.

Props progremzion, m.usama.masood

Fixes #48093

git-svn-id: https://develop.svn.wordpress.org/trunk@47526 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-28 20:42:31 +00:00
Jorge Costa dd1f14ac2f Block Editor: Update WordPress Packages WordPress 5.4 RC 5 Take 2.
The following package versions were changed:
@wordpress/edit-post: 3.13.8 -> 3.13.9
Includes PR https://github.com/WordPress/gutenberg/pull/21220

Props aduth, mapk, ItsJonQ.
Fixes: #49717.

git-svn-id: https://develop.svn.wordpress.org/trunk@47517 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-27 22:06:42 +00:00
Sergey Biryukov 33056ff892 Site Health: Remove `esc_url()` used on "Debugging in WordPress" article URL in `WP_Fatal_Error_Handler::display_default_error_template()`.
The function may not be available in some contexts, for example if a fatal error happens in `advanced-cache.php` drop-in.

Props rob006.
Fixes #49709.

git-svn-id: https://develop.svn.wordpress.org/trunk@47515 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-27 18:20:55 +00:00
Jorge Costa e858ea7058 Block Editor: Update WordPress Packages WordPress 5.4 RC 5.
The following package versions were changed:
@wordpress/annotations: 1.12.2 -> 1.12.3
@wordpress/block-directory: 1.5.6 -> 1.5.7
@wordpress/block-editor: 3.7.6 -> 3.7.7
@wordpress/block-library: 2.14.6 -> 2.14.7
@wordpress/blocks: 6.12.2 -> 6.12.3
@wordpress/components: 9.2.5 -> 9.2.6
@wordpress/core-data: 2.12.2 -> 2.12.3
@wordpress/edit-post: 3.13.7 -> 3.13.8
@wordpress/editor: 9.12.6 -> 9.12.7
@wordpress/format-library: 1.14.6 -> 1.14.7
@wordpress/list-reusable-blocks: 1.13.5 -> 1.13.6
@wordpress/nux: 3.12.5 -> 3.12.6
@wordpress/server-side-render: 1.8.5 -> 1.8.6
Description of editor changes included in the RC available at https://github.com/WordPress/gutenberg/pull/21210.

Props mcsf, aduth.
Fixes: #49716.

git-svn-id: https://develop.svn.wordpress.org/trunk@47513 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-27 18:08:43 +00:00
K. Adam White bef2746334 REST API: Fix _fields filtering of registered rest fields.
Use rest_is_field_included when determining which additional fields to include to permit filtering by nested field properties.

Props Dudo, kadamwhite, TimothyBlynJacobs.
Fixes #49648.


git-svn-id: https://develop.svn.wordpress.org/trunk@47511 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-26 17:50:39 +00:00
John Blackbourn f5550907e1 Query: Introduce an action which gets fired when a 404 is triggered.
Fixes #48061

git-svn-id: https://develop.svn.wordpress.org/trunk@47509 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-26 17:41:14 +00:00
Sergey Biryukov d8c8058309 Coding Standards: Fix WPCS issues in `wp-includes/class-wp-http-proxy.php`.
Props thrijith, mukesh27.
Fixes #46784.

git-svn-id: https://develop.svn.wordpress.org/trunk@47508 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-26 07:18:20 +00:00
Robert Anderson 251fd685dd Comments: Fix title not updating when replying to a comment
When replying to an existing comment, the comment form is moved to below the
existing comment with JS, but the form heading was not being updated. This
fixes the issue by introducing a new data-attribute to the reply link with the
correct heading string, and applying that string to the heading when the form
is moved.

Props isabel_brison, azaozz, peterwilsoncc.
Fixes #38009.


git-svn-id: https://develop.svn.wordpress.org/trunk@47506 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-25 04:53:06 +00:00
Sergey Biryukov 36d112d1c8 Docs: Revert a type change for the `$value` parameter of `WP_Dependencies::add_data()` in [47170].
Although described as a string in several places, it's technically not limited to a particular type.

Props westonruter.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47502 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-24 20:54:38 +00:00
Jorge Costa def0da1bbe Block Editor: Update WordPress Packages WordPress 5.4 RC 4.
The following package versions were changed:
@wordpress/annotations: 1.12.1 -> 1.12.2
@wordpress/block-directory: 1.5.5 -> 1.5.6
@wordpress/block-editor: 3.7.5 -> 3.7.6
@wordpress/block-library: 2.14.5 -> 2.14.6
@wordpress/blocks: 6.12.1 -> 6.12.2
@wordpress/components: 9.2.4 -> 9.2.5
@wordpress/core-data: 2.12.1 -> 2.12.2
@wordpress/data: 4.14.1 -> 4.14.2
@wordpress/data-controls: 1.8.1 -> 1.8.2
@wordpress/edit-post: 3.13.6 -> 3.13.7
@wordpress/editor: 9.12.5 -> 9.12.6
@wordpress/format-library: 1.14.5 -> 1.14.6
@wordpress/keyboard-shortcuts: 1.1.1 -> 1.1.2
@wordpress/list-reusable-blocks: 1.13.4 -> 1.13.5
@wordpress/notices: 2.0.1 -> 2.0.2
@wordpress/nux: 3.12.4 -> 3.12.5
@wordpress/rich-text: 3.12.1 -> 3.12.2
@wordpress/server-side-render: 1.8.4 -> 1.8.5
@wordpress/viewport: 2.13.1 -> 2.13.2
Description of editor changes included in the RC available at https://github.com/WordPress/gutenberg/pull/21083.

Props itsjonq, mcsf, aduth.
Fixes: #49688.

git-svn-id: https://develop.svn.wordpress.org/trunk@47495 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-23 23:38:27 +00:00
Sergey Biryukov ad8d01a7e9 Docs: Add missing `@since` tags for `WP_User_Request` properties.
Correct type for `$email`, `$confirmed_timestamp`, and `$completed_timestamp` properties.

Props pbiron, garrett-eclipse.
Fixes #49675.

git-svn-id: https://develop.svn.wordpress.org/trunk@47494 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-23 20:18:15 +00:00
Sergey Biryukov e7022adab2 Docs: Correct the description of `$hard` parameter in `flush_rewrite_rules()`.
Props david.binda.
Fixes #49660.

git-svn-id: https://develop.svn.wordpress.org/trunk@47468 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-17 19:32:45 +00:00
Jorge Costa f5c0507910 Block Editor: Update WordPress Packages WordPress 5.4 RC 3.
The following package versions were changed:
@wordpress/block-directory: 1.5.4 -> 1.5.5
@wordpress/block-editor: 3.7.4 -> 3.7.5
@wordpress/block-library: 2.14.4 -> 2.14.5
@wordpress/components: 9.2.3 -> 9.2.4
@wordpress/dependency-extraction-webpack-plugin: 2.3.0 -> 2.4.0
@wordpress/edit-post: 3.13.5 -> 3.13.6
@wordpress/editor: 9.12.4 -> 9.12.5
@wordpress/format-library: 1.14.4 -> 1.14.5
@wordpress/list-reusable-blocks: 1.13.3 -> 1.13.4
@wordpress/nux: 3.12.3 -> 3.12.4
@wordpress/server-side-render: 1.8.3 -> 1.8.4

Props aduth.
Fixes: #49657.

git-svn-id: https://develop.svn.wordpress.org/trunk@47462 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-16 22:05:14 +00:00
John Blackbourn c8d918e476 Docs: Various docblock corrections and improvements.
See #49572

git-svn-id: https://develop.svn.wordpress.org/trunk@47461 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-16 18:38:03 +00:00
Sergey Biryukov 5b88e2fa53 Menus: When adding a label for special pages in `wp_setup_nav_menu_item()` strip all HTML tags, as the label is escaped on output.
Follow-up to [47211], [47213].

Props stiofansisland.
Fixes #49374.

git-svn-id: https://develop.svn.wordpress.org/trunk@47458 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-16 01:30:14 +00:00
Sergey Biryukov c3156e6258 Toolbar: Move the logic for rendering the admin bar on `wp_footer` to `wp_admin_bar_render()`.
Clarify in the function documentation that it is now called on `wp_body_open` action first, with `wp_footer` as a fallback.

Follow-up to [47221].

Fixes #47053.

git-svn-id: https://develop.svn.wordpress.org/trunk@47455 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-14 15:59:22 +00:00
Sergey Biryukov 31dd2e70f0 General: Trim the input data in `maybe_unserialize()`, for consistency with `is_serialized()`.
Props pbearne, mikeschroder.
Fixes #36416.

git-svn-id: https://develop.svn.wordpress.org/trunk@47454 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-13 21:12:01 +00:00
SergeyBiryukov 13c5098f74 General: Move `maybe_serialize()` to a more appropriate place in the file, before `maybe_unserialize()`.
Rename the `$original` parameter of `maybe_unserialize()` to `$data`, for consistency with other serialization functions.

See #36416.

git-svn-id: https://develop.svn.wordpress.org/trunk@47453 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-13 21:05:02 +00:00
Sergey Biryukov ed9d5c383f Database: Introduce `wpdb::db_server_info()` to retrieve full MySQL server information string as supplied by `mysqli_get_server_info()`.
This complements `wpdb::db_version()`, which only returns a numeric version string and strips any additional information, e.g. vendor name.

Props clarinetlord, birgire, webaware, pento.
Fixes #40037. See #27703.

git-svn-id: https://develop.svn.wordpress.org/trunk@47451 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-12 15:53:01 +00:00
Timothy Jacobs 60edf36394 REST API: Introduce "hex-color" JSON Schema format.
Props spacedmonkey, chrisvanpatten.
Fixes #49270.


git-svn-id: https://develop.svn.wordpress.org/trunk@47450 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-12 02:40:29 +00:00
Peter Wilson eba126609f Media: Introduce preflight filter to `wp_delete_attachment()`.
Introduces the filter `pre_delete_attachment` to allow developers to prevent or modify the deletion of attachments. This improves consistency with `wp_delete_post()` and `wp_trash_post()`.

Props joemcgill, peterwilsoncc.
Fixes #49597.


git-svn-id: https://develop.svn.wordpress.org/trunk@47448 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-10 22:46:12 +00:00
Jorge Costa 94516bbb3f Block Editor: Update WordPress Packages WordPress 5.4 RC 2.
The following package versions were changed:
@wordpress/block-directory: 1.5.3 -> 1.5.4
@wordpress/block-editor: 3.7.3 -> 3.7.4
@wordpress/block-library: 2.14.3 -> 2.14.4
@wordpress/edit-post: 3.13.4 -> 3.13.5
@wordpress/editor: 9.12.3 -> 9.12.4
@wordpress/format-library: 1.14.3 -> 1.14.4

Props aduth, gziolo, mapk.
Fixes: #49611.

git-svn-id: https://develop.svn.wordpress.org/trunk@47441 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-10 14:51:10 +00:00
Sergey Biryukov 72cb0ebff8 REST API: Fix typo in `disable-custom-gradients` theme feature description.
Props Ipstenu, tobifjellner, pixelverbieger.
Reviewed by ocean90, johnbillion, SergeyBiryukov.
Fixes #49585.

git-svn-id: https://develop.svn.wordpress.org/trunk@47432 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-06 00:15:09 +00:00
Sergey Biryukov 48df8c3646 General: Ensure `get_tag_regex()` always returns a string, to match the documented value.
Props subrataemfluence.
Fixes #45643.

git-svn-id: https://develop.svn.wordpress.org/trunk@47430 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-04 12:03:32 +00:00
Sergey Biryukov 7a4f9cc9a6 General: Correct the default value of the `$defaults` parameter in `wp_parse_args()` to match the documented type.
Props subrataemfluence.
See #45643.

git-svn-id: https://develop.svn.wordpress.org/trunk@47429 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-04 11:58:31 +00:00
Sergey Biryukov 047f6e4bef Docs: Reorder `@throws` tags in `WP_Customize_Nav_Menu_Setting` and `WP_Customize_Nav_Menu_Item_Setting` for consistency with `WP_Customize_Custom_CSS_Setting`.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@47428 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-04 11:33:14 +00:00
Sergey Biryukov b52783bc4f Docs: Add missing `@throws` tag to `_wp_json_sanity_check()` DocBlock.
Props subrataemfluence.
See #45643.

git-svn-id: https://develop.svn.wordpress.org/trunk@47427 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-04 11:32:52 +00:00
Peter Wilson 55b3866749 Trunk is now 5.5 alpha
git-svn-id: https://develop.svn.wordpress.org/trunk@47426 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-04 01:18:56 +00:00
Jorge Costa 66f510bda0 Post WordPress 5.4 RC 1 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@47424 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-03 22:00:22 +00:00
Jorge Costa d4f965278a WordPress 5.4 RC 1.
git-svn-id: https://develop.svn.wordpress.org/trunk@47423 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-03 21:41:29 +00:00
Jorge Costa ae5596bf0a Editor: Update WordPress packages to make editor full-screen by default.
The following package versions were changed:
@wordpress/e2e-test-utils: 4.3.0 -> 4.3.1
@wordpress/edit-post: 3.13.3 -> 3.13.4
This commit update allows the following PR to be part of trunk https://github.com/WordPress/gutenberg/pull/20611.

Props youknowriad, mcsf, mapk.
Fixes: #49574.

git-svn-id: https://develop.svn.wordpress.org/trunk@47421 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-03 20:43:49 +00:00
Jorge Costa ac4de42983 Scripts: Use core-js url as polyfill for window.URL.
URL polyfill from the polyfill-library library is not spec-conformant, in a way which negatively impacts its usability for pending revisions to the block editor. Specifically, there were revisions to the implementation of the wp-url script to detect URL validity by relying on thrown errors from the URL constructor, but this specific behavior is not implemented in this version of the polyfill.
There was another issue in r47238, which is that the test used to check whether the polyfill should be included is not accurate. This commit uses a different check and fixes the issue.

Props aduth.
Fixes: #49360.

git-svn-id: https://develop.svn.wordpress.org/trunk@47416 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-03 16:53:32 +00:00
John Blackbourn e45162e496 Privacy: Fix the URLs and legacy redirects for the personal data export and erasure screens.
Props Jurgen Oldenburg, garrett-eclipse

Fixes #49476

git-svn-id: https://develop.svn.wordpress.org/trunk@47412 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-03 00:48:21 +00:00
Jorge Costa 8bee6a4860 Block Editor: Update WordPress Packages WordPress 5.4 RC 1.
The following package versions were changed:
@wordpress/annotations: 1.12.0 -> 1.12.1
@wordpress/block-directory: 1.5.2 -> 1.5.3
@wordpress/block-editor: 3.7.2 -> 3.7.3
@wordpress/block-library: 2.14.2 -> 2.14.3
@wordpress/blocks: 6.12.0 -> 6.12.1
@wordpress/components: 9.2.2 -> 9.2.3
@wordpress/core-data: 2.12.0 -> 2.12.1
@wordpress/data: 4.14.0 -> 4.14.1
@wordpress/data-controls: 1.8.0 -> 1.8.1
@wordpress/edit-post: 3.13.2 -> 3.13.3
@wordpress/editor: 9.12.2 -> 9.12.3
@wordpress/format-library: 1.14.2 -> 1.14.3
@wordpress/keyboard-shortcuts: 1.1.0 -> 1.1.1
@wordpress/list-reusable-blocks: 1.13.2 -> 1.13.3
@wordpress/notices: 2.0.0 -> 2.0.1
@wordpress/nux: 3.12.2 -> 3.12.3
@wordpress/priority-queue: 1.5.0 -> 1.5.1
@wordpress/rich-text: 3.12.0 -> 3.12.1
@wordpress/server-side-render: 1.8.2 -> 1.8.3
@wordpress/viewport: 2.13.0 -> 2.13.1

Props aduth.
Fixes: #49567.

git-svn-id: https://develop.svn.wordpress.org/trunk@47408 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-02 23:19:06 +00:00
John Blackbourn ef878b59c9 Feeds: Remove an unreachable condition when generating archive feed links.
Props donmhico, pbiron

Fixes #48427

git-svn-id: https://develop.svn.wordpress.org/trunk@47406 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-02 18:50:22 +00:00
Sergey Biryukov 3feb885ec3 Docs: Use more specific type in parameter descriptions for `is_page()`, `is_single()`, `is_singular()`, and their `WP_Query` counterpart methods.
Props marekdedic, shaharia.azam, shaampk1.
Fixes #48354. See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47402 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-01 17:27:03 +00:00
Sergey Biryukov 6c33566c05 Docs: Synchronize parameter descriptions for conditional tags with their `WP_Query` counterpart methods.
See #48354, #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47401 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-01 17:19:58 +00:00
Sergey Biryukov f327466200 Docs: Use more specific type in parameter description for `wp_unslash()`.
Props marekdedic.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47400 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-01 16:23:24 +00:00
Sergey Biryukov a7c0d2c8fc Docs: Use more specific type in description for `_WP_Dependency::$deps`.
Props marekdedic.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47399 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-01 16:22:51 +00:00
John Blackbourn ac6cb23470 Docs: Miscellaneous docs fixes and improvements.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47398 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-01 10:38:00 +00:00
John Blackbourn 78a6e4febb Docs: Use more specific types in parameter descriptions in place of `mixed`.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47397 602fd350-edb4-49c9-b593-d223f7449a82
2020-03-01 10:36:38 +00:00
John Blackbourn b7bc6f7bb0 Docs: Correct and improve the docs for some media related functions.
See #48303

git-svn-id: https://develop.svn.wordpress.org/trunk@47394 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-29 16:47:44 +00:00