Commit Graph

12162 Commits

Author SHA1 Message Date
Konstantin Obenland
98e9eaa3e1 Import Twenty Sixteen for the 4.7 branch.
See #36497.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40855 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-30 22:56:39 +00:00
Aaron D. Campbell
20b5d4a4e0 Post-4.7.5 version bump for 4.7 branch.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40770 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-16 23:00:35 +00:00
Aaron D. Campbell
7719ada25f Bump 4.7 branch to version 4.7.5.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40748 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-16 21:47:01 +00:00
Pascal Birchler
f5bc3b5a12 Media: Simplify upload error message construction.
Merges [40736] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40737 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-16 17:59:37 +00:00
Pascal Birchler
f54b1461ac REST API: JS Client - Enable connecting to multiple endpoints.
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.

Merges [40364] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40735 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-16 16:34:22 +00:00
Aaron D. Campbell
38b02ca333 Add nonce for updating file system credentials.
Merges [40723] to 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40724 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-16 14:50:27 +00:00
Dominik Schilling (ocean90)
85bc8c5dc3 Customize: Ignore invalid customization sessions.
Merge of [40704] to the 4.7 branch.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40705 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-16 12:13:07 +00:00
Pascal Birchler
8c2038b21f Adjust post meta checks
Merges [40692] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40693 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-16 08:47:33 +00:00
Pascal Birchler
8a28180db9 Improve redirect handling
Merges[40689] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40690 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-16 08:39:47 +00:00
Pascal Birchler
40ece6751b Whitelist post arguments in XML-RPC
Merges [40677] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40678 602fd350-edb4-49c9-b593-d223f7449a82
2017-05-16 08:16:13 +00:00
Boone Gorges
a82fe2b598 Restore support for taxonomy 'args' override when querying object terms.
[7520] introduced an undocumented feature whereby developers could
register a custom taxonomy with an 'args' parameter, consisting of
an array of config params that, when present, override corresponding
params in the `$args` array passed to `wp_get_object_terms()` when
using that function to query for terms in the specified taxonomy.

The `wp_get_object_terms()` refactor in [38667] failed to respect
this secret covenant, and the current changeset atones for the
transgression.

Ports [40513] to the 4.7 branch.

Props danielbachhuber.
Fixes #40496.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40514 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-21 19:18:00 +00:00
Dion Hulse
2c0ecb234a List Tables: After [38703], [38706], and [40118], adjust the jQuery selector to make the selection of a range of checkboxes work again.
Unprop afercia.
Merges [40268] to the 4.7 branch.
Fixes #40056.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40512 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-21 07:35:13 +00:00
Pascal Birchler
97f31221c1 Post-4.7.4 version bump for 4.7 branch.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40509 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-20 18:53:04 +00:00
Pascal Birchler
986f929a4d Bump 4.7 branch to version 4.7.4.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40487 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-20 16:20:22 +00:00
Andrew Ozz
16b1859218 TinyMCE: Fix cursor position after updating a wpview node. Fix hiding the inline toolbar on editor blur.
Props iseulde, azaozz.

Merges [40481] to the 4.7 branch.
Fixes #40480.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40482 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-19 22:17:25 +00:00
Pascal Birchler
45e83df257 Bump 4.7 branch to 4.7.4-RC1.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40475 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-18 17:05:28 +00:00
Pascal Birchler
7efa7c5af2 4.7.4-RC
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40474 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-18 15:51:27 +00:00
Pascal Birchler
ea9c78ce42 Twenty Seventeen: Bump version and update the changelog.
Updates changelog to link to Codex pages, like other default themes.

Props swissspidy, davidakennedy.
Fixes #40461.

Merges [40472] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40473 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-18 09:21:52 +00:00
Pascal Birchler
aae4c43484 Fix broken audio/video functions when sanitizing ID3 data
This fixes a bug where running `wp_kses_post_deep()` on all the ID3
tag data corrupted blob data.

Fixes #40075, #40085.

Merges [40400] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40460 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-17 12:59:21 +00:00
Pascal Birchler
02c197a874 Twenty Seventeen: Correct heading hierarchy for posts on the front page.
When the posts page is on the front page or within a front page section, the heading hierarchy for the individual post titles needs to be adjusted accordingly.

Props joedolson, celloexpressions, davidakennedy.
Fixes #40264.

Merges [40458] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40459 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-17 10:23:25 +00:00
Pascal Birchler
232293a9f5 Media: Ensure Crop Image is always visible.
Previously, the crop button in the media modal after uploading header images or similar was hidden and the task could not be completed.

Props karinedo, sagarprajapati, Cybr, mayurk.
Fixes #40152.

Merges [40428] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40429 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-14 09:33:35 +00:00
Pascal Birchler
6c2132089e REST API: Allow fetching multiple terms at once via the slug parameter.
This matches a similar change previously made for posts (#38579) and an upcoming change for users (#40213).

Props wonderboymusic, MatheusGimenez, curdin.
Fixes #40027.

Merges [40376] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40427 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-14 08:53:11 +00:00
Pascal Birchler
0b17a58481 REST API: Allow fetching multiple users at once via the slug parameter.
This matches similar changes previously made for posts (#38579) and terms (#40027).

Props curdin, MatheusGimenez.
Fixes #40213.

Merges [40378] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40426 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-14 08:46:22 +00:00
Pascal Birchler
59e00d43a5 Media: Add filters to allow overriding slow media queries.
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.

Merges [40382] and [40421] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40425 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-14 08:39:46 +00:00
Pascal Birchler
41e53f4385 Customize: Verify availability of history.replaceState (in IE9) before attempting to populate changeset_uuid parameter.
Props westonruter, timmydcrawford for testing.
Amends [39686].
See #39227.
Fixes #40405.

Merges[40405] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40420 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-13 12:31:23 +00:00
Andrew Ozz
3f0f8d4a31 Update TinyMCE to 4.5.6. Has many improvements and bug fixes. Changelog: https://github.com/tinymce/tinymce/blob/4.5.x/changelog.txt.
Merges [40398] to the 4.7 branch.

Props programmin, eclev91 and boldwater for finding and reporting this.
Fixes #40305.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40419 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-13 01:51:44 +00:00
Pascal Birchler
9e500a9b06 Media: Improve handling of non-image files in wp_get_image_mime.
This prevents non-image fileypes from returning a mime type of "application/octet-stream" when `exif_imagetype()` returns `false`.

Props blobfolio.
Fixes #40017.

Merges [40397] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40403 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-10 14:27:23 +00:00
Pascal Birchler
e86ab4f969 Customize: Auto-expand a widget area section when expanding the Widgets panel if there is only one registered sidebar and it is active.
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.

Merges [40395] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40402 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-10 12:35:38 +00:00
Pascal Birchler
fd09e9b680 Customize: Fix behavior of clicking Delete Menu link and keep available nav menu items panel open when doing bulk deletion.
Props maguiar, adamsilverstein for testing.
Amends [39548].
Fixes #38953.

Merges [40396] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40401 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-10 12:28:08 +00:00
Pascal Birchler
4c580ff912 Bootstrap/Load: Only load PasswordHash class once.
`require_once` prevents errors when loading WordPress and the class already exists.

See [40387].
Fixes #39445. 


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40389 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-06 18:22:32 +00:00
Pascal Birchler
c7c37590f9 Customize: Fix HTTPS navigation of site in preview on IE11.
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.

Merges [40381] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40386 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-06 17:32:17 +00:00
Pascal Birchler
d6bf6a5261 Multisite: Handle sites cache invalidation more granularly for option updates.
Previously `update_blog_option()` would trigger an invalidation of that site's entire cache although these changes did not affect the content of 
these caches. Furthermore changes to the special options `blogname`, `siteurl` and `post_count` should not invalidate the entire cache of that site, but only their respective site details cache. The option `home` now has the same behavior as it also belongs to the site details, but did not invalidate the cache at all previously.

Several new unit tests confirm these changes work as expected.

Fixes #40063.

Merges [40305] and [40333] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40385 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-06 17:26:04 +00:00
Pascal Birchler
1bf5e510aa Customize: Use is_header_video_active() as active_callback for external_header_video control instead of is_front_page().
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.

Merges [40379] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40384 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-06 17:20:08 +00:00
Pascal Birchler
8aed649adf Customize: Fix reversal of nav menu item's type and object properties for
page stub added in customizer.

Amends [38906].
See #38164.
Fixes #40277.

Merges [40380] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40383 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-06 17:17:19 +00:00
Pascal Birchler
5b74245108 Customize: Fix failure to collapse expanded sections and panels that become deactivated.
Improve jsdoc for `onChangeActive` function. Restores fix from [34557] which got dropped in [38648].

Props dlh, westonruter.
See #34391, #33509.
Fixes #39430.

Merges [40304] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40375 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-04 06:51:39 +00:00
Pascal Birchler
7abacb8516 Twenty Seventeen: Use esc_attr_e() for translatable strings in HTML attributes.
Props bor0.
Fixes #40216.

Merges [40311] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40374 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-04 06:39:15 +00:00
Pascal Birchler
9bf0436c67 Twenty Seventeen: Declare jQuery as a dependency for navigation.js.
Props chesio.
Fixes #40224.

Merges [40315] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40373 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-04 06:37:47 +00:00
Pascal Birchler
0b4f35262f Customize: Use get_user_locale() in customizer body class.
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.

Merges [40368] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40369 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-03 22:40:59 +00:00
Pascal Birchler
477746ab1a Administration: Fix minor misalignments caused by the button-link CSS class.
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.

Merges [40358] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40367 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-03 22:20:37 +00:00
Pascal Birchler
f9d84dd4ba Customize: Fix selective refresh when customizing the 404 template.
Overrides the 404 status during partial refresh requests to serve back 200 so that the request is not deemed a failure and invoke the fallback behavior (full refresh).

See #27355.
Fixes #40018.

Merges [40316] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40366 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-03 22:14:33 +00:00
Pascal Birchler
4294392293 Quick/Bulk Edit: Fix the Tag suggestions position on the Bulk Edit textarea.
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.

Merges [40357] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40365 602fd350-edb4-49c9-b593-d223f7449a82
2017-04-03 21:55:50 +00:00
Boone Gorges
52e1c3eff0 Invalidate term query caches when setting or deleting term relationships.
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.

Merges [40353] to the 4.7 branch.

Props mboynes.
Fixes #40306.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40354 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-30 16:55:32 +00:00
Pascal Birchler
a983452638 Customize: Prevent client-side validation from being cleared when no corresponding server-side validation is present.
See #36944.
Fixes #39770.

Merges [40319] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40345 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-28 07:21:20 +00:00
Pascal Birchler
16c518a2b0 Customize: Trailingslash the home nav menu item URL in starter content.
This prevents an additional 301 redirect when clicking on the nav menu item, and it also prevents a scenario where the auth cookie may not be passed 
and cause an authentication error when navigating in the customizer.

Props dlh, swissspidy.
Fixes #40112.

Merges [40300] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40338 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-27 09:28:36 +00:00
Pascal Birchler
3f200a7c35 REST API: Confirm the parent post object of an attachment exists in WP_REST_Posts_Controller::check_read_permission().
Avoid a PHP Error when attempting to embed the parent post of an attachment, when the parent post ID is invalid. Instead check if the parent post 
object exists before checking the read permission for the parent post.

Props GhostToast.
Fixes #39881. 

Merges [40306] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40337 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-27 09:23:05 +00:00
Pascal Birchler
8e68bdace3 REST API: Add gmt_offset and timezone_string to the base /wp-json response.
The site's current timezone offset is an important piece of information for any REST API client that needs to manipulate dates.  It has not been 
previously available.

Expose both the `gmt_offset` (the site's current offset from UTC in hours) and `timezone_string` (which also provides information about daylight 
savings time) via the "site info" endpoint (the base `/wp-json` response).

Also update the `wp-api-generated.js` fixture file with the changes to the default API responses.

Props sagarkbhatt.
Fixes #39854.

Merges [40238] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40336 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-27 07:08:54 +00:00
Pascal Birchler
966fca980f Customize: Fix navigation of site in preview on IE11.
Addresses issue in IE11 where the default port number of `:80` is unexpectedly included on `link.host` for links dynamically created by scripts.

Props westonruter, afercia for testing.
See #38409.
Fixes #40198.

Merges [40318] to the 4.7 branch.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40335 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-27 06:20:19 +00:00
Pascal Birchler
c25258a927 Customize: Harden site_icon control template to account for when full image size is missing.
Props aussieguy123, westonruter.
See #36749.
Fixes #40010.

Merges [40314] to the 4.7 branch.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40332 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-25 15:25:48 +00:00
Pascal Birchler
b10061bf8e Customize: Prevent links to customize.php from being generated which have query vars from wp_removable_query_args() present.
Props dlh.
See #23367, #32692.
Fixes #31850.

Merges [40313] to the 4.7 branch.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40331 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-25 13:34:27 +00:00
Pascal Birchler
0145add43a Posts, Post Types: Add missing REST API properties to WP_Post_Type class.
Props danielbachhuber.
Fixes #39986.

Merges [40302] to the 4.7 branch.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40329 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-24 19:04:26 +00:00
Pascal Birchler
12080c2497 Taxonomy: Add missing REST API properties to WP_Taxonomy class.
Props danielbachhuber.
Fixes #39987.

Merges [40303] to the 4.7 branch.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40328 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-24 19:03:14 +00:00
Pascal Birchler
e63968f21d Themes: Add filter for excluding directories from being scanned for template files.
Exclude 'node_modules' directories from paths searched in `WP_Theme::scandir()`. Introduces the `theme_scandir_exclusions` filter to allow sites to 
exclude any other paths like `bower_components` or `vendor` from being searched for template files.

Props lukasbesch, dd32, swisspidy, rachelbaker. 
Fixes #38292.

Merges [40301] to the 4.7 branch.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40326 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-24 18:43:13 +00:00
Pascal Birchler
d142d7fa23 REST API: Use get_gmt_from_date() when preparing a draft post for response.
This prevents wrong dates when dealing with DST, see [40115] and [40284].

Props nerrad.
Fixes #40136.

Merges [40284] and [40324] to the 4.7 branch.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40325 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-24 17:52:02 +00:00
John Blackbourn
8b23276a6a Login and Registration: Avoid a potentially incorrect value for the cookie hash on multisite installations that don't have a value in the siteurl network option.
This reverts [38619].

See #34084, #39497

Merges [40320] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40321 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-23 19:02:23 +00:00
Boone Gorges
4eb0dcc64d Fix the formatting of $taxonomies parameter of 'wp_get_object_terms' filter.
[38667]  changed the way that the filter parameters are built. That
changeset didn't fully account for the pre-4.7 format of `$taxonomies`.

Merge of [40290] to the 4.7 branch.

Props ig_communitysites.
Fixes #40154.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40291 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-14 18:42:57 +00:00
John Blackbourn
ec70d962ca Build/Test tools: Don't override the wp_set_auth_cookie() and wp_clear_auth_cookie() functions.
Overriding pluggable functions in the test suite is asking for trouble in the future. In addition, it means the test suite can't be guaranteed to behave the same as core.

This instead introduces a `send_auth_cookies` filter which can be hooked in during the test suite to prevent these functions from attempting to send cookie headers to the client.

Fixes #39367

Merges [40263] and [40264]  to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40265 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-10 15:05:36 +00:00
Sergey Biryukov
c12b33e067 Post-4.7.3 version bump for 4.7 branch.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40224 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-06 18:51:44 +00:00
James Nylen
b101339531 Bump 4.7 branch to version 4.7.3.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40202 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-06 15:55:16 +00:00
John Blackbourn
918efad6fd Press This: Verify intent before fetching in-page resources using Press This.
Props vortfu

Merges [40195] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40196 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-06 13:56:00 +00:00
Aaron D. Campbell
742d7e6663 Strip control characters before validating redirect.
Merges [40183] to 4.7 branch.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40184 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-06 13:39:33 +00:00
John Blackbourn
a0902e8a13 Taxonomy: Correct the formatting of HTML entities when generating the screen reader text for tag removal.
Props adamsilverstein

Merges [40181] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40182 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-06 13:15:20 +00:00
Aaron D. Campbell
151bf11e0e Plugins: Add file check to plugin deletions.
Merges [40169] to 4.7 branch.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40170 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-06 12:57:08 +00:00
Dominik Schilling (ocean90)
bdbceecd3e Embeds: URL encode YouTube video IDs for broader compatibility.
Merge of [40160] to the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40161 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-06 12:03:54 +00:00
Jeremy Felt
01c719f87e Validate video and audio metadata.
merge of [40148] to the 4.7 branch


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40149 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-06 08:02:21 +00:00
Dion Hulse
b1bc210c02 Bump the version after the 4.7.3-RC1 packaging.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40141 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-28 00:15:02 +00:00
Dion Hulse
b7be60afb6 Version bump for WordPress 4.7.3-RC1
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40140 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-28 00:09:52 +00:00
Dominik Schilling (ocean90)
a2c633fdc7 REST API: Allow setting post formats even if they are not supported by the theme.
A `post_format` not used by the current theme, but supported by core is not a wrong/broken piece of information. It's just not used at this point in time. Therefore we should allow setting and retrieving any of the standard post formats supported in core, even if the current theme doesn't use them.

After this commit, a post's `format` value can survive a round trip through the API, which is a good general design principle for an API.

Merge of [40120] and [40121] to the 4.7 branch.

Props JPry, iseulde, davidakennedy, Drivingralle.
Fixes #39232.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40137 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-27 20:02:43 +00:00
Dominik Schilling (ocean90)
6bfb976577 REST API: Fix behavior of sticky posts filter when no posts are sticky.
Previously, when getting posts from the API with `sticky=true`, if there were no sticky posts set, the query would return all posts  as if the `sticky` argument was not set.  In this situation, the query should return an empty array instead.

A `sticky=true` query that should return an empty array (in the previous situation, or with `include` and no intersecting post IDs) was also broken in that it would query the post with ID 1.

Finally, this commit significantly improves test coverage for the `sticky` filter argument, including direct testing of the `WHERE` clauses generated by `WP_Query`.

Merge of [40037] and [40122] to the 4.7 branch.

Props ryelle, jnylen0.
See #39079.
Fixes #39947.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40136 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-27 19:53:43 +00:00
Joe McGill
260f39ea0f Media: Reset Exif orientation after rotate in WP_Image_Editor_Imagick.
Due to inconsistencies in the way browsers handle Exif orientation data,
if a user manually rotates an image within WordPress, set the Exif orientation to
the default (1) so that the image displays with the same rotation/flip in every browser.

Props sanchothefat, triplejumper12, joemcgill, azaozz, markoheijnen, mikeschroder.
Merges [40123] and [40129] to the 4.7 branch.
Fixes #37140. See #14459.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40135 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-27 19:32:45 +00:00
Joe McGill
f055694b32 Media: Reduce failing uploads following 4.7.1.
[39831] introduced more strict MIME type checking for uploads, which
resulted in unintetionally blocking several filetypes that were
previously valid. This change uses a more targeted approach to MIME
validation to restore previous behavior for most types.

Props blobfolio, iandunn, ipstenu, markoheijnen, xknown, joemcgill.
Merges [40124] and [40125] to the 4.7 branch.
Fixes #39550, #39552.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40134 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-27 19:27:58 +00:00
Joe McGill
9cf5b91e9c Media: Keep PDF previews from overwriting files.
Since support for PDF previews were added in [38949], it's possible
that the generated image file could overwrite an existing image file
with the same name. This uses wp_unique_filename() to avoid this
issue and adds a '-pdf' identifier on the end of filenames.

Props gitlost, desrosj, mikeschroder, joemcgill.
Merges [40130] and [40131] to the 4.7 branch.
Fixes #39875. See #31050.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40133 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-27 19:24:50 +00:00
Joe McGill
2e5f3b41a8 Media: Restore correct upload errors displaying after [37610].
Props codegeass, MatheusGimenez, joemcgill.
Merges [40126] to the 4.7 branch.
Fixes #39516.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40132 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-27 19:20:58 +00:00
Sergey Biryukov
7182e5b7b4 Plugins: After [38703], adjust the selector for checkbox selection to account for nested tables.
Props afercia, swissspidy, reldev.
Merges [40118] to the 4.7 branch.
Fixes #39739.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40119 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-24 23:12:51 +00:00
Sergey Biryukov
44c58d1a12 REST API: JavaScript client - improve route discovery for custom namespaces.
Fix parsing of custom namespace routes. Transform class names, removing dashes and capitalizing each word/route part so a route path of `widgets/recent-posts` becomes a collection with the name `WidgetsRecentPosts`. Correct parent route part when routes are longer than expected, reversing parse direction.

Props westonruter, jazbek, adamsilverstein, jnylen0.
Merges [40074] and [40109] to the 4.7 branch.
Fixes #39561.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40117 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-24 22:47:47 +00:00
Sergey Biryukov
9afe01b087 REST API: Shim post_date_gmt for drafts / empty dates in the REST API.
Internally, WordPress uses a special `post_date_gmt` value of `0000-00-00 00:00:00` to indicate that a draft's date is "floating" and should be updated whenever the post is saved. This makes it much more difficult for API clients to know the correct date of a draft post.

This commit provides a best guess at a `date_gmt` value for draft posts in this situation using the `date` field and the site's current timezone offset.

Props joehoyle, jnylen0.
Merges [40108] to the 4.7 branch.
Fixes #38883.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40115 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-24 22:02:48 +00:00
Sergey Biryukov
9c7ef6a3ad REST API: Fix multiple issues with setting dates of posts and comments.
This commit modifies the `rest_get_date_with_gmt` function to correctly parse local and UTC timestamps with or without timezone information.

It also ensures that the REST API can edit the dates of draft posts by setting the `edit_date` flag to `wp_update_post`.

Overall this commit ensures that post and comment dates can be set and updated as expected.

Props jnylen0.
Merges [40101] to the 4.7 branch.
Fixes #39256.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40114 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-24 21:58:07 +00:00
Sergey Biryukov
32ccf017de REST API: Correctly parse body parameters for DELETE requests.
DELETE was inadvertently omitted from the list of non-POST HTTP methods that should be able to accept body parameters. Parameters passed to DELETE requests as JSON are already parsed correctly; this commit fixes application/x-www-form-urlencoded parameters as well.

Props mnelson4.
Merges [40105] to the 4.7 branch.
Fixes #39933.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40113 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-24 20:56:00 +00:00
Andrew Ozz
fd740182af TinyMCE: preserve empty image alt attributes.
Props afercia.
Merges [40110] to the 4.7 branch.
Fixes #39912.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40112 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-24 20:51:19 +00:00
Sergey Biryukov
caebbb456e REST API: Do not allow access to users from a different site in multisite.
It has been unintendedly possible to both view and edit users from a different site than the current site in multisite environments. Moreover, when passing roles to a user in an update request, that user would implicitly be added to the current site.

This changeset removes the incorrect behavior for now in order to be able to provide a proper REST API workflow for managing multisite users in the near future. Related unit tests have been adjusted as well.

Props jnylen0, jeremyfelt, johnjamesjacoby.
Merges [40106] to the 4.7 branch.
Fixes #39701.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40111 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-24 20:45:52 +00:00
Dion Hulse
8d666d2ce1 Customize: Prevent vertical clipping of thumbnail in header image customizer control.
Removes some method overrides on `wp.customize.HeaderTool.ChoiceView` introduced in [27497].

See #21785.
Props bradyvercher, westonruter.
Merges [40082] to the 4.7 branch.
Fixes #38559.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40100 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-21 07:04:34 +00:00
Dion Hulse
809c9d5b7a Customize: Extend auto-draft life of a customize_changeset post whenever modified.
Keep bumping the date for the auto-draft to preserve it from garbage-collection via `wp_delete_auto_drafts()` after 7 days.

Props westonruter.
Merges [40041] to the 4.7 branch.
See #30937.
Fixes #39713.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40099 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-21 07:02:14 +00:00
Dion Hulse
bce41a8435 Customize: Allow custom post types to be used in starter content.
Changes `WP_Customize_Nav_Menus::insert_auto_draft_post()` so it can be invoked for a `post_type` that is not registered (yet).

Props westonruter.
Merges [39924] to the 4.7 branch.
See #38615, #38114.
Fixes #39610.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40098 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-21 07:01:07 +00:00
Dion Hulse
cba5d45c90 Customize: Ensure edit shortcuts get re-created for nested partials when a parent partial is refreshed.
Fixes issue where the edit shortcut for a nav menu gets dropped when the containing Custom Menu widget is updated.

Props westonruter.
Merges [40055] to the 4.7 branch.
See #39101.
Fixes #39353.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40097 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-21 06:58:37 +00:00
Dion Hulse
ce9e48622a Customize: Skip intercepting non-HTTP(S) links in customizer preview just as jump links are ignored.
Ensures that links with `javascript:`, `mailto:` and other protocols work as expected in the customizer preview.

Props westonruter.
Merges [40064] to the 4.7 branch.
Fixes #39797.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40096 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-21 06:55:18 +00:00
Dion Hulse
9307967ccf Customize: Always enqueue customize-preview stylesheet in the customizer preview to style selective refresh and visual edit shortcuts.
Enqueues the style along with the `customize-preview` script in the manager instead of via the `widgets` and `nav_menus` components, ensuring that the stylesheet is loaded for users who cannot manage widgets or nav menus.

Props dlh, westonruter.
Merges [39951] to the 4.7 branch.
See #27403.
Fixes #39498.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40095 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-21 06:53:19 +00:00
Dion Hulse
60ca80009a Customize: Trim whitespace from nav menu item titles so that the underlying object's original title appears as input placeholder and in the control's title.
Whitespace is trimmed from titles in PHP when saved in any case, so this aligns the client-side behavior with what happens on the server.

Amends [38618].
Merges [39994] to the 4.7 branch.
See #38015.
Fixes #39600.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40094 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-21 06:51:47 +00:00
Dion Hulse
bb3ffecc32 Customize: Update customize.php URL with changeset_uuid param the instant a change is made instead of deferring until the changeset update request responds.
Props asalce, westonruter.
Merges [39686] to the 4.7 branch.
Fixes #39227.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40093 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-21 06:49:39 +00:00
Dion Hulse
dd766aa246 Menus: Prevent notice thrown in class-walker-page.php.
Calling `Walker_Page::walk()` directly was causing an `Undefined index: item_spacing` notice to be thrown, this adds an `isset()` check to prevent it.

Props bhargavbhandari90, peterwilsoncc.
Merges [39949] to the 4.7 branch.
Fixes #39564.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40092 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-21 03:50:13 +00:00
Dion Hulse
28bcb22f2f Formatting: fix wpautop() to stop adding paragraph tags around <figcaption>.
Props azaozz, pbearne for tests.
Merges [39912], [39914] to the 4.7 branch.
Fixes #39307 for 4.7.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40091 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-21 03:41:42 +00:00
Sergey Biryukov
b34712067e About page: Remove autoplay and loop attributes on "Theme Starter Content", "Edit Shortcuts", and "Video Headers" videos, originally added as a part of [39512].
For UX and accessibility reasons, it's better to always avoid playing videos automatically.

Props bor0.
Merges [40089] to the 4.7 branch.
Fixes #39560.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40090 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-20 13:08:20 +00:00
Dion Hulse
1109726f83 Customize: Ensure root values are accessible in multidimensional custom setting types.
Fixes bad conditions in `WP_Customize_Setting::get_root_value()` and `WP_Customize_Setting::set_root_value()`.

Props dlh, westonruter.
Amends [35007].
Merges [40036] to the 4.7 branch.
See #32103.
Fixes #36952.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40088 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-20 06:49:11 +00:00
Dion Hulse
5a0a298082 Customize: Introduce get_header_video_url filter for the return value of get_header_video_url().
Props sanket.parmar, celloexpressions, SergeyBiryukov.
Merges [40045], [40086] to the 4.7 branch.
Fixes #39512.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40087 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-20 06:47:39 +00:00
Dion Hulse
af53eecf76 Feeds: Prevent empty feeds from returning 404 errors.
Partial revert of [38929].

This reverts the source code from the commit for #30210 to prevent valid but empty feeds from returning 404 file not found errors for the home and custom feeds.

The tests in the commit that remain applicable are retained.

Props pavelevap for reporting, stevenkword for initial patch, peterwilsoncc.
See #30210.
Merges [40030] to the 4.7 branch.
Fixes #39157.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40085 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-20 06:37:22 +00:00
Dion Hulse
f6c038da0c REST API: JavaScript client should use _.extend when merging objects.
Correct an issue during the client's dynamic route discovery in `wp.api.utils.decorateFromRoute` where `_.union` potentially failed if used on objects.

Props ketuchetan, adamsilverstein.
Merges [40040] to the 4.7 branch.
Fixes #39341.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40084 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-20 06:34:17 +00:00
Dion Hulse
8531c4e5a6 Taxonomy: Disallow overriding the name property when registering a taxonomy.
Props wpfo for initial patch, swissspidy.
Merges [40049] to the 4.7 branch.
Fixes #39308.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40083 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-20 06:15:07 +00:00
Rachel Baker
72294c9caa REST API: Include the status property in view context responses from the Posts endpoints.
Previously the status for a Post (or other post_types) was only exposed under the `edit` context, which doesn't really make much sense considering we support querying by post status without authentication. Originally introduced in v2.0 beta 1: 69f617d749 without any explanation in the commit message.

Props dhanendran, jnylen0, rachelbaker.
Merges [40080] to the 4.7 branch.
Fixes #39466.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40081 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-19 04:35:28 +00:00
Rachel Baker
3daa063286 REST API: Correctly serve the index with PATH_INFO
When hitting the index, `untrailingslashit()` would make the REST route empty, which would then use the fallback inside WP_REST_Server. This isn't a problem most of the time, but WP_REST_Server contains a fallback to PATH_INFO. Combined with PATH_INFO permalinks, this would give a 404 on the API index, as it attempts to look up a route for "/wp-json/".

Props ccprog.
Merges [39923] to the 4.7 branch.
Fixes #39432.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40079 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-19 03:27:13 +00:00
Rachel Baker
7be9593b68 REST API: Cast revision author ID to int.
The `post_author` field is a string internally, but we need to cast it to an integer in the REST API. This was already done for posts, but not for revisions. The field is already declared as an integer in both controllers.

Props jnylen0.
Merges [40063] to the 4.7 branch.
Fixes #39871.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40078 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-19 03:18:38 +00:00
Sergey Biryukov
c6511562c6 Media: In wp_unique_filename(), use explicit type casting when incrementing $number.
This prevents the "non-numeric value encountered" warning in PHP 7.1, caused by trying to increment an empty string on the first loop iteration.

Props drrobotnik for initial patch.
Merges [40039] to the 4.7 branch.
Fixes #39774.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40075 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-17 21:23:52 +00:00
Dion Hulse
a345f95664 Media: Avoid PHP Warnings in get_post_galleries() when processing empty [gallery] shortcodes and avoid returning the incorrect results when the global $post does not match the provided post ID.
Props dd32, joemcgill, seanchayes.
Merges [40070] to the 4.7 branch.
Fixes #39277, #39304.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@40071 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-17 06:46:45 +00:00