Commit Graph

12162 Commits

Author SHA1 Message Date
Gary Pendergast
b1882aa8f1 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.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39631 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-21 05:33:15 +00:00
Gary Pendergast
81cc13dd49 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.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39630 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-21 05:29:24 +00:00
Gary Pendergast
fab33a89e5 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.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39629 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-21 05:18:24 +00:00
Gary Pendergast
092fa83f60 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.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39628 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-21 05:12:06 +00:00
Dion Hulse
7e49d80783 Feeds: Do not translate the lastBuildDate field in RSS feeds.
Props stevenkword.
Partial Merge of [39613] to the 4.7 branch.
Fixes #39141.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39615 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-16 06:43:48 +00:00
Dion Hulse
2e6ae93cf2 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.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39611 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-16 05:49:02 +00:00
Dion Hulse
8cbd30e3ce 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.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39610 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-16 05:45:50 +00:00
Dion Hulse
321599cc46 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.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39609 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-16 05:42:23 +00:00
Dion Hulse
4d3fb455f5 Posts, Post Types: Ensure is_page_template() can only return true when viewing a singular post query.
Props natereist, dlh, johnbillion.
Merges [39599] to the 4.7 branch.
Fixes #39211.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39608 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-16 05:40:01 +00:00
Dion Hulse
c41a10ecb1 PDF Images: Avoid a PHP Warning when attempting to process a file without an extension.
Props chandrapatel for initial patch.
Merges [39580] to the 4.7 branch.
Fixes #39195.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39607 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-16 05:38:41 +00:00
Dion Hulse
746b590ee7 Customize: Prevent edit shortcut from losing event handler after selective refresh.
Props sirbrillig.
Merges [39581] to the 4.7 branch.
See #27403.
Fixes #39100.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39606 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-16 05:37:41 +00:00
Dion Hulse
4ce30a06ff Bootstrap: Re-initialize any hooks added manually by object-cache.php.
Prior to 3.1 if a object cache dropin wanted to add actions, they needed to use `$wp_filter` directly.

Props jorbin.
Merges [39565] to the 4.7 branch.
Fixes #39132.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39605 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-16 05:36:33 +00:00
Adam Silverstein
126ba8a400 WP-API: JavaScript client - fix setup of models used by wp.api.collections objects.
Correct setup for the `model` attribute of `wp.api.collections` objects. Set the collection model as a function that returns a new model of the underlying type, instead of setting it as the model prototype. Fixes an issue where models for fetched collections weren't set up properly and didn't have the expected mixin methods such as `getCategories` available.

Props jesseenterprises.
Merges [39603] to the 4.7 branch.
Fixes #39070.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39604 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-15 13:01:26 +00:00
Ella van Dorpe
c30742ceaf Editor: Remove target=_blank when unchecked in the link modal.
Merges [39601] to the 4.7 branch.
Fixes #39276.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39602 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-14 20:58:36 +00:00
Konstantin Obenland
652e264ef7 Themes: Add missing square bracket in jQuery selector.
Fixes a bug in Safari where the UI wasn't updated after deleting a theme due to
the incomplete selector.

Props Hristo Sg.
Merges [39586] to the 4.7 branch.
Fixes #39246.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39587 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 09:33:56 +00:00
Dion Hulse
55e4ca9b6f Customize: Prevent navigation in preview when clicking on child elements of preview links that have non-previewable URLs.
Props westonruter.
Merges [39584] to the 4.7 branch.
Fixes #39098.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39585 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 08:25:45 +00:00
Dion Hulse
82d5647540 The 4.7 branch is now 4.7.1-alpha.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39576 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 04:53:57 +00:00
Dion Hulse
26caea9b90 Customize: Deprecate page_home nav menu item starter content in favor of home_link; replace usage in Twenty Seventeen.
Props celloexpressions, westonruter.
See #38615, #38114, [38991].
Merges [39561] to the 4.7 branch.
Fixes #39104.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39575 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 02:24:19 +00:00
Dion Hulse
78c5da52b5 Customize: Allow (optional) url parameter to be omitted in intercepted calls to history.pushState() and history.replaceState() in customize preview.
Fixes issue where calls without the `url` parameter erroneously end up rewriting the location path to `/undefined`.

Props Christian1012, westonruter.
Merges [39547] to the 4.7 branch.
Fixes #39175.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39574 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 02:10:30 +00:00
Dion Hulse
5fa5e22427 Customize: Trim whitespace for URLs supplied for external_header_video to prevent esc_url_raw() from making them invalid.
Props tyxla.
See #38172.
Merges [39560] to the 4.7 branch.
Fixes #39125.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39573 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 02:05:22 +00:00
Dion Hulse
2ee02541d5 Customize: Fix ability to shift-click on placeholder/pre-saved nav menu items in preview to focus on corresponding control.
Props westonruter.
Merges [39562] to the 4.7 branch.
Fixes #39102.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39572 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 02:03:22 +00:00
Dion Hulse
9431b1e310 Customize: Use selected user language for edit shortcuts in preview instead of site language.
Props ocean90.
Merges [39545] to the 4.7 branch.
Fixes #39009.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39571 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 01:58:21 +00:00
Dion Hulse
ce5e63c224 Customize: Fix inability to delete nav menus by preventing preview filters from being added during customize_save admin ajax request.
Also prevent setting `nav_menu_locations[...]` values to `NaN` which gets sent as `null`.

Props westonruter.
See #30937, [38810].
Merges [39558] to the 4.7 branch.
Fixes #39103.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39570 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 01:56:53 +00:00
Dion Hulse
1a84a32ffd Customize: Prevent scrolling custom_css textarea to top when pressing tab.
Props tyxla, sstoqnov for testing, celloexpressions for testing.
See #38667.
Merges [39557] to the 4.7 branch.
Fixes #39134.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39569 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 01:55:02 +00:00
Dion Hulse
cef6896bae Customize: Use esc_url_raw() instead of wp_json_encode() to eliminate extraneous slashes when outputting background image URL in CSS url().
Props tyxla, westonruter.
See #22058.
Merges [39546] to the 4.7 branch.
Fixes #39145.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39568 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 01:45:58 +00:00
Dion Hulse
620d169b35 Customize: Prevent single quotes (apostrophes) in custom_css values from unexpectedly causing false positives for unbalanced character validation errors.
Props westonruter.
See #39218, #35395.
Merges [39559] to the 4.7 branch.
Fixes #39198.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39567 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 01:44:26 +00:00
Dion Hulse
0087500d9c REST API: Treat any falsy value as false in 'rest_allow_anonymous_comments'.
Extend the check in 'rest_allow_anonymous_comments' to accept any falsy value (previously this was an explicit check for `false`).

One possible failure case is that a plugin developer forgets to include a return value for some code path in their callback for this filter, leading to a value of null which is currently treated like `true`.

Props joehoyle, jnylen0.
Merges [39487] to the 4.7 branch.
Fixes #39010.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39566 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 01:39:13 +00:00
Helen Hou-Sandi
eca76c5789 WordPress 4.7 "Vaughan".
It's very sassy.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39524 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-06 18:38:54 +00:00
Helen Hou-Sandi
c882d12068 About page: Update video and REST API reference URLs.
props ocean90, kadamwhite, coffee2code.
see #38616 for the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39523 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-06 18:23:50 +00:00
Helen Hou-Sandi
db37244980 Remove 4.7 cruft from $_old_files.
fixes #39113.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39521 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-06 17:17:37 +00:00
Helen Hou-Sandi
4f78d35064 Post-RC3 bump.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39519 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-06 07:22:19 +00:00
Helen Hou-Sandi
9ec1bf21ac About page: Bump image versions because CDN caching.
props pento.
see #38616 for the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39518 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-06 07:12:55 +00:00
Helen Hou-Sandi
b23d5f2a6b WordPress 4.7 RC3.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39516 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-06 06:58:29 +00:00
Joe McGill
e2633109b1 About page: Resposive images and CDN media URLs.
This adds `srcset` and `sizes` to the about page images, including
art direction, via `<picture>` for the lead Twenty Seventeen image.

This also replaces URLs for all images and feature videos to their
CDN locations on s.w.org.

Props helen, pento, joemcgill.
Fixes #38616 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39515 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-06 06:57:25 +00:00
Helen Hou-Sandi
f872b5557e About page: Imagery and beautification.
Still to come: responsive images, optimized videos, and CDN URLs.

merges [39512] to the 4.7 branch.
props melchoyce, helen, ramiabraham.
see #38616.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39513 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-06 04:01:29 +00:00
Weston Ruter
a7bed1e872 Customize: Prevent infinite full refresh from occurring when selective refresh falls back for a nav menu that has items excluded from rendering via filtering.
Merges [39510] onto 4.7 branch.
Fixes #38612 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39511 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-06 02:52:14 +00:00
Dominik Schilling (ocean90)
ea175aae36 Comments: Merge a similar string between comments.php, XML-RPC and the REST API comments controller.
Merge of [39508] to the 4.7 branch.

Props ramiy.
See #39013.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39509 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-05 20:17:06 +00:00
Weston Ruter
cee7b15ead Customize: Defer populating post_name for auto-draft posts in customized state until posts are published.
The ultimate `post_name` is stored in postmeta until the post is published. The `get_page_by_path()` function does not exclude `auto-draft` posts. Revert changes to `wp_unique_post_slug()` from [39411] which excluded `auto-draft` posts.

Props westonruter, dlh for testing, helen for testing.
Merges [39506] onto 4.7 branch.
Fixes #39078 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39507 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-05 19:38:16 +00:00
Weston Ruter
8886763a6d Customize: Ensure changeset_uuid query param is removed from the customize.php window's location once a changeset has been published (committed) with starter content.
Props westonruter, dlh for testing.
Merges [39504] onto 4.7 branch.
Fixes #39081 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39505 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-05 16:56:50 +00:00
Weston Ruter
49cb84ba0d Customize: Prevent posts/pages imported via starter content from being dropped when adding post/page stubs via nav menus and the dropdown-pages control.
Props westonruter, dlh for testing.
Merges [39502] onto 4.7 branch.
Fixes #39071 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39503 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-05 16:48:16 +00:00
Andrew Ozz
9d4bdea5c3 TinyMCE: fix the styling of notices generated by the editor UI.
Props: mor10, karmatosed, azaozz.
Fixes #38917 for 4.7.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39501 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-05 15:10:01 +00:00
Weston Ruter
fee8b61eb1 Customize: Ensure textarea for Custom CSS displays as code (in LTR) when an RTL language is active.
Merges [39499] onto 4.7 branch.
Fixes #39085 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39500 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-05 13:59:49 +00:00
Dominik Schilling (ocean90)
6facdb3a46 Default Themes: Update version numbers and readme files for 4.7 release
Bump version numbers and update readme files for themes with changes. Also updates description for Twenty Seventeen and removes version number for HTML5 shiv for easier updates in the future.

Merge of [39496] to the 4.7 branch.

Props davidakennedy.
See #38858.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39498 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-05 09:35:15 +00:00
Dominik Schilling (ocean90)
c9df76e2ac Twenty Seventeen: Fix CSS specificity problem with CSS feature query for object-fit
Previously, the theme's CSS feature query for `object-fit` overrode styles it shouldn't have on interior pages.

This moves the feature query farther down in the stylesheet so it takes precedence in the cascade in supported browsers, and applies the appropriate selector for the interior pages. In browsers that don't support feature queries or `object-fit`, the fallback styles are still applied. The problem was that the rules had the same specificity, so this way, the cascade takes over properly. The transforms and position changes for fallbacks are still needed in browsers that don't support `object-fit` and feature queries.

Merge of [39495] to the 4.7 branch.

Props peterwilsoncc, davidakennedy.
See #39073.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39497 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-05 09:29:41 +00:00
Rachel Baker
ac7222bfe9 Comments: Merge similar strings between comments.php and the REST API comments controller.
Merges [39490] to the 4.7 branch.

Props ramiy.
Fixes #39014 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39491 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-04 20:36:02 +00:00
Rachel Baker
ce0fe0838a REST API: Merge similar date strings in the revisions and comments controllers.
Merges [39488] to the 4.7 branch.

Props ramiy.
Fixes #39016 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39489 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-04 20:26:21 +00:00
Helen Hou-Sandi
8397b5023f Twenty Seventeen: Improve display of video header and header image in modern browsers
The theme uses a hack to help the video header and header image fill the available space. This centers around `max-width: 1000%;`. It causes visual issues (zooming of the header video or image) for all users though.

This fixes that with CSS Features Queries. The hack remains for browsers that don't support Feature Queries  and `object-fit`. Browsers that do support both get a better experience with a more reliable styling of the video and image header container.

Props laurelfulford, peterwilsoncc.

Fixes #39035 for the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39485 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-04 19:23:20 +00:00
Helen Hou-Sandi
e27a7eb76e Twenty Seventeen: Add specific font stack for Thai language
Improves legability and design for users viewing the theme with Thai language.

Props imnok, netweb, melchoyce.

Fixes #38937 for the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39484 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-04 19:22:38 +00:00
Weston Ruter
98b7307e75 Customize: Ensure a custom_css post insertion gets an initial post revision.
Merges [39477] onto 4.7 branch.
Props georgestephanis, westonruter.
Fixes #39032 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39479 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-04 17:31:28 +00:00
Helen Hou-Sandi
4a5828fc8f Docs: Update an @since as there will not be a 4.6.2 before 4.7.
props boonebgorges.
fixes #37291 for the 4.7 branch. see [38776].


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39476 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-04 17:16:23 +00:00
Helen Hou-Sandi
ea4e965942 Post-RC2 bump.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39474 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-03 06:16:51 +00:00
Helen Hou-Sandi
baa0da9eb8 WordPress 4.7 RC2.
git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39473 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-03 06:04:21 +00:00
Andrew Nacin
3bcc86a908 REST API: Register the admin_email setting in single site only.
Merges [39470] and [39471] to the 4.7 branch.

fixes #38990.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39472 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-03 05:41:52 +00:00
Gary Pendergast
3b3a0f0a68 REST API: Site URL setting should not be present on multisite installations.
The `siteurl` setting is registered and made available to the REST API. On a multisite installation, this setting is not configurable from the General Settings screen, but due to the above it is configurable from the REST API.

Merge of [39468] to the 4.7 branch.

Props peterwilsoncc.
Fixes #39005.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39469 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-03 05:17:26 +00:00
Helen Hou-Sandi
313cb29f82 Custom CSS: Change the help link to something better for users.
fixes #39015 for the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39467 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-03 05:11:21 +00:00
Gary Pendergast
e67b742256 REST API: Capability check for editing a single term should use the singular form.
As an extra level of sanity checking, the term ID should be cast as an int in `map_meta_cap()`.

Merge of [39464] to the 4.7 branch.

Props johnbillion, nacin, dd32, pento.
See #35614.
Fixes #39012.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39465 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-03 05:08:33 +00:00
Gary Pendergast
0970fc22e1 Docs: Add missing REST API-related args to register_post_type() and register_taxonomy().
These functions now accept the `show_in_rest`, `rest_base`, and `rest_controller_class` args.

Merges [39462] to the 4.7 branch.

Props ketuchetan, rahulsprajapati.
Fixes #39023.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39463 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-03 04:49:37 +00:00
Gary Pendergast
aed692cddd REST API: Use the correct error message when editing a single term.
Merges [39460] to the 4.7 branch.

Props ramiy, johnbillion.
Fixes #39017.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39461 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-03 04:43:21 +00:00
Gary Pendergast
3904937cd6 Load: Re-add class-wp-upgrader-skins.php, class-feed.php, locale.php, and session.php.
Several files were removed during 4.7 that can be loaded externally, so we need to keep them, though their use is now deprecated.

Merges [39449], [39450], [39453], [39455], and [39456] to the 4.7 branch.
Fixes #39027.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39459 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-03 04:29:44 +00:00
Gary Pendergast
378d9f8f7c REST API: Merge similar strings in a comments endpoint parameter description.
Merge of [39457] to the 4.7 branch.

Props ramiy.
Fixes #39036.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39458 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-03 04:23:17 +00:00
Dion Hulse
ce83066d30 Revert [38677] from the 4.7 branch.
This avoids fatal errors caused with recursive calling of term functions within the `get_terms` filter.

See #21760.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39454 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-03 04:04:05 +00:00
Helen Hou-Sandi
17f7611df2 Twenty Seventeen: Improve ARIA for the nav menu.
The `onResizeARIA()` function was not very useful and buggy.

props afercia.
fixes #39029, #39026 for the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39452 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-03 03:43:17 +00:00
Helen Hou-Sandi
87e16e3ce3 Twenty Seventeen: Ensure header text color updates in Customizer preview when cleared
Checks if the text color has been cleared and removes the `style` block if it has been. Uses color styles in theme stylesheet.

Props sstoqnov, davidakennedy.

Fixes #38993 for the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39448 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-02 23:02:15 +00:00
Rachel Baker
75ce33e358 REST API: Fix bug where comment author and author email could be an empty string when creating a comment.
If the `require_name_email` option is true, creating a comment with an empty string for the author name or email should not be accepted.  Both values can be an empty string on update.

Merges [39444] into the 4.7 branch.
Props flixos90, hnle, dd32, rachelbaker, jnylen0, ChopinBach, joehoyle, pento.

Fixes #38971 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39446 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-02 22:45:06 +00:00
Helen Hou-Sandi
bcc8cdf112 About page: Add strings for 4.7 and make available for translation.
It doesn't look very pretty; design changes still to come.

merges [39420], [39432], [39433], [39442], [39443] to the 4.7 branch.

props helen, michaelarestad, samuelsidler, jbpaul17, jorbin, nacin, melchoyce, ocean90, ramiy.
see #38616.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39445 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-02 22:43:52 +00:00
Rachel Baker
334635ee5e REST API: Fix handling of some orderby parameters for the Posts controller.
- 'orderby' => 'include' requires an array of post_ids via the include collection param.
- 'orderby' => 'id' and 'orderby' => 'slug' need map the correct WP_Query equivalents. 

Merges [39440] to the 4.7 branch.

Props flixos90, hnle, dd32, rachelbaker, joehoyle, pento.
Fixes #38971 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39441 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-02 22:20:27 +00:00
Jeremy Felt
fde4185ae4 REST API: Disable DELETE requests for users in multisite.
In wp-admin, users are removed from individual sites rather than deleted. A user can only be deleted from the network admin.
Until support for a PUT request that removes a user's site and content associations is available, DELETE requests are disabled to avoid possible issues with lost content.

Merges [34938] onto 4.7 branch.

Props jnylen0, rachelbaker.
Fixes #38962 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39439 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-02 22:15:32 +00:00
Rachel Baker
8fe31dc36a REST API: Return a WP_Error if meta property is not an array.
Fixes bug where a PHP Warning is currently thrown if a client sends a request where `meta` is not an array value.

Merges [39436] onto 4.7 branch.

Props timmydcrawford, jnylen0, rachelbaker, pento.
Fixes #38989 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39437 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-02 22:04:06 +00:00
Weston Ruter
73a9c335db Customize: Fix posts limit query arg for WP_Query from incorrect number to posts_per_page.
Merges [39434] onto 4.7 branch.
Props dlh.
Fixes #39022 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39435 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-02 16:18:43 +00:00
Gary Pendergast
2c8812f524 Plugins: Add a current_priority() method to WP_Hook.
This allows plugins to determine the currently running priority of a filter.

Merges [39430] to the 4.7 branch.

Fixes #39007.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39431 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-02 07:10:56 +00:00
Gary Pendergast
2c907c7248 Readme: Update recommendations to PHP 7, and to include HTTPS.
See https://wordpress.org/news/2016/12/moving-toward-ssl/

Merges [39428] to the 4.7 branch.

Fixes #39024.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39429 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-02 07:03:21 +00:00
Gary Pendergast
05b8b42a10 REST API: Require the reassign parameter when deleting users.
When deleting a user through the WordPress admin, a specific decision is presented - whether to assign all of the user's posts to another user, or to delete all of the posts.

This change requires `reassign` as a parameter in the corresponding REST API endpoint, so that content isn't accidentally lost.

Merges [39426] to the 4.7 branch.

Props jeremyfelt.
Fixes #39000.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39427 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-02 06:58:36 +00:00
Helen Hou-Sandi
6df38cddce Twenty Seventeen: Fix broken menu toggle in Customizer after menu items are added
This simplifies the line `$( siteNavigation.closest( '.main-navigation' ), this ).toggleClass( 'toggled-on' );` to `$( siteNavContain ).toggleClass( 'toggled-on' );`, since `this` is the clicked button, so the extra context isn't needed.

Props afercia, laurelfulford.

Fixes #38992 for the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39423 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-02 06:33:25 +00:00
Helen Hou-Sandi
3793811761 Twenty Seventeen: Fix style issues with gallery image links
* Ensures dark color scheme has proper box shadow and hover/focus styles.
* Make sure links are correct width.

Props afercia, laurelfulford.

Fixes #38969 for the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39422 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-02 06:32:44 +00:00
Helen Hou-Sandi
a10ce3904a Twenty Seventeen: Hide front section panels on page load of Customizer.
Props sstoqnov.

Fixes #38951 for the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39421 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-02 06:31:36 +00:00
Joe McGill
9a3f41ea68 Twenty Seventeen: Add .has-header-video styles for custom color schemes.
Following [39413], this adds `.has-header-video` style definitions in
`/inc/custom-header.php` to support custom color schemes.

Props laurelfulford.
Fixes #38995 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39416 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-02 05:46:19 +00:00
Joe McGill
a76e08ccab Twenty Seventeen: Better handling of custom headers when no image is set.
This ensures that a standard header is shown on the front page whenever
a header video is set without a header image if the video doesn't load,
e.g., on mobile sizes or if the JS doesn't fire.

This adds a new class, `.has-header-video` that is added whenever the
`wp-custom-header-video-loaded` event is fired, which is then used to style
the custom headers along with `.has-header-image` whenever a header image
is available. This also changes the class name on the custom header media
wrapping `div` from `.custom-header-image` to `.custom-header-media`.

Props laurelfulford, joemcgill.
Fixes #38995 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39414 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-02 05:19:44 +00:00
Weston Ruter
b878b509ed Customize: Reuse existing non-auto-draft posts and existing auto-draft posts in the customized state with matching slugs when applying starter content.
* Updates `wp_unique_post_slug()` to ignore `auto-draft` posts. Prevents publishing multiple posts that have the same slugs from starter content.
* Fixes fatal error when attempting to save an header_image setting from a non-admin context.
* Fixes substituting attachment symbols in options and theme mods.
* Fixes applying starter content for header images and background images.

Merges [39411] to 4.7 branch.
See #38114.
Fixes #38928 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39412 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-02 00:25:47 +00:00
Weston Ruter
a3ed458867 Customize: Reject a changeset update when a non-future date is provided and also ensure that a published changeset always gets set to the current date/time.
* Also moves checks from `customize_save` Ajax handler to the underlying `WP_Customize_Manager::save_changeset_post()` call which plugins may invoke directly.
* Ensures that `customize_save_response` filter is always passed an array, with error code available as `code`.

Props utkarshpatel, westonruter, sayedwp.
Merges [39409] into 4.7 branch.
See #30937.
Fixes #38943 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39410 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-02 00:06:59 +00:00
Rachel Baker
25830c6798 REST API: Correct the admin_email setting description for single site installs.
Display different descriptions for multisite or single site installations.

Props johnbillion, ocean90.

Merges [39406] to the 4.7 branch.
Fixes #38990 for 4.7


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39407 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-01 03:05:32 +00:00
Weston Ruter
691be0fbf7 Twenty Seventeen: Make spacing on pages without comments consistent
Previously, the top of the page had more space than the bottom, not matching the original design.

Props laurelfulford, melchoyce.
Merges [39404] onto the 4.7 branch.
Fixes #38972 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39405 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-01 02:51:59 +00:00
Rachel Baker
ff5be90aad REST API: Fix incorrect capability check on term create.
Change the capability check used in `WP_REST_Terms_Controller` when creating a new term is attempted, from `manage_terms` to `edit_terms`. This matches the behavior within the WordPress admin. See #35614.

Props johnbillion, rmccue, rachelbaker, helen, jorbin, SergeyBiryukov.

Merges [39402] to the 4.7 branch.
Fixes #38958 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39403 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-01 02:45:17 +00:00
Rachel Baker
2a32f5ca13 REST API: Fix incorrect uses of rest_sanitize_value_from_schema().
In the `check_username()` and `check_password()` callbacks in the Users controller cast the provided request value to a string. The `rest_sanitize_value_from_schema()` function was being used incorrectly which was causing unintended request parsing. 
In `rest_sanitize_request_arg()` do not pass nonexistent third parameter for the `rest_sanitize_value_from_schema()` function.

Props jnylen0, joehoyle, rachelbaker, ocean90.

Merges [39400] to the 4.7 branch.
Fixes #38984 for 4.7.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39401 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-01 02:18:41 +00:00
Mike Schroder
fb1b875797 Media: Fix regression with display of small images in media library.
Fixes a regression in the media library after [38949], which caused
small images (< thumbnail size) to not display within the media library.

Accounts for images that have no intermediate sizes
in `wp_prepare_attachment_for_js()`.

Adds test.

Merges [39396] to the 4.7 branch.

Fixes #38965 for 4.7.
Props joemcgill, clorith, mikeschroder.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39399 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-01 00:28:00 +00:00
Helen Hou-Sandi
7054419f0f Twenty Seventeen: Make sure header text color is applied when color schemes are active.
Props laurelfulford, ocean90.

Merges [39397] to the 4.7 branch.
Fixes #38980 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39398 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-01 00:11:26 +00:00
Weston Ruter
ac62809001 Customize: Fix handling of the nav menu item labels (titles) that match defaults (original titles) and fix the display of item type labels.
* Show default labels for nav menu item as placeholders in a control's label field instead of showing blank.
* Store empty string as label instead of copying default labels.
* Prevent labels for post type archive items from being dropped in preview.
* Also ensure that the item type label is displayed on nav menu item controls for settings that are loaded from an existing changeset.

Amends [38618].
See #38015.
Fixes #38955 for 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39395 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-30 23:41:50 +00:00
Helen Hou-Sandi
2124943c71 Twenty Seventeen: Make fixed navigation apply at correct height on front page, without header video or image
Props laurelfulford, littlebigthing.

Merges [39392] to the 4.7 branch.
Fixes #38927 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39394 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-30 23:38:54 +00:00
Dominik Schilling (ocean90)
8a3192234d Docs: Document the usage of the global $wpdb in _filter_query_attachment_filenames().
Merge of [39390] to the 4.7 branch.

Props mt8.biz.
See #38973.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39391 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-30 23:20:33 +00:00
Dominik Schilling (ocean90)
3f120c78cb Twenty Seventeen: Provide a background color fallback for non-webkit browsers on input styles
This allows the styles to work correctly when modified by high contrast computer setups.

Merge of [39388] to the 4.7 branch.

Props presskopp.
See #38939.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39389 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-30 23:06:27 +00:00
Dominik Schilling (ocean90)
b07efe6c1f Twenty Seventeen: Allow child themes to easily extend custom color patterns
By adding a filter, child themes can add additional selectors onto the custom color scheme CSS. Like so:

{{{
// Add child theme selectors for color schemes.
function dynamic_seventeen_custom_colors_css( $css, $hue, $saturation ) {
	$css .= '
	.colors-custom .content-menu > article:not(.has-post-thumbnail),
	.colors-custom .content-menu > section:not(.has-post-thumbnail) {
		border-top-color: hsl( ' . $hue . ', ' . $saturation . ', 87% ); /* base: #ddd; */
	}';
	return $css;
}
add_filter( 'twentyseventeen_custom_colors_css', 'dynamic_seventeen_custom_colors_css', 10, 3 );
}}}

Merge of [39386] to the 4.7 branch.

Props celloexpressions.
See #38949.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39387 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-30 22:56:08 +00:00
Dominik Schilling (ocean90)
b0a9a79f86 Twenty Seventeen: Make screen reader text on scroll arrow more meaningful
This way screen reader users will know what to expect when they use this link.

Merge of [39384] to the 4.7 branch.

Props rianrietveld.
See #38970.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39385 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-30 22:17:41 +00:00
Dominik Schilling (ocean90)
60e9d045e7 Options: Pass the $passed_default parameter to the default_option_{$option} filter in add_option().
This was missed in [38910].

Merge of [39382] to the 4.7 branch.

Props joehoyle, lucasstark.
See #38176, #38930.

git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39383 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-30 21:31:38 +00:00
Joe McGill
859f180baf Twenty Seventeen: Keep header videos from extending past footer.
This adds 1px of bottom padding to header videos to keep them from
extending past the footer at the bottom of the page.

Fixes #38950 for 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39381 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-30 20:58:01 +00:00
Weston Ruter
932b861ef9 Customize: Fix regression in ability to hide fields for advanced menu properties in nav menu item controls.
Props westonruter, celloexpressions.
See #34391.
Fixes #38952 for 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39379 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-30 18:02:31 +00:00
Weston Ruter
a03f3dc4ee Customize: Fix regression in ability to create submenus for nav menus via drag and drop.
See #34391.
Fixes #38948 for 4.7 branch.
Props delawski, adamsilverstein.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39377 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-30 17:44:08 +00:00
Helen Hou-Sandi
d9cf3680f3 Twenty Seventeen: Add textdomain for starter content attachment titles.
fixes #38981 for the 4.7 branch.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39374 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-30 05:48:52 +00:00
Dion Hulse
356b9ebdc2 WP_Hook: Re-initialize any actions added directly to $wp_filter by advanced-cache.php.
Props dd32, ocean90.
Merges [39369] to the 4.7 branch.
Fixes #38929.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39370 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-29 05:38:16 +00:00
Weston Ruter
e534c73c34 Customize: Fix logic for previewing the URL for nav_menu_item settings for terms and post type archives.
Fixes typo in args passed to `get_term_link()` which caused a fatal error due to this call returning a `WP_Error` which was set to `url`. Also fixes never-satisfiable condition for obtaining post type archive URL. Also ensures that `WP_Error` never leaks through as `url` by setting it to an empty string. Adds missing unit tests.

Amends [38991].
See #38114.
Fixes #38945 for 4.7.


git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39366 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-27 03:19:32 +00:00
Helen Hou-Sandi
055e85698b Post-4.7 RC1 bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@39355 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-24 04:28:58 +00:00
Helen Hou-Sandi
70ce11bbfd WordPress 4.7 RC1.
git-svn-id: https://develop.svn.wordpress.org/trunk@39354 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-24 04:02:24 +00:00
Joe Hoyle
a1c2caa4e3 REST API: Special case the “standard” post format to always be allowed.
Fixes #38916.

git-svn-id: https://develop.svn.wordpress.org/trunk@39353 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-24 00:07:50 +00:00
joehoyle
7dc75c29f6 REST API: Allow unsetting a post’s password.
Props danielbachhuber, iseulde.
Fixes #38919.

git-svn-id: https://develop.svn.wordpress.org/trunk@39352 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-23 23:12:05 +00:00
Drew Jaynes
0587033b4a Docs: Add a missing changelog entry for the point where the $tagnames parameter was added to get_shortcode_regex().
Props keesiemeijer.
Fixes #38914.


git-svn-id: https://develop.svn.wordpress.org/trunk@39351 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-23 17:34:10 +00:00
Weston Ruter
8bcbe1a35c Customize: Refactor logic for updating custom_css posts by introducing wp_update_custom_css_post() function and renaming update filter.
* Moves logic from `WP_Customize_Custom_CSS_Setting::update()` into a re-usable `wp_update_custom_css_post()` function, useful for future REST API endpoint, WP-CLI command, or plugin migrations.
* Renames `customize_update_custom_css_post_content_args` filter to `update_custom_css_data` and improves the naming of the parameters. Instead of passing `post_content` and `post_content_filtered` the filtered array now contains `css` and `preprocessed` respectively. 
* The second context param for the `update_custom_css_data` filter is now an array of the original args passed to `wp_update_custom_css_post()` and there is now no more `$setting` arg since it isn't necessarily being called in the customizer context.

Props westonruter, georgestephanis.
See #35395.
Fixes #38672.


git-svn-id: https://develop.svn.wordpress.org/trunk@39350 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-23 17:33:21 +00:00
Joe Hoyle
5d7118d63e REST API: Add support for comments of password-protected posts.
Core requires the post password to view and create comments on password protected posts, so we must support a “password” param on the comments endpoint when fetch comments for a specific post and creating a comment on a password protected post.

Props flixos90, jnylen0.
Fixes #38692.

git-svn-id: https://develop.svn.wordpress.org/trunk@39349 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-23 16:14:08 +00:00
Rachel Baker
24abde4e54 REST API: Always fire the rest_insert_* actions after the related object is updated or inserted.
Brings consistency to the `rest_insert_*` actions. Also includes some shuffling and clean-up as well including:
- Ensure we are passing the most current `$post` and `$user` objects to the `update_additional_fields_for_object()` callbacks.
- Changes the function signature of `handle_status_param()` in the Comments controller to accept just the comment_id as the 2nd parameter, instead of a full WP_Comment object. Only the comment_id is needed in the method, this avoids having to include another `get_comment()` call. 
- Renames a variable in the `create_item()` method of the Posts controller from `$post` -> `$prepared_post` to be more explicit.
- Minor fixes/clarifications to the rest_insert_* hook docs

Props rachelbaker, joehoyle
Fixes #38905.

git-svn-id: https://develop.svn.wordpress.org/trunk@39348 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-23 15:32:25 +00:00
Pascal Birchler
ab087e8593 Embeds: Correctly remove security attribute from iframes in IE 10 and IE 11.
This was originally added in 4.4, but presumably broke with [35708], which prevented these browsers from actually reaching the relevant code section.
Let's make embeds work again in IE 10 and IE 11.

Fixes #38694.

git-svn-id: https://develop.svn.wordpress.org/trunk@39347 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-23 13:37:12 +00:00
Helen Hou-Sandi
f3a59f8632 Theme starter content: Add support for featured images and page templates.
Featured image support means that attachments can now be imported. Media can be sideloaded from within theme or plugin directories. Like other posts, attachments are auto-drafts until customizer changes are published, and are not duplicated when they already exist in the customized state. Attachment IDs can be used for any number of purposes, much like post IDs. Twenty Seventeen now includes 3 images used as featured images to best showcase the multi-section homepage setup.

As featured image IDs are stored in post meta, it also made sense to add support for page templates. Twenty Seventeen does not include any such templates, but the functionality can be quite important for displaying themes to their best effect.

props westonruter, helen, flixos90.
fixes #38615.


git-svn-id: https://develop.svn.wordpress.org/trunk@39346 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-23 09:52:27 +00:00
Weston Ruter
9528abe32b Customize: Clean up docs and code style for customize changes in 4.7.
* Adds missing `resolve`/`fail` for promise returned by `loadThemePreview`.
* Adds missing jsdoc blocks and tags.
* Adds missing phpdoc and makes corrections.

See #37770.
Fixes #38908.


git-svn-id: https://develop.svn.wordpress.org/trunk@39345 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-23 06:04:23 +00:00
Joe Hoyle
ed13670fde REST API: Make JS Client store schema in session storage.
Props adamsilverstein.
Fixes #38895.

git-svn-id: https://develop.svn.wordpress.org/trunk@39344 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-23 02:54:24 +00:00
Joe Hoyle
e606bc36c1 REST API: Allow unsetting of page templates in update requests.
Sending a request to update a page with the template property set to an empty string resulted in an error because “” was not a valid value in the enum.

Props lucasstark, swissspidy.
Fixes #38877.

git-svn-id: https://develop.svn.wordpress.org/trunk@39343 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-23 02:46:42 +00:00
Joe Hoyle
2341473a5f REST API: Update “resource” strings to use the appropriate nouns.
Props ramiy.
Fixes #38811.

git-svn-id: https://develop.svn.wordpress.org/trunk@39342 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-23 02:42:00 +00:00
David A. Kennedy
d6d843dccd Twenty Seventeen: Ensure edit button label displays properly in other languages
This bug occurred in any language where text wraps character-by-character, since those languages don't delimit words with spaces. In Japanese, Chinese and Korean, etc., it was possible for the label to be displayed vertically.

Props tg29359, afercia, odysseygate.

Fixes #38876.


git-svn-id: https://develop.svn.wordpress.org/trunk@39341 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-23 00:43:22 +00:00
Joe McGill
59db3d7e76 Twenty Seventeen: CSS coding standards fixes.
This makes a few adjustments to CSS to bring them inline with WordPress
CSS coding standards including:

* Font weights should be defined using numeric values
* Do not pad parentheses with spaces

This also fixes a couple of typos to inline comments.

Props netweb for initial patch.
Fixes #38901.

git-svn-id: https://develop.svn.wordpress.org/trunk@39340 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-22 20:46:04 +00:00
Helen Hou-Sandi
bf4dd6a8cb Twenty Seventeen: Ensure galleries display correctly in IE11.
It appears IE11 needs an explicit width for an `inline-block` parent element.

props derrickkoo, afercia.
fixes #38872.


git-svn-id: https://develop.svn.wordpress.org/trunk@39339 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-22 15:50:25 +00:00
Peter Wilson
e174fdf21b Themes: Prevent unneeded database updates in wp_get_custom_css_post().
When a custom header image was set but custom CSS was not, `wp_get_custom_css_post()` was generating an UPDATE query on every frontend request.

In theme options the header image meta data is stored as an object. In `update_option()` this hits an edge case as the resource IDs of the old and new values never match.

This changes the logic of `wp_get_custom_css_post()` to ensure `set_theme_mod()` is only called when the custom CSS has changed.

Props bradyvercher, helen.
Fixes #38866.


git-svn-id: https://develop.svn.wordpress.org/trunk@39338 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-22 11:40:22 +00:00
Rachel Baker
6028062ade REST API: Set the comment type to a readonly property in the schema.
Document the type property as `readonly` and remove the default value. After #38820 it is no longer possible to set the type property on a comment to anything a custom type.

Props jnylen0, rachelbaker.
Fixes #38886.

git-svn-id: https://develop.svn.wordpress.org/trunk@39337 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 22:55:33 +00:00
Helen Hou-Sandi
21175d59a7 Plugin install: De-duplicate a conditional, introduced in [38172].
props ChrisWiegman.
fixes #38190.


git-svn-id: https://develop.svn.wordpress.org/trunk@39336 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 21:32:58 +00:00
Joe Hoyle
a8a015c3c0 REST API: Update description strings to match already existing ones in the admin.
Props dimadin.
Fixes #38807.

git-svn-id: https://develop.svn.wordpress.org/trunk@39335 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 20:40:10 +00:00
azaozz
48192f196f TinyMCE: avoid calling editor.focus() on loading the content in the editor. It may trigger scroll-into-view in the browser. Call the quirks fix in TinyMCE directly.
Props gitlost.
Fixes #38511.

git-svn-id: https://develop.svn.wordpress.org/trunk@39334 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 20:14:01 +00:00
Weston Ruter
ccf9b72446 Customize: Prevent selective refresh from causing infinite fallback refreshes when nav menu contains invalid items.
Invalid nav menu items are exported as settings in the customize controls since it `is_admin()`, but any such `nav_menu_item` settings are excluded from the preview since it's the frontend. Selective refresh for nav menus needs to ignore the syncing of any such `nav_menu_item` settings that are `_invalid` since they are never rendered, and when a nav menu only contains invalid items, an infinite fallback refresh can ensue.

Fixes #38890.


git-svn-id: https://develop.svn.wordpress.org/trunk@39333 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 19:15:05 +00:00
Weston Ruter
f21e17dbf0 Customize: Remove iframe-specific behaviors from customize preview when previewing on frontend and not contained inside iframe.
* Strip out `customize_messenger_channel` from preview window URL when not contained in iframe.
* Allow interacting with unpreviewable links and forms when previewing customized state on frontend.

See #30937.
Fixes #38867.


git-svn-id: https://develop.svn.wordpress.org/trunk@39332 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 16:55:20 +00:00
Dominik Schilling (ocean90)
257026f7a3 I18N: In wp_dropdown_languages() rename the new show_site_locale_default argument to show_option_site_default.
This makes it consistent with arguments of other `wp_dropdown_*()` functions.

Props SergeyBiryukov.
See #38632.
Fixes #38871.

git-svn-id: https://develop.svn.wordpress.org/trunk@39331 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 16:14:01 +00:00
Dominik Schilling (ocean90)
e2f67203bb I18N: Add an additional caching layer for _load_textdomain_just_in_time().
Previously, if no translation files exist for a text domain, `_load_textdomain_just_in_time()` went through the entire process each time it was called. This results in an increased call to `get_locale()` and its `locale` filter.
This change splits the logic into `_get_path_to_translation()` and `_get_path_to_translation_from_lang_dir()`. The former, which is used by `_load_textdomain_just_in_time()`, caches the result of the latter. It also removes some non-working code from `WP_Locale_Switcher::load_translations()`.

Props jrf, swissspidy, sharkomatic, ocean90.
Fixes #37997.

git-svn-id: https://develop.svn.wordpress.org/trunk@39330 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 16:06:38 +00:00
Ryan McCue
0cbea5855e REST API: Trim trailing slashes from routes.
WordPress' rewrites do this usually, but the behaviour was inconsistent when using non-pretty permalinks.

Props joehoyle.
Fixes #38873.


git-svn-id: https://develop.svn.wordpress.org/trunk@39329 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 05:45:31 +00:00
Ryan McCue
096f23db65 REST API: Correctly map meta keys to field names.
This accidentally assumed $name was the same as $meta_key, which ruined the whole point of $name.

Props tharsheblows, joehoyle.
Fixes #38786.


git-svn-id: https://develop.svn.wordpress.org/trunk@39328 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 05:40:46 +00:00
Ryan McCue
4b275bf861 REST API: Disable anonymous commenting by default.
Adding a brand new anonymous comment method is a potential conduit for spam. Since it's still useful functionality, we're now hiding it behind a filter to allow plugins and themes to turn it on if they do want it.

Props helen, rachelbaker, joehoyle.
Fixes #38855.


git-svn-id: https://develop.svn.wordpress.org/trunk@39327 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 05:31:07 +00:00
John Blackbourn
347040745d I18n: Introduce more translator comments for strings that contain placeholders but don't have an accompanying translator comment.
See #38882


git-svn-id: https://develop.svn.wordpress.org/trunk@39326 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 02:45:53 +00:00
Sergey Biryukov
7faf699c69 I18N: Move the support forums URL in update-related HTTP API error messages to a separate translatable string that is already used elsewhere.
Props ramiy, SergeyBiryukov.
Fixes #38880.

git-svn-id: https://develop.svn.wordpress.org/trunk@39325 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 01:51:39 +00:00
John Blackbourn
942302eb63 Remove an erroneous @TODO introduced in [39323].
See #38882


git-svn-id: https://develop.svn.wordpress.org/trunk@39324 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 01:25:09 +00:00
John Blackbourn
f6f0e6098d I18n: Begin introducing translator comments for strings which include placeholders but no accompanying translator comment.
Adds context to one string used in two different contexts for the new user and new site signup email notification.

More to come.

See #38882


git-svn-id: https://develop.svn.wordpress.org/trunk@39323 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-21 01:21:01 +00:00
Joe Hoyle
ec023e37ec REST API: Merge two error messages for edit / update.
Props ramiy.
Fixes #38879.

git-svn-id: https://develop.svn.wordpress.org/trunk@39322 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-20 22:35:44 +00:00
Sergey Biryukov
da47a962d5 REST API: Update error messages in WP_REST_Comments_Controller to use the common text for permission errors.
Props ramiy.
Fixes #38875.

git-svn-id: https://develop.svn.wordpress.org/trunk@39321 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-20 11:45:59 +00:00
Weston Ruter
bf07e57e4b Customize: Ensure that WP_Customize_Manager::save_changeset_post() returns setting_validities even for supplied values that are unchanged from values in changeset.
Check setting existence and authorization via `WP_Customize_Manager::validate_setting_values()` even for `null` values to account for custom params being added to settings, preventing failures from being silently ignored.

See #38705, #30937.
Fixes #38865.


git-svn-id: https://develop.svn.wordpress.org/trunk@39320 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 22:38:40 +00:00
Gary Pendergast
e969ae3b6a Emoji: Update Twemoji fallback to version 2.2.2.
This removes support for the skin tone modifier on emoji involving two or more people. This functionality is opposed by Apple and Google, so there is unlikely to be an input mechanism for such emoji, they oppose it on the grounds that they "...do not think a mechanism should be supported that only permits depiction of multi-person groups (or elements) in which each person has the same skin tone."

See their official notification for further details: http://www.unicode.org/L2/L2016/16332-remove-multi-emb.pdf

This change does not require a CDN update, as no emoji were altered or added, only removed.

See #38113.



git-svn-id: https://develop.svn.wordpress.org/trunk@39319 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 11:04:30 +00:00
Weston Ruter
68b9b45548 Customize: Ensure WP_Customize_Setting::value() returns previewed value for custom types utilizing the customize_value_{$id_base} filter.
Fixes #38864.


git-svn-id: https://develop.svn.wordpress.org/trunk@39318 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 05:59:12 +00:00
Helen Hou-Sandi
e1215e1268 Twenty Seventeen: Avoid an undefined index notice after [39291].
props westonruter.
see #38847.


git-svn-id: https://develop.svn.wordpress.org/trunk@39317 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 04:54:14 +00:00
Sergey Biryukov
bc11236b4c I18N: Use 'WordPress hook name' instead of 'PHP hook name' in translator comments added in [39315].
See #38862.

git-svn-id: https://develop.svn.wordpress.org/trunk@39316 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 02:43:49 +00:00
Sergey Biryukov
b706194ec3 I18N: Add translator comments for strings in _deprecated_*() functions.
See #38862.

git-svn-id: https://develop.svn.wordpress.org/trunk@39315 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 02:38:16 +00:00
Sergey Biryukov
d9c848142e I18N: Remove unnecessary __() calls in _rotate_image_resource() and _flip_image_resource().
Use `_deprecated_function()`'s native strings.

Props ramiy.
Fixes #38862.

git-svn-id: https://develop.svn.wordpress.org/trunk@39314 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 02:29:51 +00:00
Sergey Biryukov
78ae6a3ac0 REST API: Merge some more permission error strings missed in [39309].
See #38857.

git-svn-id: https://develop.svn.wordpress.org/trunk@39313 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 02:20:08 +00:00
Sergey Biryukov
4e5fdda8f9 Text Changes: Merge strings referring to list_users capability.
See #38857.

git-svn-id: https://develop.svn.wordpress.org/trunk@39312 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 02:15:10 +00:00
Sergey Biryukov
ecb95b299c I18N: Merge two 'RSS Error:' strings.
Props ramiy.
Fixes #38861.

git-svn-id: https://develop.svn.wordpress.org/trunk@39311 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 01:56:01 +00:00
Sergey Biryukov
ae7642de08 REST API: After [39306], move author_ip argument to the correct place.
See #38822.

git-svn-id: https://develop.svn.wordpress.org/trunk@39310 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 01:51:01 +00:00
Sergey Biryukov
dad2cdf083 REST API: Merge and clarify some permission error strings.
Fixes #38857.

git-svn-id: https://develop.svn.wordpress.org/trunk@39309 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 01:45:30 +00:00
Sergey Biryukov
81353e76be Text Changes: Merge and clarify some permission error strings in the admin.
See #38857.

git-svn-id: https://develop.svn.wordpress.org/trunk@39308 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 01:37:25 +00:00
Sergey Biryukov
abfbc08c34 I18N: Merge two 'ERROR:' strings.
Props ramiy.
Fixes #38860.

git-svn-id: https://develop.svn.wordpress.org/trunk@39307 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 01:08:40 +00:00
Sergey Biryukov
24b1b19c50 REST API: After [39302], clarify author_ip parameter in error message.
Properties of objects should not be translated, and therefore are pulled out of the translation strings.

Props ramiy.
Fixes #38822.

git-svn-id: https://develop.svn.wordpress.org/trunk@39306 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 01:05:36 +00:00
Sergey Biryukov
b61f722856 REST API: Merge two similar permission error strings in class-wp-rest-comments-controller.php.
We're checking if `current_user_can( 'moderate_comments' )` here, not the specific comment permissions.

See #38857.

git-svn-id: https://develop.svn.wordpress.org/trunk@39305 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-19 00:09:07 +00:00
Sergey Biryukov
d087812e08 REST API: Merge two similar permission error strings.
Props ramiy.
Fixes #38857.

git-svn-id: https://develop.svn.wordpress.org/trunk@39304 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 23:52:21 +00:00
Mike Schroder
0ab17d2158 Media: Allow override of PDF setup for multiple pages or DPI.
After [39187], WordPress started loading only the first page of a PDF.

This is appropriate for performance, but made it impossible to
write plugins that read other pages without overriding `load()`.

Introduces `WP_Image_Editor_Imagick->pdf_setup()`, to allow an override
to change WordPress' rendering DPI defaults or which pages are loaded.

Fixes #38832. See #38522, #31050.
Props markoheijnen, joemcgill, mikeschroder.

git-svn-id: https://develop.svn.wordpress.org/trunk@39303 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 22:21:19 +00:00
Rachel Baker
aa4af7839e REST API: On Comment create, limit the ability to set the author_ip value directly.
Users without the moderate_comments capability can no longer set the `author_ip` property directly, and instead receive a `WP_Error` if they attempt to do so. Otherwise, the `author_ip property` is populated from `$_SERVER['REMOTE_ADDR']` if present and a valid IP value. Finally, fallback to 127.0.0.1 as a last resort.

Props dd32, rachelbaker, joehoyle.
Fixes #38819.

git-svn-id: https://develop.svn.wordpress.org/trunk@39302 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 21:12:03 +00:00
Helen Hou-Sandi
9385bda4ce Autoprefixer for [39249].
Fixes one errant value and re-aligns some existing prefixed property values so they don't get doubled when precommit/postcss is run again in the future.

props davidakennedy.
see #29158.


git-svn-id: https://develop.svn.wordpress.org/trunk@39301 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 21:05:33 +00:00
David A. Kennedy
364d79e205 Twenty Seventeen: Make all Codex links in DocBlocks use HTTPS
Props johnpgreen.

Fixes #38854.


git-svn-id: https://develop.svn.wordpress.org/trunk@39300 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 20:48:47 +00:00
Ella van Dorpe
1e4c6afab3 TinyMCE: fix automatic scroll on page load.
Set focus when new content is loaded in the editor, but not when it's the initial load.

Fixes #38511.



git-svn-id: https://develop.svn.wordpress.org/trunk@39299 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 20:37:50 +00:00
Joe Hoyle
96dba32dfb REST API: Clarify parameters when used in error strings.
Properties of objects should not be translated, and therefore are pulled out of the translation strings.

Props ocean90, ramiy, danielbachhuber.
Fixes #38822.

git-svn-id: https://develop.svn.wordpress.org/trunk@39298 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 20:20:01 +00:00
David A. Kennedy
05b394ccaa Twenty Seventeen: Adds background-attachment: fixed; to devices that should support it
iOS  disables this feature under the hood, but it also distorts the images – unlike other mobile devices that don't support it. So this adds a  check for both `background-attachment: fixed` support or whether it’s an iOS device - passing it adds the class `background-fixed` which is used to add the proper styles.

It also lowers the media query so the parallax-like style is present on a wider range of screens since this bug can be better targeted and avoided. In this way, screens that aren't the offending devices aren't punished merely based on screen size.

Props joemcgill, laurelfulford, helen.

Fixes #38395.


git-svn-id: https://develop.svn.wordpress.org/trunk@39297 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 20:10:18 +00:00
Joe Hoyle
ba5a196d9e REST API: Change “ipv4” types to “ip” to support ipv6.
Stop presuming IP address are IPv4, instead make the type “ip” to be agnostic of IP version. This fixes requests with ipv6 addresses for comments in core.

Props dd32, schlessera, danielbachhuber.
Fixes #38818.

git-svn-id: https://develop.svn.wordpress.org/trunk@39296 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 19:32:03 +00:00
Joe Hoyle
db07183b6f REST API: Check read permissions on posts when viewing comments.
With a few tests for getting / creating comments to reflect core behaviour.

Props timmyc.

git-svn-id: https://develop.svn.wordpress.org/trunk@39295 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 19:06:26 +00:00
Helen Hou-Sandi
b34803f431 Twenty Seventeen: Rename the starter content menus to match the menu area names.
Saves strings and is more descriptive.

props davidakennedy.
see #38615.


git-svn-id: https://develop.svn.wordpress.org/trunk@39294 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 19:04:25 +00:00
Rachel Baker
7552367e7a REST API: Remove the karma property and query parameter from the Comments endpoints.
WordPress has not used the `karma` property internally for the past 8 years. There is no need to expose it in the REST API endpoints. Sites that use `karma` can include it using the `register_rest_field()` function.

Props dd32, danielbachhuber.
Fixes #38821.

git-svn-id: https://develop.svn.wordpress.org/trunk@39292 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 18:52:19 +00:00
David A. Kennedy
ebe736af3f Twenty Seventeen: Ensure the use of proper image size for custom header image
The `sizes` attribute was calculated incorrectly, resulting in the browser downloading the wrong resource. This filters the attribute to correct that.

Before the filter, the `img` contained:
`sizes="(max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px"`

And after:
`sizes="100vw"`

Props joemcgill, transl8or.

Fixes #38847.


git-svn-id: https://develop.svn.wordpress.org/trunk@39291 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 18:42:16 +00:00
Rachel Baker
f553ad6277 REST API: On comment create, return an error if the type property is set to anything other than comment.
Of the default comment_types, only comments are expected to be created via the REST API endpoint. Comments do not have registered types the way that Posts do, so we do not have a method to accurately check permissions for arbitrary comment types.

Props dd32, boonebgorges, rachelbaker.
Fixes #38820.

git-svn-id: https://develop.svn.wordpress.org/trunk@39290 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 18:36:10 +00:00
Rachel Baker
659822098a REST API: Allow parent property to be explicitly set to 0 when creating or updating a Post.
Props lucasstark, danielbachhuber.
Fixes #38852.

git-svn-id: https://develop.svn.wordpress.org/trunk@39289 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 18:11:49 +00:00
Rachel Baker
ff38fc46e4 REST API: On comment create, return an error if the post parameter does not relate to a valid WP_Post object.
Return a `WP_Error` object for attempts to create a comment without an empty or invalid `post` ID.

Props dd32, jnylen0, rachelbaker.
Fixes #38816.

git-svn-id: https://develop.svn.wordpress.org/trunk@39288 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 16:55:03 +00:00
Rachel Baker
cceb9a6053 REST API: On comment create, fallback to the user_agent header value.
If a user-agent is not explicitly provided in the `author_user_agent` parameter, fallback to the `user_agent` value in the request header.

Props dd32, jnylen0, rachelbaker.
Fixes #38817.

git-svn-id: https://develop.svn.wordpress.org/trunk@39287 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 16:21:27 +00:00
Helen Hou-Sandi
faf751b039 Twenty Seventeen: Remove some extraneous function calls.
fixes #38848.


git-svn-id: https://develop.svn.wordpress.org/trunk@39286 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 06:35:15 +00:00
Weston Ruter
c1b2e9dd41 Customize: Remove obsolete edit shortcut style rules from Twenty Seventeen.
Props celloexpressions.
Fixes #38776.


git-svn-id: https://develop.svn.wordpress.org/trunk@39285 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-18 05:22:00 +00:00
Ella van Dorpe
48830b5e10 TinyMCE: remove extra space in tooltip.
This prevents wrapping and looks better, even though there seems to be some space between the other control key characters.

See #38063.



git-svn-id: https://develop.svn.wordpress.org/trunk@39284 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-17 23:58:11 +00:00
Peter Wilson
bd320a9965 Taxonomy: Update register_taxonomy hook to use WP_Taxonomy object.
Casts `WP_Taxonomy` to an array for passing to the `register_taxonomy` hook. This maintains backward compatibility with the processed arguments used prior to WordPress 4.7.

Fixes #38765.


git-svn-id: https://develop.svn.wordpress.org/trunk@39283 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-17 23:34:42 +00:00
Ella van Dorpe
bbd3e0174e TinyMCE views: fix Firefox issues.
* Set focus before rendering to prevent reload in Firefox.
* Rerender views if they are unloaded.
* Remove timeout added in [29513].
* Fix argument in wp.mce.views.render.
* Empty views on hide. Missed in #36434.

Props gitlost, azaozz, iseulde.
Fixes #38511.



git-svn-id: https://develop.svn.wordpress.org/trunk@39282 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-17 20:31:12 +00:00
Sergey Biryukov
3f11a75b2d Docs: Use 3-digit, x.x.x style semantic versioning for @since 4.7.0 entries.
See #37770.

git-svn-id: https://develop.svn.wordpress.org/trunk@39281 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-17 18:27:16 +00:00
Sergey Biryukov
f493ebb369 Taxonomy: Prevent wp_list_categories() from producing not well-nested output if hide_title_if_empty is true.
Props chesio.
Fixes #38839. See #33460.

git-svn-id: https://develop.svn.wordpress.org/trunk@39280 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-17 18:01:13 +00:00
Joe McGill
1c547f56c1 Twenty Seventeen: Additional default header image optimizations.
This is a follow-up to [39248] that applies a bit more compression to
the default header image in Twenty Seventeen.

Props Presskopp, lukecavanagh.
Fixes #38793.

git-svn-id: https://develop.svn.wordpress.org/trunk@39279 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-17 17:12:49 +00:00
Sergey Biryukov
eb26b2a6a7 Text Changes: Merge some duplicate strings with the same meaning in error messages, adjust some other strings for consistency and accuracy.
Props ramiy, SergeyBiryukov.
Fixes #38808.

git-svn-id: https://develop.svn.wordpress.org/trunk@39278 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-17 15:52:18 +00:00
Andrea Fercia
b2983232c3 Small coding standards cleanup of wp-custom-header.js.
Small coding standards cleanup of wp-custom-header.js after [39272].


git-svn-id: https://develop.svn.wordpress.org/trunk@39277 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-17 09:03:39 +00:00
Weston Ruter
a3b66814a7 Customize: Add unit tests for importing theme starter content.
Props welcher, westonruter.
See #38114, #38533, #38615.
Fixes #38540.


git-svn-id: https://develop.svn.wordpress.org/trunk@39276 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-17 08:17:57 +00:00
Gary Pendergast
365241878f Database: Add support for LIKE-escaped tables in ::get_table_from_query().
The `SHOW TABLES LIKE` query can be used to search for tables that match a pattern, `wp\_123\_%`, for example. While this isn't the name of an actual table, the `wp_123_` prefix can be used by database drop-ins to direct the query correctly. This change removes the escaping and `%` modifier, to provide this usable prefix.

Props andy, pento.
Fixes #38751.



git-svn-id: https://develop.svn.wordpress.org/trunk@39275 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-17 04:20:22 +00:00
Boone Gorges
206a330d72 Comments: Query used to fill comment descendants should reset 'offset' and 'number' params.
Descendant queries should not inherit the 'offset' and 'number'
parameters of the parent query, or descendants will be missed.

Previously: [38497].

See #37696.

git-svn-id: https://develop.svn.wordpress.org/trunk@39274 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-17 03:02:40 +00:00
Joe McGill
1e05bf877e Twenty Seventeen: Add styles for custom header video controls.
Following [39272], this uses the `header_video_settings` filter to modify
the default video header control markup and adds theme specific styles
for the play/pause button.

Props melchoyce, laurelfulford, joemcgill, davidakennedy, bradyvercher.
Fixes #38697.

git-svn-id: https://develop.svn.wordpress.org/trunk@39273 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-16 23:37:42 +00:00
Joe McGill
b5563ef917 Themes: Improve a11y and extendability of custom video headers.
This adds play/pause controls to video headers, along with voice
assistance, using `wp.a11y.speak`, to make custom video headers more
accessible. To make styling the play/pause button easier for themes,
CSS has been omitted from the default implementation.

This also includes a refactor of the `wp.customHeader` code to introduce
a `BaseHandler` class, which can be extended by plugins and themes to modify
or enhance the default video handlers.

Props davidakennedy, afercia, bradyvercher, joemcgill, adamsilverstein, rianrietveld.
Fixes #38678.

git-svn-id: https://develop.svn.wordpress.org/trunk@39272 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-16 23:25:28 +00:00
Weston Ruter
ac9a74eff5 Customize: Ensure Close button actually closes customizer (instead of going back) after switching to a different theme inside a customize-loader iframe.
Fixes #38833.


git-svn-id: https://develop.svn.wordpress.org/trunk@39271 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-16 22:16:10 +00:00
Weston Ruter
0dbb9c4248 Customize: Prevent edit shortcut buttons from being inserted into container elements in the head or into elements which should not get interactive children.
See #27403, #38672.
Fixes #38830.


git-svn-id: https://develop.svn.wordpress.org/trunk@39270 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-16 20:36:40 +00:00
Dominik Schilling (ocean90)
a9a8a9b121 Users: In edit_user() fall back to site's locale instead of en_US for invalid user locales.
See #38632, #29783.
Fixes #38798.

git-svn-id: https://develop.svn.wordpress.org/trunk@39269 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-16 20:11:12 +00:00
Weston Ruter
be9b516d42 Customize: Allow URL for Codex link in Additional CSS section to be translated.
Props odysseygate, ocean90, westonruter.
See #35395.
Fixes #38823.


git-svn-id: https://develop.svn.wordpress.org/trunk@39268 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-16 18:41:13 +00:00
Sergey Biryukov
b91eca1291 REST API: After [39252] and [39264], uppercase some more 'ID' references in translatable strings.
See #38791.

git-svn-id: https://develop.svn.wordpress.org/trunk@39266 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-16 13:27:10 +00:00
Sergey Biryukov
9421418577 REST API: Uppercase 'ID' in endpoint descriptions and error messages for consistency with other strings.
See #38791.

git-svn-id: https://develop.svn.wordpress.org/trunk@39264 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-16 12:17:31 +00:00
Helen Hou-Sandi
93583764b5 Post-4.7 beta 4 bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@39263 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-16 01:53:12 +00:00
Helen Hou-Sandi
d8fbae7fc3 WordPress 4.7 Beta 4.
git-svn-id: https://develop.svn.wordpress.org/trunk@39262 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-16 01:34:31 +00:00
Helen Hou-Sandi
5d43d3a353 Theme starter content: Add reference IDs for most default widgets.
Some widgets that require more configuration are not included, such as RSS and Custom Menu. Tag Cloud is also not included because fresh sites do not have any tags to display.

Also adds a search widget to a Twenty Seventeen footer widget area.

see #38615.


git-svn-id: https://develop.svn.wordpress.org/trunk@39261 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-16 00:39:47 +00:00
Helen Hou-Sandi
e29ff6f4ca Theme starter content: Refine the content for pages.
see #38615.


git-svn-id: https://develop.svn.wordpress.org/trunk@39260 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-16 00:28:27 +00:00
Sergey Biryukov
830f60ffb8 REST API: Unify some more permission error messages.
Props ramiy.
Fixes #38803.

git-svn-id: https://develop.svn.wordpress.org/trunk@39259 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-15 23:35:50 +00:00
Sergey Biryukov
6e997f7cf9 Text Changes: Unify permission error messages in wp-admin/users.php.
Props ramiy.
Fixes #38804.

git-svn-id: https://develop.svn.wordpress.org/trunk@39258 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-15 22:24:30 +00:00
Sergey Biryukov
922878c13f REST API: Unify permission error messages.
Props ramiy.
Fixes #38803.

git-svn-id: https://develop.svn.wordpress.org/trunk@39257 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-15 22:22:33 +00:00
Helen Hou-Sandi
2c3006d7a1 Theme starter content: Add more social link items to select from.
New: Foursquare, GitHub, LinkedIn, Pinterest, and YouTube. They are also now all alphabetized.

see #38615.


git-svn-id: https://develop.svn.wordpress.org/trunk@39256 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-15 21:19:40 +00:00
Helen Hou-Sandi
345341f8d9 Theme starter content: Revamp the credits widget into an about widget.
The credits widget from the original commit was a nice test to see the date changing, but isn't really very inspirational. Also, implement it in Twenty Seventeen.

see #38615.


git-svn-id: https://develop.svn.wordpress.org/trunk@39255 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-15 21:07:36 +00:00
Sergey Biryukov
b059e8df3e I18N: Remove <code> tags from translatable strings in wp-includes/class-wp-customize-manager.php.
Props ramiy.
Fixes #38802.

git-svn-id: https://develop.svn.wordpress.org/trunk@39254 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-15 20:53:18 +00:00
Sergey Biryukov
a0be8c4393 Text Changes: Unify permission error message in wp-ajax-response.js.
See #34521.

git-svn-id: https://develop.svn.wordpress.org/trunk@39253 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-15 20:41:40 +00:00
Sergey Biryukov
72b100ed7e REST API: Remove two duplicate strings, use the ones we already have.
See #38791.

git-svn-id: https://develop.svn.wordpress.org/trunk@39252 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-15 20:39:13 +00:00
Sergey Biryukov
4230b2a17c REST API: Unify permission error messages.
Props ramiy.
See #38791, #34521.

git-svn-id: https://develop.svn.wordpress.org/trunk@39251 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-15 20:36:27 +00:00
Joe Hoyle
d76017c51e REST API: Clean up argument and property types.
There's a couple of places where we were missing type notes for arguments, which mainly affects documentation.

Props jnylen0.
Fixes #38792.


git-svn-id: https://develop.svn.wordpress.org/trunk@39250 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-15 18:15:30 +00:00
Helen Hou-Sandi
d37312f3bf Customize: More visible focus and hover states for close and back buttons.
props celloexpressions, folletto.
fixes #29158.


git-svn-id: https://develop.svn.wordpress.org/trunk@39249 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-15 18:10:16 +00:00
Joe McGill
e9c20890da Twenty Seventeen: Compress the default header image.
This replaces the default `header.jpg` with a compressed version.
The original was 209KB and the new version is 143KB with almost no
distinguishable visual loss.

Props Presskopp.
Fixes #38793.

git-svn-id: https://develop.svn.wordpress.org/trunk@39248 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-15 18:00:22 +00:00
Andrea Fercia
a3e9876c39 Accessibility: Improve the Post Attributes meta box fields labels.
With [38951] the support for custom page templates has been extended to all post
types. By making the visible meta box titles real labels, accessibility improves
for all users and form fields have meaningful labels.

Fixes #38790.


git-svn-id: https://develop.svn.wordpress.org/trunk@39247 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-15 16:00:41 +00:00
Joe McGill
f922c64efa Media: Make PDF preview sizes filterable.
This adds a new filter, `fallback_intermediate_image_sizes`, which
can be used to modify the array of image sizes created for previewing
PDFs in the media library and checks for the existence of sizes before
processing any image representations of a PDF.

Fixes #38594.

git-svn-id: https://develop.svn.wordpress.org/trunk@39246 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-15 13:25:46 +00:00
Sergey Biryukov
9ae30a3725 REST API: After [39238] and [39239], move the remaining translator comments to preceding line.
See #38791.

git-svn-id: https://develop.svn.wordpress.org/trunk@39245 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-15 13:06:11 +00:00
Dominik Schilling (ocean90)
6e19fe7f5c Docs: Apply documentation standards to the new get_available_languages filter.
See #38788.

git-svn-id: https://develop.svn.wordpress.org/trunk@39244 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-15 09:51:17 +00:00
Weston Ruter
8bb2e8e9f7 Customize: Ensure edit shortcuts have same background color regardless of theme colors.
Fixes #38776.


git-svn-id: https://develop.svn.wordpress.org/trunk@39243 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-15 09:13:21 +00:00
Weston Ruter
b7efb95bc9 Customize: Add !important line-height to edit shortcut buttons.
Ensure that icon inside edit shortcut is centered when theme defines default `line-height` for `button` elements.

Fixes #38787.


git-svn-id: https://develop.svn.wordpress.org/trunk@39242 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-15 09:07:49 +00:00
Weston Ruter
29629ecc52 Customize: Allow starter content to apply in a new theme when switching from another theme containing changes.
* Ensure that starter content can apply from theme B after previewing starter content in theme A.
* Introduce new `starter_content` flag in changeset setting params which is used to capture whether a value is starter content and thus can be overridden.
* Create changeset up-front with `starter_content` flags instead of waiting for `AUTOSAVE_INTERVAL`.
* Eliminate instantiation of settings for widget instances in favor of directly calling `sanitize_widget_js_instance`. This eliminates issues with looking for widgets before they are registered.
* Ensure that non-placeholders (inline arrays instead of string references) can be supplied in starter content.
* Re-use auto-draft posts as starter content across theme switches.
* Introduce `starter_content` param for `WP_Customize_Manager::save_changeset_post()` which is `false` except when starter content is being loaded on a `fresh_site`.

See #38114.
Fixes #38541.


git-svn-id: https://develop.svn.wordpress.org/trunk@39241 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-15 09:02:38 +00:00
Peter Wilson
55fd899391 Themes: Remove front page restriction from video header functions.
Adds a callback for determining when video headers should be displayed in themes supporting custom headers. By default, video headers are only displayed on the front page of a site.

Theme authors may set a custom callback by passing `'video-active-callback' => 'mytheme_video_active_callback'` as an argument. The default callback is `is_front_page()`.

This introduces the new function `is_header_video_active()` - returns `true` on pages that should display video headers. The return value can be filtered using the new filter of the same name.

Props flixos90, bradyvercher, peterwilsoncc, joemcgill.
Fixes #38738.


git-svn-id: https://develop.svn.wordpress.org/trunk@39240 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-15 07:15:20 +00:00
Ryan McCue
2d0cd4493c REST API: Move translator comments to preceding line.
Inline translator comments break POT file generation.

Props dd32.
See #38791.


git-svn-id: https://develop.svn.wordpress.org/trunk@39239 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-15 05:38:21 +00:00
Ryan McCue
6fee13fda7 REST API: Add translator comments to text with placeholders.
Props dimadin.
Fixes #38791.


git-svn-id: https://develop.svn.wordpress.org/trunk@39238 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-15 04:27:49 +00:00
Weston Ruter
c03e8cd51c Customize: Only show video header controls if previewing front page; show explanatory notice when controls are hidden.
Also include todo for the `header_video` control's `button_labels`. See #38796.

Props westonruter, joemcgill, celloexpressions.
Fixes #38778.


git-svn-id: https://develop.svn.wordpress.org/trunk@39237 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-15 03:46:14 +00:00
Peter Wilson
f62112fa16 Posts, Post Types: Improve sanitisation of templates' post types.
Prevents post type templates ignoring post types due to invalid characters. Each entry in the `Template Post Type` comment is run through `sanitize_key()` to match the sanitisation used by `register_post_type()`.

Fixes #38766.


git-svn-id: https://develop.svn.wordpress.org/trunk@39236 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-15 03:36:13 +00:00
Gary Pendergast
80bd60fb88 I18N: Add the get_available_languages filter.
Sometimes, a language file may not exist in exactly the format or location that `get_available_languages()` expects it to be in - for sites with this level of customisation, they need to be able to add their own language files to the list of those available.

Props yoavf.
Fixes #38788.



git-svn-id: https://develop.svn.wordpress.org/trunk@39235 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-15 01:18:37 +00:00
Weston Ruter
32325e8e1d Customize: Use video-specific labels for buttons in Header Video media control.
See #38172.


git-svn-id: https://develop.svn.wordpress.org/trunk@39234 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-15 00:21:33 +00:00
Weston Ruter
ad0dae996e Customize: Adjust layout for edit shortcuts only when shown.
Add theme-specific positioning of edit shortcuts in Twenty Fourteen and Twenty Seventeen.

Props sirbrillig, sstoqnov, westonruter.
Fixes #38651.


git-svn-id: https://develop.svn.wordpress.org/trunk@39233 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-15 00:14:24 +00:00
Tammie Lister
c8b86fdd52 Twenty Seventeen: Fix for mobile menu parent items requiring double tap
After further review from the accessibility team, it was determined that the menu items with sub-menus don't need the aria-haspopup attribute.

Props davidakennedy, celloexpressions, voldemortensen, afercia
See #38397



git-svn-id: https://develop.svn.wordpress.org/trunk@39232 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-14 22:33:40 +00:00
Helen Hou-Sandi
7ba0908947 Theme starter content: Add context to all strings.
fixes #38770.


git-svn-id: https://develop.svn.wordpress.org/trunk@39231 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-14 21:37:55 +00:00
Dominik Schilling (ocean90)
cf220df2b7 I18N: Don't use get_available_languages() in _load_textdomain_just_in_time().
`get_available_languages()` is only designed to work with translations for core. Using it for plugins/themes means unnecessary `strpos()` checks and incomplete results for plugins/themes whose names are beginning with `admin-` or `ms-`.

Props swissspidy, ocean90.
Fixes #38590.

git-svn-id: https://develop.svn.wordpress.org/trunk@39230 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-14 21:06:22 +00:00
Weston Ruter
58d01ff805 Customize: Maximize height of Custom CSS textarea without causing doubled scrollbars.
Textarea will fill vertical height of Custom CSS section for browsers that support `calc()` and when plugins don't add other controls to the section. Also run CSS autoprefixer.

Props michaelarestad, westonruter.
See #35395.
Fixes #38755.


git-svn-id: https://develop.svn.wordpress.org/trunk@39229 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-14 19:11:35 +00:00
Weston Ruter
292011aecc Customize: Improve styles for hover, focus, and active states on edit shortcuts.
Props michaelarestad.
Fixes #38758.


git-svn-id: https://develop.svn.wordpress.org/trunk@39228 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-14 18:48:59 +00:00
Weston Ruter
64e9d9f4eb Customize: Use selective refresh for custom header changes when possible.
* Use `postMessage` transport for header image settings by default when video headers are supported, and thus `the_custom_header_markup()` will necessarily be used (and thus a selective refresh partial will be available).
* Ensure that `the_custom_header_markup()` always outputs a container element in the customizer preview even if the header is empty.
* Ensure that edit shortcut appearing for custom header does not get positioned off-screen.

Props bradyvercher, westonruter.
See #38639.
Fixes #38737.


git-svn-id: https://develop.svn.wordpress.org/trunk@39227 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-14 18:40:08 +00:00
Tammie Lister
28befc73cd Twenty Fourteen: Removes video header support
Support was added to test implementation but never completed. This removes the test implementation.

Props davidakennedy
Fixes #38783


git-svn-id: https://develop.svn.wordpress.org/trunk@39226 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-14 17:16:04 +00:00
Tammie Lister
bffa48a6ee Twenty Seventeen: Resolves focused controls hidden by the top menu.
When a page is scrolled, the top nav menu become fixed. Depending on the page content this caused issue where focused links or buttons may be hidden behind the  nav menu.

Props afercia, davidakennedy, Fencer04
Fixes #38476



git-svn-id: https://develop.svn.wordpress.org/trunk@39225 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-14 17:00:57 +00:00
Tammie Lister
6d7ed1e861 Twenty Seventeen: Fixes custom header text color issues
Removes default header text color and updates and updates selectors.

Props laurelfulford, davidakennedy, Idealien
Fixes #38391



git-svn-id: https://develop.svn.wordpress.org/trunk@39224 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-14 16:48:32 +00:00
Joe Hoyle
850dd1be76 REST API: Make all collection params filterable.
For developers wanting to add their own registered collection parameters, they can now use the `rest_$type_collection_params` filter. This brings consistency with the already existing `rest_$post_type_collection_params`.

Fixes #38710.
Props jnylen0.


git-svn-id: https://develop.svn.wordpress.org/trunk@39223 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-14 16:41:40 +00:00
Joe Hoyle
58169b04fa REST API: Validate and Sanitize registered meta based off the schema.
With the addition of Array support in our schema validation functions, it's now possible to use these in the meta validation and sanitization steps. Also, this increases the test coverage of using registered via meta the API significantly.

Fixes #38531.
Props rachelbaker, tharsheblows.


git-svn-id: https://develop.svn.wordpress.org/trunk@39222 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-14 16:35:35 +00:00
David A. Kennedy
76e44c9166 Twenty Seventeen: Make sure theme JavaScript follows proper coding standards
Props sstoqnov, afercia.

Fixes #38752.


git-svn-id: https://develop.svn.wordpress.org/trunk@39221 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-14 11:40:55 +00:00
David A. Kennedy
5b41a1c33e Twenty Seventeen: Make custom header preview match front end in Customizer when changed
* Toggles `has-header-image` body class  in Customizer preview whenever images or videos are added or removed.
* Hides the `.custom-header-image`div in CSS when an image or video haven't been set so preview changes are smoother.
* Also fixes the main issues in #38391 – making the preview match.

Props bradyvercher.

Fixes #38627.
See #38391.


git-svn-id: https://develop.svn.wordpress.org/trunk@39220 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-14 11:22:25 +00:00
Ryan McCue
ecb1e33d0d REST API: Improve validation for usernames and passwords.
Also improves the slashing of user data in the REST API to avoid data loss.

Props jnylen0.
Fixes #38739.


git-svn-id: https://develop.svn.wordpress.org/trunk@39219 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-14 07:12:31 +00:00
Weston Ruter
47a04c044d Customize: Remove root panel description text which notes that edit shortcuts can be toggled by clicking anywhere in the preview.
Amends [39131], in which this method of toggling edit shortcuts was removed.
Props presskopp.
See #27403.


git-svn-id: https://develop.svn.wordpress.org/trunk@39218 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-14 04:32:47 +00:00
Andrew Ozz
61de8de75a TinyMCE: fix black outline around _moz_abspos. This is added in Firefox in paragraphs inserted after a non-editable block.
See #38757.

git-svn-id: https://develop.svn.wordpress.org/trunk@39217 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-14 02:33:05 +00:00
David A. Kennedy
2835aa5f99 Twenty Seventeen: Adds numbers to the table of contents in style.css
Props karmatosed.

Fixes #38767.


git-svn-id: https://develop.svn.wordpress.org/trunk@39216 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-13 23:44:39 +00:00
David A. Kennedy
40b3a5a878 Twenty Seventeen: Fix Customizer preview display issues in IE9
IE9 doesn't understands `vh ` (vertical height) when inside of an `iframe`. Normally IE9 will understand `vh` as the vertical height relative to the viewport, but in an `iframe`, IE9 thinks the vertical height is relative to the size of the whole page. So this fixes that when the site is viewed in the Customizer preview – an `iframe`.

Props laurelfulford.

Fixes #38722.


git-svn-id: https://develop.svn.wordpress.org/trunk@39215 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-13 23:30:53 +00:00
Weston Ruter
2158edc28f Customize: Prevent the "Hide Controls" button label from overrunning the device preview buttons.
Adds translation context for "Hide Controls" strings so translators can supply shorter strings where space is constrained. Adds styles to fade-out long the "Hide Controls" label where it would run into the device preview buttons.

Props westonruter, ocean90.
Fixes #38762.


git-svn-id: https://develop.svn.wordpress.org/trunk@39214 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-13 18:59:21 +00:00
Helen Hou-Sandi
0c044ba8d9 Media: Clearly indicate that PDF thumbnails are just document previews.
This helps affirm that your upload is fine, and has not been reduced down to the first page or changed into an image. This applies to the attachment details modal in the media library, where media is also now centered in the preview area.

props folletto, helen.
fixes #38717.


git-svn-id: https://develop.svn.wordpress.org/trunk@39213 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-13 16:38:06 +00:00
Dion Hulse
6ade77e936 WP_HTTP: Map internal Requests hooks to WordPress actions.
This change introduces a `requests-{$hook}` action which can be used to hook into Requests hooks, and restores the `http_api_curl` action.

Props rmccue.
Fixes #37843.


git-svn-id: https://develop.svn.wordpress.org/trunk@39212 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-13 10:35:15 +00:00
Dion Hulse
4404f32cb5 Updates: Allow background updates to update multiple plugins/themes in the same request.
Due to the `clear_update_cache` parameter not being respected, update caches were being cleared incorrectly which prevented multiple plugins to be updated at the same time in background updates - failing with a `fs_unavailable` error message.

Fixes #38024


git-svn-id: https://develop.svn.wordpress.org/trunk@39211 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-13 09:52:49 +00:00
Dion Hulse
7e9960edad Posts, Post Types: Fix Quick Edit to correctly set the page template for non-hierarchical post types.
Props dd32, swissspidy.
Fixes #38655.


git-svn-id: https://develop.svn.wordpress.org/trunk@39210 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-13 07:41:30 +00:00
Weston Ruter
c68c1c8ec7 Customize: Improve extensibility of Custom CSS.
* Add `customize_value_custom_css` filter to `WP_Customize_Custom_CSS::value()` method.
* Introduce `customize_update_custom_css_post_content_args` filter in `WP_Customize_Custom_CSS::update()` method.
* Make clear that `wp_get_custom_css()` and `wp_get_custom_css` filter are specifically for obtaining the value to render/display. Eliminate use of `wp_get_custom_css()` when getting the setting value. Use the underlying `post_value` directly when `is_previewed`.
* Move anonymous functions handing JS previewing for `custom_logo`, `custom_css`, and `background` into named functions on the `wp.customize.settingPreviewHandlers` to allow plugins to override/extend preview logic.
* Update `_custom_background_cb` to always print a `style` tag wen in the customizer preview, and update background preview logic to replace existing style element instead of appending a new style to the head so that background changes don't unexpectedly override any Custom CSS in the preview's stylesheet cascade.

Props westonruter, georgestephanis.
See #22058.
Fixes #38672.


git-svn-id: https://develop.svn.wordpress.org/trunk@39209 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-13 02:42:04 +00:00
David A. Kennedy
97ae697d6a Twenty Seventeen: Fix typos in font family translator comment
Props dimadin.

Fixes #38740.


git-svn-id: https://develop.svn.wordpress.org/trunk@39208 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-13 01:29:29 +00:00
David A. Kennedy
09a0941999 Twenty Seventeen: Update screen-reader-text to reset word-wrap
This resets the property to normal where needed and, to be safe, uses `!important`. It avoids screen readers reading out words ignoring spaces between words in some cases.

Props afercia.

Fixes #38764.


git-svn-id: https://develop.svn.wordpress.org/trunk@39207 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-13 00:25:49 +00:00
Tammie Lister
5cab939b1e Twenty Seventeen: Keyboard navigation on Safari 10 fix
This resolves the weird behaviour on Safari 10 has some weird behaviour.

Props rianrietveld, swisspidy, afercia, sami.keijonen, arush, davidakennedy
Fixes #38387



git-svn-id: https://develop.svn.wordpress.org/trunk@39206 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-12 23:38:43 +00:00
Joe McGill
ef9eb5f26e Customize: Rename "Header Visuals" to "Header Media".
"Header Visuals" is a bit vague since the title/tagline are arguably
also “header visuals”. "Header Media" is more descriptive and is
consistent with how we refer to images/videos throughout core.

Props bradyvercher.
Fixes #38756.

git-svn-id: https://develop.svn.wordpress.org/trunk@39205 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-11 23:23:06 +00:00
Andrew Ozz
9f67a915d9 TinyMCE: fix freezing the editor when wpautop is disabled and a paragraph starts with a lot of white space characters.
Fixes #38294.

git-svn-id: https://develop.svn.wordpress.org/trunk@39204 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-11 23:06:03 +00:00
Dominik Schilling (ocean90)
74e3e309c3 Multisite: Rename the $user parameter to $user_login in wpmu_signup_blog_notification() and wpmu_signup_user_notification().
[38961] added a `$user = get_user_by( 'login', $user );` call which was overriding the `$user` string variable for the login name. The change to `$user_login` makes this clear.

Props johnjamesjacoby.
Fixes #38763.

git-svn-id: https://develop.svn.wordpress.org/trunk@39203 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-11 22:19:14 +00:00
Weston Ruter
5f9c6ef4ae Customize: Remove left-margin guard from edit shortcuts and adjust for small screen sizes.
Removes the `.customize-partial-edit-shortcut-left-margin` class which was not effective on some themes, created a worse experience for other themes, and which did not recalculate when the preview was reflowed or resized. Now some small-width media queries are added to handle common cases while more dramatic issues can be handled by the theme. Also renames `Partial.positionEditShortcut()`to `Partial.addEditShortcutToPlacement()` which is a more accurate description of its function.

Props sirbrillig, sstoqnov.
See #38651, #27403.


git-svn-id: https://develop.svn.wordpress.org/trunk@39202 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-11 09:46:47 +00:00
Helen Hou-Sandi
9d73e7a311 Post-4.7 beta 3 bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@39201 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-11 03:31:59 +00:00