Commit Graph

41830 Commits

Author SHA1 Message Date
Pascal Birchler
65a6412681 Sitemaps: Do not unnecessarily call WP_Query::get_posts() in posts provider.
The posts have already been fetched at this point, no need to do it again.

Props Chouby.
Fixes #50463.

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

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


git-svn-id: https://develop.svn.wordpress.org/trunk@48281 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-03 08:49:23 +00:00
Sergey Biryukov
3785439c8b Tests: Further fix some issues with indeterminate sort ordering in Tests_List_Pages:
* Make sure `test_wp_list_pages_number()` sorts by ID, as there are several pages with the same title.
* Limit `test_wp_list_pages_sort_column()` to one level, as the child page fixtures don't have an author and cannot be reliably sorted by `post_author`.

Follow-up to [48157].

Props afercia.
See #50466.

git-svn-id: https://develop.svn.wordpress.org/trunk@48280 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-02 18:21:43 +00:00
Greg Ziółkowski
3439a14e57 Editor: Move core blocks registration to init hook
After working on support for register_block_type_args filter in #49615, it became clear that we need to use init action for core blocks to make it possible to use this filter.

Fixes #50263.



git-svn-id: https://develop.svn.wordpress.org/trunk@48279 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-02 17:20:28 +00:00
Jonathan Desrosiers
3acf97a7ce External Libraries: Update getID3 to version 1.9.20.
A full list of changes in this update can be found on GitHub: https://github.com/JamesHeinrich/getID3/compare/v1.9.19...v1.9.20.

Props hareesh-pillai, desrosj.
Previously [47601-47604].
Fixes #49945.

git-svn-id: https://develop.svn.wordpress.org/trunk@48278 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-02 15:46:17 +00:00
Riad Benguella
73dc1a0854 Color schemes: Add new modern color scheme option.
This PR adds a new color scheme option, which uses a high luminosity blue spot color, almost-black menu, and pure white for menu items. 
This helps increase contrast, and bring more consistency with some of the higher contrast colors used in the block editor.

Props joen, ibdz, shaunandrews.
Fixes #50504.


git-svn-id: https://develop.svn.wordpress.org/trunk@48277 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-02 14:53:37 +00:00
Sergey Biryukov
9459335d1b Script Loader: Restore correct versions for Masonry and imagesLoaded.
These libraries were previously updated in [48038], but some changes were accidentally reverted in [48267].

Props kebbet.
See #50526.

git-svn-id: https://develop.svn.wordpress.org/trunk@48276 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-02 13:08:04 +00:00
Sergey Biryukov
c5e620f6ef Docs: Spell "falsey" in a consistent way.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48275 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-02 11:28:13 +00:00
Sergey Biryukov
5714ef31c0 I18N: Use wp.i18n for translatable strings in wp-admin/js/privacy-tools.js.
This removes the usage of `wp_localize_script()` for passing translations to the script and instead adds the translatable strings in the script directly through the use of `wp.i18n` and its utilities.

Props swissspidy, ocean90, afercia.
See #20491.
Fixes #50535.

git-svn-id: https://develop.svn.wordpress.org/trunk@48274 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-02 11:09:23 +00:00
Timothy Jacobs
6cc0063ba6 REST API: Link to the REST route for the currently queried resource.
This allows for programatically determining the REST version of the current page. The links also aid human discovery of the REST API in general.

Props dshanske, tfrommen, TimothyBlynJacobs.
Fixes #49116.


git-svn-id: https://develop.svn.wordpress.org/trunk@48273 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-02 05:55:04 +00:00
Felix Arntz
284b92b122 Media: Improve support for opting out of lazy-loading for template images.
With this changeset, in addition to the already present `wp_lazy_loading_enabled` filter, developers can now opt out of lazy-loading template images via `wp_get_attachment_image()` by passing a `loading` attribute with boolean value `false`. This can be used e.g. by theme developers on images which are very likely to be in the initial viewport.

This changeset also improves related test coverage.

Props adamsilverstein, azaozz, joemcgill, johnbillion.
See #50425, #44427.


git-svn-id: https://develop.svn.wordpress.org/trunk@48272 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-02 02:01:28 +00:00
Jake Spurlock
46f51c4bc1 Bundled Themes: Update latest version for Tested up to: in readme.txt file.
Fixes #50503.
Props mukesh27, hareesh-pillai.



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

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

git-svn-id: https://develop.svn.wordpress.org/trunk@48270 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 20:36:32 +00:00
Jonathan Desrosiers
ebc856482e External Libraries: Update Moment.js to version 2.27.0.
A full list of changes in this update can be found on GitHub: https://github.com/moment/moment/compare/2.26.0...2.27.0

Props hareesh-pillai, desrosj.
Previously [48075].
Fixes #50408.

git-svn-id: https://develop.svn.wordpress.org/trunk@48269 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 20:27:51 +00:00
Andrea Fercia
35e7658df8 Media: Enable JavaScript translations for the media-views script after [48232].
See #48463.


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

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

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

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

git-svn-id: https://develop.svn.wordpress.org/trunk@48266 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 19:28:14 +00:00
Andrea Fercia
f3f7b77522 Accessibility: Media: Fix the Image Editor mismatching keyboard focus order and visual reading order.
Swaps the DOM order of the two main columns within the admin Image Editor.

When the sequence in which content is presented affects its meaning and the navigation sequences affect meaning or operation, visual order and DOM order must match. See WCAG 2.1 Success Criterion 1.3.2 Meaningful Sequence and Success Criterion 2.4.3 Focus Order.

Props sabernhardt, anevins, audrasjb, afercia.
Fixes #47136.


git-svn-id: https://develop.svn.wordpress.org/trunk@48265 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 14:27:18 +00:00
Sergey Biryukov
28cb0c2049 Docs: Bundled Themes: Correct DocBlock placement for custom header and background argument filters.
See #49572.

git-svn-id: https://develop.svn.wordpress.org/trunk@48264 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 13:50:28 +00:00
Greg Ziółkowski
a425f15dd7 Editor: Support filtering arguments in block type registration
Adds possibility to filter the settings of a block type during its registration.

Props aduth, azaozz.
Fixes #49615.



git-svn-id: https://develop.svn.wordpress.org/trunk@48263 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 13:08:11 +00:00
Greg Ziółkowski
f7d617cfb8 Editor: Register core blocks on the server
Exposes all core blocks (excluding embeds) on the server to be used with the REST API block types endpoint.

Props spacedmonkey, timothyblynjacobs.
Fixes #50263.



git-svn-id: https://develop.svn.wordpress.org/trunk@48262 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 12:27:10 +00:00
Greg Ziółkowski
ac7c4e270b Editor: More strict checks for globals in render_block
Props kraftbj.
Fixes #49927.



git-svn-id: https://develop.svn.wordpress.org/trunk@48243 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 06:06:39 +00:00
Timothy Jacobs
b2cc1dfd70 REST API: Introduce plugin management and block directory endpoints.
These endpoints facilitate the Block Directory Inserter feature in Gutenberg. Users can now install, activate, deactivate, and delete plugins over the REST API. The block directoryendpoint allows searching for available blocks from the WordPress.org block directory.

Props cklee, talldanwp, noisysocks, joen, soean, youknowriad, dufresnesteven, gziolo, dd32, tellyworth, ryelle, spacedmonkey, TimothyBlynJacobs.
Fixes #50321.



git-svn-id: https://develop.svn.wordpress.org/trunk@48242 602fd350-edb4-49c9-b593-d223f7449a82
2020-07-01 04:22:25 +00:00
Sergey Biryukov
48f0e74279 Administration: Pass the result of set-screen-option filter to the new set_screen_option_{$option} filter to ensure backward compatibility.
Rename the `$keep` parameter of both filters to `$screen_option` for clarity, update the documentation to better reflect its purpose.

Props Chouby, sswells, SergeyBiryukov.
Fixes #50392.

git-svn-id: https://develop.svn.wordpress.org/trunk@48241 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-30 21:51:47 +00:00
Sergey Biryukov
b9871a67cb Administration: Always show the filters on media and post list tables.
Previously, the filters were hidden for single posts or attachments, which could only be achieved by editing the URL manually.

The `is_singular()` check was added long before the list tables were introduced, and appears to no longer serve any purpose in the current code.

As a side effect, this resolves an issue where a non-existing attachment ID in the URL would block further search in Media Library.

Props afercia, tomdude, audrasjb, bencroskery, desrosj, SergeyBiryukov.
Fixes #38221.

git-svn-id: https://develop.svn.wordpress.org/trunk@48240 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-30 20:33:32 +00:00
Felix Arntz
9ab408d9f6 Media: Only add loading attribute to img tags using double quotes.
Props azaozz.
Fixes #50367.


git-svn-id: https://develop.svn.wordpress.org/trunk@48239 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-30 20:32:44 +00:00
Sergey Biryukov
a21b3b7d36 Code Modernization: Introduce the spread operator in WP_HTTP_IXR_Client.
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.

This makes the signature of `WP_HTTP_IXR_Client::query()` compatible with the parent class method.

Follow-up to [48204].

Props ayeshrajans.
See #48267, #47678.

git-svn-id: https://develop.svn.wordpress.org/trunk@48238 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-30 19:48:48 +00:00
Felix Arntz
d8af0369e3 Media: Introduce wp_img_tag_add_width_and_height_attr() to add dimension attributes to images.
Following up on [48170], this changeset moves the new logic to add missing `img` dimension attributes into a separate function that is run first within `wp_filter_content_tags()`. It also adds a utility function `wp_image_src_get_dimensions()` with logic reused from `wp_image_add_srcset_and_sizes()`, and it ensures that `width` and `height` attributes only get added if both of the attributes are missing on the original `img` tag.

This changeset furthermore improves test coverage and separates tests for the different aspects of `img` tag modification.

Props azaozz.
Fixes #50367. See #44427.


git-svn-id: https://develop.svn.wordpress.org/trunk@48237 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-30 19:28:07 +00:00
Andrea Fercia
e85b141183 Fix Privacy tests after [48234].
See #50335.


git-svn-id: https://develop.svn.wordpress.org/trunk@48236 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-30 14:20:37 +00:00
Sergey Biryukov
90e840f9db Comments: Make wp_update_comment() return false instead of 0 for an invalid comment or post ID.
This addresses an inconsistency where 0 could mean one of the three scenarios:

* Invalid comment ID.
* Invalid comment post ID.
* No DB rows updated. This is not an error and should not be treated as one.

With this change, `wp_update_comment()` always returns either `false` or a `WP_Error` object on failure, depending on the value of the `$wp_error` parameter.

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

Props dd32, jnylen0, enrico.sorcinelli.
Fixes #39732. See #38700, #39735.

git-svn-id: https://develop.svn.wordpress.org/trunk@48235 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-30 14:11:00 +00:00
Andrea Fercia
0445f4b95c Accessibility: Privacy: Accessibility improvements for the Privacy Policy Guide page.
Improves accessibility of the "Copy this section" button and "Return to Top" link:
- uses `setTimeout()` and `clearTimeout()` to properly handle the "Copied!" text
- simplifies the button text by removing the redundant visually hidden text
- fixes the mismatching visual and DOM order of the Copy button and the "Return to Top" link 
- improves the "Return to Top" links by providing real page fragment identifiers, when possible
- hides the "Return to Top" up arrow from assistive technologies
- minor coding standards

Props afercia, garrett-eclipse.
See #48463, #50322.
Fixes #50335.


git-svn-id: https://develop.svn.wordpress.org/trunk@48234 602fd350-edb4-49c9-b593-d223f7449a82
2020-06-30 13:54:40 +00:00
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