Commit Graph

41949 Commits

Author SHA1 Message Date
Andrea Fercia 2df56667b3 Accessibility: Site Health: Improve the "Copy site info" button accessibility.
- avoids a focus loss when clicking the "Copy site info" button
- uses `setTimeout()` and `clearTimeout()` to properly handle the "Copied!" text
- minor JavaScript coding standards

Props audrasjb, Clorith, afercia.
See #48463, #50335.
Fixes #50322.


git-svn-id: https://develop.svn.wordpress.org/trunk@48233 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-30 13:24:12 +00:00
Andrea Fercia 36a39ff333 Accessibility: Media: Add a "Copy URL" button to the attachment File URL fields.
For a number of years, various screens in the WordPress admin provided users with a readonly input field to copy the attachment file URL. Manually copying from a readonly field is an annoying task at best even for mouser users. It's a usability and accessibility issue at the same time. 
These fields now have a new "Copy URL" button that is easy to use and accessible to everyone.

Props theolg, markdubois, vabrashev, sajjad67, xkon, nrqsnchz, melchoyce, audrasjb, afercia.
See #41612, #50322, #50335.
Fixes #48463.


git-svn-id: https://develop.svn.wordpress.org/trunk@48232 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-30 13:14:05 +00:00
Sergey Biryukov cc4767cec0 Tests: Place `remove_filter()` calls for `_wp_update_comment_data_filter()` before the assertions, for consistency with other tests.
Follow-up to [48154], [48222].

See #39732.

git-svn-id: https://develop.svn.wordpress.org/trunk@48231 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-30 12:27:05 +00:00
Sergey Biryukov 595a799da0 Comments: Add a `@since` note to the `wp_update_comment_data` filter about returning a `WP_Error` value.
Remove the ability to short-circuit comment update by returning `false` from the filter for now.

This was inconsistent with the `pre_comment_approved` filter, and should not be necessary if a more descriptive reason can be given by always using `WP_Error`.

See #39732.

git-svn-id: https://develop.svn.wordpress.org/trunk@48230 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-30 12:01:05 +00:00
Sergey Biryukov 3e1f66bb2e Coding Standards: Add missing visibility keywords to `Tests_Comment` methods.
See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@48229 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-30 11:38:40 +00:00
Sergey Biryukov 7653810aa2 Tests: Remove unnecessary i18n from `_wp_update_comment_data_filter()`.
Follow-up to [48154], [48217].

See #39732.

git-svn-id: https://develop.svn.wordpress.org/trunk@48228 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-30 11:34:58 +00:00
Sergey Biryukov 5f046745ff Comments: Correct `$wpdb->prepare()` usage in `_wp_batch_update_comment_type()`.
Follow-up to [47597], [48225].

See #50513, #49236.

git-svn-id: https://develop.svn.wordpress.org/trunk@48227 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-30 11:28:55 +00:00
Sergey Biryukov ce23609e56 Docs: Correct `$wp_query` global reference in `render_block()`.
See #49927, #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48226 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-30 11:14:33 +00:00
Sergey Biryukov 4a495dfc99 Comments: Introduce `wp_update_comment_type_batch_size` filter for the comment batch size in `_wp_batch_update_comment_type()`.
Follow-up to [47597].

Props dchymko.
Fixes #50513. See #49236.

git-svn-id: https://develop.svn.wordpress.org/trunk@48225 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-30 11:03:57 +00:00
Greg Ziółkowski 910de8f689 Editor: Introduce block context
Backports a new block context feature from Gutenberg. The purpose of this feature is to be able to establish values in a block hierarchy which can be consumed by blocks anywhere lower in the same hierarchy. These values can be established either by the framework, or by other blocks which provide these values. See documentation: https://github.com/WordPress/gutenberg/blob/master/docs/designers-developers/developers/block-api/block-context.md

Props aduth, epiqueras.
Fixes #49927.



git-svn-id: https://develop.svn.wordpress.org/trunk@48224 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-30 11:02:22 +00:00
Sergey Biryukov 9602c4acf7 Docs: Add a `@since` note to `edit_comment()` about the new return value.
Follow-up to [48154].

See #39732.

git-svn-id: https://develop.svn.wordpress.org/trunk@48223 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-30 01:02:52 +00:00
Sergey Biryukov 5d0b2a7510 Tests: Remove unnecessary `tearDown()` method in `Tests_Ajax_EditComment`.
Restoring the hook-related globals to their state at `setUp()` is addressed by `WP_UnitTestCase_Base::_restore_hooks()`.

Follow-up to [48154].

See #39732.

git-svn-id: https://develop.svn.wordpress.org/trunk@48222 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-30 00:58:07 +00:00
Sergey Biryukov 43977e7689 Docs: Remove `@return void` from some tests, per the documentation standards.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48221 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-30 00:41:57 +00:00
Sergey Biryukov 6dca33c0b1 Docs: Improve documentation for Ajax comment tests per the documentation standards.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48220 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-30 00:41:30 +00:00
Sergey Biryukov 6c81fa8a73 Docs: Correct documentation for the `filter` parameter of `get_category()` and `get_tag()`.
Follow-up to [48197].

See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48219 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-30 00:02:05 +00:00
Sergey Biryukov 99c3a2695b Comments: Make `wp_update_comment()` return a `WP_Error` object for a canceled update, if `$wp_error` parameter is true.
Remove redundant checks for `wp_update_comment()` results being `false`, as the function always returns a `WP_Error` object now if `$wp_error` is true.

Follow-up to [48154], [48215], [48216].

See #39732.

git-svn-id: https://develop.svn.wordpress.org/trunk@48218 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-29 23:40:56 +00:00
Sergey Biryukov 8b31484919 Tests: Remove unnecessary i18n from `_wp_update_comment_data_filter()`.
Follow-up to [48154].

See #39732.

git-svn-id: https://develop.svn.wordpress.org/trunk@48217 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-29 23:07:09 +00:00
Sergey Biryukov 726b1f664c Comments: Make `wp_update_comment()` return a `WP_Error` object on database error, if `$wp_error` parameter is true.
Follow-up to [48154], [48215].

See #39732.

git-svn-id: https://develop.svn.wordpress.org/trunk@48216 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-29 23:04:17 +00:00
Sergey Biryukov 9787f2fff9 Comments: Minor adjustments to `wp_update_comment()`:
* Revert the logic of `$wp_error` checks to avoid negation.
* Clarify the return value, restore the edits from [47017].
* Update `wp_update_comment_data` filter check to allow `false` to prevent the update.

Follow-up to [48154].

See #39732.

git-svn-id: https://develop.svn.wordpress.org/trunk@48215 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-29 22:42:08 +00:00
Sergey Biryukov dc3c92d08f Docs: Improve documentation for the `$prev_value` parameter and return result of various metadata update functions.
Props stevenlinx.
Fixes #50502. See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48214 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-29 21:20:11 +00:00
Greg Ziółkowski df8af186de Chore: Update package-lock.json file
Improve the shape of package-lock.json file to make it stable. The main change is that both dependencies of WordPress packages that use npm aliases are listed as development dependencies: puppeteer and prettier. This patch includes also block.json files for dynamic blocks copied from WordPress packages.

Props ellatrix.
Fixes #50420.



git-svn-id: https://develop.svn.wordpress.org/trunk@48213 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-29 11:48:53 +00:00
Sergey Biryukov dc00393c1f Docs: Document the return value of `wp_get_attachment_metadata()` using hash notation.
Props stevenlinx.
Fixes #50505.

git-svn-id: https://develop.svn.wordpress.org/trunk@48212 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-29 11:18:37 +00:00
Sergey Biryukov 6a3d4fe520 Customize: Do not allow changesets to be deleted when someone is editing them.
This makes the behavior consistent with that of locked posts, which can't be deleted via the list tables when another user is editing them.

Props dlh.
Fixes #50501.

git-svn-id: https://develop.svn.wordpress.org/trunk@48211 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-29 10:31:12 +00:00
Sergey Biryukov 52f139829c Customize: Ensure the default message in `LockedNotification` is set to a string instead of `null`.
This avoids a JS error when passing the message to `wp.a11y.speak()` when showing the "changeset is locked" overlay to prevent two users from editing the same changeset simultaneously.

Props dlh.
Fixes #50500.

git-svn-id: https://develop.svn.wordpress.org/trunk@48210 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-29 09:47:11 +00:00
Sergey Biryukov 9f053c58fe Themes: Add a return value to theme functions calling `locate_template()`:
* `get_header()`
* `get_footer()`
* `get_sidebar()`
* `get_template_part()`

These functions now return false if the template file could not be found, to allow for easier debugging.

Props tferry, sphakka, johnbillion, pento, davidbinda, desrosj, birgire, garrett-eclipse, williampatton, davidbaumwald, SergeyBiryukov.
Fixes #40969.

git-svn-id: https://develop.svn.wordpress.org/trunk@48209 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-28 23:08:57 +00:00
Sergey Biryukov 43823df70a Comments: Rename the `$avoid_die` parameter of `wp_allow_comment()` and `wp_new_comment()` to `$wp_error`.
This makes the function signatures more consistent with `wp_update_comment()` and `wp_set_comment_status()`.

`wp_check_comment_flood()` is left as the only function with the `$avoid_die` parameter for now, as it does not return a `WP_Error` object.

Follow-up to [48154], [48207].

See #39732.

git-svn-id: https://develop.svn.wordpress.org/trunk@48208 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-28 22:08:22 +00:00
Sergey Biryukov a234b91653 Docs: Correct description for the `$avoid_die` parameter of `wp_check_comment_flood()`.
The function always return a boolean value, never a `WP_Error` object.

See #49572, #39732.

git-svn-id: https://develop.svn.wordpress.org/trunk@48207 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-28 21:40:54 +00:00
Sergey Biryukov c4a0e190d7 Bootstrap/Load: Remove special handling for `REQUEST_TIME` and `REQUEST_TIME_FLOAT` server values in `wp_magic_quotes()`.
This was intended as a temporary fix until `add_magic_quotes()` is modified to leave non-string values untouched, which has now been done.

Follow-up to [47370], [48205].

See #48605.

git-svn-id: https://develop.svn.wordpress.org/trunk@48206 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-28 21:07:36 +00:00
Sergey Biryukov e5e4f0d977 Bootstrap/Load: Make sure `add_magic_quotes()` does not inappropriately recast non-string data types to string.
Props donmhico, jrf, Veraxus, Rarst.
Fixes #48605.

git-svn-id: https://develop.svn.wordpress.org/trunk@48205 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-28 21:02:18 +00:00
Sergey Biryukov 5289a345cf Code Modernization: Introduce the spread operator in `wp-includes/IXR`.
Rather than relying `func_get_args()` to retrieve arbitrary function arguments, we can now use the spread operator to assign them directly to a variable.

Props kraftbj.
See #48267, #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@48204 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-28 18:23:39 +00:00
Sergey Biryukov bd03636941 Posts, Post Types: Return early from `WP_Posts_List_Table::formats_dropdown()` if the post type does not support post formats.
This avoids an unnecessary database query for the `post_format` taxonomy.

Props Chouby.
Fixes #50496.

git-svn-id: https://develop.svn.wordpress.org/trunk@48203 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-28 14:28:23 +00:00
Sergey Biryukov dda16f9096 Security: Improve the wording of messages in `wp_get_auto_update_message()`.
Props burhandodhy, johnbillion, apedog.
Fixes #50489.

git-svn-id: https://develop.svn.wordpress.org/trunk@48202 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-28 14:16:51 +00:00
Sergey Biryukov 1857cff7c6 Networks and Sites: Use a consistent wording when referring to site deletion on Delete Site screen.
Props burhandodhy, dartiss.
Fixes #50494.

git-svn-id: https://develop.svn.wordpress.org/trunk@48201 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-28 14:10:02 +00:00
Sergey Biryukov 8d358ca4c7 Docs: Capitalize "ID", when referring to a user ID, term ID, etc. in a more consistent way.
Follow-up to [48104]

See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48200 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-28 14:07:53 +00:00
Sergey Biryukov bb2aad471b Docs: Replace "html" and "xhtml" instances in DocBlocks and comments with "HTML" and "XHTML".
This ensures consistent capitalization where appropriate.

Props navidos, desrosj.
Fixes #50473.

git-svn-id: https://develop.svn.wordpress.org/trunk@48199 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-28 14:00:26 +00:00
Sergey Biryukov 8672d08404 Docs: Miscellaneous DocBlock corrections.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48198 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-28 11:51:29 +00:00
Sergey Biryukov 6361798918 Docs: Improve documentation for optional parameters per the documentation standards.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48197 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-28 11:47:45 +00:00
Sergey Biryukov b72fcb6a47 Tests: Adjust the test for invalid username in `WP_Test_REST_Users_Controller` to match the new string.
Follow-up to [48195].

See #47003.

git-svn-id: https://develop.svn.wordpress.org/trunk@48196 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-28 07:49:29 +00:00
Sergey Biryukov cececce972 Users: Merge two similar error messages about usernames with invalid characters.
Props ramiy, garrett-eclipse, chetan200891.
Fixes #47003.

git-svn-id: https://develop.svn.wordpress.org/trunk@48195 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-27 23:43:01 +00:00
Sergey Biryukov 43236dea96 I18N: Remove `<kbd>` tag from a translatable string on Edit Post screen.
Props ramiy, tobifjellner.
Fixes #48874.

git-svn-id: https://develop.svn.wordpress.org/trunk@48194 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-27 23:00:49 +00:00
Sergey Biryukov 7fe9600547 Docs: Synchronize some documentation for functions in `wp-includes/option.php`.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48193 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-27 16:54:29 +00:00
John Blackbourn 83b0d3709e Docs: Improvements to the inline docs for metadata related functions.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48192 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-27 16:32:57 +00:00
Sergey Biryukov 899d8ff5ec Administration: Correct the URL for "Learn more about getting started" link in "Welcome to WordPress" panel.
Props hareesh-pillai, johnbillion.
Fixes #50484.

git-svn-id: https://develop.svn.wordpress.org/trunk@48191 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-27 12:43:07 +00:00
Sergey Biryukov 506fab2814 Docs: Remove extra spaces from `@ticket` tag in unit tests.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48190 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-27 12:01:30 +00:00
Sergey Biryukov b970deb94a Docs: Improve DocBlocks in `wp-includes/theme.php` per the documentation standards.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48189 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-27 12:00:48 +00:00
SergeyBiryukov 20e96fa38a Bootstrap/Load: Make some adjustments to `wp_get_environment_type()`:
* Rename the `wp_approved_environment_types` filter to `wp_environment_types`.
* Introduce `WP_ENVIRONMENT_TYPES` system variable and constant to complement the filter.
* Correct the argument type for the `wp_environment_types` filter.
* Cache the result in a static variable to ensure consistent return value.
* Rename the `stage` type to `staging`.

Follow-up to [47919].

Props dlh, dd32, TimothyBlynJacobs, johnbillion, pbiron.
See #33161.

git-svn-id: https://develop.svn.wordpress.org/trunk@48188 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-27 10:34:02 +00:00
Sergey Biryukov 2daeac989d Taxonomy: Make sure `update_object_term_cache()` caches all terms that were not already cached.
Due to an unintended `break` instruction from a previous iteration, the function cached only one term in each taxonomy.

Follow-up to [48055].

Props Chouby.
Fixes #50352.

git-svn-id: https://develop.svn.wordpress.org/trunk@48187 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-26 22:29:27 +00:00
Sergey Biryukov 8603b3da3a Administration: Add missing comma to the message in "Post via email" section.
Props kinjaldalwadi, sabernhardt.
Fixes #49238.

git-svn-id: https://develop.svn.wordpress.org/trunk@48186 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-26 19:36:26 +00:00
Sergey Biryukov 8b67473da6 Docs: Standardize on "Returning a value from the filter" vs. "Passing a value to the filter".
The filter is the callback function added with `add_filter()`, therefore the hook passes a value to the filter, and the filter returns a value to change its behaviour.

The documentation is referring to the latter.

Props johnbillion.
See #49572, #16557.

git-svn-id: https://develop.svn.wordpress.org/trunk@48185 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-26 18:47:28 +00:00
John Blackbourn 9af5e46627 Docs: Miscellaneous docblock improvements.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48184 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-26 18:38:51 +00:00