As a follow-up to [40382], this commit makes the following improvements:
- Make the filter names more specific.
- Fix the inline documentation (use `@param` instead of `@return).
- Use `null ===` instead of `is_null` to avoid extra function calls.
- Rename the `$has_audio` and `$has_video` variables now that they actually represent something slightly different.
See #31071.
git-svn-id: https://develop.svn.wordpress.org/trunk@40421 602fd350-edb4-49c9-b593-d223f7449a82
The Toolbar search field, when the Toolbar is displayed on the frontend, might
inherit CSS properties from the active Theme stylesheet. For example, this
happened with Twenty Seventeen that sets `display: block;` on all the input
fields. Thus, there's the need to reset some CSS properties to avoid inheritance.
Props @sagarprajapati.
Fixes#40313.
git-svn-id: https://develop.svn.wordpress.org/trunk@40418 602fd350-edb4-49c9-b593-d223f7449a82
This aids in debugging XMLRPC tests which fail, by exposing the `IXR_Error` error message in the assertion failure message.
Fixes#40423
git-svn-id: https://develop.svn.wordpress.org/trunk@40417 602fd350-edb4-49c9-b593-d223f7449a82
When using `is_super_admin()` in a non-multisite environment, the function is supposed to check for administrator capabilities. The process of querying all users and filtering them with that function can be optimized by only querying users with the administrator role instead.
Fixes#40406. See #37616.
git-svn-id: https://develop.svn.wordpress.org/trunk@40406 602fd350-edb4-49c9-b593-d223f7449a82
Prior to this change, a mix of `is_super_admin()` calls and `manage_network` capability checks was used to determine whether the current user could upgrade the network. With this changeset a dedicated capability is introduced that allows more granular handling.
Props dhanendran for the original patch.
Fixes#39205. See #37616.
git-svn-id: https://develop.svn.wordpress.org/trunk@40404 602fd350-edb4-49c9-b593-d223f7449a82
This prevents non-image fileypes from returning a mime type of
"application/octet-stream" when `exif_imagetype()` returns `false`.
Props blobfolio.
Fixes#40017.
git-svn-id: https://develop.svn.wordpress.org/trunk@40397 602fd350-edb4-49c9-b593-d223f7449a82
Introduces `WP_Customize_Panel::$auto_expand_sole_section` property which allows panels to opt-in to the behavior, which the Widgets panel is made to do by default.
Props delawski, westonruter, melchoyce.
Fixes#37471.
git-svn-id: https://develop.svn.wordpress.org/trunk@40395 602fd350-edb4-49c9-b593-d223f7449a82
This is a wrapper around the checks for the `DISALLOW_FILE_MODS` constant to determine whether file modifications are disallowed.
Props MaximeCulea.
Fixes#38673.
git-svn-id: https://develop.svn.wordpress.org/trunk@40394 602fd350-edb4-49c9-b593-d223f7449a82
[40295] removed the restriction of a minimum amount of characters for new site names, which could cause unexpected behavior. That changeset is reverted here with the exception of the removal of the `is_super_admin()` check, which can safely be omitted. A new filter for the minimum site name length will be introduced later to be able to modify that behavior.
See #39676, #37616.
git-svn-id: https://develop.svn.wordpress.org/trunk@40391 602fd350-edb4-49c9-b593-d223f7449a82
`setup_network` is a new meta capability that brings more granular control over the permissions to setup a multisite environment. In a non-multisite environment it falls back to `manage_options` while in a multisite it falls back to `manage_network_options`. The introduction of this capability furthermore allows replacing an `is_super_admin()` check.
Props ashokkumar24 for the original patch.
Fixes#39206. See #37616.
git-svn-id: https://develop.svn.wordpress.org/trunk@40390 602fd350-edb4-49c9-b593-d223f7449a82
This reverts [38371] which loaded `class-phpass.php` early in `wp-settings.php` and in turn caused backward compatibility problems.
Props DavidAnderson, ketuchetan.
Fixes#39445.
git-svn-id: https://develop.svn.wordpress.org/trunk@40387 602fd350-edb4-49c9-b593-d223f7449a82
There are a couple of queries that do a full table scan of attachment posts to support features of the media library. Pending a more complete solution, allow overriding these queries via filters.
Props sboisvert, jnylen0.
See #31071.
git-svn-id: https://develop.svn.wordpress.org/trunk@40382 602fd350-edb4-49c9-b593-d223f7449a82
Accounts for HTTPS links (port 443) where [40318] only accounted for HTTP links (port 80). Addresses issue in IE11 where the default port number is unexpectedly included on `link.host` for links dynamically created by scripts.
Props mattwiebe.
Amends [40318], [38890].
See #38409.
Fixes#40198.
git-svn-id: https://develop.svn.wordpress.org/trunk@40381 602fd350-edb4-49c9-b593-d223f7449a82
Use the same `active_callback` as was supplied previously for the `header_video` control in [39240] where this instance was missed.
Amends [39240].
Props pratikshrestha.
See #38738.
Fixes#40308.
git-svn-id: https://develop.svn.wordpress.org/trunk@40379 602fd350-edb4-49c9-b593-d223f7449a82
As a follow-up to [40376], and for consistency with the posts endpoint, we should indicate in the description that the `slug` filter parameter can accept multiple values.
See #40027.
git-svn-id: https://develop.svn.wordpress.org/trunk@40377 602fd350-edb4-49c9-b593-d223f7449a82
This matches a similar change previously made for posts (#38579) and an upcoming change for users (#40213).
Props wonderboymusic, MatheusGimenez, curdin.
Fixes#40027.
git-svn-id: https://develop.svn.wordpress.org/trunk@40376 602fd350-edb4-49c9-b593-d223f7449a82
The `get_user_count()` function returns the number of active users on a network, which is stored in a `user_count` network option. Since `get_network_option()` supports retrieving options from other networks than the current one, `get_user_count()` can now make use of that feature.
Fixes#37866.
git-svn-id: https://develop.svn.wordpress.org/trunk@40371 602fd350-edb4-49c9-b593-d223f7449a82
The `get_blog_count()` function used to support an `$id` parameter for the network ID prior to WordPress 3.1. This parameter has not been used since the introduction of `get_site_option()` and was later deprecated in [25113]. With `get_network_option()` however it is possible to support the parameter again, now properly renamed as `$network_id`.
A unit test has for the parameter has been added as well. Another unit test in the same class was adjusted to work properly with multiple networks existing.
Fixes#37865.
git-svn-id: https://develop.svn.wordpress.org/trunk@40370 602fd350-edb4-49c9-b593-d223f7449a82
Otherwise CSS specific to the site's locale would be applied, even though the customizer is displayed in the user's locale.
See #29783.
Fixes#40271.
git-svn-id: https://develop.svn.wordpress.org/trunk@40368 602fd350-edb4-49c9-b593-d223f7449a82
Enable connecting to multiple wp-api `endpoints`. Calling `wp.api.init` with a new `apiRoot` will parse the new endpoint's schema and store a new set of models and collections. A collection of connected endpoints is stored in `wp.api.endpoints`.
Props lucasstark.
Fixes#39683.
git-svn-id: https://develop.svn.wordpress.org/trunk@40364 602fd350-edb4-49c9-b593-d223f7449a82
For better accessibility, expandable panels should be placed immediately after
the control that expands them. This change moves the Media Library inline
uploader up, right after the "Add New" button, also introducing consistency with
the Plugin and Theme uploaders.
Adds a proper ARIA role on the button and an `aria-expanded` attribute to give
better feedback to assistive technologies users about the uploader's expanded state.
Improves the focus handling when closing the uploader, improves the focus style
and color contrast ratio of the uploader "close" button.
Props mantismamita, karmatosed, adamsilverstein, afercia.
Fixes#37188.
git-svn-id: https://develop.svn.wordpress.org/trunk@40359 602fd350-edb4-49c9-b593-d223f7449a82
After [40059] the CSS class `button-link` uses `text-align: left` by default.
This change now requires to limit as much as possible the use of `button-link`
to controls that should really look like links and to explicitly set
`text-align: center` in a few other cases.
Fixes#39983.
git-svn-id: https://develop.svn.wordpress.org/trunk@40358 602fd350-edb4-49c9-b593-d223f7449a82
Always passes the complete `position` object to the jQuery autocomplete widget.
Also checks if an autocomplete instance already exists on the Bulk Edit textarea.
Props davidbenton.
Fixes#40242.
git-svn-id: https://develop.svn.wordpress.org/trunk@40357 602fd350-edb4-49c9-b593-d223f7449a82
Prior to 4.7, term relationships - as set by `wp_set_object_terms()` or
`wp_remove_object_terms()` - did not affect the term query cache. The
introduction of the 'object_ids' parameter in 4.7 means that the query
cache must be aware of object-term relationships. As such, the
'last_changed' incrementor is now invalidated when term relationships
are modified.
This bug only reared its head when delaying term counting, because term
counting performs its own term query cache invalidation.
Props mboynes.
Fixes#40306.
git-svn-id: https://develop.svn.wordpress.org/trunk@40353 602fd350-edb4-49c9-b593-d223f7449a82
A couple of REST API tests had an assertion `assertNotInstanceOf( 'WP_Error', $response );` which will never be true.
Since these assertions are invalid, and also made redundant by the response status check, we can just remove them.
Props dlh.
Fixes#40270.
git-svn-id: https://develop.svn.wordpress.org/trunk@40350 602fd350-edb4-49c9-b593-d223f7449a82
The `site-lookup` group was introduced in WPMU, but never actually used in WordPress core.
Props johnjamesjacoby.
Fixes#38725.
git-svn-id: https://develop.svn.wordpress.org/trunk@40347 602fd350-edb4-49c9-b593-d223f7449a82
In previous iterations of `WP_Site`, there was concern that not all properties would be available when storing a site's details in cache. When introduced in [37918], an `ms_loaded` check was added to address this concern. Any properties that are still `false` after `ms_loaded` really are `false` and can be cached as such.
Props flixos90.
Fixes#40247.
git-svn-id: https://develop.svn.wordpress.org/trunk@40344 602fd350-edb4-49c9-b593-d223f7449a82
Add `useremail`, `userslugs`, `networks`, `sites`, and `site-details` as global cache groups when added with unit tests. This aligns the list with the core default.
Fixes#40283.
git-svn-id: https://develop.svn.wordpress.org/trunk@40343 602fd350-edb4-49c9-b593-d223f7449a82