The commenter cookies checkbox is not legally required, so should be disabled by default.
Merges [43531] to the 4.9 branch.
Fixes#44373.
git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43532 602fd350-edb4-49c9-b593-d223f7449a82
The `comment_form_default_fields` filter can be used to remove the checkbox.
Props pross, SergeyBiryukov.
Merges [43518] to the 4.9 branch.
Fixes#44126.
git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43524 602fd350-edb4-49c9-b593-d223f7449a82
Introduce an object_subtype argument to the args array for register_meta() which can be used to limit meta registration to a single subtype (e.g. a custom post type or taxonomy, vs all posts or taxonomies).
Introduce register_post_meta() and register_term_meta() wrapper methods for register_meta to provide a convenient interface for the common case of registering meta for a specific taxonomy or post type. These methods work the way plugin developers have often expected register_meta to function, and should be used in place of direct register_meta where possible.
Props flixos90, tharsheblows, spacedmonkey.
Merges [43378] to the 4.9 branch.
Fixes#38323.
git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43510 602fd350-edb4-49c9-b593-d223f7449a82
The `get_term()` mapping may result in term objects that are `null` or
`WP_Error` when plugins use `get_term` or a related filter. Since `null`
and error objects are not valid results for a term query, we discard
them.
Props GM_Alex.
Merges [43049] and [43491] to the 4.9 branch.
Fixes#42691.
git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43492 602fd350-edb4-49c9-b593-d223f7449a82
When the REST API is in use on WordPress multisite, the `WP_REST_Attachments_Controller` should respect the "Max upload file size" and "Site upload space" site options.
Props flixos90, danielbachhuber.
Merges [43462] to the 4.9 branch.
Fixes#43751.
git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43489 602fd350-edb4-49c9-b593-d223f7449a82
The functions `send_confirmation_on_profile_email()`, `_wp_privacy_send_request_confirmation_notification()`, `_wp_privacy_send_erasure_fulfillment_notification()`, and `wp_send_user_request()` all include a title and URL indicating the current site. However, so far they have dealt with those values inconsistently, sometimes using the site values, other times using the network values if in a multisite. This changeset ensures that only the current site is taken into account in all cases and that special characters in the site name are consistently decoded.
Props subrataemfluence, desrosj.
Merges [43388], [43390], and [43435] to the 4.9 branch.
Fixes#44396.
git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43459 602fd350-edb4-49c9-b593-d223f7449a82
Historically, the REST API would generate the entire response object, including running expensive filters, then it would apply the `_fields` parameter, discarding the fields that weren't specificed.
This change causes `_fields` to be applied earlier, so that only requested fields are processed.
Merges [43087] to the 4.9 branch.
Props danielbachhuber.
See #43874.
git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43445 602fd350-edb4-49c9-b593-d223f7449a82
To match behaviour in the Classic Editor, we need to slightly loosen permissions on taxonomy and term endpoints. This allows users to create terms to assign to a post that they're editing.
Merges [43440] to the 4.9 branch.
Props danielbachhuber.
Fixes#44096.
git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43443 602fd350-edb4-49c9-b593-d223f7449a82
So that REST API clients can show appropriate UI for a post's revisions, it needs to know how many revisions the post has, and what the latest revision ID is.
Merge of [43439] and [43441] to the 4.9 branch.
Props kadamwhite, danielbachhuber, birgire, TimothyBlynJacobs, pento.
Fixes#44321.
git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43442 602fd350-edb4-49c9-b593-d223f7449a82
There are a variety of operations a WordPress user can only perform if they have the correct capabilities. A REST API client should only display UI for one of these operations if the WordPress user can perform the operation.
Rather than requiring REST API clients to calculate whether to display UI based on potentially complicated combinations of user capabilities, `targetSchema` allows us to expose a single flag to show whether the corresponding UI should be displayed.
This change also includes flags on post objects for the following actions:
- `action-publish`: The current user can publish this post.
- `action-sticky`: The current user can make this post sticky, and the post type supports sticking.
- `action-assign-author': The current user can change the author on this post.
- `action-assign-{$taxonomy}`: The current user can assign terms from the "$taxonomy" taxonomy to this post.
- `action-create-{$taxonomy}`: The current user can create terms int the "$taxonomy" taxonomy.
Merges [43437] to the 4.9 branch.
Props TimothyBlynJacobs, danielbachhuber.
Fixes#44287.
git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43438 602fd350-edb4-49c9-b593-d223f7449a82
WordCamps are celebrations of the local WordPress Community and once a local one is scheduled, people in that community should know it is coming. This adjusts the WordPress Events in the dashboard widgets to always display a WordCamp, even if there are multiple Meetups happening first.
Props iandunn, metalandcoffee, warmlaundry, alejandroxlopez, jorbin.
Merges [42726], [42728], and [43356] to the 4.9 branch.
Fixes#41112.
git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43357 602fd350-edb4-49c9-b593-d223f7449a82
When a term query using `fields=all_with_object_id` hits the cache, the
cached `stdClass` objects must be converted to `WP_Term` objects. This
was overlooked when `WP_Term_Query` was refactored to support object
queries in [38667].
Merges [43313] to the 4.9 branch.
Props dlh.
Fixes#44221.
git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43314 602fd350-edb4-49c9-b593-d223f7449a82
`ResourceBundle` is only countable in PHP 5.4+, which can be considered an acceptable edge case for WordPress core purposes.
Props jrf, ayeshrajans.
Merges [43226] to the 4.9 branch.
Fixes#43583.
git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43227 602fd350-edb4-49c9-b593-d223f7449a82
r43008 refactored the request flow to make several improvements, but accidentally marked `completed` requests as `confirmed`. This commit restores the intended statuses, so that the data and corresponding UI reflect reality.
Props allendav, birgire.
Merges [43183] to the 4.9 branch.
Fixes#43913.
git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43187 602fd350-edb4-49c9-b593-d223f7449a82
In many common Multisite use cases, the network administrator will want to set a network-wide privacy policy -- via the privacy_policy_url filter -- for consistency and convenience. When that's done, the Privacy Settings screen on individual sites becomes unnecessary, and may confuse administrators of those sites when they see that their changes don't have any effect on the policy link in the footer.
Since we can't programatically determine which behavior the network admins would like, the safest default setting is to restrict the ability to super admins, and let them delegate it to individual site owners via a plugin, if they'd like to.
Merhes [43147] to the 4.9 branch.
Fixes#43935.
git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43153 602fd350-edb4-49c9-b593-d223f7449a82
Multisite networks have a variety of use cases, and in many of them single-site administrators are not trusted to take actions that affect the whole network, require making decisions about legal compliance, etc. By default, those actions should require super admin capabilities. Plugins can be used to override that behavior if a particular site's use case calls for it.
Props allendav, jeremyfelt, iandunn.
Merges [43085] to the 4.9 branch.
Fixes#43919.
git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43111 602fd350-edb4-49c9-b593-d223f7449a82
This introduces the `get_the_privacy_policy_link()` and `the_privacy_policy_link()` functions, as well as the `privacy_policy_url` filter.
A new `tests/url/` folder was added to better organize tests related to `get_*_url()` functions. Previously, those tests were placed in `tests/url.php` and `tests/link/`, but neither of those locations are optimal. Placing tests in `tests/url.php` violates the guideline of creating separate files/classes for each function under test, and using `tests/link/` conflates two distinct -- albeit related -- groups of functions. Over time, URL-related tests can be migrated to the new folder.
Props birgire, xkon, azaozz, iandunn.
Merges [43002] to the 4.9 branch.
See #43850.
git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43109 602fd350-edb4-49c9-b593-d223f7449a82
[42967] included new post statii, but didn't add them to the REST API tests.
Props pento.
Merges [42972] to the 4.9 branch.
See #43481.
git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43072 602fd350-edb4-49c9-b593-d223f7449a82
Any WordPress user who can `edit_posts` of a post type with `show_in_rest=true` can query for authors. This maps to current WordPress behavior where a WordPress user who can view the Manage Posts view for a post type can see any WordPress user assigned to a post (whether published or draft).
This implementation, over restricting `who=authors` to users with `list_users`, gives us future flexibility in displaying lists of posts. It still respects more restrictive permissions for `context=edit`.
Props danielbachhuber.
Merges [43001] to the 4.9 branch.
Fixes#42202.
git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43067 602fd350-edb4-49c9-b593-d223f7449a82
For the block editor to be able to expose the Preview button correctly, it needs to know the `is_post_type_viewable()` setting, this change adds it to the Post Type response.
Props danielbachhuber.
Merges [43007] to the 4.9 branch.
Fixes#43739.
git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43038 602fd350-edb4-49c9-b593-d223f7449a82
This updates the expected version number for Hello Dolly in `Tests_Ajax_Update_Plugin::test_update_plugin` following [42839].
See #43555.
Merges [42841] to the 4.9 branch.
git-svn-id: https://develop.svn.wordpress.org/branches/4.9@42842 602fd350-edb4-49c9-b593-d223f7449a82
This is a partial revert of [41724], so image captions include an
inline `width` style instead of `max-width`.
This returns the caption shortcode to the pre-4.9.0 behavior, while
retaining the extra unit test coverage added in [41724].
Fixes#43123. See #33981.
Merges [42837] to the 4.9 branch.
git-svn-id: https://develop.svn.wordpress.org/branches/4.9@42838 602fd350-edb4-49c9-b593-d223f7449a82
Corrects logic that kept plugins from setting crop value of intermediate image sizes for rendered PDFs.
Adds test.
Props leemon, SergeyBiryukov, chetan200891, birgire.
Merges [42792] to the 4.9 branch.
Fixes#43226.
git-svn-id: https://develop.svn.wordpress.org/branches/4.9@42813 602fd350-edb4-49c9-b593-d223f7449a82
In particular allows audio and video playlists to be added to the Text widget and previewed.
Props bpayton, westonruter.
See #40854.
Merges [42613], [42617] to the 4.9 branch.
Fixes#42495.
git-svn-id: https://develop.svn.wordpress.org/branches/4.9@42622 602fd350-edb4-49c9-b593-d223f7449a82
Merges [42581], [42585], and [42594] to the 4.9 branch.
Adds tests to continue the behavior for both null and strings. Skip the tests on PHP 5.2 as they require ReflectionMethod.
See https://wiki.php.net/rfc/counting_non_countables for information on the PHP change.
Fixes#42860.
Props dd32 for test skipping and janak007 and ayeshrajans for initial patches.
git-svn-id: https://develop.svn.wordpress.org/branches/4.9@42597 602fd350-edb4-49c9-b593-d223f7449a82
When a post slug is changed, we store a copy of the old slug, so that we can redirect visitors visiting the old URL to the new URL.
In the same way, this stores a copy of the old date, when the post date changes, so we can redirect visitors to the new URL.
Merge of [42401,42587,42588] to the 4.9 branch.
Props nickmomrik, frank-klein.
Fixes#15397.
git-svn-id: https://develop.svn.wordpress.org/branches/4.9@42589 602fd350-edb4-49c9-b593-d223f7449a82