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
* 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
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
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
This improves the wording of the inline documentation for `redirect_guess_404_permalink()` and the related filters introduced in [47878].
Previously [47878,47885]
See #16557.
git-svn-id: https://develop.svn.wordpress.org/trunk@48182 602fd350-edb4-49c9-b593-d223f7449a82
Adds a Social Icons Filter to Twenty Twenty that allows for new icons to be added to the theme by filter.
Props JarretC, nielslange, acosmin, desrosj.
Fixes#48713.
git-svn-id: https://develop.svn.wordpress.org/trunk@48180 602fd350-edb4-49c9-b593-d223f7449a82