In 4.3 the widget controls were fully initialized up front along with the sidebar controls. The sidebar control depended (unnecessarily) on the widget control to ensure that `wp.customize.Widgets.savedWidgetIds` was defined. So after [34563] there could be a situation where the widgets are added/removed from a sidebar before their controls are initialized (if the sidebar section is never expanded), resulting in an error attempting to get a property off of an undefined value. So this change does the right thing and defines `savedWidgetIds` up front.
Also changes the `savedWidgetIds` variable type from an array to an object, to match how it is used as a dictionary lookup.
See #33901.
git-svn-id: https://develop.svn.wordpress.org/trunk@34883 602fd350-edb4-49c9-b593-d223f7449a82
Defer to default styling provided by the theme (and browser) in `wp-activate.php` and remove the `font-family` and `color` from the provided internal stylesheet.
Previously, [17327] and [18406].
Fixes#34145.
git-svn-id: https://develop.svn.wordpress.org/trunk@34882 602fd350-edb4-49c9-b593-d223f7449a82
Up until now password protected posts would only get a identifying class when
the password was still required. This adds a class for the case when that
requirement has been met.
For the other visibility types we already have `status-publish`
and `status-private`.
Props mdgl, F4rkie, wonderboymusic for initial patches.
Fixes#21899.
git-svn-id: https://develop.svn.wordpress.org/trunk@34881 602fd350-edb4-49c9-b593-d223f7449a82
WordPress.org was taken down due to as Otto42 describes:
The previous version of this function added the query piece for the meta key = blog_id.capabilities, regardless of whether or not a role was requested. This limits the users returned to those with some defined role on this particular multisite instance.
See #22212
git-svn-id: https://develop.svn.wordpress.org/trunk@34880 602fd350-edb4-49c9-b593-d223f7449a82
* 'role' now accepts an array or comma-separated list of role names. When passing multiple values for 'role', `WP_User_Query` will only match users that have all of the specified roles.
* 'role__in' accepts an array of role names, and allow the filtering of matched users to those with at least one of the specified roles.
* 'role__not_in' accepts an array of role names, and allows the filtering of matched users to those who have none of the specified roles.
Props swissspidy, mordauk, barrykooij, sirbrillig.
Fixes#22212.
git-svn-id: https://develop.svn.wordpress.org/trunk@34875 602fd350-edb4-49c9-b593-d223f7449a82
The static 'comment-form' class was originally added to `comment_form()` in [24525]. This new argument should provide needed flexibility in styling the comment form further.
Props flixos90.
Fixes#34170. See #23851.
git-svn-id: https://develop.svn.wordpress.org/trunk@34871 602fd350-edb4-49c9-b593-d223f7449a82
New functions in `media.php`:
* `wp_get_attachment_image_srcset_array()` - Returns an array of image candidate string data used to build a `srcset` value for an attachment given an `$attachement_id` and `$size`.
* `wp_get_attachment_image_srcset()` - Returns the `srcset` value for an attachment given an `$attachement_id` and `$size`.
* `wp_get_attachment_image_sizes()` - Returns the `sizes` value for an attachment given an `$attachement_id` and `$size` and optional arguments used to alter its output.
* `wp_make_content_images_responsive()` - A display filter for adding `srcset` and `sizes` to images embedded in content.
* `wp_img_add_srcset_and_sizes()` - A utility function used by `wp_make_content_images_responsive()` to add `srcset` and `sizes` to a single `<img>` element.
Modifies existing core functions:
* Modify `wp_get_attachment_image()` so the HTML returned for an image includes `srcset` and `sizes`.
* Modify `get_media_embedded_in_content()` (sup, 3.6 leftover) by adding `<img>` to the list of accepted tags that can be matched in content. This is used in `wp_make_content_images_responsive()` to find all of the images embedded in content before passing them off to `wp_img_add_srcset_and_sizes()`.
Tests:
* Add a new factory method to `WP_UnitTest_Factory_For_Attachment` named `create_upload_object()`
* Adds unit tests
* Updates unit tests
Props joemcgill, tevko, jaspermdegroot, mdmcginn, barryceelen, peterwilsoncc, fsylum, wonderboymusic, chriscoyier, benjaminpick, jrfnl, #12kingkool68, janhenckens, ryanmarkel, side777, ryelle, wturrell, micahmills, mattbagwell, coliff, DrewAPicture.
See #33641.
git-svn-id: https://develop.svn.wordpress.org/trunk@34855 602fd350-edb4-49c9-b593-d223f7449a82
The function encapsulates the existing `subdirectory_reserved_names` filter and reduces the maintenance burden of keeping the value of (currently) two instances of the same hook in sync.
See #33615.
git-svn-id: https://develop.svn.wordpress.org/trunk@34854 602fd350-edb4-49c9-b593-d223f7449a82
It should be the time at which the post was written, but it was never because of the missing `$parent` argument.
Fixes#33238.
git-svn-id: https://develop.svn.wordpress.org/trunk@34839 602fd350-edb4-49c9-b593-d223f7449a82
Adds unit tests for `WP_Customize_Setting::save()` (and `WP_Customize_Setting::update()`), along with the actions `customize_update_{$type}`, and `customize_save_{$id_base}` which they trigger.
Fixes#34140.
git-svn-id: https://develop.svn.wordpress.org/trunk@34838 602fd350-edb4-49c9-b593-d223f7449a82
This brings it closer to the width of the input so there is less jumping around of buttons. We can afford the space now that other buttons in the space are typically no longer there.
fixes#18306.
git-svn-id: https://develop.svn.wordpress.org/trunk@34833 602fd350-edb4-49c9-b593-d223f7449a82
The `WP_INSTALLING` constant is a flag that WordPress sets in a number of
places, telling the system that options should be fetched directly from the
database instead of from the cache, that WP should not ping wordpress.org for
updates, that the normal "not installed" checks should be bypassed, and so on.
A constant is generally necessary for this purpose, because the flag is
typically set before the WP bootstrap, meaning that WP functions are not yet
available. However, it is possible - notably, during `wpmu_create_blog()` -
for the "installing" flag to be set after WP has already loaded. In these
cases, `WP_INSTALLING` would be set for the remainder of the process, since
there's no way to change a constant once it's defined. This, in turn, polluted
later function calls that ought to have been outside the scope of site
creation, particularly the non-caching of option data. The problem was
particularly evident in the case of the automated tests, where `WP_INSTALLING`
was set the first time a site was created, and remained set for the rest of the
suite.
The new `wp_installing()` function allows developers to fetch the current
installation status (when called without any arguments) or to set the
installation status (when called with a boolean `true` or `false`). Use of
the `WP_INSTALLING` constant is still supported; `wp_installing()` will default
to `true` if the constant is defined during the bootstrap.
Props boonebgorges, jeremyfelt.
See #31130.
git-svn-id: https://develop.svn.wordpress.org/trunk@34828 602fd350-edb4-49c9-b593-d223f7449a82