Commit Graph

23422 Commits

Author SHA1 Message Date
Pascal Birchler d9681fd881 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40460


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40336 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-17 13:00:35 +00:00
Pascal Birchler a785107bf4 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40459


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40335 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-17 10:24:38 +00:00
John Blackbourn 97572ef88b Build/Test tools: Reverse the order in which the Travis jobs run.
As a general rule, this means the fastest test jobs now run first because each subsequent version of PHP is faster than the previous. When a committer is patiently waiting for a Travis build to complete, they are at least more likely to see unexpected failures earlier than they otherwise would.

In addition, this updates the JavaScript test job to run on PHP 7.1.

Props netweb

See #39705

Merges [40434] to the 4.7 branch.

Built from https://develop.svn.wordpress.org/branches/4.7@40435


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40333 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-15 17:44:37 +00:00
Pascal Birchler 50867ef8b8 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40429


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40327 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-14 09:34:35 +00:00
Pascal Birchler aaf7176230 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40427


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40325 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-14 08:54:35 +00:00
Pascal Birchler 981dc8e4c2 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40426


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40324 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-14 08:47:34 +00:00
Pascal Birchler fd65a37c76 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40425


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40323 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-14 08:40:37 +00:00
Pascal Birchler 3623849a05 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40420


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40318 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-13 12:32:35 +00:00
Andrew Ozz 1830ea20c4 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40419


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40317 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-13 01:52:38 +00:00
Pascal Birchler e249f4aa32 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40403


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40310 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-10 14:28:36 +00:00
Pascal Birchler 6736569b43 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40402


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40309 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-10 12:36:34 +00:00
Pascal Birchler df7c706b34 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40401


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40308 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-10 12:29:38 +00:00
Pascal Birchler 0373a7bd29 Bootstrap/Load: Only load `PasswordHash` class once.
`require_once` prevents errors when loading WordPress and the class already exists.

See [40387].
Fixes #39445. 

Built from https://develop.svn.wordpress.org/branches/4.7@40389


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40296 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-06 18:23:35 +00:00
Pascal Birchler 4430527126 Build/Test Tools: Add assertNotFalse() method to WP_UnitTestCase and use it where appropriate.
Props peterwilsoncc.
Fixes #39219.

Merges [39919] to the 4.7 branch.

Built from https://develop.svn.wordpress.org/branches/4.7@40388


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40295 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-06 18:20:33 +00:00
Pascal Birchler 2800ad60b0 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40386


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40293 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-06 17:33:34 +00:00
Pascal Birchler de5181d97b 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40385


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40292 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-06 17:27:35 +00:00
Pascal Birchler bc0a2456cc 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40384


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40291 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-06 17:21:34 +00:00
Pascal Birchler 0a91666a7e 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40383


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40290 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-06 17:18:36 +00:00
Pascal Birchler c0f0a7739a 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40375


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40282 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-05 02:20:25 +00:00
Pascal Birchler c12fcf422a Twenty Seventeen: Use `esc_attr_e()` for translatable strings in HTML attributes.
Props bor0.
Fixes #40216.

Merges [40311] to the 4.7 branch.

Built from https://develop.svn.wordpress.org/branches/4.7@40374


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40281 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-05 02:19:51 +00:00
Pascal Birchler cafbb22729 Twenty Seventeen: Declare jQuery as a dependency for `navigation.js`.
Props chesio.
Fixes #40224.

Merges [40315] to the 4.7 branch.

Built from https://develop.svn.wordpress.org/branches/4.7@40373


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40280 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-05 02:19:18 +00:00
Pascal Birchler a394c05654 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40369


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40276 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-05 02:16:34 +00:00
Pascal Birchler 5a10b5c879 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40367


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40274 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-05 02:15:18 +00:00
Pascal Birchler 255819e18a 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40366


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40273 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-05 02:14:45 +00:00
Pascal Birchler 1b7455c6d3 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40365


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40272 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-04-05 02:14:11 +00:00
Boone Gorges c7782be54b 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40354


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-30 16:57:15 +00:00
Pascal Birchler 511b47afd9 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40345


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40252 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-28 07:22:37 +00:00
Pascal Birchler 6f7014a74d 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40338


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-27 09:29:35 +00:00
Pascal Birchler 7f659d9ea1 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40337


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40244 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-27 09:24:41 +00:00
Pascal Birchler a56cceb25f 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40336


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40243 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-27 07:09:41 +00:00
Pascal Birchler 0b6084b362 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.


Built from https://develop.svn.wordpress.org/branches/4.7@40335


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40242 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-27 06:21:38 +00:00
Pascal Birchler 4876c17ef5 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.


Built from https://develop.svn.wordpress.org/branches/4.7@40332


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40239 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-25 15:26:33 +00:00
Pascal Birchler 52f0c65fc5 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.


Built from https://develop.svn.wordpress.org/branches/4.7@40331


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40238 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-25 13:35:38 +00:00
Pascal Birchler e1f9e1eaa0 Posts, Post Types: Add missing REST API properties to `WP_Post_Type` class.
Props danielbachhuber.
Fixes #39986.

Merges [40302] to the 4.7 branch.


Built from https://develop.svn.wordpress.org/branches/4.7@40329


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40236 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-24 19:05:34 +00:00
Pascal Birchler a1b4295ba7 Taxonomy: Add missing REST API properties to `WP_Taxonomy` class.
Props danielbachhuber.
Fixes #39987.

Merges [40303] to the 4.7 branch.


Built from https://develop.svn.wordpress.org/branches/4.7@40328


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40235 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-24 19:04:38 +00:00
Pascal Birchler ca47fafaa9 List Tables: After [38703], [38706], and [40118], adjust the jQuery selector to make the selection of a range of checkboxes work again.
Unprop afercia.
Fixes #40056.

Merges [40268] to the 4.7 branch.


Built from https://develop.svn.wordpress.org/branches/4.7@40327


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40234 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-24 18:50:35 +00:00
Pascal Birchler 2ea46dbe7f 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.


Built from https://develop.svn.wordpress.org/branches/4.7@40326


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40233 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-24 18:44:37 +00:00
Pascal Birchler 05655c5d1a 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.
Built from https://develop.svn.wordpress.org/branches/4.7@40325


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40232 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-24 17:53:36 +00:00
John Blackbourn bfa0cc8b91 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40321


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40228 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-23 19:03:37 +00:00
Boone Gorges 913475ecdf 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40291


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40198 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-14 18:43:37 +00:00
John Blackbourn 49dea066cc Build/Test tools: Get Travis builds working on HHVM again.
This change moves to specifying the PHPUnit version for all PHP versions, and fixes an issue where the Composer global bin directory is not at `~/.composer/vendor/bin` on the boxes that are used for HHVM builds.

See #40100

Merges [40269] and [40271] to the 4.7 branch.

Built from https://develop.svn.wordpress.org/branches/4.7@40272


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40191 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-11 00:06:35 +00:00
John Blackbourn 7bebbc7006 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40265


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40185 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-10 15:06:34 +00:00
Dominik Schilling f0be016b5e Build/Test Tools: Update `.travis.yml` to include latest improvements from trunk.
* Explicitly use PHPUnit 5.7 for the PHP 7 builds on Travis.
* On Travis CI install and use the node version which is specified in package.json.
* Add some more debugging to Travis and bring the format of the Xdebug fix inline with branches.

Merge of [40255] and [40257-40259] to the 4.7 branch.

Props netweb, johnbillion.
See #35105, #39822, #40086.
Built from https://develop.svn.wordpress.org/branches/4.7@40260


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40182 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-09 22:02:39 +00:00
John Blackbourn c498f12182 Build/Test tools: Remove the unnecessary clone of the twentysixteen repo.
This is no longer needed since #31550.

Fixes #40066

Merges [40252] to the 4.7 branch.

Built from https://develop.svn.wordpress.org/branches/4.7@40253


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40175 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-09 01:36:36 +00:00
John Blackbourn 92357b6a80 Build/Test tools: In Travis, skip some tests when not on trunk.
This skips time sensitive tests (copyright year and PHP/MySQL version requirements) when tests are run on branches on Travis.

Props netweb, jorbin

Fixes #39486

Merges [40241] to the 4.7 branch.

Built from https://develop.svn.wordpress.org/branches/4.7@40250


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-08 00:52:36 +00:00
John Blackbourn d2c4cb36db Build/Test Tools: Call `wp_head()` and `wp_footer()` in the theme used during tests.
See #31550
Fixes #39988

Merges [40235] to the 4.7 branch.

Built from https://develop.svn.wordpress.org/branches/4.7@40236


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40166 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-07 01:35:33 +00:00
John Blackbourn 7b45ddd449 Build/Test Tools: Disable Xdebug when testing on Travis to increase performance.
See #39978

Built from https://develop.svn.wordpress.org/branches/4.7@40225


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40164 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-07 00:21:32 +00:00
Sergey Biryukov 5ef79ffc04 Post-4.7.3 version bump for 4.7 branch.
Built from https://develop.svn.wordpress.org/branches/4.7@40224


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40163 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-06 18:52:35 +00:00
James Nylen 8622d105f5 Bump 4.7 branch to version 4.7.3.
Built from https://develop.svn.wordpress.org/branches/4.7@40202


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40141 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-06 15:56:33 +00:00
John Blackbourn 882ac7830f Press This: Verify intent before fetching in-page resources using Press This.
Props vortfu

Merges [40195] to the 4.7 branch.

Built from https://develop.svn.wordpress.org/branches/4.7@40196


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-06 13:56:35 +00:00
Aaron Campbell dfb508f59d Strip control characters before validating redirect.
Merges [40183] to 4.7 branch.


Built from https://develop.svn.wordpress.org/branches/4.7@40184


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40123 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-06 13:40:35 +00:00
John Blackbourn 0066640479 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40182


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40121 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-06 13:16:35 +00:00
Aaron Campbell 177b19d9ec Plugins: Add file check to plugin deletions.
Merges [40169] to 4.7 branch.


Built from https://develop.svn.wordpress.org/branches/4.7@40170


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40109 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-06 12:58:35 +00:00
Dominik Schilling 25e3338dbc Embeds: URL encode YouTube video IDs for broader compatibility.
Merge of [40160] to the 4.7 branch.

Built from https://develop.svn.wordpress.org/branches/4.7@40161


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40100 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-06 12:04:34 +00:00
Jeremy Felt a80351f7ed Validate video and audio metadata.
merge of [40148] to the 4.7 branch

Built from https://develop.svn.wordpress.org/branches/4.7@40149


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40088 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-03-06 08:03:35 +00:00
Dion Hulse 58acc1c53f Bump the version after the 4.7.3-RC1 packaging.
Built from https://develop.svn.wordpress.org/branches/4.7@40141


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-28 00:16:33 +00:00
Dion Hulse 931b5a10ac Version bump for WordPress 4.7.3-RC1
Built from https://develop.svn.wordpress.org/branches/4.7@40140


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40077 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-28 00:10:36 +00:00
Dominik Schilling 6485764f43 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.
Built from https://develop.svn.wordpress.org/branches/4.7@40137


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-27 20:03:37 +00:00
Dominik Schilling e7b04993a6 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.
Built from https://develop.svn.wordpress.org/branches/4.7@40136


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-27 19:54:39 +00:00
Joe McGill d9ce7b2739 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40135


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-27 19:33:35 +00:00
Joe McGill 4771761186 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40134


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40071 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-27 19:28:34 +00:00
Joe McGill 498f71615f 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40133


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-27 19:25:34 +00:00
Joe McGill c2a90ea28d Media: Restore correct upload errors displaying after [37610].
Props codegeass, MatheusGimenez, joemcgill.
Merges [40126] to the 4.7 branch.
Fixes #39516.

Built from https://develop.svn.wordpress.org/branches/4.7@40132


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40069 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-27 19:21:36 +00:00
Sergey Biryukov ecf9c19e04 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.
Built from https://develop.svn.wordpress.org/branches/4.7@40119


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-24 23:13:34 +00:00
Sergey Biryukov d66cefb840 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.
Built from https://develop.svn.wordpress.org/branches/4.7@40117


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-24 22:48:37 +00:00
Sergey Biryukov b25d41d205 REST API: Add QUnit tests for wp-api.js and PHPUnit fixture generation.
Add QUnit tests: verify that wp-api loads correctly, verify that the expected base models and collections exist and can be instantiated, verify that collections contain the correct models, verify that expected helper functions are in place for each collection.

The QUnit tests rely on two fixture files: `tests/qunit/fixtures/wp-api-generated.js` contains the data response from each core endpoint and is generated by running the PHPUnit `restapi-jsclient` group. `tests/qunit/fixtures/wp-api.js` maps the generated data to endpoint routes, and overrides `Backbone.ajax` to mock the responses for the tests.

Add PHPUnit tests in `tests/phpunit/tests/rest-api/rest-schema-setup.php`. First, verify that the API returns the expected routes via `server->get_routes()`. Then, the `test_build_wp_api_client_fixtures` test goes thru each endpoint and requests it from the API, tests that it returns data, and builds up the data for the mocked QUnit tests, saving the final results to `tests/qunit/fixtures/wp-api-generated.js`.

Add a new grunt task `restapi-jsclient` which runs the phpunit side data generation and the qunit tests together.

Props jnylen0, welcher, adamsilverstein, netweb, ocean90, rachelbaker.
Merges [40058], [40061], [40065], [40066], [40077], and [40104] to the 4.7 branch.
Fixes #39264.
Built from https://develop.svn.wordpress.org/branches/4.7@40116


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-24 22:34:34 +00:00
Sergey Biryukov 9dac8e173f 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.
Built from https://develop.svn.wordpress.org/branches/4.7@40115


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40052 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-24 22:03:34 +00:00
Sergey Biryukov 68740ca5a1 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.
Built from https://develop.svn.wordpress.org/branches/4.7@40114


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40051 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-24 21:59:35 +00:00
Sergey Biryukov f980f4ca90 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.
Built from https://develop.svn.wordpress.org/branches/4.7@40113


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40050 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-24 20:56:34 +00:00
Andrew Ozz d95e0f8116 TinyMCE: preserve empty image alt attributes.
Props afercia.
Merges [40110] to the 4.7 branch.
Fixes #39912.
Built from https://develop.svn.wordpress.org/branches/4.7@40112


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-24 20:52:35 +00:00
Sergey Biryukov 3ded99cef7 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.
Built from https://develop.svn.wordpress.org/branches/4.7@40111


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-24 20:46:35 +00:00
Dion Hulse f609be0542 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40100


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-21 07:05:36 +00:00
Dion Hulse 876e894635 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40099


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40036 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-21 07:03:34 +00:00
Dion Hulse 02789248ca 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40098


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40035 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-21 07:02:34 +00:00
Dion Hulse f5b00a1534 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40097


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-21 06:59:31 +00:00
Dion Hulse bade579fc3 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40096


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40033 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-21 06:56:34 +00:00
Dion Hulse de7de0a0d6 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40095


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40032 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-21 06:54:35 +00:00
Dion Hulse a0edd9b006 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40094


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-21 06:52:35 +00:00
Dion Hulse 2a891e4456 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40093


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40030 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-21 06:50:41 +00:00
Dion Hulse d1b2273838 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40092


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-21 03:51:35 +00:00
Dion Hulse e18e5acce8 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.


Built from https://develop.svn.wordpress.org/branches/4.7@40091


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-21 03:42:38 +00:00
Sergey Biryukov f65de13e9f 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.
Built from https://develop.svn.wordpress.org/branches/4.7@40090


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40027 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-20 13:09:34 +00:00
Dion Hulse 6e1fe24284 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40088


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-20 06:50:50 +00:00
Dion Hulse bc0cb365a3 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40087


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40024 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-20 06:49:53 +00:00
Dion Hulse 6f0ebaba78 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40085


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40022 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-20 06:38:48 +00:00
Dion Hulse cb22496f4c 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40084


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40021 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-20 06:35:48 +00:00
Dion Hulse 5789e5f074 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40083


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40020 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-20 06:16:53 +00:00
Rachel Baker 2dda813ae2 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40081


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40018 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-19 04:36:32 +00:00
Rachel Baker 4bd52ccd1d 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40079


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40016 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-19 03:28:34 +00:00
Rachel Baker a51de29064 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40078


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40015 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-19 03:19:37 +00:00
Sergey Biryukov c884f781e1 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.
Built from https://develop.svn.wordpress.org/branches/4.7@40075


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40012 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-17 21:24:35 +00:00
Dion Hulse 297220b740 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.

Built from https://develop.svn.wordpress.org/branches/4.7@40071


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40008 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-17 06:47:34 +00:00
Dion Hulse 1ffeb0f19f HTTP API: Restore backwards compatibility with the `http_api_curl` filter - it expects that the handle parameter is passed as a reference, however [39212] missed that.
Props pento.
Merges [40068] to the 4.7 branch.
Fixes #39783.

Built from https://develop.svn.wordpress.org/branches/4.7@40069


git-svn-id: http://core.svn.wordpress.org/branches/4.7@40006 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-02-17 05:07:33 +00:00
Aaron Campbell aa89522a9b Post-4.7.2 version bump for 4.7 branch.
Built from https://develop.svn.wordpress.org/branches/4.7@40018


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39955 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-26 21:58:35 +00:00
Aaron Campbell 665617103b Fix version to 4.7.2 not 4.7.3.
Built from https://develop.svn.wordpress.org/branches/4.7@39997


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-26 18:19:35 +00:00
Aaron Campbell befa21d88e Bump 4.7 branch to version 4.7.2.
Built from https://develop.svn.wordpress.org/branches/4.7@39995


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39932 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-26 18:14:35 +00:00
Boone Gorges 89d7d9e70f Revert to pre-4.7 behavior for fetching object instances by id.
This changeset reverts [38381], which caused inconsistencies in the way the
REST API fetches posts and other objects.

Merge of [39992] to the 4.7 branch.

See #38792, #37738.

Built from https://develop.svn.wordpress.org/branches/4.7@39993


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39930 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-26 16:57:32 +00:00
John Blackbourn fa47298720 Posts, Post Types: When using Excerpt mode on the Posts list table, ensure the excerpt output matches what was manually entered into the Excerpt field.
Merges [39956] to the 4.7 branch.

Built from https://develop.svn.wordpress.org/branches/4.7@39990


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39927 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-26 15:12:34 +00:00
Dominik Schilling ad0f68291a Press This: Do not show Categories & Tags UI for users who cannot assign terms to posts anyways.
Merge of [39968] to the 4.7 branch.
Built from https://develop.svn.wordpress.org/branches/4.7@39969


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39906 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-26 14:01:34 +00:00
Dominik Schilling 599e703836 REST API: Unify object access handling for simplicity.
Rather than repeating ourselves, unifying the access into a single method keeps everything tidy. While we're at it, add in additional schema handling for common parameters.

Merge of [39954] to the 4.7 branch.

See #38792.
Built from https://develop.svn.wordpress.org/branches/4.7@39957


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39894 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-26 13:47:34 +00:00
Dominik Schilling 5960939cca Query: Ensure that queries work correctly with post type names with special characters.
Merge of [39952] to the 4.7 branch.
Built from https://develop.svn.wordpress.org/branches/4.7@39953


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39890 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-26 13:36:37 +00:00
Aaron Campbell 7b45f8189d Post-4.7.1 version bump for 4.7 branch.
Built from https://develop.svn.wordpress.org/branches/4.7@39883


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-11 21:36:35 +00:00
Joe McGill 0df6499c8d Media: Fix exif_imagetype check in wp_get_image_mime
This is a follow up to [39831].

Merges [39850] to the 4.7 branch.

Built from https://develop.svn.wordpress.org/branches/4.7@39851


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39788 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-11 16:38:32 +00:00
Aaron Campbell 5094cbd599 Bump 4.7 branch to version 4.7.1.
Built from https://develop.svn.wordpress.org/branches/4.7@39845


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-11 15:15:35 +00:00
Aaron Campbell 39b785c7f9 REST API: Change which users are shown in the users endpoint.
Only show users that have authored a post of a post type that has `show_in_rest` set to true.

Props rachelbaker, jnylen0.
Merges [39843] to 4.7 branch.

Built from https://develop.svn.wordpress.org/branches/4.7@39844


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39782 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-11 14:49:33 +00:00
Joe McGill 75df12f322 Media: Improve image filetype checking.
This adds a new function `wp_get_image_mime()` which is used by
`wp_check_filetype_and_ext()` to validate image files using
`exif_imagetype()` if available instead of `getimagesize()`.

`getimagesize()` is less performant than `exif_imagetype()` and is
dependent on GD. If `exif_imagetype()` is not available, it falls back to
`getimagesize()` as before.

If `wp_check_filetype_and_ext()` can't validate the filetype, we now return
`false` for ext/MIME values.

Merges [39831] to the 4.7 branch.

Built from https://develop.svn.wordpress.org/branches/4.7@39832


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39770 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-11 13:12:34 +00:00
Dominik Schilling 3176a085da Updates: Translate plugin data on the Updates screen.
Merge of [39808] to the 4.7 branch.
Built from https://develop.svn.wordpress.org/branches/4.7@39820


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-11 11:39:34 +00:00
Dominik Schilling e0b6a13194 Themes: Fix markup for theme name fallbacks.
Merge of [39807] to the 4.7 branch.
Built from https://develop.svn.wordpress.org/branches/4.7@39809


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39747 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-11 11:08:37 +00:00
Jeremy Felt 871bb10c9a Multisite: Use `wp_rand()` in signup key creation.
Merges [39795] to the 4.7 branch.

Built from https://develop.svn.wordpress.org/branches/4.7@39796


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39734 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-11 05:31:35 +00:00
Dion Hulse 31c9a63bfb Update PHPMailer to 5.2.22.
The full list of changes is available here:
https://github.com/PHPMailer/PHPMailer/compare/v5.2.21...v5.2.22

Merges [39759] to the 4.7 branch.
Fixes #37210 for 4.7.

Built from https://develop.svn.wordpress.org/branches/4.7@39783


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39721 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-11 05:21:59 +00:00
Jeremy Felt 63828d08a0 Mail: Disable wp-mail.php when `mailserver_url` is mail.example.com.
Merges [39772] to the 4.7 branch.

Built from https://develop.svn.wordpress.org/branches/4.7@39773


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39711 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-11 05:15:34 +00:00
Aaron Campbell 189e5449a3 Add nonce for widget accessibility mode.
Props vortfu.

See #23328.

Merges [39760] to 4.7 branch.

Built from https://develop.svn.wordpress.org/branches/4.7@39761


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-11 01:40:34 +00:00
Aaron Campbell d47305bfe4 Add -src back to version
Built from https://develop.svn.wordpress.org/branches/4.7@39750


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39688 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-06 23:04:36 +00:00
Aaron Campbell aa13103db8 Post 4.7.1-RC1 version bump
Built from https://develop.svn.wordpress.org/branches/4.7@39749


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-06 22:44:35 +00:00
Aaron Campbell 3027491963 WordPress 4.7.1-RC1
Built from https://develop.svn.wordpress.org/branches/4.7@39746


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-06 22:16:57 +00:00
Aaron Campbell ed77d76855 Twenty Seventeen: add more details about filter and requires version
The required version should be 4.7 and also adds more information to changelog.

Props @ocean90 @Presskopp

Merges [39744] to 4.7 branch.


Built from https://develop.svn.wordpress.org/branches/4.7@39745


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-06 22:16:24 +00:00
Aaron Campbell 483fa89c88 Twenty Seventeen: version bump and update changelog
Adds in changelog since last version and all the changes listed in readme.txt.
Bumps version numbers in style.css and readme.txt.

Props @ocean90

Merges [39742] to the 4.7 branch.


Built from https://develop.svn.wordpress.org/branches/4.7@39743


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-06 22:15:10 +00:00
Dominik Schilling 95026e579b Twenty Seventeen: Introduce a theme-specific filter `twentyseventeen_starter_content` for customizing the starter content array.
Add some documentation to the default starter content.

Merge of [39720] to the 4.7 branch.

Props sanket.parmar, celloexpressions.
See #39109.
Built from https://develop.svn.wordpress.org/branches/4.7@39721


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-06 22:03:30 +00:00
Dion Hulse 425d389d92 Upgrade/Install: Avoid creating nonce during installation.
When installing and using database-saved salts, wp_create_nonce() causes database errors as wp_salt() attempts to insert into the not-yet-created options table. Since authentication isn't available during installation, we can safely skip creating a nonce.

Props nullvariable, pento, dd32, rmccue.
Merges [39684] to the 4.7 branch.
Fixes #39047.

Built from https://develop.svn.wordpress.org/branches/4.7@39697


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39637 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-05 08:18:37 +00:00
Dion Hulse 6cdd4b1250 Customize: Prevent removal of underline upon hover/focus for nav menu deletion links.
Props monikarao.
Amends [38503].
See #37527.
Merges [39677] to the 4.7 branch.
Fixes #39444.

Built from https://develop.svn.wordpress.org/branches/4.7@39696


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-05 08:17:37 +00:00
Dion Hulse 4a804cac79 Customize: Remove extra left padding in core for site title and widgets in preview.
These styles should only be applied by theme stylesheets as needed.

Props sirbrillig.
Reverts parts of [39202] and [39233].
See #38651.
Merges [39685] to the 4.7 branch.
Fixes #39349.

Built from https://develop.svn.wordpress.org/branches/4.7@39695


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39635 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-05 08:16:39 +00:00
Dion Hulse cc4a680493 Customize: Ensure `theme_mod`-cache of `custom_css` lookup of `-1` short-circuits a `WP_Query` from being made.
Props dlh, westonruter.
See #35395.
Merges [39688] to the 4.7 branch.
Fixes #39259.

Built from https://develop.svn.wordpress.org/branches/4.7@39694


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-05 08:15:35 +00:00
Dion Hulse d93d3febfe Customizer: Don't query for postmeta for Custom CSS (for not-current-themes) and Customizer Changeset posts.
Props dlh.
Merges [39692] to the 4.7 branch.
Fixes #39194.

Built from https://develop.svn.wordpress.org/branches/4.7@39693


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39633 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-05 08:13:35 +00:00
Dion Hulse 8cc3c97b85 Updates: Properly define `$filesystemForm` to handle error in modals.
Amends [39657].
Merges [39689] to the 4.7 branch.
See #39057.

Built from https://develop.svn.wordpress.org/branches/4.7@39690


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-05 07:28:36 +00:00
Dion Hulse 2d20b59244 Feeds: Don't override the Content-Type header inside `fetch_feed()`.
SimplePie can set the Content-Type header automatically with the correct charset for convenience, but we already force the charset to match the site's, making it redundant at best. At worst, SimplePie incorrectly overrides the content-type for non-HTML content (such as API requests).

Props dlh, stevenkword, rmccue.
Merges [39681] to the 4.7 branch.
Fixes #39066.

Built from https://develop.svn.wordpress.org/branches/4.7@39683


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-05 03:09:35 +00:00
Dion Hulse d4399a7082 REST API: Add error handling for fetch error in `buildModelGetter` of wp-api.js.
When a call to a model getter method fails, reject the returned deferred object. Enables better handling of fetch errors.

Props westonruter, adamsilverstein.
Merges [39680] to the 4.7 branch.
Fixes #39314.

Built from https://develop.svn.wordpress.org/branches/4.7@39682


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-05 03:07:17 +00:00
Andrew Ozz ce7ab0d87f Always add `page-template-default` class to the editor body when the template is not specified. This matches the behavior on the front-end.
Props timph (for the detailed bug report), azaozz.
Merges [39678] to the 4.7 branch.
Fixes #39368.
Built from https://develop.svn.wordpress.org/branches/4.7@39679


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39619 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-05 01:59:38 +00:00
Boone Gorges 6124fbb02c Ignore the 'comment_order' setting when determining comment pagination.
[38740] incorrectly introduced logic that changed a comment's page when
'comment_order' was set to 'desc'. This is in violation of the design
of the comment pagination system: a comment's page is designed not to
change when 'comment_order' or 'default_comment_page' are changed.
See #31101.

Merges [39663] to the 4.7 branch.

Props rachelbaker.
Fixes #39280.

Built from https://develop.svn.wordpress.org/branches/4.7@39664


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-02 20:08:23 +00:00
Rachel Baker b410db797b General: Update copyright year to 2017 in license.txt.
Props Nikschavan.
Merges [39659] to the 4.7 branch.
Fixes #39433.

Built from https://develop.svn.wordpress.org/branches/4.7@39661


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-01-02 18:51:35 +00:00
Dion Hulse e87ab24ef8 Updates: Show the Authentication key settings after selecting the SSH transport in both the modal, and also on the plugin/theme updates screen.
Props afercia.
Merges [39657] to the 4.7 branch.
Fixes #39057.

Built from https://develop.svn.wordpress.org/branches/4.7@39658


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39598 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-30 07:46:35 +00:00
Dion Hulse 6c457d4415 Media: Move a variable definition outside of conditionals to ensure it's always available.
This fixes cases where the URL to a PDF preview may be incorrectly calculated when no thumbnails were generated for the PDF (and avoids a PHP Notice at the same time).

Merges [39612] to the 4.7 branch.
Fixes #39250.

Built from https://develop.svn.wordpress.org/branches/4.7@39654


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39594 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-30 06:24:33 +00:00
Dion Hulse fb52c9599d Customize: Fix visible edit shortcuts for `wp_nav_menu()` instances using the `menu` arg (such as in the Custom Menu widget) instead of the `theme_location` arg.
Also fix logic for `focus-control-for-setting` handler to focus on the first control (lowest `priority` value) associated with a given setting instead of the last control encountered when iterating over all controls, as this ensures the first control in a `nav_menu` section is focused rather than the last one.

Props westonruter, sirbrillig.
See #27403.
Merges [39622] to the 4.7 branch.
Fixes #39101.

Built from https://develop.svn.wordpress.org/branches/4.7@39653


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-30 06:13:34 +00:00
Dion Hulse 8f7e4969bc Taxonomy: Redirect to current taxonomy when adding a term without AJAX.
Fixes a regression in which adding terms via a full page refresh, ie without AJAX, would always redirect to the tags taxonomy.

Props szaqal21, peterwilsoncc.
Merges [39649] to the 4.7 branch.
Fixes #39328 for 4.7.

Built from https://develop.svn.wordpress.org/branches/4.7@39652


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-30 05:55:32 +00:00
Dion Hulse b28d64fb46 Customize: Bump `wp_custom_css_cb` from running at `wp_head` priority 11 to 101 to ensure Custom CSS overrides other CSS.
Aligns `wp_head` action priority with Jetpack's Custom CSS.

Amends [38829].
See #35395, #38672.
Merges [39616] to the 4.7 branch.
Fixes #39270.

Built from https://develop.svn.wordpress.org/branches/4.7@39651


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39591 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-30 05:49:34 +00:00
Dion Hulse 61fb79c097 Twenty Seventeen: Fix incorrect `$content_width` value in theme.
This addresses a major bug. Incorrectly setting the `$content_width` causes media embeds to end up with the wrong aspect ratio, among other issues. This fix uses `template_redirect`,  to ensure conditional theme tags can be used. It also defines a default value at `after_theme_setup` so that plugins have something to work with at `init`.

Props sstoqnov, laurelfulford, obenland.
Merges [39635] to the 4.7 branch.
Fixes #39272.

Built from https://develop.svn.wordpress.org/branches/4.7@39650


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39590 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-30 05:47:37 +00:00
Dion Hulse 9edb03c095 Upgrade PHPMailer from 5.2.14 to 5.2.21.
The full list of changes is available here:
https://github.com/PHPMailer/PHPMailer/compare/v5.2.14...v5.2.21

Props sebastian.pisula, MattyRob, sfpt, dd32, peterwilsoncc, voldemortensen.
Merges [39645] to the 4.7 branch.
Fixes #37210 for trunk.

Built from https://develop.svn.wordpress.org/branches/4.7@39646


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39586 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-29 03:00:37 +00:00
Rachel Baker bd0a38d439 REST API: Allow schema sanitization_callback to be set to null to bypass fallback sanitization functions.
The logic in WP_REST_Request->sanitize_params() added in [39091] did not account for `null` or `false` being the sanitization_callback preventing overriding `rest_parse_request_arg()`. This fixes that oversight, allowing the built in sanitization function to be bypassed. See #38593.

Merges [39563] to the 4.7  branch.

Props kkoppenhaver, rachelbaker, jnylen0.
Fixes #39042.

Built from https://develop.svn.wordpress.org/branches/4.7@39642


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39582 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-27 17:49:36 +00:00
Rachel Baker 8780e40de2 Comments: Fix placement of the wp_update_comment_data filter to safeguard filtered data from triggering a database error.
Introduced in [38674], the wp_update_comment_data filter took place after the $data was sliced and prepared for the database update statement. The location of the filter assumed the result of anyone applying it would not change the data type or make structural modifications or additions to the $data array. 😅
This moves the wp_update_comment_data filter to take place before the $data is sliced and prepared for the database update statement.

Merges [39640] to the 4.7  branch.

Props dshanske for initial patch.
Fixes #39380.

Built from https://develop.svn.wordpress.org/branches/4.7@39641


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39581 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-27 17:42:35 +00:00
Ella Iseulde Van Dorpe 559e81937b Editor: Let the Add New link disappear in DFW mode.
The link was moved outside the heading in [38983].

Merges [39619] to the 4.7 branch.
Fixes #39313.


Built from https://develop.svn.wordpress.org/branches/4.7@39634


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39574 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-21 14:56:34 +00:00
Gary Pendergast 8a2525a88d Media: Allow PDF fallbacks filter to process custom sizes.
This fixes an oversight in [39246], which added a hook for filtering the array of sizes used for PDF thumbnails, but failed to provide a way for sizes added through `add_image_size()` to be processed.

Merge of [39617] to the 4.7 branch.

Props gitlost.
Fixes #39231. See #38594.


Built from https://develop.svn.wordpress.org/branches/4.7@39633


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39573 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-21 05:53:33 +00:00
Gary Pendergast 7d1db9607d Twenty Seventeen: Ensure functions in `customize-controls.js` don't count on Customizer sections always being present
Before, the code assumed the `theme_options` section is always present, but it can be removed by plugins. This way, if it is, no JavaScript errors occur.

Merge of [39623] to the 4.7 branch.

Props westonruter.
Fixes #39355.


Built from https://develop.svn.wordpress.org/branches/4.7@39632


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-21 05:48:34 +00:00
Gary Pendergast 6e8114742f REST API: Improve the `rest_*_collection_params` filter docs and fix the terms filter.
The `rest_{$taxonomy}_collection_params` filter in 4.7 is incorrectly using single quotes instead of double quotes, which means it is not working correctly as a dynamic filter. This fixes the quotes around the filter name, and also updates the docblocks for the other 3 similar filters for better conformance to the documentation standards.

Merge of [39621] to the 4.7 branch.

Props shazahm1hotmailcom, JPry, jnylen0.
Fixes #39300.


Built from https://develop.svn.wordpress.org/branches/4.7@39631


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39571 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-21 05:34:34 +00:00
Gary Pendergast cf9b1dbc1f REST API: Fix PHP warnings when `get_theme_support( 'post-formats' )` is not an array.
If `add_theme_support( 'post-formats' )` is called with no additional arguments, then `get_theme_support( 'post-formats' )` returns `true` rather than an array of supported formats. Avoid generating PHP warnings in this situation.

Merge of [39620] to the 4.7 branch.

Props dreamon11, ChopinBach.
Fixes #39293.


Built from https://develop.svn.wordpress.org/branches/4.7@39630


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39570 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-21 05:30:34 +00:00
Gary Pendergast bba21b983c REST API: Add support for filename search in media endpoint.
In [38625], the functionality to search for attachments by filename was added via the `posts_clauses` filter and the `_filter_query_attachment_filenames()` function. This moves `_filter_query_attachment_filenames()` from `wp-admin/includes/post.php` to `wp-includes/post.php` so that it can be applied in the same manner in the REST API media endpoint.

Merge of [39598] to the 4.7 branch.

Props jblz, tyxla.
Fixes #39092.


Built from https://develop.svn.wordpress.org/branches/4.7@39629


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39569 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-21 05:19:34 +00:00
Gary Pendergast e6ce714219 REST API: Allow sending an empty or no-op comment update.
In general, updates that don't actually change anything should succeed. [39371] added tests for other object types, and this commit fixes empty updates for comments and adds the missing test.

Merges [39597] to the 4.7 branch.

Props jnylen0.
Fixes #38700.


Built from https://develop.svn.wordpress.org/branches/4.7@39628


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39568 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-21 05:13:36 +00:00
Gary Pendergast 45e03c2576 Tests: Restore the database connection earlier when switching test groups.
When plugins don't disable the `backupGlobals` PHPUnit option in their own tests, `$wpdb` is backed up and restored between classes of tests. The serialisation process used for this broke the database connection. This previously wasn't a problem, as it was reconnecting before each test.

[38398] introduced some changes that required the connection to be available in `setUpBeforeClass()`, earlier than in was previously reconnecting. This didn't cause warnings in Core, but it did cause warnings for plugins that don't disable the `backupGlobals` option.

The database connection now reconnects in `setUpBeforeClass()`. This change also fixes a few Core tests that weren't calling `parent::setUpBeforeClass()` or `parent::tearDown()` correctly.

Merges [39626] to the 4.7 branch.

Fixes #39327.


Built from https://develop.svn.wordpress.org/branches/4.7@39627


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-21 05:08:33 +00:00
Dion Hulse 540a3164a4 Feeds: Do not translate the `lastBuildDate` field in RSS feeds.
Props stevenkword.
Partial Merge of [39613] to the 4.7 branch.
Fixes #39141.

Built from https://develop.svn.wordpress.org/branches/4.7@39615


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39555 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-16 06:44:33 +00:00
Dion Hulse 592f1be68e Taxonomy: Restore the ability to use string-based `$args` in `wp_get_object_terms()`.
Props tyxla.
Merges [39578] to the 4.7 branch.
Fixes #39215.

Built from https://develop.svn.wordpress.org/branches/4.7@39611


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-16 05:50:32 +00:00
Dion Hulse 380cc5d7d6 REST API: Do not include the `password` argument when getting media items
Currently, `attachment` is the only post type exposed via the REST API that
does not support password protection, but it's possible for other post types to
remove password support.

Props jnylen0.
Merges [39595] to the 4.7 branch.
Fixes #38977.

Built from https://develop.svn.wordpress.org/branches/4.7@39610


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39550 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-16 05:46:35 +00:00
Dion Hulse 0b813f2544 REST API: Do not error on empty JSON body
It's fairly common for clients to send `Content-Type: application/json` with an
empty body.  While technically not valid JSON, we've historically supported
this behaviour, so it shouldn't cause an error.

Props JPry, jnylen0.
Merges [39594] to the 4.7 branch.
Fixes #39150.

Built from https://develop.svn.wordpress.org/branches/4.7@39609


git-svn-id: http://core.svn.wordpress.org/branches/4.7@39549 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-12-16 05:43:33 +00:00