2682 Commits

Author SHA1 Message Date
Sergey Biryukov
8880871b78 Privacy: Revert [43525].
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
2018-07-24 17:07:19 +00:00
Sergey Biryukov
f147a718ab REST API: Ensure attachments created with WP_REST_Attachments_Controller::create_item() on Windows have a relative path.
Props ocean90, SergeyBiryukov, redcastor.
Merges [43529] to the 4.9 branch.
Fixes #40861.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43530 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-24 16:53:17 +00:00
Sergey Biryukov
ed6fe25890 Privacy: Remove the setting to enable comment cookies consent added in [43469].
This needs some more work to ensure expected behaviour.

Merges [43525] to the 4.9 branch.
See #44373.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43526 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-24 12:52:29 +00:00
Sergey Biryukov
f1e98d9609 Comments: Ensure that themes overriding default comment_form() fields still display the cookies consent checkbox.
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
2018-07-24 12:42:33 +00:00
K. Adam White
343e8d4ea3 REST API: Support meta registration for specific object subtypes.
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
2018-07-19 18:48:52 +00:00
Sergey Biryukov
9c35dcd477 Privacy: Use the actual Privacy Policy page title in get_the_privacy_policy_link().
Props desrosj, birgire, ianbelanger, Ov3rfly.
Merges [43506] to the 4.9 branch.
Fixes #44192.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43507 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-18 11:51:06 +00:00
Sergey Biryukov
2080421de2 Privacy: Add unit tests for _wp_privacy_send_request_confirmation_notification(), introduced in [43211].
Props birgire, desrosj, garrett-eclipse.
Merges [43499] to the 4.9 branch.
Fixes #43967.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43500 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 23:02:14 +00:00
Sergey Biryukov
9f2e375a48 Taxonomy: Ensure that invalid term objects are discarded in WP_Term_Query.
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
2018-07-17 16:27:12 +00:00
Sergey Biryukov
26d12c9753 REST API: Attachments controller should respect upload limits.
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
2018-07-17 16:11:48 +00:00
Andrew Ozz
f2783d5e91 Customize: Do not attempt to count uncountable value.
Props dlh.
Merges [43480] to the 4.9 branch.
Fixes #44104.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43481 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 14:39:59 +00:00
Andrew Ozz
98972bf358 Privacy: Fix tests after [43467].
Merges [43471] to the 4.9. branch.
See #44141.


git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43473 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 10:06:12 +00:00
Andrew Ozz
0f75de12c7 Privacy: Don't replace comment author URL and email with anything.
Props TZ-Media, desrosj, birgire.
Merges [43467] to the 4.9 branch.
Fixes #44141.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43468 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-17 09:03:33 +00:00
Sergey Biryukov
8123e2187a Privacy: Use consistent values for the site name and URL used in notification emails.
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
2018-07-16 14:23:26 +00:00
Gary Pendergast
96c83f4400 REST API: Filter responses based on the _fields parameter, before data is processed.
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
2018-07-13 06:50:51 +00:00
Gary Pendergast
f364b2fa5c Emoji: Update Twemoji to version 11.0.
🦹

Backport of [43377] to the 4.9 branch.

Props kraftbj,
Fixes #44339.



git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43444 602fd350-edb4-49c9-b593-d223f7449a82
2018-07-13 06:36:23 +00:00
Gary Pendergast
b16c8874f2 REST API: Tweak permission checks for taxonomy and term endpoints
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
2018-07-13 06:28:29 +00:00
Gary Pendergast
c8d1e3f6b8 REST API: Expose revision count and last revision ID on Post response
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
2018-07-13 06:13:27 +00:00
Gary Pendergast
f02581f667 REST API: Declare user capabilities using JSON Hyper Schema's "targetSchema".
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
2018-07-11 09:20:10 +00:00
Andrew Ozz
5ab9fcc659 Privacy: add esc_html to assertion in test_wp_comments_personal_data_exporter.
Props mermel, 1naveengiri.
Merges [43371] to the 4.9 branch.
Fixes #44113.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43372 602fd350-edb4-49c9-b593-d223f7449a82
2018-06-18 16:12:08 +00:00
Sergey Biryukov
c4b31e3816 Community Events Dashboard: Always show a WordCamp if one is coming up.
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
2018-06-16 10:42:16 +00:00
John Blackbourn
e86a6dfdb5 Build/Test Tools: Allow the unit test framework to be used without the data directory in place.
Fixes #43982

Merges [43315] to the 4.9 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43316 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-25 22:47:39 +00:00
Boone Gorges
f27af570cd Taxonomy: Improve cache handling when querying for terms using all_with_object_id.
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
2018-05-25 01:25:55 +00:00
Sergey Biryukov
b6f00e0c4c General: Skip test_is_countable_ResourceBundle() on PHP 5.3 and below.
`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
2018-05-10 20:17:00 +00:00
Sergey Biryukov
ef2fccb0f9 General: In the is_countable() polyfill, if the provided object implements SimpleXMLElement or ResourceBundle, consider it countable.
Props ayeshrajans, jrf, desrosj.
Merges [43220] to the 4.9 branch.
Fixes #43583.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43221 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-10 17:58:46 +00:00
Sergey Biryukov
39fd607088 Privacy: Mark processed requests as completed instead of confirmed.
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
2018-05-09 14:30:59 +00:00
Andrew Ozz
bb3e7f4779 Privacy: rename manage_privacy_policy to manage_privacy_options.
Props desrosj.
Merges [43155] to the 4.9 branch.
Fixes #43935.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43156 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-03 19:34:21 +00:00
Andrew Ozz
64279d7f38 Privacy: Limit Privacy Settings screen to Super Admins in Multisite.
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
2018-05-03 18:41:18 +00:00
Sergey Biryukov
b1b7009e55 Privacy: add user information to the personal data export file.
Props TZ-Media, desrosj.
Merges [43055] and [43116] to the 4.9 branch.
See #43547.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43117 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 04:20:35 +00:00
Sergey Biryukov
e8e4f97a73 Privacy: Limit export and erasure to super admins on Multisite.
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
2018-05-02 03:48:27 +00:00
Sergey Biryukov
c9b8dffac9 Privacy: improve wp_privacy_erase_personal_data(), return boolean values.
Props ericdaams.
Merges [43061] to the 4.9 branch.
See #43602.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43110 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 03:43:37 +00:00
Sergey Biryukov
c3a2cff3f8 Privacy: Add template tags for building link to privacy policy page.
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
2018-05-02 03:38:23 +00:00
Sergey Biryukov
9a76fbceab Privacy: fix unit tests after [43012].
Props iandunn.
Merges [43015] to the 4.9 branch.
See #43546.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43093 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 02:16:59 +00:00
Sergey Biryukov
ccccd321f6 Privacy: add helper function for anonymizing data in a standardized way.
Props jesperher, allendav, iandunn, birgire, azaozz, joemcgill.
Merges [42971] and [43081] to the 4.9 branch.
Fixes #43545.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43082 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 00:48:23 +00:00
Sergey Biryukov
f1dce1678f Privacy: add functionality to anonymize commenters.
Props xkon, fclaussen, allendav, birgire, azaozz.
Merges [42994] to the 4.9 branch.
See #43442.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43080 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 00:20:31 +00:00
Sergey Biryukov
a5d2916bdf Privacy: fix docs, formatting, white space, add tests for the personal data from comments exporter.
Props birgire.
Merges [42987] to the 4.9 branch.
See #43440.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43077 602fd350-edb4-49c9-b593-d223f7449a82
2018-05-02 00:11:50 +00:00
Sergey Biryukov
61018a787a Tests: Update the REST API fixtures.
[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
2018-05-01 23:45:35 +00:00
Sergey Biryukov
d9d156de80 REST API: Add who=authors as a query parameter for GET wp/v2/users.
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
2018-05-01 22:17:26 +00:00
Sergey Biryukov
dae28e7c84 REST API: Include viewable attribute on Post Type resource for edit context.
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
2018-04-30 04:30:23 +00:00
Sergey Biryukov
c125a27018 General: Introduce a polyfill for is_iterable() function added in PHP 7.1.
Props jrf, schlessera, desrosj.
Merges [43036] to the 4.9 branch.
See #43619.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43037 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-30 04:16:43 +00:00
Sergey Biryukov
170e2df167 General: Introduce a polyfill for is_countable() function added in PHP 7.3.
Props jrf, ayeshrajans, desrosj.
Merges [43034] to the 4.9 branch.
See #43583.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@43035 602fd350-edb4-49c9-b593-d223f7449a82
2018-04-30 03:46:07 +00:00
Sergey Biryukov
342cac1a88 Formatting: Avoid a PHP 7.2 warning in wp_kses_attr() when one of $allowedtags elements is an uncountable value.
Props andrei0x309, soulseekah, SergeyBiryukov.
Merges [42860] to the 4.9 branch.
Fixes #43312.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@42861 602fd350-edb4-49c9-b593-d223f7449a82
2018-03-20 21:36:04 +00:00
Joe McGill
a035fa16b6 Update unit test following r42839.
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
2018-03-17 20:59:30 +00:00
Joe McGill
1d3974aee4 Revert max-width styles on caption shortcodes.
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
2018-03-16 20:18:48 +00:00
Mike Schroder
1e1f116671 Media: Correctly allow changing PDF thumbnail crop value.
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
2018-03-09 03:20:52 +00:00
Sergey Biryukov
fc91f93c7a Customize: Ensure media playlists get initialized after selective refresh; expose new wp.playlist.initialize() API.
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
2018-01-30 14:55:25 +00:00
Sergey Biryukov
99d37cc0fb Customize: Include nav menu item for Home custom link in search results for "Home".
Props audrasjb, westonruter.
Merges [42611] to the 4.9 branch.
Fixes #42991.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@42621 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-30 14:45:55 +00:00
Sergey Biryukov
58b2a6e572 Customize: Ensure customize_autosaved requests only use revision of logged-in user.
Props dlh, westonruter.
See #42433, #39896.
Merges [42615] to the 4.9 branch.
Fixes #42450.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@42620 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-30 14:43:55 +00:00
Aaron Jorbin
049b63a3fa Query: Fix warning on counting non countable
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
2018-01-24 21:43:17 +00:00
Sergey Biryukov
5d91d4eb94 Tests: Update emoji base URL in Tests_Formatting_Emoji after [42590].
Merges [42592] to the 4.9 branch.
See #42862.

git-svn-id: https://develop.svn.wordpress.org/branches/4.9@42593 602fd350-edb4-49c9-b593-d223f7449a82
2018-01-24 17:30:11 +00:00
Gary Pendergast
1cc2b3f6b6 Canonical URLs: Redirect to the correct URL when the post date changes.
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
2018-01-24 07:11:40 +00:00