`get_category_link()` is a wrapper for `get_term_link()`. Using the
unwrapped function makes more sense semantically (it's taxonomy-
agnostic) and it's also more parsimonious (the `WP_Error` check in
`get_category_link()` is redundant with similar checks just before
in `get_term_link()`).
Props keesiemeijer.
Fixes#17069.
git-svn-id: https://develop.svn.wordpress.org/trunk@39593 602fd350-edb4-49c9-b593-d223f7449a82
We need to check that the final line is actually an artifact of explode(), not just an empty input string.
See #37082.
git-svn-id: https://develop.svn.wordpress.org/trunk@39592 602fd350-edb4-49c9-b593-d223f7449a82
create_function() is equivalent to eval(), and most of our uses can be refactored. This is simpler, more secure, and slightly more performant.
Props sgolemon.
Fixes#37082.
git-svn-id: https://develop.svn.wordpress.org/trunk@39591 602fd350-edb4-49c9-b593-d223f7449a82
Site administrators should not be able to remove themselves from a site. This moves the enforcement of this rule from `wp-admin/users.php` to `remove_user_from_blog()` via the `remove_user` capability, which furthermore allows us to get rid of two additional clauses and their `is_super_admin()` checks in `wp-admin/users.php`. A unit test for the new behavior has been added.
Fixes#39063. See #37616.
git-svn-id: https://develop.svn.wordpress.org/trunk@39588 602fd350-edb4-49c9-b593-d223f7449a82
Fixes a bug in Safari where the UI wasn't updated after deleting a theme due to
the incomplete selector.
Props Hristo Sg.
Fixes#39246.
git-svn-id: https://develop.svn.wordpress.org/trunk@39586 602fd350-edb4-49c9-b593-d223f7449a82
Prior to 3.1 if a object cache dropin wanted to add actions, they needed to use `$wp_filter` directly.
Props jorbin.
Fixes#39132.
git-svn-id: https://develop.svn.wordpress.org/trunk@39565 602fd350-edb4-49c9-b593-d223f7449a82
Previously an option containing an object would trigger an SQL `UPDATE` on all calls to `update_option`, even if the old and new values were identical. This was due to the old and new values having differing resource IDs.
This change compares the old and new values as serialized data to remove the resource ID from the comparison.
Props salcode, bradyvercher, peterwilsoncc.
Fixes#38903.
git-svn-id: https://develop.svn.wordpress.org/trunk@39564 602fd350-edb4-49c9-b593-d223f7449a82
The logic in WP_REST_Request->sanitize_params() added in [39091] did not account for `null` or `false` being the sanitization_callback preventing overriding `rest_parse_request_arg()`. This fixes that oversight, allowing the built in sanitization function to be bypassed. See #38593.
Props kkoppenhaver, rachelbaker, jnylen0.
Fixes#39042.
git-svn-id: https://develop.svn.wordpress.org/trunk@39563 602fd350-edb4-49c9-b593-d223f7449a82
This new function is a taxonomy-agnostic version of `get_category_parents()`.
Props keesiemeijer, SergeyBiryukov, rafaehlers.
Fixes#17069.
git-svn-id: https://develop.svn.wordpress.org/trunk@39549 602fd350-edb4-49c9-b593-d223f7449a82
Fixes issue where calls without the `url` parameter erroneously end up rewriting the location path to `/undefined`.
Props Christian1012, westonruter.
Fixes#39175.
git-svn-id: https://develop.svn.wordpress.org/trunk@39547 602fd350-edb4-49c9-b593-d223f7449a82
The super admin on multisite as well as the administrator on non-multisite both have this capability already. For custom post types using different capabilities this change ensures that only users with that capability have permissions.
Fixes#39059. See #37616.
git-svn-id: https://develop.svn.wordpress.org/trunk@39539 602fd350-edb4-49c9-b593-d223f7449a82
They were commented out in `admin-bar.css` since 3 years, see [26770].
Props kafleg, ketuchetan.
Fixes#39137.
git-svn-id: https://develop.svn.wordpress.org/trunk@39533 602fd350-edb4-49c9-b593-d223f7449a82
When the direct SQL query was removed in [38446], part of the SQL
concatenation was not removed. This changeset fixes that.
Props david.binda.
Fixes#39142.
git-svn-id: https://develop.svn.wordpress.org/trunk@39532 602fd350-edb4-49c9-b593-d223f7449a82
When sections of the media modal are hidden out of view, their controls may be
still focusable and actionable. This completely hides these sections to avoid
unnecessary tab stops and potential confusion for assistive technology users.
Props SergeyBiryukov, afercia.
Fixes#30599.
git-svn-id: https://develop.svn.wordpress.org/trunk@39529 602fd350-edb4-49c9-b593-d223f7449a82