Commit Graph

35822 Commits

Author SHA1 Message Date
Weston Ruter
d616ad29a5 Customize: Remove edit shortcut toggle button from preview since visibility is now linked with pane visibility.
Amends [39131].
Props westonruter, sirbrillig.
See #27403.
Fixes #38668.


git-svn-id: https://develop.svn.wordpress.org/trunk@39144 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-04 20:53:56 +00:00
Helen Hou-Sandi
7435ecdce0 Post-4.7 beta 2 bump.
git-svn-id: https://develop.svn.wordpress.org/trunk@39143 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-04 17:40:12 +00:00
Helen Hou-Sandi
7ece646407 WordPress 4.7 Beta 2.
git-svn-id: https://develop.svn.wordpress.org/trunk@39142 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-04 16:08:49 +00:00
Aaron Jorbin
9768ec2b97 Administration: Ensure collapse menu is usable with a keyboard
Currently, the "Collapse menu" item is not focusable and keyboard users can't collapse/expand the admin menu. This aims to fix it so that screen readers no longer announce it as a clickable but it remains unfocusable and thus unusable. So it's now a button.

Quoting joedolson at WordCamp Chicago 2014:
"If it's supposed to act like a button, it should be a button."

Also includes a grunt:precommit run that picked up some postcss changes to src/wp-includes/css/customize-preview.css

Fixes #29958.
Props ajercia, ipm-frommen for an iterative patch, valendesigns for an iterative patch, GaryJ for feedback, joedolson for feedback, helen for feedback




git-svn-id: https://develop.svn.wordpress.org/trunk@39141 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-04 16:01:24 +00:00
Helen Hou-Sandi
f7e5811287 Customize: Revert theme install feature.
This is a great goal for core, and is close, but it is not in shape to be shipped for 4.7 and there is not enough time left in the development cycle to alter and polish sufficiently. There are bugs, but more than that, there are more fundamental questions around the use of existing UI, general UX, and how findable themes are (not) on the .org side.

see #37661.


git-svn-id: https://develop.svn.wordpress.org/trunk@39140 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-04 15:53:01 +00:00
John Blackbourn
f8a5c7b8d4 Editor: Correct the docblock for the wp_default_editor filter.
Props dimadin
See #38327


git-svn-id: https://develop.svn.wordpress.org/trunk@39139 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-04 12:14:05 +00:00
Weston Ruter
ef33fd1841 Customize: Ensure page/post stubs are included in listings and searches for available nav menu items.
Include the customized state in the Ajax requests to load items and search items.

See #38573.
Fixes #38122.


git-svn-id: https://develop.svn.wordpress.org/trunk@39138 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-04 07:23:49 +00:00
Weston Ruter
d6c217886a Customize: Combine Ajax requests for initial load of available nav menu items into a single request.
When there are many post types registered, prevent Ajax requests from piling up and slamming WordPress with concurrent requests.

Props curdin, westonruter.
Fixes #36697.


git-svn-id: https://develop.svn.wordpress.org/trunk@39137 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-04 06:03:51 +00:00
Weston Ruter
71f8622cdc Customize: Use button with svg as click target instead of :before content, improving clickability of edit shortcuts in Firefox.
Props sirbrillig, celloexpressions, delawski.
See #38532.


git-svn-id: https://develop.svn.wordpress.org/trunk@39136 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-04 01:47:56 +00:00
David A. Kennedy
a02ab35128 Twenty Seventeen: Make sure skip link works in all versions of Internet Explorer
This also reduces the number of browsers detected and patched with this fix. Most modern browsers have patched this common bug, where an anchor link does not move focus when clicked. Twenty Seventeen will only worry about older versions of Internet Explorer in this regard.

Props afercia, sami.keijonen.

See #38604.


git-svn-id: https://develop.svn.wordpress.org/trunk@39135 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 23:07:20 +00:00
Dominik Schilling (ocean90)
ece3b68aaf I18N: In get_user_locale() ensure that $user_id isn't a falsy value before calling get_user_by().
Fixes #38485.

git-svn-id: https://develop.svn.wordpress.org/trunk@39134 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 23:05:34 +00:00
Weston Ruter
ed37aaa664 Customize: No-op edit_post_link() when in customizer preview.
Edit links can be restored in plugins by removing the `__return_empty_string` function from the `get_edit_post_link` filter at the `customize_preview_init` action.

Fixes #38648.


git-svn-id: https://develop.svn.wordpress.org/trunk@39133 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 22:43:43 +00:00
Weston Ruter
58f7c47cfc Customize: For toggling visibility of the controls pane, rename "Collapse (Sidebar)" to "Hide Controls" and "Expand Sidebar" to "Expand Controls".
Fixes #38647.


git-svn-id: https://develop.svn.wordpress.org/trunk@39132 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 22:34:05 +00:00
Weston Ruter
a981b22e15 Customize: Let edit shortcuts be persistently visible when controls pane is expanded, hidden when collapsed, and always visible in mobile preview. Remove initial flash of edit shortcuts.
Props westonruter, sirbrillig.
Fixes #27403.


git-svn-id: https://develop.svn.wordpress.org/trunk@39131 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 22:22:43 +00:00
Dominik Schilling (ocean90)
fb9b3819de Load: Remove unused global imports in wp_load_translations_early().
See #38535.

git-svn-id: https://develop.svn.wordpress.org/trunk@39130 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 22:02:00 +00:00
David A. Kennedy
119c36b0bd Twenty Seventeen: Correct issues with hidden overflow and height on site header
In -r39124, some additional issues were introduced:

* The 'overflow: hidden' on the `.site-header;` was added to prevent a side-scrolling issue, but it ended up cutting off the menu. It looks like the cause of the side-scroll was related to how the scroll down icon was rotated, so it's addressed by rotating the icon and not the `<a>`.
* Also, `min-height` doesn't play well with `display: table;` in Firefox. So it's addressed with just `height`.

Props laurelfulford, sami.keijonen.

See #38543.


git-svn-id: https://develop.svn.wordpress.org/trunk@39129 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 22:01:46 +00:00
Joe McGill
bd52f81e87 Customize: Remove Vimeo reference from description for external header videos.
Vimeo's API requires a Pro account to display videos as background videos
(i.e., without player controls), thus we shouldn't support Vimeo
URLs by default in custom header videos. This removes the reference of Vimeo
from the control description in the customizer.

Fixes #38544.

git-svn-id: https://develop.svn.wordpress.org/trunk@39128 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 21:33:47 +00:00
Pascal Birchler
8a08cfc840 I18N: Use the user's locale when loading text domains in the admin.
Leverages `get_user_locale()` in `load_*_textdomain()` and `_load_textdomain_just_in_time()` to always load translations in the user's language when in the admin.

This re-introduces [39069], but now with additional tests and a `function_exists( 'wp_get_current_user' )` check in `get_user_locale()` in case it gets used early.

Props swissspidy, ocean90.
Fixes #38485.

git-svn-id: https://develop.svn.wordpress.org/trunk@39127 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 20:07:08 +00:00
Rachel Baker
4757546045 REST API: Modify the structure of our DELETE responses to be more explicit.
Add the `deleted` property to the root of the Response object to communicate if the delete action was successful. Move the state of the resource prior to the delete request under a new `previous` property.  As a result DELETE responses are now structured like so:
 `{ deleted: true, previous: { ... } }`

Also includes helpful information to DELETE requests for resources that are not trashable.

Props timmydcrawford, rmccue, jnylen0.
Fixes #38494.

git-svn-id: https://develop.svn.wordpress.org/trunk@39126 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 20:04:59 +00:00
Pascal Birchler
b7cfad8697 I18N: Move load_textdomain() tests to separate file.
See #38485.

git-svn-id: https://develop.svn.wordpress.org/trunk@39125 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 19:56:53 +00:00
David A. Kennedy
9dd2063876 Twenty Seventeen: Fix site name and description appearing off screen in some browsers
* Occurred in Firefox and IE 11.
* Removes Flexbox in favor of more well-supported `display: table; ` layout technique.
* Maintains consistent layout on smaller screens.

Props laurelfulford.

Fixes #38543.


git-svn-id: https://develop.svn.wordpress.org/trunk@39124 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 19:43:15 +00:00
Joe McGill
4bdbfc4526 Themes: Improve support for placeholders in default headers.
When themes register default headers, they can use sprintf style placeholder
strings in place of the template directory URI, which WordPress transforms
in several places by running the value of
`get_theme_support( 'custom-header', 'default-image' )` through `sprintf()`.

This fixes a few places where WordPress skipped the `sprintf()` step and
referenced the `get_theme_support()` value directly.

Props bradyvercher for initial patch.
See #38557.

git-svn-id: https://develop.svn.wordpress.org/trunk@39123 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 19:01:16 +00:00
Dominik Schilling (ocean90)
c1f7d89592 I18N: Show "Settings saved." in the correct language after switching the site language.
This simplifies the logic by comparing `get_user_locale()` before and after an settings update.

Props swissspidy, ocean90.
See #29783, #29281.
Fixes #38482.

git-svn-id: https://develop.svn.wordpress.org/trunk@39122 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 17:54:42 +00:00
Joe McGill
f64f956847 Themes: Improve reliability of URL used in get_header_image_tag().
`get_header_image_tag()` relies on the data returned by `get_custom_header()`
to build the attributes for the header `<img>` element. However,
`get_custom_header()` relies on data from the `header_image_data` theme
mod rather than the `header_image` theme mod that `get_header_image()` uses.
This can create inconsistencies when no header image is set, but a theme
supports a default header image.

This fixes the issue by making `get_custom_image_tag()` rely on the URL
returned by `get_header_image()` instead.

Props bradyvercher.
Fixes #38633.

git-svn-id: https://develop.svn.wordpress.org/trunk@39121 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 12:36:01 +00:00
Weston Ruter
144f0cb317 Customize: Prevent collapsing expanded panel/section/control when Esc is pressed on another closable UI element.
Prevents collapsing constructs when hitting `Esc` on a TinyMCE toolbar, lightbox, or expanded color picker.

See #22237.
Fixes #38091.


git-svn-id: https://develop.svn.wordpress.org/trunk@39120 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 06:18:35 +00:00
Aaron Jorbin
40197b63d9 Revert [39118] due to incompatibility with node v0.10.x
Props nacin

See #38199.



git-svn-id: https://develop.svn.wordpress.org/trunk@39119 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 06:08:34 +00:00
Aaron Jorbin
c03bc60a70 Bump grunt-includes from 0.5.4 to 1.0.0
Diff
0790695413

See #38199.


git-svn-id: https://develop.svn.wordpress.org/trunk@39118 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 05:44:18 +00:00
Aaron Jorbin
2c0e24babf Bump grunt-contrib-uglify from 1.0.1 to 2.0.0
Sets `screwIE8` to false as it is now enabled by default

Files Changed:
build/wp-admin/js/customize-nav-menus.min.js
build/wp-admin/js/customize-widgets.min.js
build/wp-includes/js/customize-loader.min.js

Changelog:
2016-07-19   v2.0.0   Update uglify-js to v2.7.0. screwIE8 is enabled by default.
2016-07-19   v1.0.2   Update grunt to ^1.0.0. Fix beautify when passed as an object. Fix docs about report values.

See #38199.



git-svn-id: https://develop.svn.wordpress.org/trunk@39117 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 05:39:10 +00:00
Aaron Jorbin
fff00cbc94 Bump grunt-contrib-cssmin from v1.0.0 to v1.0.2
Changelog:
2016-08-31   v1.0.2   Fix issues for node 6.
2016-03-16   v1.0.1   Downgrade maxmin to support Node.js 0.10.

See #38199.


git-svn-id: https://develop.svn.wordpress.org/trunk@39116 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 05:31:56 +00:00
Aaron Jorbin
2de138fbb6 Bump grunt-contrib-compress from 1.1.0 to 1.3.0
Changelog:
2016-05-24   v1.3.0   Update to Archiver 1.0. Fix node 6 support.
2016-03-24   v1.2.0   Dependency update.

See #38199


git-svn-id: https://develop.svn.wordpress.org/trunk@39115 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 05:27:41 +00:00
Aaron Jorbin
05b092902a Bump autoprefixer from 6.5.0 to 6.5.1
Changelog
Fix selectors with :-- prefix support.

See #38199.

M    package.json


git-svn-id: https://develop.svn.wordpress.org/trunk@39114 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 05:17:07 +00:00
Aaron Jorbin
822762b101 Bump grunt-contrib-qunit from 1.1.0 to 1.2.0
Changlog:
2016-04-14   v1.2.0   Add support for filtering running modules using command line (--modules) Removed 'grunt.warn' output from error.onError handler, onus now on end user binding to event. Update docs.

See #38199.


git-svn-id: https://develop.svn.wordpress.org/trunk@39113 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 05:13:35 +00:00
Weston Ruter
5a03cb2426 Customize: Prevent syncing unmodified settings from controls into preview to guard against triggering an infinite reload due to selective refresh fallback behavior.
If a value is sanitized in PHP and differs from the JS value in the pane, a `change` event for the setting is triggered upon refresh. This should be avoided since the value just came from the server as being sanitized. This also fixes periodic issue where selective refresh happens immediately after a full refresh.

Fixes #37032.


git-svn-id: https://develop.svn.wordpress.org/trunk@39112 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 05:06:17 +00:00
Ryan McCue
a94ba30624 REST API: Only provide JSON error code on PHP 5.3+.
json_last_error() was only added to PHP 5.3.0, so we can't provide the information for older versions.

See #38547.


git-svn-id: https://develop.svn.wordpress.org/trunk@39111 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 04:57:00 +00:00
Aaron Jorbin
3146b1e971 Bump grunt-sass from 1.1.0 to 1.2.1
diff: https://github.com/sindresorhus/grunt-sass/compare/v1.1.0...v1.2.1

See #38199.


git-svn-id: https://develop.svn.wordpress.org/trunk@39110 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 04:54:46 +00:00
Joe Hoyle
f784a0481b REST API: Return error when JSON decoding fails.
If you send a request to the REST API with invalid JSON in body than it will now return a error. This assists developers if they accidentally send invalid JSON and wonder why their data appears to be ignored.

Props rmccue.
Fixes #38547.


git-svn-id: https://develop.svn.wordpress.org/trunk@39109 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 04:04:41 +00:00
Rachel Baker
973ade2a28 REST API: Return a WP_Error when a user does not have permission to create or update a post with the provided terms.
Add the 'assign_term' check for post create and update.

Props boonebgorges, johnbillion.
Fixes #38505.

git-svn-id: https://develop.svn.wordpress.org/trunk@39108 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 03:15:28 +00:00
Joe McGill
f2f3b3696b Media: Sanity check array value in wp_prepare_attachment_for_js().
This adds a sanity check to the return value of the `image_downsize` filter
in `wp_prepare_attachment_for_js()` to avoid undefined offest notices.

Props justinbusa for initial patch.
Fixes 34437.

git-svn-id: https://develop.svn.wordpress.org/trunk@39107 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 02:22:43 +00:00
Joe Hoyle
7f67e60817 REST API: Switch to stable version of JSON Schema.
Props danielbachhuber.
Fixes #38635.


git-svn-id: https://develop.svn.wordpress.org/trunk@39106 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 02:21:48 +00:00
Rachel Baker
baf52c815a REST API: Clean-up our validation callbacks and add missing array items properties in our endpoint schemas.
Props joehoyle, jnylen0.
Fixes #38617.

git-svn-id: https://develop.svn.wordpress.org/trunk@39105 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 02:17:39 +00:00
Joe Hoyle
25b892c1ca REST API: Support querying for multiple post statuses.
Multiple post statuses can be specified by the usual CSV or array-propper format.

Props jnylen0, kadamwhite, websupporter.
Fixes #38420.


git-svn-id: https://develop.svn.wordpress.org/trunk@39104 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 01:45:48 +00:00
Rachel Baker
a0876e06cd REST API: Use the items attribute for the taxonomies types schema property for proper sanitization/validation.
Props danielbachhuber, joehoyle.
Fixes #38631.

git-svn-id: https://develop.svn.wordpress.org/trunk@39103 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 01:25:48 +00:00
Joe McGill
22bb12dd61 Themes: Remove jQuery dependency from wp-custom-header.js.
In [38985], we used jQuery to trigger a custom event once a video
handler has completed so themes, like Twenty Fourteen, can execute
their own adjustments after the header video has loaded.

This replaces the jQuery `trigger()` method with a native event and
updates Twenty Fourteen accordingly.

Props adamsilverstein, joemcgill.
Fixes #38550.

git-svn-id: https://develop.svn.wordpress.org/trunk@39102 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 01:20:14 +00:00
Rachel Baker
c962a98980 REST API: Return an error when the length of a comment field is too long.
Introduces `wp_check_comment_data_max_lengths()` which allows both the REST API comments endpoints and `wp_handle_comment_submission()` to check the length of the comment content, author name, author url, and author email fields against their respective database columns.

Props rachelbaker, mangeshp, salcode, pento.
Fixes #38477.

git-svn-id: https://develop.svn.wordpress.org/trunk@39101 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-03 01:11:30 +00:00
Weston Ruter
73c595f3e4 Customize: Prevent PHP warning in applying widget starter content on fresh installs.
Fixes PHP warning triggered by calling `max()` on `$widget_numbers` when there are no widget instances of the type yet. Also makes sure that widget instances start at 2 instead of 1.

See #38114.


git-svn-id: https://develop.svn.wordpress.org/trunk@39100 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-02 23:59:28 +00:00
Pascal Birchler
21dc2530eb Plugins: Improve Ajax search of installed plugins.
Removes the highlight from the current filter when performing an Ajax search and adds it back when clearing the search input.

Fixes #37657.

git-svn-id: https://develop.svn.wordpress.org/trunk@39099 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-02 22:46:25 +00:00
Helen Hou-Sandi
9bb355dccd Menus: Use a label of "Display location" for individual nav menu settings.
While "Menu/Theme locations" was descriptive of what the choices listed were, in the context of editing an individual nav menu it is more descriptive to use a setting label that tells you what it is you are affecting for that nav menu, which is where it will be displayed. Technically multiple locations can be chosen, but in practice that appears to be rare enough that we can avoid an awkward "location(s)" type string.

props Fencer04 for the initial patch.
fixes #38525.


git-svn-id: https://develop.svn.wordpress.org/trunk@39098 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-02 22:10:30 +00:00
Joe Hoyle
082151025e REST API: Include taxonomies as an attribute of post types.
Add the taxonomies for a post type to the `/wp/v2/types` endpoint, so clients know which taxonomies are available for which post types.

Props danielbachhuber.
Fixes #38438, #38631.


git-svn-id: https://develop.svn.wordpress.org/trunk@39097 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-02 21:50:08 +00:00
Joe Hoyle
e78230b39a REST API: Add en_US to the locales enum.
Props ocean90.
Fixes #38528. 


git-svn-id: https://develop.svn.wordpress.org/trunk@39096 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-02 21:20:12 +00:00
Dominik Schilling (ocean90)
4dfb71c3b5 Query: Add tests for WP_Query::is_single() and get_body_class() with attachments.
See [39052]
See #38225.

git-svn-id: https://develop.svn.wordpress.org/trunk@39095 602fd350-edb4-49c9-b593-d223f7449a82
2016-11-02 19:22:17 +00:00