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
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
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
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
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
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
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
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
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
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
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
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
- 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
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
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
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
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
* 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
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
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
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
* `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
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
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
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