Commit Graph

10215 Commits

Author SHA1 Message Date
Sergey Biryukov b54d5925ce Docs: Improve documentation for `WP_REST_Attachments_Controller`.
This adds a missing DocBlock for `::register_routes()` and parameter descriptions for `::post_process_item()`.

Includes minor documenation fixes in other REST API classes for consistency.

Props dkarfa, mukesh27, SergeyBiryukov.
Fixes #48841.

git-svn-id: https://develop.svn.wordpress.org/trunk@47391 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-28 12:29:53 +00:00
Sergey Biryukov 697127203b Docs: Improve documentation for various metadata functions.
This adds a more specific description for accepted object types: `post`, `comment`, `term`, `user`, or any other object type with an associated meta table.

Props sheparddw, kraftbj, DrewAPicture, SergeyBiryukov.
Fixes #45464.

git-svn-id: https://develop.svn.wordpress.org/trunk@47390 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-28 12:12:58 +00:00
Sergey Biryukov ef613db765 Docs: Add a reference to `WP_Customize_Panel::__construct()` for information on accepted arguments in `WP_Customize_Manager::add_panel()`.
Synchronize the documentation between two places, use `WP_Customize_Panel::__construct()` as the canonical source.

Props iaaxpage, marekdedic.
Fixes #48344.

git-svn-id: https://develop.svn.wordpress.org/trunk@47387 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-27 20:34:49 +00:00
Sergey Biryukov 19bdff7326 Docs: Add a reference to `WP_Customize_Section::__construct()` for information on accepted arguments in `WP_Customize_Manager::add_section()`.
Synchronize the documentation between two places, use `WP_Customize_Section::__construct()` as the canonical source.

Props amolv, marekdedic.
Fixes #48346.

git-svn-id: https://develop.svn.wordpress.org/trunk@47386 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-27 20:27:45 +00:00
Sergey Biryukov 33b88a7c7f Docs: Clarify the type of `theme_supports` argument in various Customizer classes.
Props marekdedic.
See #48347.

git-svn-id: https://develop.svn.wordpress.org/trunk@47385 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-27 20:21:35 +00:00
Sergey Biryukov 9793244c74 Docs: Add a reference to `WP_Customize_Setting::__construct()` for information on accepted arguments in `WP_Customize_Manager::add_setting()`.
Synchronize the documentation between two places, use `WP_Customize_Setting::__construct()` as the canonical source.

Props tmanoilov, marekdedic.
Fixes #48347.

git-svn-id: https://develop.svn.wordpress.org/trunk@47384 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-27 20:07:31 +00:00
Sergey Biryukov bd71eb4b74 Docs: Use a consistent description for the `$manager` parameter in various Customizer class constructions.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47383 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-26 15:31:19 +00:00
Sergey Biryukov aab2667898 Docs: Add a `@see` reference to `WP_Customize_Control::__construct()` in child class constructors.
Follow-up to [47363], [47364].

See #48343, #48348.

git-svn-id: https://develop.svn.wordpress.org/trunk@47382 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-26 13:29:01 +00:00
Andrew Ozz 3a4faa975f Build Tools: Do not delete the (now committed) `script-loader-packages.php` file when running `clean:js` and copy it to /build. Fixes cases when running `grunt watch` or `-dev` where that file may be deleted and not recreated.
See #48154.

git-svn-id: https://develop.svn.wordpress.org/trunk@47380 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-26 05:13:05 +00:00
Jorge Costa 0975f8e79b Post WordPress 5.4 Beta 3 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@47379 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-25 22:11:55 +00:00
Jorge Costa 16aa8bbcce WordPress 5.4 Beta 3.
git-svn-id: https://develop.svn.wordpress.org/trunk@47378 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-25 21:54:53 +00:00
Sergey Biryukov 762dc39878 Block Editor: Update `wp-includes/assets/script-loader-packages.php`.
Follow-up to [47352], [47354].

Props aduth, ocean90, garrett-eclipse.
Fixes #49506.

git-svn-id: https://develop.svn.wordpress.org/trunk@47377 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-25 21:43:57 +00:00
Sergey Biryukov ccb7aec7fc Accessibility: Media: Hide the invisible "file upload button" on media views from assistive technologies.
The button is visually hidden, but was announced by screen readers in workflows unrelated to file uploading, leading to confusion.

Props afercia, audrasjb, azaozz.
Fixes #47611.

git-svn-id: https://develop.svn.wordpress.org/trunk@47375 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-25 20:42:19 +00:00
Sergey Biryukov 22c02a0325 General: Introduce HTML classes in `get_calendar()` for easier CSS targeting:
* `.wp-calendar-table` for the `<table>` element.
* `.wp-calendar-nav` for the navigation wrapper.
* `.wp-calendar-nav-prev` for the previous month link.
* `.wp-calendar-nav-next` for the next month link.

Replace `#prev` and `#next` HTML IDs with `.wp-calendar-nav-prev` and `.wp-calendar-nav-next` classes.

Props sabernhardt, BackuPs, audrasjb, jorbin.
Fixes #39763.

git-svn-id: https://develop.svn.wordpress.org/trunk@47374 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-25 20:28:29 +00:00
Sergey Biryukov 91878831dd Docs: In `update_option()`, remove an inaccurate statement about the `$autoload` value for new options.
If the option does not exist, it will be created with whatever was passed to the `$autoload` parameter, `'yes'` being only the default value.

Props leogermani.
Fixes #48357.

git-svn-id: https://develop.svn.wordpress.org/trunk@47373 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-25 20:06:32 +00:00
Sergey Biryukov 38e9142a66 Coding Standards: Use strict comparison for `normalize_whitespace()` checks when comparing revisions or autosaves.
Props dkarfa, itowhid06, TimothyBlynJacobs.
Fixes #47965.

git-svn-id: https://develop.svn.wordpress.org/trunk@47372 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-25 19:33:22 +00:00
Sergey Biryukov f852ca2cc1 Widgets: Create a unique HTML ID for the `<ul>` element of Recent Comments widget if more than one instance is displayed on the page.
Props peterwilsoncc, audrasjb, birgire, justinahinon, mbrailer, desrosj.
Fixes #46747.

git-svn-id: https://develop.svn.wordpress.org/trunk@47371 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-25 19:27:22 +00:00
Sergey Biryukov 97d43fbff5 Bootstrap/Load: In `wp_magic_quotes()`, revert the type change to string for `REQUEST_TIME` and `REQUEST_TIME_FLOAT` values, which should retain their proper type.
Among other things, this preserves compatibility of WP with PHPUnit Code Coverage generation.

Props jrf, Veraxus, Rarst.
See #48605.

git-svn-id: https://develop.svn.wordpress.org/trunk@47370 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-25 18:31:33 +00:00
Sergey Biryukov 8dbe048737 Docs: In `wp_insert_user()`, correct `@type` for `rich_editing`, `syntax_highlighting`, `comment_shortcuts`, and `show_admin_bar_front` arguments.
Follow-up to [47368].

See #49087.

git-svn-id: https://develop.svn.wordpress.org/trunk@47369 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-25 18:18:26 +00:00
Sergey Biryukov d722bdb0ac Docs: In `wp_insert_user()`, clarify that `rich_editing`, `syntax_highlighting`, `comment_shortcuts`, and `show_admin_bar_front` arguments accept `true` or `false` as a string literal, not boolean.
Props garrett-eclipse, audrasjb, valentinbora, bilgilabs, SergeyBiryukov.
Fixes #49087.

git-svn-id: https://develop.svn.wordpress.org/trunk@47368 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-25 18:15:00 +00:00
Sergey Biryukov f1124fc1cb Docs: Clarify in `WP_Customize_Manager::remove_*()` methods that removing a setting, panel, section, or control does not destroy the class instance or remove its filters.
Props dlh, fgiannar, jon81, westonruter.
Fixes #48747.

git-svn-id: https://develop.svn.wordpress.org/trunk@47367 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-25 17:48:40 +00:00
Sergey Biryukov a6b80a326a Comments: Restore the fourth parameter of `comments_number()` as `$post_id`, for consistency with `get_comments_number_text()`.
The parameter was previously used as the number of comments, marked as deprecated in [5101].

Given that it's been deprecated for the last 13 years, it should be safe to undeprecate and repurpose it for a cleaner function signature, instead of adding a fifth parameter.

Follow-up to [47276].

Fixes #48772.

git-svn-id: https://develop.svn.wordpress.org/trunk@47366 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-25 17:32:34 +00:00
Sergey Biryukov 3bd4e3a075 Docs: Add a reference to `WP_Customize_Control::__construct()` for information on accepted arguments in `WP_Customize_Manager::add_control()`.
Synchronize the documentation between two places, use `WP_Customize_Control::__construct()` as the canonical source.

Props hAmpzter, marekdedic, SergeyBiryukov.
Fixes #48343.

git-svn-id: https://develop.svn.wordpress.org/trunk@47364 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-25 16:39:36 +00:00
Sergey Biryukov 5178d29f4a Docs: Add a reference to `WP_Customize_Control::__construct()` for information on accepted arguments to override class property defaults in child classes.
Props marcio-zebedeu, marekdedic.
Fixes #48348.

git-svn-id: https://develop.svn.wordpress.org/trunk@47363 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-25 16:19:08 +00:00
K. Adam White 4e0062e5be REST API: Correctly infer empty objects passed via query parameters.
Permit passing an empty object as the string "?obj=". The type of the passed empty argument is inferred from the registered schema.

Props TimothyBlynJacobs, steffanhalv, schlessera, dd32.
Fixes #42961.


git-svn-id: https://develop.svn.wordpress.org/trunk@47362 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-25 15:32:27 +00:00
K. Adam White b5190458fe REST API: Permit access to the themes controller if user can edit any post type.
Check a more exhaustive list of post type editing caps beyond "edit_post" to ensure custom user roles with access to to specific post types may still use block editor functionality depending on theme features.

Props miyauchi, TimothyBlynJacobs.
Fixes #46723.


git-svn-id: https://develop.svn.wordpress.org/trunk@47361 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-25 15:18:19 +00:00
K. Adam White a0ac0ff13d REST API: Apply all relevant block rendering filters when rendering block previews.
Several filters were introduced to the render_block method since the initial implementation of the block-renderer/ endpoints, causing the output of those endpoints to diverge from the rendered content of blocks on the frontend.

Props kadamwhite, TimothyBlynJacobs, miinasikk.
Fixes #49387.


git-svn-id: https://develop.svn.wordpress.org/trunk@47360 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-25 15:03:57 +00:00
Sergey Biryukov 51e6228635 Script Loader: Improve performance of `wp_script_is()` for scripts registered with complex dependencies.
This switches `WP_Dependencies::recurse_deps()` from recursively checking the same handles over and over again to keep a flattened array of queued items and their dependencies for faster lookup in `WP_Dependencies::query()`.

Props superdav42.
Fixes #46469.

git-svn-id: https://develop.svn.wordpress.org/trunk@47359 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-25 13:40:52 +00:00
Sergey Biryukov 887e0a8004 Docs: Add a `@since` note for including `delete_posts` in default capabilities in `get_post_type_capabilities()`.
Follow-up to [47357].

See #30991.

git-svn-id: https://develop.svn.wordpress.org/trunk@47358 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-25 12:53:35 +00:00
Sergey Biryukov 317e1c076c Posts, Post Types: Ensure `delete_posts` is included in default post type capabilities regardless of `map_meta_cap` value.
This resolves PHP notices in a few places in core where this capability is checked.

Props Mte90, johnbillion, dipesh.kakadiya, jipmoors, bamadesigner, dd32, johnjamesjacoby, xedin.unknown, flixos90, SergeyBiryukov.
Fixes #30991.

git-svn-id: https://develop.svn.wordpress.org/trunk@47357 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-25 12:48:11 +00:00
Sergey Biryukov f40c6c9ebe Script Loader: Remove unnecessary reference sign from function definitions in script loader.
This resolves PHP warnings when extensions like `php_uopz` or `php_tideways_xhprof` are in use.

Object variables in PHP 5+ contain a reference to the object, and it's the reference that's passed around.

Props jqz, killerbishop, Mte90, TJNowell, jorbin, pento, pcarvalho, valentinbora, SergeyBiryukov.
Fixes #44979.

git-svn-id: https://develop.svn.wordpress.org/trunk@47355 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-25 00:57:33 +00:00
Jorge Costa bc3850c8dc Block Editor: Update WordPress Packages WordPress 5.4 Beta 3.
The following package versions were changed:
@wordpress/block-directory: 1.5.1 -> 1.5.2
@wordpress/block-editor: 3.7.1 -> 3.7.2
@wordpress/block-library: 2.14.1 -> 2.14.2
@wordpress/components: 9.2.1 -> 9.2.2
@wordpress/edit-post: 3.13.1 -> 3.13.2
@wordpress/editor: 9.12.1 -> 9.12.2
@wordpress/format-library: 1.14.1 -> 1.14.2
@wordpress/list-reusable-blocks: 1.13.1 -> 1.13.2
@wordpress/media-utils: 1.7.1 -> 1.7.2
@wordpress/nux: 3.12.1 -> 3.12.2
@wordpress/server-side-render: 1.8.1 -> 1.8.2

Fixes #49506.

git-svn-id: https://develop.svn.wordpress.org/trunk@47354 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-25 00:16:12 +00:00
Sergey Biryukov 753ffe3968 Accessibility: Widgets: Restore missing string in script loader.
The string was previously added in [42794] and accidentally removed in [44163].

Props garrett-eclipse, audrasjb.
Fixes #49505.

git-svn-id: https://develop.svn.wordpress.org/trunk@47353 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-24 23:05:14 +00:00
Andrew Ozz b2d243fbe6 Build Tools:
- Update the DependencyExtractionWebpackPlugin to 2.3.0 and set it to output a single assets file.
- Grunt: copy the assets file to both `SOURCE_DIR` and `BUILD_DIR` as `wp-includes/assets/script-loader-packages.php`.
- "Unignore" the `wp-includes/assets` directory. Its content will be committed similarly to `wp-includes/blocks`.
- Update `wp_default_packages_scripts()` to use the above file. This also removes the hard-coded lists of packages and packages with translations.

Props gziolo, pbearne, johnbillion, isabel_brison, ocean90, azaozz.
Fixes #48154.

git-svn-id: https://develop.svn.wordpress.org/trunk@47352 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-24 21:20:49 +00:00
K. Adam White 4e18f78ced REST API: Fix namespace shadowing issue in route matching logic.
Following [47260] a namespace such as "test-ns" prevents any namespace such as "test-ns/v1" from being found when matching routes.
While not best practice, this was an unintentional back-compat break; this patch restores the original behavior.

Props david.binda, TimothyBlynJacobs.
Fixes #48530.



git-svn-id: https://develop.svn.wordpress.org/trunk@47351 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-24 18:05:12 +00:00
Sergey Biryukov 74baee2f19 Menus: Introduce `wp_nav_menu_item_custom_fields_customize_template` action that fires at the end of the form field template for nav menu items in the customizer.
This brings parity with the `wp_nav_menu_item_custom_fields` action added in [47190] for the Menus screen.

Props celloexpressions.
Fixes #47056.

git-svn-id: https://develop.svn.wordpress.org/trunk@47350 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-24 14:56:42 +00:00
Sergey Biryukov 2f10289ffb Docs: Use third-person singular verbs for function descriptions in `wp-includes/option.php`, per the documentation standards.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47347 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-23 01:05:28 +00:00
Sergey Biryukov 84764d4cee Docs: Add a `@staticvar` entry for `$transports` in `WP_Http::_dispatch_request()`.
Props utsav72640.
Fixes #48774.

git-svn-id: https://develop.svn.wordpress.org/trunk@47346 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-22 19:10:47 +00:00
Timothy Jacobs 8a62f46beb REST API: Don't assume all item schemas have properties.
All schema types, not just objects, are permitted as the base type of a resource. A future patch could add validation support for those types, but this fix only prevents a PHP warning from being issued.

Props dhavalkasvala, johnwatkins0, birgire.
Fixes #48785.


git-svn-id: https://develop.svn.wordpress.org/trunk@47328 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-20 16:56:17 +00:00
Timothy Jacobs be371a7431 REST API: Fix links format in OPTIONS requests for non-variable routes.
Props nsundberg, johnwatkins0, birgire.
Fixes #49149.


git-svn-id: https://develop.svn.wordpress.org/trunk@47326 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-20 00:53:43 +00:00
Timothy Jacobs 727faabe98 REST API: Warn if registering array settings without an items schema.
The documentation for register_setting has also been clarified to include all of the supported types and the flexibility of the show_in_rest parameter.

Fixes #42875.
Props perrywagle, dshanske, kadamwhite.


git-svn-id: https://develop.svn.wordpress.org/trunk@47325 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-19 22:54:03 +00:00
Sergey Biryukov 5f26580730 Docs: Add missing quote to `{@see 'comment_$old_status_to_$new_status'}` hook reference in `wp_transition_comment_status()` DocBlock.
Props coffee2code.
Fixes #49474.

git-svn-id: https://develop.svn.wordpress.org/trunk@47324 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-19 13:43:16 +00:00
Sergey Biryukov 2d73050eda Posts, Post Types: Discard `tags_input` parameter in `wp_update_post()` if it's the same as existing post tags.
This ensures that `wp_update_post()` does not unintentionally modify post tags if the post has several tags with the same name but different slugs.

Tags should only be modified if `tags_input` parameter was explicitly provided, and is different from the existing tags.

Props kaggdesign, SergeyBiryukov.
Fixes #45121.

git-svn-id: https://develop.svn.wordpress.org/trunk@47317 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-19 03:50:38 +00:00
Tammie Lister 6930542657 Bump version number to beta 2-47310
git-svn-id: https://develop.svn.wordpress.org/trunk@47310 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-18 21:27:31 +00:00
Tammie Lister bc0847e8bd Bump version number to beta 2
git-svn-id: https://develop.svn.wordpress.org/trunk@47309 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-18 21:09:56 +00:00
Jonathan Desrosiers 9f87034879 Widgets: Revert [47307].
Even though the source URL for an attachment is stored in a variable, attachments should still be passed through the `wp_video_shortcode()` function.

Unprops desrosj, spacedmonkey.
See #46718.

git-svn-id: https://develop.svn.wordpress.org/trunk@47308 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-18 18:17:53 +00:00
Jonathan Desrosiers 0d7a5f949d Widgets: Remove unnecessary redundant conditional.
Props spacedmonkey.
Fixes #46718.

git-svn-id: https://develop.svn.wordpress.org/trunk@47307 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-18 17:50:54 +00:00
Sergey Biryukov 6234fd90c2 Theme Editor: Disable CodeMirror CSS linting.
Being a good idea in theory, in practice it does not always work reliably, may not recognize newer CSS properties, and sometimes displays phantom errors with no particular error message.

A plugin can re-enable CSS linting via the `wp_code_editor_settings` filter.

Props skypressatx, ThemeZee, johnbillion, ianbelanger, ZanderZ, starvoters1, raoulunger, prashantvatsh, SergeyBiryukov.
Fixes #44471.

git-svn-id: https://develop.svn.wordpress.org/trunk@47305 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-18 15:49:08 +00:00
Sergey Biryukov 9ac7fca92b Users: Limit the scope of admin files required in `WP_REST_Users_Controller`.
This requires only `wp-admin/includes/user.php` for `get_editable_roles()`, instead of `wp-admin/includes/admin.php`.

Follow-up to [43589].

Props johnwatkins0.
Fixes #49450.

git-svn-id: https://develop.svn.wordpress.org/trunk@47299 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-17 05:31:18 +00:00
Sergey Biryukov b8993b72bd Docs: Improve inline comments for `require_once` calls in `WP_REST_Users_Controller` per the documentation standards.
Follow-up to [47295].

See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47298 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-17 03:54:11 +00:00
Sergey Biryukov 7d8b92ede9 Docs: Fix typo in a comment in `WP_REST_Attachments_Controller::create_item()`.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47297 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-17 03:28:05 +00:00
Sergey Biryukov 2d9f3a1330 REST API: Restore `wp-admin/includes/image.php` requirement in `WP_REST_Attachments_Controller::create_item()`.
Although the file is already included via the `::insert_attachment()` method, this addresses an inconsistency and corrects a misleading comment.

It also reduces the possibility of a future error in case `::insert_attachment()` is no longer called earlier in `::create_item()` at some point.

Follow-up to [43850] and [44206].

Props luisrivera.
Fixes #49449.

git-svn-id: https://develop.svn.wordpress.org/trunk@47296 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-17 03:22:43 +00:00
Sergey Biryukov f8d1664544 Docs: Improve inline comments for `require_once()` calls in `WP_REST_Attachments_Controller`.
See #49449, #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47295 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-17 03:11:50 +00:00
Sergey Biryukov 543944257c Coding Standards: Rename `$d` parameter in various date/time functions to `$format` for clarity.
See #49222.

git-svn-id: https://develop.svn.wordpress.org/trunk@47287 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-14 00:05:43 +00:00
Sergey Biryukov a41b2d93d3 Docs: Update `@return` tag for `wp_allow_comment()` with `trash` as a possible return value.
Props oakesjosh, jeremyfelt.
Fixes #49206.

git-svn-id: https://develop.svn.wordpress.org/trunk@47286 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-13 17:48:50 +00:00
Jorge Costa 20849f39b4 Post WordPress 5.4 Beta 1 version bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@47282 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-11 22:44:50 +00:00
Jorge Costa f9fe81df19 WordPress 5.4 Beta 1.
git-svn-id: https://develop.svn.wordpress.org/trunk@47281 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-11 22:18:40 +00:00
Sergey Biryukov f97a60c9b7 Privacy: Revert [47269] for now to address side effects on Multisite installations.
See #44176.

git-svn-id: https://develop.svn.wordpress.org/trunk@47280 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-11 21:46:54 +00:00
Sergey Biryukov 1106d82f93 Privacy: Introduce filters for the headers of all the privacy-related e-mails:
* `wp_privacy_personal_data_email_headers`
* `user_request_confirmed_email_headers`
* `user_erasure_complete_email_headers`
* `user_request_action_email_headers`

Props xkon, garrett-eclipse, zaffarn, desrosj.
Fixes #44501.

git-svn-id: https://develop.svn.wordpress.org/trunk@47279 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-11 21:41:26 +00:00
Sergey Biryukov d6352c544b Coding Standards: Use a strict `in_array()` check for reserved names of user data items in `wp_user_personal_data_exporter()`.
Props azaozz.
Fixes #47509.

git-svn-id: https://develop.svn.wordpress.org/trunk@47277 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-11 20:53:40 +00:00
Sergey Biryukov 4020493d45 Comments: Add a `$post_id` parameter to `get_comments_number_text()` and `comments_number()`.
This allow for using these functions outside of the loop.

Props donmhico, garrett-eclipse, Hinjiriyo, imath.
Fixes #48772.

git-svn-id: https://develop.svn.wordpress.org/trunk@47276 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-11 20:39:12 +00:00
Andrew Ozz 896de1cba2 Media: Pass through the `$unfiltered` param to `get_attached_file()` in `wp_get_original_image_path()`.
Props ianmjones, joemcgill, azaozz.
Fixes #48421.

git-svn-id: https://develop.svn.wordpress.org/trunk@47274 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-11 19:45:46 +00:00
Sergey Biryukov 0ad4121c91 Privacy: Introduce `wp_privacy_additional_user_data` filter to make it easier to include additional user meta in a personal data export.
Props pbiron, xkon, garrett-eclipse, azaozz.
Fixes #47509.

git-svn-id: https://develop.svn.wordpress.org/trunk@47270 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-11 18:57:51 +00:00
Sergey Biryukov 0911aecf36 Privacy: Un-map privacy capabilities to make them available to be assigned for custom roles:
* `erase_others_personal_data`
* `export_others_personal_data`
* `manage_privacy_options`

Previously mapped to `manage_options` or `manage_network` (on Multisite), these are now added to the Administrator role separately.

Additionally, `manage_privacy_options` is added to the Editor role.

Props garrett-eclipse, xkon, pbiron, desrosj, johnbillion, flixos90, juliobox, lakenh, Ov3rfly, ianatkins.
Fixes #44176.

git-svn-id: https://develop.svn.wordpress.org/trunk@47269 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-11 18:34:08 +00:00
Sergey Biryukov 2599e1b4fb Customize: Avoid unnecessary `get_theme_mod()` call and premature escaping in `get_header_video_url()`.
The result is still escaped with `esc_url_raw()` for retrieval, and with `esc_url()` for display in `the_header_video_url()`.

Props dlh, Tkama.
Fixes #40044.

git-svn-id: https://develop.svn.wordpress.org/trunk@47267 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-11 16:34:09 +00:00
Andrea Fercia 5866986d74 Media: Fix bottom spacing on various Media Modal elements for non-webkit browsers.
Implementation of bottom padding in overflow content differs across browsers. See https://github.com/w3c/csswg-drafts/issues/129. To make bottom spacing consistent across browsers there's the need for an alternate CSS method.
- uses a CSS `after` pseudo element or simply a bottom margin to reserve some bottom spacing
- removes a couple leftovers from [40428]
- fixes an annoying visual glitch where the media modal content is visible behind the bottom toolbar border

Props sabernhardt, afercia.
See #40152.
Fixes #48378.


git-svn-id: https://develop.svn.wordpress.org/trunk@47266 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-11 16:30:13 +00:00
K. Adam White b6dcb779ed REST API: Introduce rest_{$this->post_type}_item_schema filter to enable manipulation of schema values.
register_rest_field can be used to add properties to a schema, but no mechanism existed to alter existing properties like "content".
Running the schema through this filter lets plugins append additional sub-properties to existing schema definitions.

Props luisherranz, TimothyBlynJacobs, swissspidy, westonruter, kadamwhite.
Fixes #47779.



git-svn-id: https://develop.svn.wordpress.org/trunk@47265 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-11 16:26:56 +00:00
K. Adam White 886a02686b REST API: Allow meta to be set when creating a new media record via REST.
Props TimothyBlynJacobs, apermo.
Fixes #44567.


git-svn-id: https://develop.svn.wordpress.org/trunk@47261 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-11 03:37:17 +00:00
K. Adam White fc434a0c77 REST API: Match REST API routes on namespace before performing regex checks.
Rule out groups of API endpoints by simple namespace string comparison to reduce the number of regex checks necessary when matching a route.

Props TimothyBlynJacobs.
Fixes #48530.


git-svn-id: https://develop.svn.wordpress.org/trunk@47260 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-11 03:20:05 +00:00
azaozz 3125c21cc4 Media: Improve wording for error message on failed post-processing of uploaded images.
Props eclev91, desrosj, antpb, azaozz.
Fixes #49280.

git-svn-id: https://develop.svn.wordpress.org/trunk@47259 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-11 03:18:02 +00:00
K. Adam White d06637f9b5 REST API: List all core theme feature support details in /themes endpoint response.
Fully list which first-party core theme features are supported in the /themes endpoint response. This brings the REST API themes controller's response more in line with the output of get_theme_support().

Props adamboro, apieschel, koke, spacedmonkey, TimothyBlynJacobs.
See #49037.


git-svn-id: https://develop.svn.wordpress.org/trunk@47258 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-11 01:58:08 +00:00
Jorge Costa f558f5ff37 Block Editor: Update WordPress Packages; Remove navigation block; Add social links block
The following package versions were changed:
@wordpress/annotations: 1.11.0 -> 1.12.0
@wordpress/api-fetch: 3.10.0 -> 3.11.0
@wordpress/block-directory: 1.4.0 -> 1.5.0
@wordpress/block-editor: 3.6.0 -> 3.7.0
@wordpress/block-library: 2.13.0 -> 2.14.0
@wordpress/blocks: 6.11.0 -> 6.12.0
@wordpress/components: 9.1.0 -> 9.2.0
@wordpress/core-data: 2.11.0 -> 2.12.0
@wordpress/data: 4.13.0 -> 4.14.0
@wordpress/data-controls: 1.7.0 -> 1.8.0
@wordpress/e2e-test-utils: 4.2.0 -> 4.3.0
@wordpress/edit-post: 3.12.0 -> 3.13.0
@wordpress/editor: 9.11.0 -> 9.12.0
@wordpress/format-library: 1.13.0 -> 1.14.0
@wordpress/icons: 1.0.0 -> 1.1.0
@wordpress/keyboard-shortcuts: 1.0.0 -> 1.1.0
@wordpress/list-reusable-blocks: 1.12.0 -> 1.13.0
@wordpress/media-utils: 1.6.0 -> 1.7.0
@wordpress/notices: 1.12.0 -> 2.0.0
@wordpress/nux: 3.11.0 -> 3.12.0
@wordpress/plugins: 2.11.0 -> 2.12.0
@wordpress/primitives: 1.0.0 -> 1.1.0
@wordpress/rich-text: 3.11.0 -> 3.12.0
@wordpress/server-side-render: 1.7.0 -> 1.8.0
@wordpress/url: 2.10.0 -> 2.11.0
@wordpress/viewport: 2.12.0 -> 2.13.0
The navigation block inclusion was reverted.
The social links block was included.

Props gziolo, youknowriad, mcsf, noisysocks.
Fixes #49397.

git-svn-id: https://develop.svn.wordpress.org/trunk@47250 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-10 22:31:13 +00:00
Sergey Biryukov de5d82fe52 Docs: Improve documentation for the `$attr` parameter of `wp_get_attachment_image()`.
Props juanfra, Mte90, DrewAPicture, joemcgill, SergeyBiryukov.
Fixes #36661.

git-svn-id: https://develop.svn.wordpress.org/trunk@47249 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-10 22:01:49 +00:00
Sergey Biryukov c0c2fd3f63 Privacy: Rename `wp_get_user_request_data()` to `wp_get_user_request()` for clarity; deprecate the old function.
The function returns an instance of the `WP_User_Request` object itself, not its `$request_data` property.

Follow-up to [44606].

Props garrett-eclipse.
Fixes #46302.

git-svn-id: https://develop.svn.wordpress.org/trunk@47245 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-10 19:55:51 +00:00
Timothy Jacobs e7399111b4 REST API: Add support for the REDIRECT_HTTP_AUTHORIZATION header.
Previously the REST API did not account for server configurations where the Authorization header must be added using ModRewrite. This caused major DUX issues when trying to use custom authentication mechanisms.

Fixes #47077.
Props dshanske, cklosows.


git-svn-id: https://develop.svn.wordpress.org/trunk@47239 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-10 16:06:58 +00:00
Andrew Duthie 2c795289c8 Script Loader: Add polyfill for window.URL, window.DOMRect.
Pending block editor revisions for WordPress 5.4 will make use of `window.URL` and `window.DOMRect`. These are not available in Internet Explorer (or pre-Chromium Edge for `DOMRect`) and must be polyfilled to avoid script errors.

The changes make use of the existing polyfill pattern, and existing `polyfill-library` dependency. The dependency is bumped to the latest version, since the previous version did not include the `DOMRect` polyfill.

Props jorgefilipecosta.
Fixes #49360.


git-svn-id: https://develop.svn.wordpress.org/trunk@47238 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-10 15:15:07 +00:00
Sergey Biryukov 5b0be97e7c Privacy: Include session tokens in Personal Data Export.
Session tokens contain an IP address and user agent.

Props garrett-eclipse, nickylimjj, lakenh, xkon, rconde.
Fixes #45889.

git-svn-id: https://develop.svn.wordpress.org/trunk@47237 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-10 05:42:52 +00:00
Sergey Biryukov 8fef1b28a9 Privacy: Include `community-events-location` user meta value in Personal Data Export.
The value is used by the WordPress Events and News widget to show relevant WP community events.

The location information may include an IP address, location description, and latitude/longitude coordinates.

Props garrett-eclipse, coreymckrill, xkon.
Fixes #43921.

git-svn-id: https://develop.svn.wordpress.org/trunk@47236 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-10 05:30:03 +00:00
Sergey Biryukov 023d4b2796 Administration: Capitalize `Trash` consistently in various messages and comments.
When used as a noun referring to the "virtual" place, `Trash` should be capitalized.

Props garrett-eclipse, aandrewdixon, Presskopp.
Fixes #45317.

git-svn-id: https://develop.svn.wordpress.org/trunk@47233 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-10 04:10:09 +00:00
Sergey Biryukov c80af9030d Docs: Add descriptions for some globals:
* `$wp_version`
* `$wp_local_package`
* `$required_php_version`
* `$required_mysql_version`

See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47230 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-10 03:28:20 +00:00
Timothy Jacobs 98e5dd52de REST API: Introduce selective link embedding.
Previously the _embed flag would embed all embeddable links in a response even if only a subset of the links were necessary. Now, a list of link relations can be passed in the _embed parameter to restrict the list of embedded objects.

Props rheinardkorf, adamsilverstein, jnylen0, cklosows, chrisvanpatten, TimothyBlynJacobs.
Fixes #39696.


git-svn-id: https://develop.svn.wordpress.org/trunk@47224 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-09 20:52:06 +00:00
Aaron Jorbin c647007a82 General: Fix HTML for get_calendar()
The <tfoot> element was allowed to precede the <tbody> element in HTML 5. However, that was changed in HTML 5.1 and <tfoot> must now follow <tbody>.

This removes the tfooot and instead uses a nav element for navigation between months.

Fixes: #39763
Props: isabel_brison, Harry Milatz, audrasjb, abhijitrakas, SergeyBiryukov


git-svn-id: https://develop.svn.wordpress.org/trunk@47223 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-09 20:42:26 +00:00
Joe Dolson 3fb063f705 Toolbar: Load toolbar in `wp_body_open` when available.
For accessibility, the visual appearance and source order should match. Moving the toolbar to load in the new hook `wp_body_open` (5.2) fixes a long-standing source order problem.

Props jankimoradiya, afercia, SergeyBiryukov, audrasjb, ocean90, xkon, dinhtungdu.
Fixes #47053.


git-svn-id: https://develop.svn.wordpress.org/trunk@47221 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-09 18:24:41 +00:00
Sergey Biryukov 130751cda3 Coding Standards: Use Yoda conditions where appropriate.
See #49222.

git-svn-id: https://develop.svn.wordpress.org/trunk@47219 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-09 16:52:28 +00:00
Sergey Biryukov 734bf726d7 Embeds: Add support for TikTok.
Props audrasjb, jblz, peterwilsoncc, felipeloureirosantos.
Fixes #49083.

git-svn-id: https://develop.svn.wordpress.org/trunk@47216 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-09 04:53:29 +00:00
Sergey Biryukov 1f8531c753 Menus: When adding a label for special pages in `wp_setup_nav_menu_item()`, check if `get_post_states()` is available, to avoid fatal errors on front end.
Fixes #49374.

git-svn-id: https://develop.svn.wordpress.org/trunk@47213 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-08 12:47:33 +00:00
Sergey Biryukov 2aecc8f3e6 Tests: Add a basic test for `wp()` function.
Props pbearne, donmhico.
Fixes #48844.

git-svn-id: https://develop.svn.wordpress.org/trunk@47212 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-08 05:29:54 +00:00
Sergey Biryukov 11eb80e59e Menus: Use `get_post_states()` to denote special pages on the added menu item accordions.
Front Page, Posts Page, or Privacy Policy Page should now be marked as such on the added menu items.

Props garrett-eclipse.
Fixes #49374.

git-svn-id: https://develop.svn.wordpress.org/trunk@47211 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-07 23:44:22 +00:00
Sergey Biryukov dce15b92d0 Docs: Improve description for the `$editor_id` parameter of `wp_editor()` and `_WP_Editors::editor()`.
The restictions mentioned for the parameter value should be consistenct.

Props pbiron, SergeyBiryukov.
Fixes #49384.

git-svn-id: https://develop.svn.wordpress.org/trunk@47210 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-07 23:28:22 +00:00
Sergey Biryukov f8b2ff1b53 Coding Standards: Adjust coding standards to always omit parentheses for `include`/`require` statements.
These are language constructs, not function calls, so the parentheses are unnecessary.

This updates the PHPCS configuration file the enforce the sniff until it is moved from the `WordPress-Extra` ruleset to the `WordPress-Core` ruleset upstream.

Follow-up to [47198].

Props desrosj, jrf, GaryJ.
Fixes #49376.

git-svn-id: https://develop.svn.wordpress.org/trunk@47207 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-07 19:14:29 +00:00
John Blackbourn c7caac7289 Taxonomy: Clarify the docs for the return values of the `term_exists()` function.
Props dotancohen, sathyapulse

Fixes #43345

git-svn-id: https://develop.svn.wordpress.org/trunk@47205 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-07 17:46:51 +00:00
John Blackbourn 1feff0de47 Script Loader: Fix a docblock so it points to the correct page on the developer reference.
Props joyously, pbiron

Fixes #48503

git-svn-id: https://develop.svn.wordpress.org/trunk@47204 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-07 17:40:29 +00:00
John Blackbourn 7efcf03d94 Posts, Post Types: Introduce a filter which allows the addition of `__trashed` suffixes on post slugs to be skipped.
Fixes #46433

git-svn-id: https://develop.svn.wordpress.org/trunk@47203 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-07 17:31:52 +00:00
Andrew Ozz 112649ea92 Media: Add link to the original image in the image properties if it was scaled or rotated after uploading.
Fixes #49290.

git-svn-id: https://develop.svn.wordpress.org/trunk@47202 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-07 05:11:45 +00:00
Jorge Costa 8640eaa96e Block Editor: Update WordPress Packages.
The following package versions were changed:
@wordpress/a11y: 2.6.0 -> 2.7.0
@wordpress/annotations: 1.10.0 -> 1.11.0
@wordpress/api-fetch: 3.9.0 -> 3.10.0
@wordpress/autop: 2.5.1 -> 2.6.0
@wordpress/blob: 2.6.0 -> 2.7.0
@wordpress/block-directory: 1.3.0 -> 1.4.0
@wordpress/block-editor: 3.5.0 -> 3.6.0
@wordpress/block-library: 2.12.0 -> 2.13.0
@wordpress/block-serialization-default-parser: 3.4.1 -> 3.5.0
@wordpress/blocks: 6.10.0 -> 6.11.0
@wordpress/components: 9.0.0 -> 9.1.0
@wordpress/compose: 3.10.0 -> 3.11.0
@wordpress/core-data: 2.10.0 -> 2.11.0
@wordpress/custom-templated-path-webpack-plugin: 1.5.0 -> 1.6.0
@wordpress/data: 4.12.0 -> 4.13.0
@wordpress/data-controls: 1.6.0 -> 1.7.0
@wordpress/date: 3.7.0 -> 3.8.0
@wordpress/dependency-extraction-webpack-plugin: 2.1.0 -> 2.2.0
@wordpress/deprecated: 2.6.1 -> 2.7.0
@wordpress/dom: 2.7.0 -> 2.8.0
@wordpress/dom-ready: 2.6.0 -> 2.7.0
@wordpress/e2e-test-utils: 4.1.0 -> 4.2.0
@wordpress/edit-post: 3.11.0 -> 3.12.0
@wordpress/editor: 9.10.0 -> 9.11.0
@wordpress/element: 2.10.0 -> 2.11.0
@wordpress/escape-html: 1.6.0 -> 1.7.0
@wordpress/format-library: 1.12.0 -> 1.13.0
@wordpress/hooks: 2.6.0 -> 2.7.0
@wordpress/html-entities: 2.5.0 -> 2.6.0
@wordpress/i18n: 3.8.0 -> 3.9.0
@wordpress/is-shallow-equal: 1.7.0 -> 1.8.0
@wordpress/keyboard-shortcuts: 0.2.0 -> 1.0.0
@wordpress/keycodes: 2.8.0 -> 2.9.0
@wordpress/library-export-default-webpack-plugin: 1.5.0 -> 1.6.0
@wordpress/list-reusable-blocks: 1.11.0 -> 1.12.0
@wordpress/media-utils: 1.5.0 -> 1.6.0
@wordpress/notices: 1.11.0 -> 1.12.0
@wordpress/nux: 3.10.0 -> 3.11.0
@wordpress/plugins: 2.10.0 -> 2.11.0
@wordpress/priority-queue: 1.4.0 -> 1.5.0
@wordpress/redux-routine: 3.6.2 -> 3.7.0
@wordpress/rich-text: 3.10.0 -> 3.11.0
@wordpress/scripts: 6.2.0 -> 7.0.0
@wordpress/server-side-render: 1.6.0 -> 1.7.0
@wordpress/shortcode: 2.5.0 -> 2.6.0
@wordpress/token-list: 1.8.0 -> 1.9.0
@wordpress/url: 2.9.0 -> 2.10.0
@wordpress/viewport: 2.11.0 -> 2.12.0
@wordpress/wordcount: 2.6.2 -> 2.7.0
Added these new packages:
@wordpress/warning
@wordpress/primitives
@wordpress/icons
Re-added keyboard-shortcuts to script loader removed by mistake on revision 47198.

Props gziolo, itsjonq, youknowriad, mcsf, andraganescu.
Fixes #49358.

git-svn-id: https://develop.svn.wordpress.org/trunk@47199 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-06 21:01:16 +00:00
Sergey Biryukov e72fff9cef Code Modernization: Replace `dirname( __FILE__ )` calls with `__DIR__` magic constant.
This avoids the performance overhead of the function call every time `dirname( __FILE__ )` was used instead of `__DIR__`.

This commit also includes:

* Removing unnecessary parentheses from `include`/`require` statements. These are language constructs, not function calls.
* Replacing `include` statements for several files with `require_once`, for consistency:
 * `wp-admin/admin-header.php`
 * `wp-admin/admin-footer.php`
 * `wp-includes/version.php`

Props ayeshrajans, desrosj, valentinbora, jrf, joostdevalk, netweb.
Fixes #48082.

git-svn-id: https://develop.svn.wordpress.org/trunk@47198 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-06 06:31:22 +00:00
Sergey Biryukov b02e49c2e8 Coding Standards: Move `WP_Object_Cache` to `wp-includes/class-wp-object-cache.php`.
This ensures the file containing the `WP_Object_Cache` class conforms to the coding standards.

For backward compatibility, the new file is included from `wp-includes/cache.php`.

Fixes #49373. See #49222.

git-svn-id: https://develop.svn.wordpress.org/trunk@47197 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-06 05:51:58 +00:00
Sergey Biryukov 011962fae0 Posts, Post Types: Add default `menu_icon` values for built-in post types.
This allows the icons to be retrieved via `get_post_type_object()`.

Props m.usama.masood, michael.ecklund, SergeyBiryukov.
Fixes #38844.

git-svn-id: https://develop.svn.wordpress.org/trunk@47196 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-05 22:38:11 +00:00
Sergey Biryukov 3d43f46907 Posts, Post Types: Change "Featured Image" post label to use sentence case: "Featured image".
This makes it more consistent with other UI elements in the block editor.

Props mcsf.
Fixes #49371.

git-svn-id: https://develop.svn.wordpress.org/trunk@47194 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-05 19:07:33 +00:00
Sergey Biryukov 658ff7a581 Docs: Add a `@since` note for [47186].
See #48558.

git-svn-id: https://develop.svn.wordpress.org/trunk@47187 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-05 06:31:05 +00:00
Sergey Biryukov e4d8eac50f Taxonomy: In `register_taxonomy()`, return the registered taxonomy object on success, for consistency with `register_post_type()`.
Props krynes, SergeyBiryukov.
Fixes #48558.

git-svn-id: https://develop.svn.wordpress.org/trunk@47186 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-05 06:24:16 +00:00
Sergey Biryukov 1fa5058ef3 Docs: Clarify that `is_page_template()` accepts a template filename, not the `Template Name` file header.
Props mkaz.
Fixes #49362.

git-svn-id: https://develop.svn.wordpress.org/trunk@47182 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-05 03:12:14 +00:00
Sergey Biryukov 5e8563eb6b Posts, Post Types: Fail gracefully when checking whether a single post with an unregistered post status should be displayed in `WP_Query::get_posts()`.
If the post status is not registered, assume it's not public, but still allow access to users with edit permissions (same as for a protected post status, e.g. `draft`), so that they could recover orphaned content.

Add unit tests.

Follow-up to [47178].

Props roytanck, SergeyBiryukov.
Fixes #48653.

git-svn-id: https://develop.svn.wordpress.org/trunk@47181 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-05 01:31:38 +00:00
Sergey Biryukov 5ada288488 Posts, Post Types: Revert [47179] pending test failures investigation.
See #48653.

git-svn-id: https://develop.svn.wordpress.org/trunk@47180 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-04 23:00:53 +00:00
Sergey Biryukov 9e5c22aa09 Posts, Post Types: Fail gracefully when checking whether the post should be displayed in `WP_Query::get_posts()` against unregistered post status.
If the post status is not registered, assume it's not public.

Follow-up to [47178].

Props roytanck.
See #48653.

git-svn-id: https://develop.svn.wordpress.org/trunk@47179 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-04 22:20:25 +00:00
Sergey Biryukov 6f15251aa4 Posts, Post Types: Fail gracefully when checking mapped cap against unregistered post status.
With `map_meta_cap` enabled for a post type, the `read_post` capability for posts with a public status is supposed to be mapped to the post type's `read` capability.

When a post is left in the database after the post status is no longer present, and WP does a `read_post` check against it, a PHP notice was thrown, and the cap check always failed.

As a more graceful fallback, the cap is now mapped onto `edit_others_posts`, which allows highly privileged users to be able to access orphaned content.

A `_doing_it_wrong()` notice is also added, so that developers and site administrators are aware that the cap mapping is failing in the absence of the registered post status.

Follow-up to [34091], which introduced a similar approach to checking mapped caps against an unregistered post type.

Props roytanck, SergeyBiryukov.
Fixes #48653.

git-svn-id: https://develop.svn.wordpress.org/trunk@47178 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-04 22:13:15 +00:00
Sergey Biryukov 0bfacbe3b2 Coding Standards: Fix WPCS issues in [47175].
See #49361.

git-svn-id: https://develop.svn.wordpress.org/trunk@47177 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-04 21:40:27 +00:00
Jorge Costa 4bcf9be615 Block Editor: Include navigation block server logic.
Core did not include the navigation block PHP files.
This commit fixes the issue referred, and now the navigation block is executed on the frontend. The block still does not work as expected and throws an error during frontend execution. That problem is going to be fixed on the next WordPress package update.
This commit adds the file as it is on the npm package used.

Props gziolo.
Fixes #49348.

git-svn-id: https://develop.svn.wordpress.org/trunk@47176 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-04 20:14:50 +00:00
Sergey Biryukov 664e5a7568 Users: Pass the `$reassign` parameter to the `remove_user_from_blog` action.
Props Tivus.
Fixes #49361.

git-svn-id: https://develop.svn.wordpress.org/trunk@47175 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-04 19:41:41 +00:00
Sergey Biryukov 8f3f181c4e Docs: Improve description for `add_user_to_blog()` and `remove_user_from_blog()` parameters.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47174 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-04 19:38:12 +00:00
Sergey Biryukov 2c8da49588 Users: In `remove_user_from_blog()`:
* Change default value of the `$blog_id` parameter to match the documented type.
* Change the type of the `$reassign` parameter for consistency with `$user_id` and `$blog_id`.
* Add documentation for the return value.

See #49361.

git-svn-id: https://develop.svn.wordpress.org/trunk@47173 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-04 19:34:27 +00:00
Sergey Biryukov b26b0ccf8c Database: Add `ANSI` to the list of incompatible SQL modes.
Starting with MySQL 5.7.5, the `ANSI` mode implies `ONLY_FULL_GROUP_BY`, which is already listed in `wpdb` as incompatible per [27072].

When `ANSI` is enabled on MySQL 5.7.5+, `ONLY_FULL_GROUP_BY` remains enabled even after being "unset" by `wpdb::set_sql_mode()`.

To prevent this, the `ANSI` mode should also be listed as incompatible. It is not enabled on default MySQL installations.

Props jnylen0.
Fixes #48377.

git-svn-id: https://develop.svn.wordpress.org/trunk@47171 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-04 01:12:53 +00:00
Sergey Biryukov ec83cd08eb Docs: Improve documentation for `WP_Dependencies`, `WP_Scripts`, and `WP_Styles` methods.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47170 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-03 00:17:38 +00:00
Sergey Biryukov dd48b7f757 Canonical: When removing trailing punctuation from query string arguments, match the whole query var name.
Props daveslaughter.
Fixes #49347.

git-svn-id: https://develop.svn.wordpress.org/trunk@47169 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-03 00:12:22 +00:00
Sergey Biryukov 78029013d8 REST API: Merge "not allowed to create new terms" permission error message with an existing string.
Follow-up to [39309], [39313].

See #38857.

git-svn-id: https://develop.svn.wordpress.org/trunk@47166 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-02 05:39:29 +00:00
Sergey Biryukov 4e6674c48c Docs: Fix typo in a comment with `WP_DEBUG_DISPLAY` description.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47165 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-02 05:32:35 +00:00
Sergey Biryukov 706daca6a3 Editor: Remove back-compat stub for Classic Editor's old distraction-free writing mode.
The original script was deprecated in [30338] and removed in [32677].

Props Presskopp, ketuchetan.
Fixes #39448.

git-svn-id: https://develop.svn.wordpress.org/trunk@47164 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-02 04:13:25 +00:00
Sergey Biryukov 73e75195eb Docs: Add more specific description for `WP_Http::processResponse()` return value.
Props marekdedic, takeshifurusato.
Fixes #48351.

git-svn-id: https://develop.svn.wordpress.org/trunk@47161 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-02 03:25:57 +00:00
Sergey Biryukov fd3083e3f5 Post Thumbnails: Make sure `get_post_thumbnail_id()` returns an integer, to match the documented return value.
This makes the function more consistent with `get_the_ID()` or `wp_get_post_parent_id()`, both returning an integer.

Props 0v3rth3d4wn.
Fixes #40096.

git-svn-id: https://develop.svn.wordpress.org/trunk@47160 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-02 03:06:31 +00:00
Sergey Biryukov 5e11891a05 Docs: Correct DocBlock formatting for `register_setting()`.
Document the full list of whitelisted option key names.

See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47157 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-01 21:59:14 +00:00
Sergey Biryukov 54c6311c96 Accessibility: Text Changes: Use sentence case for the word `Error` in various error messages, instead of all caps.
Using all caps should be avoided for better readability and because screen readers may pronounce all-caps words as abbreviations.

Props afercia, ryokuhi, sabernhardt, garrett-eclipse.
See #47656, #43037, #42945.

git-svn-id: https://develop.svn.wordpress.org/trunk@47156 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-01 21:36:44 +00:00
Sergey Biryukov b3da2c99a1 Text Changes: Capitalize error messages consistently.
Props Presskopp.
Fixes #42945.

git-svn-id: https://develop.svn.wordpress.org/trunk@47154 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-01 20:53:14 +00:00
Sergey Biryukov db8a038541 Text Changes: Add missing periods to some error messages, for consistency.
Props Presskopp.
Fixes #42735.

git-svn-id: https://develop.svn.wordpress.org/trunk@47153 602fd350-edb4-49c9-b593-d223f7449a82
2020-02-01 20:30:20 +00:00
Sergey Biryukov 13a9ab716e Site Health: Add support for required WordPress and PHP versions to themes.
Follow-up to [45546] for plugins.

Props flixos90, afragen.
Fixes #44592. See #40934, #meta3718.

git-svn-id: https://develop.svn.wordpress.org/trunk@47145 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-31 01:15:32 +00:00
K. Adam White 547a08ee03 REST API: Reuse previously-generated embedded objects when building collection response.
Store each generated embedded object in a temporary cache when querying for linked resources so that repeated links to the same resource do not trigger repeated queries or processing.

Props TimothyBlynJacobs.
Fixes #48838.



git-svn-id: https://develop.svn.wordpress.org/trunk@47138 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-30 20:20:30 +00:00
Sergey Biryukov a271f98952 Themes: Replace `&mdash;` with `&ndash;` as a separator between Monday and Friday in theme starter content.
The `ndash` standardly is the "through" indicator for showing inclusive dates and numbers, while the `mdash` is an interruptor and used as an aside.

Props mikejdent, garrett-eclipse.
Fixes #48286.

git-svn-id: https://develop.svn.wordpress.org/trunk@47134 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-30 19:15:19 +00:00
Sergey Biryukov cfc3b57488 Docs: Improve inline comments per the documentation standards.
Includes minor code layout fixes for better readability.

See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47122 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-29 00:43:23 +00:00
Sergey Biryukov d5e20d8ab5 Comments: Add `In reply to: %s` parent comment link to new comment email notifications.
This information was previously available on the Moderate Comment screen in the admin, but was missing from moderation emails.

Props imath, danieltj, andraganescu, galbaras, SergeyBiryukov.
Fixes #43805. See #43429.

git-svn-id: https://develop.svn.wordpress.org/trunk@47114 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-27 04:31:48 +00:00
Sergey Biryukov ffb9ef6d52 Comments: Add `In reply to %s.` prefix to child comments in comments feed.
The prefix includes a link to the parent comment and the name of its author.

Props zodiac1978, imath, SergeyBiryukov.
Fixes #43429.

git-svn-id: https://develop.svn.wordpress.org/trunk@47111 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-26 22:27:08 +00:00
Sergey Biryukov 8e6c884e87 Docs: Improve documentation for `add_user_to_blog()`, `add_existing_user_to_blog()`, and `add_new_user_to_blog()`.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47109 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-24 17:18:37 +00:00
Andrea Fercia 67f246b9b0 Toolbar: Remove leftover `@since` notations after [46678].
See #19647.


git-svn-id: https://develop.svn.wordpress.org/trunk@47108 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-23 12:57:41 +00:00
Sergey Biryukov e7303345ae Cache API: Remove `WP_Object_Cache::__destruct()` and `wpdb::__destruct()`.
Originally added in [4686], these constructor/destructor pairings were designed to prevent the objects from being destroyed before shutdown, when output buffers are flushed.

A deeper investigation reveals that this approach didn't quite work as expected and was later made redundant by introducing `wp_ob_end_flush_all()` in [5462].

Props wonderboymusic, nacin, Mte90, SergeyBiryukov.
Fixes #21402.

git-svn-id: https://develop.svn.wordpress.org/trunk@47107 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-23 00:25:38 +00:00
Jorge Costa 1c006d724b Block Editor: Update WordPress Packages.
The following package versions were changed:
@wordpress/a11y: 2.5.1 -> 2.6.0
@wordpress/annotations: 1.9.0 -> 1.10.0
@wordpress/api-fetch: 3.8.0 -> 3.9.0
@wordpress/blob: 2.5.1 -> 2.6.0
@wordpress/block-directory: 1.2.0 -> 1.3.0
@wordpress/block-editor: 3.4.0 -> 3.5.0
@wordpress/block-library: 2.11.0 -> 2.12.0
@wordpress/blocks: 6.9.0 -> 6.10.0
@wordpress/components: 8.5.0 -> 9.0.0
@wordpress/compose: 3.9.0 -> 3.10.0
@wordpress/core-data: 2.9.0 -> 2.10.0
@wordpress/data: 4.11.0 -> 4.12.0
@wordpress/data-controls: 1.5.0 -> 1.6.0
@wordpress/dom: 2.6.0 -> 2.7.0
@wordpress/dom-ready: 2.5.1 -> 2.6.0
@wordpress/e2e-test-utils: 4.0.0 -> 4.1.0
@wordpress/edit-post: 3.10.0 -> 3.11.0
@wordpress/editor: 9.9.0 -> 9.10.0
@wordpress/format-library: 1.11.0 -> 1.12.0
@wordpress/i18n: 3.7.0 -> 3.8.0
@wordpress/is-shallow-equal: 1.6.1 -> 1.7.0
@wordpress/keycodes: 2.7.0 -> 2.8.0
@wordpress/list-reusable-blocks: 1.10.0 -> 1.11.0
@wordpress/media-utils: 1.4.0 -> 1.5.0
@wordpress/notices: 1.10.0 -> 1.11.0
@wordpress/nux: 3.9.0 -> 3.10.0
@wordpress/plugins: 2.9.0 -> 2.10.0
@wordpress/priority-queue: 1.3.1 -> 1.4.0
@wordpress/rich-text: 3.9.0 -> 3.10.0
@wordpress/scripts: 6.1.1 -> 6.2.0
@wordpress/server-side-render: 1.5.0 -> 1.6.0
@wordpress/viewport: 2.10.0 -> 2.11.0
The following package was added:
@wordpress/keyboard-shortcuts

Props gziolo.
Fixes #49204.

git-svn-id: https://develop.svn.wordpress.org/trunk@47106 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-22 22:04:35 +00:00
Ian Dunn 05a2cd6f71 Multisite: Add `$context` parameter to `switch_blog` action.
The action is fired by both `switch_to_blog()` and `restore_current_blog()`, and previously it was difficult for callback functions to determine which function had fired it.

Props SergeyBiryukov, johnbillion, jeremyfelt.
Fixes #49265.


git-svn-id: https://develop.svn.wordpress.org/trunk@47105 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-22 20:51:26 +00:00
Sergey Biryukov e1348046ac Docs: Expand `@return` value description for `wp_loginout()`, `wp_register()`, `get_calendar()`.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47104 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-22 00:55:13 +00:00
Sergey Biryukov dbe67c4586 Docs: Expand `@return` description for `the_terms()`.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47103 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-22 00:39:32 +00:00
Sergey Biryukov 5db9ef75c9 Docs: Adjust documentation for some `pre_*` filters for consistency.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47101 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-22 00:23:09 +00:00
Sergey Biryukov af39b30e28 Date/Time: In `wp_maybe_decline_date()`, add support for a range of days, e.g. `February 21–23`.
A potential use case is displaying multi-day events in the WordPress Events and News dashboard widget.

See #47798, #48934.

git-svn-id: https://develop.svn.wordpress.org/trunk@47098 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-21 23:46:36 +00:00
Sergey Biryukov 1bf8b94129 Docs: Expand `@return` value description for `wp_nav_menu()`.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47097 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-21 20:11:11 +00:00
Sergey Biryukov 79391187c9 Docs: Correct DocBlock formatting for filters accepting the `$parsed_args` parameter.
Follow-up to [45667].

See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47096 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-21 15:39:17 +00:00
Sergey Biryukov 8753725a3d I18N: Merge duplicate "you must be logged in to comment" strings.
Props ramiy.
Fixes #49251.

git-svn-id: https://develop.svn.wordpress.org/trunk@47095 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-21 14:51:00 +00:00
Sergey Biryukov ad2261bfdd I18N: Synchronize MediaElement.js translation strings with the currently bundled version.
Some strings were previously removed in [43345] and accidentally reintroduced in [44163].

Props ramiy.
Fixes #49249. See #42139, #37453.

git-svn-id: https://develop.svn.wordpress.org/trunk@47094 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-21 02:19:04 +00:00
Sergey Biryukov 26f27a24d8 I18N: Merge duplicate `%1$s is not of type %2$s` strings in `rest_validate_value_from_schema()`.
Props ramiy.
Fixes #49244.

git-svn-id: https://develop.svn.wordpress.org/trunk@47091 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-20 14:42:12 +00:00
Sergey Biryukov 8738b08b2e I18N: Remove unnecessary HTML from "Active:" strings in `wp-admin/themes.php`.
Follow-up to [45435].

Props ramiy.
Fixes #49243.

git-svn-id: https://develop.svn.wordpress.org/trunk@47090 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-20 14:25:13 +00:00
Sergey Biryukov a8f4ed69de Docs: Update links to https://secure.php.net/, they now redirect to https://www.php.net/.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47088 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-20 03:12:12 +00:00
Sergey Biryukov 88836de35c Docs: Correct description for `shortcode_atts_{$shortcode}` filter.
Props glebkema.
Fixes #49225.

git-svn-id: https://develop.svn.wordpress.org/trunk@47087 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-19 13:39:21 +00:00
Sergey Biryukov 480b5c88c3 Mail: Remove angle brackets from password reset URL in emails sent by `retrieve_password()` and `wp_new_user_notification()`.
The brackets were originally added in [16285] per W3C recommendation in https://www.w3.org/Addressing/URL/5.1_Wrappers.html to avoid wrapping the URL across multiple lines in plain text in older email clients.

This doesn't seem like a common issue in modern email clients, and the current implementation causes more issues than it solves. Since the URL is on a line by itself, it should not require any delimiters.

The URL in recovery mode email introduced in [44973] doesn't have angle brackets, so it's time to retire them in password reset email too if they're not used consistently.

Props donmhico, Otto42, sproutchris, iandunn, dd32, DaveWP196, sebastian.pisula, tommix, sablednah, julian.kimmig, Rahe, clayisland, arenddeboer, nicole2292, nagoke, squarecandy, eatingrules, SergeyBiryukov.
Fixes #21095, #23578, #44589.

git-svn-id: https://develop.svn.wordpress.org/trunk@47086 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-18 02:30:24 +00:00
Sergey Biryukov 5bef137806 Date/Time: Pass the date format to `wp_maybe_decline_date()`.
This ensures that the function has enough context to determine the necessity of replacing the month name with the correct form in locales that require it.

Props SergeyBiryukov, Rarst.
Fixes #48934.

git-svn-id: https://develop.svn.wordpress.org/trunk@47078 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-17 01:10:57 +00:00
Sergey Biryukov 5ee2e239dc Cron API: Use `WEEK_IN_SECONDS` constant for the `weekly` schedule added in [47062].
Props afercia.
See #47606.

git-svn-id: https://develop.svn.wordpress.org/trunk@47068 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-13 17:03:39 +00:00
Sergey Biryukov 14376be6e1 Docs: Correct description for `show_in_admin_all_list` and `show_in_admin_status_list` arguments of `register_post_status()`.
Props audrasjb.
Fixes #49180.

git-svn-id: https://develop.svn.wordpress.org/trunk@47066 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-13 00:48:27 +00:00
Sergey Biryukov 5eaf1605e8 Cron API: Add a new cron schedule for `weekly` events.
Props Clorith.
See #47606.

git-svn-id: https://develop.svn.wordpress.org/trunk@47062 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-12 11:18:03 +00:00
Sergey Biryukov 4c2ee4e9ff Docs: In various `@return` tags, list the expected type first, instead of `false`.
Follow-up to [46696].

See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47060 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-11 18:30:58 +00:00
Sergey Biryukov 32ccb24cb0 Docs: Remove `@return void` from widget DocBlocks.
Per the documentation standards, it should not be used outside of the default bundled themes.

See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47055 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-10 00:28:10 +00:00
Sergey Biryukov 90db6f5941 Docs: Correct alphabetic order of parameters in `WP_Query::parse_query()` DocBlock.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47052 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-08 12:08:49 +00:00
Jorge Costa e02ebc183b Block Editor: Update WordPress Packages.
Updated packages:
@wordpress/annotations: 1.7.2 -> 1.9.0
@wordpress/api-fetch: 3.6.4 -> 3.8.0
@wordpress/block-directory: 1.0.5 -> 1.2.0
@wordpress/block-editor: 3.2.5 -> 3.4.0
@wordpress/block-library: 2.9.6 -> 2.11.0
@wordpress/blocks: 6.7.2 -> 6.9.0
@wordpress/components: 8.3.2 -> 8.5.0
@wordpress/compose: 3.7.2 -> 3.9.0
@wordpress/core-data: 2.7.5 -> 2.9.0
@wordpress/data: 4.9.2 -> 4.11.0
@wordpress/data-controls: 1.3.4 -> 1.5.0
@wordpress/date: 3.5.0 -> 3.7.0
@wordpress/dom: 2.5.2 -> 2.6.0
@wordpress/e2e-test-utils: 3.0.0 -> 4.0.0
@wordpress/edit-post: 3.8.6 -> 3.10.0
@wordpress/editor: 9.7.6 -> 9.9.0
@wordpress/element: 2.8.2 -> 2.10.0
@wordpress/escape-html: 1.5.1 -> 1.6.0
@wordpress/format-library: 1.9.5 -> 1.11.0
@wordpress/i18n: 3.6.1 -> 3.7.0
@wordpress/keycodes: 2.6.2 -> 2.7.0
@wordpress/list-reusable-blocks: 1.8.4 -> 1.10.0
@wordpress/media-utils: 1.2.4 -> 1.4.0
@wordpress/notices: 1.8.2 -> 1.10.0
@wordpress/nux: 3.7.2 -> 3.9.0
@wordpress/plugins: 2.7.2 -> 2.9.0
@wordpress/rich-text: 3.7.2 -> 3.9.0
@wordpress/scripts: 6.0.0 -> 6.1.1
@wordpress/server-side-render: 1.3.4 -> 1.5.0
@wordpress/shortcode: 2.4.1 -> 2.5.0
@wordpress/token-list: 1.6.1 -> 1.8.0
@wordpress/url: 2.8.2 -> 2.9.0
@wordpress/viewport: 2.8.2 -> 2.10.0

Props gziolo, youknowriad.
Fixes #49142.

git-svn-id: https://develop.svn.wordpress.org/trunk@47051 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-08 11:55:03 +00:00
Sergey Biryukov 7b0f5e5de8 Coding Standards: Use Yoda conditions in `wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php`.
Props jenilk.
Fixes #49150.

git-svn-id: https://develop.svn.wordpress.org/trunk@47050 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-08 11:30:37 +00:00
Sergey Biryukov 6bf5238ebb Docs: Indicate that `load_script_textdomain_relative_path` filter value can be `false`.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47049 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-08 00:25:04 +00:00
Grzegorz (Greg) Ziółkowski 01a3632b15 Build Tools: do not include assets for JS dependencies that do not exist.
This is a follow-up for #48154, where we started including *.asset.php files to declare package dependencies.
This works well but creates warnings in environments where the package does not exist because WordPress was not fully built.

Props jeherve, swissspidy.

Fixes #49144.



git-svn-id: https://develop.svn.wordpress.org/trunk@47048 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-07 15:26:44 +00:00
Sergey Biryukov f216d9c73a REST API: Display the actual conflicting value in addition to the taxonomy name in the `_doing_it_wrong()` message for a conflicting `rest_base` or `name` property.
Follow-up to [47037] and [47045].

Props TimothyBlynJacobs.
See #48401.

git-svn-id: https://develop.svn.wordpress.org/trunk@47046 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-06 17:07:52 +00:00
Sergey Biryukov 105375cce7 REST API: Display the taxonomy name in the `_doing_it_wrong()` message for a conflicting `rest_base` or `name` property, to match the translator comment.
Follow-up to [47037].

See #48401.

git-svn-id: https://develop.svn.wordpress.org/trunk@47045 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-06 16:45:58 +00:00
Sergey Biryukov 6cd0e35c6b I18N: Replace `rest_authentication_errors` filter name with a placeholder in a translatable string.
Follow-up to [38947] and [40038].

See #38446.

git-svn-id: https://develop.svn.wordpress.org/trunk@47044 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-06 16:19:51 +00:00
Dominik Schilling 086ae28f0e Docs: Remove duplicate inline comment in `wp_mail()`.
See [5639].
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47042 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-06 14:49:13 +00:00
Dominik Schilling 5f600eb32a Media: After [46375], enable JavaScript translations for the `media-views` script.
See #49134.

git-svn-id: https://develop.svn.wordpress.org/trunk@47040 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-05 13:09:52 +00:00
K. Adam White 746502eaa9 REST API: Issue doing_it_wrong if a taxonomy's specified rest_base is already in use by a different resource.
Props fgiannar, TimothyBlynJacobs, kingkool68, SergeyBiryukov.
Fixes #48401.



git-svn-id: https://develop.svn.wordpress.org/trunk@47037 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-03 19:22:32 +00:00
K. Adam White 172e0b01c6 REST API: Short-circuit comment controller permissions check if commented-upon post type does not exist.
Props imani3011, dragosh635, subrataemfluence, timothyblynjacobs.
Fixes #42238.



git-svn-id: https://develop.svn.wordpress.org/trunk@47036 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-03 18:42:09 +00:00
Grzegorz (Greg) Ziółkowski a35e46a937 Build Tools: Integrate DependencyExtractionWebpackPlugin in the JS build.
This patch integrates DependencyExtractionWebpackPlugin which was battle-tested in Gutenberg. 

This will greatly simplify the process of upgrading npm packages which change after every Gutenberg release. It might even useful during the WordPress release cycle as we might need to publish more often as we discover critical bugs and regressions.

Props jonsurrell, adamsilverstein, youknowriad, ocean90, netweb.

Fixes #48154. 



git-svn-id: https://develop.svn.wordpress.org/trunk@47035 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-03 13:15:33 +00:00
Sergey Biryukov c27ab74ca9 REST API: Synchronize permission checks in `::get_items_permissions_check()` methods for post types, post statuses, and users:
* Only query post types with `'show_in_rest' => true` instead of looping over all post types and checking the `show_in_rest` property separately.
* Return from the `foreach()` loop as soon as the permission check succeeded.

Props pbiron, TimothyBlynJacobs, SergeyBiryukov.
Fixes #49118.

git-svn-id: https://develop.svn.wordpress.org/trunk@47034 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-03 02:26:36 +00:00
Sergey Biryukov b773334bf2 Docs: Synchronize "Default empty array" notes for `$args` parameter in `get_comment_text()` and `comment_text()`.
Props denisco.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47032 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-02 19:20:33 +00:00
Sergey Biryukov 3e47858a53 Coding Standards: Use strict comparison and Yoda conditions in `wp-includes/widgets.php`.
Props jenilk.
Fixes #49104.

git-svn-id: https://develop.svn.wordpress.org/trunk@47027 602fd350-edb4-49c9-b593-d223f7449a82
2020-01-02 11:35:55 +00:00
Sergey Biryukov ae53e417d5 Docs: Add missing descriptions and `@return` tags for `_WP_Editors::get_mce_locale()` and `::get_baseurl()`.
Props adnan.limdi.
Fixes #41869.

git-svn-id: https://develop.svn.wordpress.org/trunk@47023 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-31 01:29:42 +00:00
Sergey Biryukov fa0feb0cff Docs: Add missing `@since` tags for `wp-includes/class-wp-editor.php`.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47022 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-31 01:23:11 +00:00
Sergey Biryukov ef6973b7f0 Bootstrap/Load: Make handling the `/favicon.ico` requests more flexible.
Previously, `wp_favicon_request()` was introduced in [13205] to avoid a performance hit of serving a full 404 page on every favicon request.

While working as intended, that implementation did not provide a way for theme or plugin authors to manage the behavior of favicon requests.

This changeset implements the following logic (only applied if WordPress is installed in the root directory):

* If there is a Site Icon set in Customizer, redirect `/favicon.ico` requests to that icon.
* Otherwise, use the WordPress logo as a default icon.
* If a physical `/favicon.ico` file exists, do nothing, let the server handle the request.

Handling `/favicon.ico` is now more consistent with handling `/robots.txt` requests.

New functions and hooks:

* Introduce `is_favicon()` conditional tag to complement `is_robots()`.
* Introduce `do_favicon` action to complement `do_robots` and use it in template loader.
* Introduce `do_favicon()` function, hooked to the above action by default, to complement `do_robots()`.
* Introduce `do_faviconico` action to complement `do_robotstxt`, for plugins to override the default behavior.
* Mark `wp_favicon_request()` as deprecated in favor of `do_favicon()`.

Props jonoaldersonwp, birgire, joostdevalk, mukesh27, SergeyBiryukov.
Fixes #47398.

git-svn-id: https://develop.svn.wordpress.org/trunk@47018 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-28 21:18:03 +00:00
Sergey Biryukov 85c7a64791 Docs: Improve `@return` description for `wp_update_comment()` and `WP_UnitTest_Factory_For_Comment::update_object()`.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47017 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-27 00:28:39 +00:00
Sergey Biryukov dbf6a0ba7c Media: Make sure `attachment_url_to_postid()` performs a case-sensitive search for the uploaded file name.
Previously, the first available match was returned, regardless of the case, which was not always the expected result.

Props archon810, ben.greeley, tristangemus, vsamoletov, SergeyBiryukov.
Fixes #39768.

git-svn-id: https://develop.svn.wordpress.org/trunk@47010 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-25 02:24:38 +00:00
Sergey Biryukov d56642ea57 Docs: Use a third-person singular verb for comment template function descriptions, per the documentation standards.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@47009 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-24 16:17:17 +00:00
Sergey Biryukov 51b421a6d1 Docs: Improve documentation for `get_comment_author_url()`.
Props stevenlinx.
Fixes #49076.

git-svn-id: https://develop.svn.wordpress.org/trunk@47008 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-24 16:08:34 +00:00
Sergey Biryukov 5c83f0630a Shortcodes: Introduce `apply_shortcodes()` as an alias for `do_shortcode()`.
This better aligns with the semantics of applying filters to the input and returning a result, rather than performing an action and outputting to the current buffer.

Props ljasinskipl, thefarlilacfield.
Fixes #37422.

git-svn-id: https://develop.svn.wordpress.org/trunk@47004 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-21 20:10:25 +00:00
Sergey Biryukov 939fbfa7d3 Administration: Add `doing_wp_cron` 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 dlh.
Fixes #49017.

git-svn-id: https://develop.svn.wordpress.org/trunk@47002 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-21 16:12:15 +00:00
Sergey Biryukov 0ff4f016fe Networks and Sites: Remove invalidation of unused cache keys in `clean_blog_cache()`.
Props spacedmonkey, flixos90, thamaraiselvam.
Fixes #40363.

git-svn-id: https://develop.svn.wordpress.org/trunk@46990 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-18 02:57:18 +00:00
Sergey Biryukov 38cfdae6e9 I18N: Make the minimum input length to start searching posts in the "Insert/edit link" modal localizable.
Props Toro_Unit, birgire, miyauchi, swissspidy, ocean90.
Fixes #44662.

git-svn-id: https://develop.svn.wordpress.org/trunk@46988 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-18 01:13:14 +00:00
Sergey Biryukov a3e674d4f9 Docs: Various documentation fixes for unit test factories.
See #48303.

git-svn-id: https://develop.svn.wordpress.org/trunk@46985 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-18 00:17:54 +00:00
Andrew Ozz a276995ff9 Upload: Run the final file name collision test in `wp_unique_filename()` for each existing file + 1.
Props pbiron.
See #48975.


git-svn-id: https://develop.svn.wordpress.org/trunk@46976 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-17 20:50:16 +00:00
Sergey Biryukov a4b65bfca8 Date/Time: Ensure that `get_feed_build_date()` correctly handles a modified post object with invalid date.
* Clarify in the documentation that the function returns `false` on failure.
* Consistently pass the return value through the `get_feed_build_date` filter.

Props Rarst, dd32, azaozz, tellyworth.
Fixes #48957.

git-svn-id: https://develop.svn.wordpress.org/trunk@46974 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-17 20:41:09 +00:00
Sergey Biryukov 9d69e005ea Docs: Clarify that `get_lastpostdate()` and `get_lastpostmodified()` can return `false` on failure.
The both use `_get_last_post_time()` internally.

Props Rarst.
See #48957.

git-svn-id: https://develop.svn.wordpress.org/trunk@46973 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-17 20:24:46 +00:00
Sergey Biryukov 81a54a49d4 Login/Registration: Pass the error data to the `wp_login_failed` action.
Props hamedmoodi, rixeo.
Fixes #49007.

git-svn-id: https://develop.svn.wordpress.org/trunk@46971 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-17 15:34:49 +00:00
Sergey Biryukov 7261695f7d Docs: Correct `@type` for `timeout` argument in `WP_Http::request()`.
Props georgestephanis, benedictsinger.
Fixes #49005.

git-svn-id: https://develop.svn.wordpress.org/trunk@46970 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-17 15:23:33 +00:00
Sergey Biryukov e8c854d2ce Date/Time: In `wp_insert_post()`, when checking the post date to set `future` or `publish` status, use a proper delta comparison.
[3525] allowed a difference up to 59 seconds between the post date/time and the current time to consider the post published instead of scheduled, but that didn't take start of a new minute into account.

Rapidly creating post fixtures in unit tests could encounter a one-second discrepancy between `current_time( 'mysql' )` and `gmdate( 'Y-m-d H:i:s' )`, returning values like `2019-12-16 23:43:00` vs. `2019-12-16 23:42:59`, respectively, and setting the post to a `future` status instead of `publish`.

[45851], while working as intended, made the issue somewhat more likely to occur.

This caused all sorts of occasional random failures in various tests on Travis, mostly on PHP 7.1.

Fixes #48145.

git-svn-id: https://develop.svn.wordpress.org/trunk@46968 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-17 02:23:51 +00:00
Andrew Ozz 99ef48a585 Upload: Fix the final file name collision test in `wp_unique_filename()` when uploading a file with upper case extension. Add a unit test to catch that in the future.
Fixes #48975 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@46966 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-16 23:42:34 +00:00
Andrew Ozz 735b3543db Upload:
- Fix PHP warnings in `wp_unique_filename()` when the destination directory is unreadable.
- Run the final name collision test only for files that are saved to the uploads directory.
- Update the unit tests to match.

Props eden159, audrasjb, azaozz.
Fixes #48960 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@46965 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-16 23:22:00 +00:00
Sergey Biryukov b202cb423a Formatting: Return early from `wp_kses_attr_check()` if the element is not in the list of allowed elements and attributes.
Props krynes, tristanleboss.
Fixes #48549.

git-svn-id: https://develop.svn.wordpress.org/trunk@46959 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-14 15:51:33 +00:00
Sergey Biryukov 1440dab429 Docs: Clarify descriptions for `get_gmt_from_date()` and `get_date_from_gmt()`.
Props johnbillion, Rarst.
Fixes #48650.

git-svn-id: https://develop.svn.wordpress.org/trunk@46958 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-13 21:43:06 +00:00
Jake Spurlock 7c38cf178a Prevent stored XSS in the block editor.
Prevent escaped unicode characters become unescaped in unsafe HTML during JSON decoding.

Props: aduth, epiqueras, 


git-svn-id: https://develop.svn.wordpress.org/trunk@46896 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-12 18:00:45 +00:00
Jake Spurlock 39a8eacb5f Update `wp_kses_bad_protocol()` to recognize `&colon;` on uri attributes,
`wp_kses_bad_protocol()` makes sure to validate that uri attributes don’t contain invalid/or not allowed protocols. While this works fine in most cases, there’s a risk that by using the colon html5 named entity, one is able to bypass this function.

Props: xknown, nickdaugherty, peterwilsoncc.


git-svn-id: https://develop.svn.wordpress.org/trunk@46895 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-12 17:52:18 +00:00
Jake Spurlock dcab984b1b Prevent stored XSS through wp_targeted_link_rel().
Props: vortfu, whyisjake, peterwilsoncc, xknown,  SergeyBiryukov, flaviozavan.



git-svn-id: https://develop.svn.wordpress.org/trunk@46894 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-12 17:51:35 +00:00
Jake Spurlock fb952b5ce0 Ensure that a user can publish_posts before making a post sticky.
Props: danielbachhuber, whyisjake, peterwilson, xknown.



git-svn-id: https://develop.svn.wordpress.org/trunk@46893 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-12 17:50:13 +00:00
Sergey Biryukov a69a2c241d Docs: Update description for `get_categories()` to avoid suggesting the deprecated `type` argument.
Follow-up to [13754].

Props dingo_d.
Fixes #48913.

git-svn-id: https://develop.svn.wordpress.org/trunk@46891 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-12 16:45:32 +00:00
Sergey Biryukov 3778b1eb82 Comments: Avoid a PHP notice in `comment_form()` if the `email` field is not set.
Follow-up to [46090].

Props mat-lipe.
Fixes #48943.

git-svn-id: https://develop.svn.wordpress.org/trunk@46885 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-11 22:12:09 +00:00
Sergey Biryukov 78feb00f7c Comments: Optimize the query for pending comments count in `wp_notify_moderator()` for better performance on large tables.
Props sgoen.
Fixes #48514.

git-svn-id: https://develop.svn.wordpress.org/trunk@46878 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-10 13:45:41 +00:00
Sergey Biryukov 7ac5a9f003 Coding Standards: Fix WPCS and JSHint issues in [46872].
See #47069.

git-svn-id: https://develop.svn.wordpress.org/trunk@46874 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-10 01:32:56 +00:00
Andrew Ozz 2133f8392e Fix the admin toolbar js when jQuery is not present and replace the jQuery based hoverIntent.js with a native implementation. Introduces the "hoverintent" (no dependencies) package.
Props dinhtungdu, audrasjb, azaozz.
Fixes #47069.

git-svn-id: https://develop.svn.wordpress.org/trunk@46872 602fd350-edb4-49c9-b593-d223f7449a82
2019-12-10 01:01:35 +00:00