Commit Graph

9838 Commits

Author SHA1 Message Date
Aaron Jorbin 32be6f7bb7 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.


Built from https://develop.svn.wordpress.org/trunk@39117


git-svn-id: http://core.svn.wordpress.org/trunk@39059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-03 05:40:34 +00:00
Aaron Jorbin 21ddb65fcc 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.

Built from https://develop.svn.wordpress.org/trunk@39116


git-svn-id: http://core.svn.wordpress.org/trunk@39058 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-03 05:32:32 +00:00
Aaron Jorbin c8bf15c41c 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

Built from https://develop.svn.wordpress.org/trunk@39115


git-svn-id: http://core.svn.wordpress.org/trunk@39057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-03 05:28:32 +00:00
Aaron Jorbin 8ed617ad9f Bump autoprefixer from 6.5.0 to 6.5.1
Changelog
Fix selectors with :-- prefix support.

See #38199.

M    package.json

Built from https://develop.svn.wordpress.org/trunk@39114


git-svn-id: http://core.svn.wordpress.org/trunk@39056 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-03 05:18:36 +00:00
Aaron Jorbin ffdac5599b 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.

Built from https://develop.svn.wordpress.org/trunk@39113


git-svn-id: http://core.svn.wordpress.org/trunk@39055 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-03 05:14:44 +00:00
Weston Ruter 985a1f6a97 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.

Built from https://develop.svn.wordpress.org/trunk@39112


git-svn-id: http://core.svn.wordpress.org/trunk@39054 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-03 05:07:32 +00:00
Ryan McCue 721cf281a3 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.

Built from https://develop.svn.wordpress.org/trunk@39111


git-svn-id: http://core.svn.wordpress.org/trunk@39053 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-03 04:57:30 +00:00
Aaron Jorbin 63ba4592e1 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.

Built from https://develop.svn.wordpress.org/trunk@39110


git-svn-id: http://core.svn.wordpress.org/trunk@39052 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-03 04:55:52 +00:00
Joe Hoyle 6b08485cfa 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.

Built from https://develop.svn.wordpress.org/trunk@39109


git-svn-id: http://core.svn.wordpress.org/trunk@39051 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-03 04:05:36 +00:00
Rachel Baker 8c9f4f812a 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.
Built from https://develop.svn.wordpress.org/trunk@39108


git-svn-id: http://core.svn.wordpress.org/trunk@39050 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-03 03:16:30 +00:00
Joe McGill 37318fe73f 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.
Built from https://develop.svn.wordpress.org/trunk@39107


git-svn-id: http://core.svn.wordpress.org/trunk@39049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-03 02:23:29 +00:00
Joe Hoyle d544c6ddd0 REST API: Switch to stable version of JSON Schema.
Props danielbachhuber.
Fixes #38635.

Built from https://develop.svn.wordpress.org/trunk@39106


git-svn-id: http://core.svn.wordpress.org/trunk@39048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-03 02:22:29 +00:00
Rachel Baker dcb12c35cf REST API: Clean-up our validation callbacks and add missing array `items` properties in our endpoint schemas.
Props joehoyle, jnylen0.
Fixes #38617.
Built from https://develop.svn.wordpress.org/trunk@39105


git-svn-id: http://core.svn.wordpress.org/trunk@39047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-03 02:18:29 +00:00
Joe Hoyle 901c4ed17a 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.

Built from https://develop.svn.wordpress.org/trunk@39104


git-svn-id: http://core.svn.wordpress.org/trunk@39046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-03 01:46:29 +00:00
Rachel Baker 676ae9fc2b REST API: Use the `items` attribute for the taxonomies `types` schema property for proper sanitization/validation.
Props danielbachhuber, joehoyle.
Fixes #38631.
Built from https://develop.svn.wordpress.org/trunk@39103


git-svn-id: http://core.svn.wordpress.org/trunk@39045 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-03 01:26:28 +00:00
Joe McGill 89a70eb859 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.
Built from https://develop.svn.wordpress.org/trunk@39102


git-svn-id: http://core.svn.wordpress.org/trunk@39044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-03 01:21:28 +00:00
Rachel Baker 94ab2f9b16 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.
Built from https://develop.svn.wordpress.org/trunk@39101


git-svn-id: http://core.svn.wordpress.org/trunk@39043 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-03 01:12:31 +00:00
Weston Ruter c0b41d8fee 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.

Built from https://develop.svn.wordpress.org/trunk@39100


git-svn-id: http://core.svn.wordpress.org/trunk@39042 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-03 00:00:32 +00:00
Pascal Birchler ceeb8ddb46 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.
Built from https://develop.svn.wordpress.org/trunk@39099


git-svn-id: http://core.svn.wordpress.org/trunk@39041 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-02 22:47:30 +00:00
Helen Hou-Sandí 6485e5e3cf 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.

Built from https://develop.svn.wordpress.org/trunk@39098


git-svn-id: http://core.svn.wordpress.org/trunk@39040 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-02 22:11:31 +00:00
Joe Hoyle 5666292dda 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.

Built from https://develop.svn.wordpress.org/trunk@39097


git-svn-id: http://core.svn.wordpress.org/trunk@39039 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-02 21:51:30 +00:00
Joe Hoyle 37858faf96 REST API: Add en_US to the locales enum.
Props ocean90.
Fixes #38528. 

Built from https://develop.svn.wordpress.org/trunk@39096


git-svn-id: http://core.svn.wordpress.org/trunk@39038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-02 21:21:32 +00:00
Dominik Schilling 9bc3830845 Query: Add tests for `WP_Query::is_single()` and `get_body_class()` with attachments.
See [39052]
See #38225.
Built from https://develop.svn.wordpress.org/trunk@39095


git-svn-id: http://core.svn.wordpress.org/trunk@39037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-02 19:23:28 +00:00
Tammie Lister 40dc499cda Twenty Seventeen: Unifies the labels for front page sections
Front page sesctions # Content were labelled in Customizer Theme Options but the preview called it Panel # placeholder. This unifies that.

Props Clorith, ahortin, celloexpressions, davidakennedy
Fixes #38567


Built from https://develop.svn.wordpress.org/trunk@39094


git-svn-id: http://core.svn.wordpress.org/trunk@39036 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-02 19:09:32 +00:00
Ryan McCue 34cf5d8934 REST API: Allow querying for multiple `slug` values.
Props jnylen0, rachelbaker.
Fixes #38579.

Built from https://develop.svn.wordpress.org/trunk@39093


git-svn-id: http://core.svn.wordpress.org/trunk@39035 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-02 07:14:29 +00:00
Ryan McCue 624def0ec3 REST API: Add update and delete endpoints to /users/me
Now that /users/me is a standalone resource, it should have all the standard endpoints for a resource.

Props pento.
Fixes #38521 (hopefully).

Built from https://develop.svn.wordpress.org/trunk@39092


git-svn-id: http://core.svn.wordpress.org/trunk@39034 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-02 06:53:32 +00:00
Ryan McCue 3fef086ede REST API: Set default sanitize callback if type is set.
Props joehoyle, ChopinBach, jnylen0.
Fixes #38593.

Built from https://develop.svn.wordpress.org/trunk@39091


git-svn-id: http://core.svn.wordpress.org/trunk@39033 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-02 06:28:29 +00:00
Ryan McCue 862724274e REST API: Add locale to user resource.
Props ocean90, joehoyle.
Fixes #38528.

Built from https://develop.svn.wordpress.org/trunk@39090


git-svn-id: http://core.svn.wordpress.org/trunk@39032 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-02 06:24:29 +00:00
Ryan McCue a911bf7e2c REST API: Avoid default sanitization for polymorphic params.
Some parameters (`title`, `content`, etc) are objects in the output, but allow objects or strings to be sent in updates for a more ergonomic interface. This is pretty weird behaviour, so the default sanitisation doesn't handle this. We instead handle this ourselves in the preparation.

Props joehoyle, rachelbaker.
Fixes #38529.

Built from https://develop.svn.wordpress.org/trunk@39089


git-svn-id: http://core.svn.wordpress.org/trunk@39031 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-02 06:02:29 +00:00
Gary Pendergast 6f13b8291d Roles: Fix a PHP error introduced in [39082].
The now deprecated `WP_Roles::reinit()` method was trying to call `__deprecated_function()`, instead of `_deprecated_function()`.

See 23016.


Built from https://develop.svn.wordpress.org/trunk@39088


git-svn-id: http://core.svn.wordpress.org/trunk@39030 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-02 05:55:30 +00:00
Ryan McCue d7bdd72510 REST API: Change method of merging parameters.
`array_merge()` incorrectly reindexes numeric parameters, causing things like `{"123": true}` to be "dropped".

Props sswells, joehoyle.
Fixes #38306.

Built from https://develop.svn.wordpress.org/trunk@39087


git-svn-id: http://core.svn.wordpress.org/trunk@39029 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-02 05:53:31 +00:00
Helen Hou-Sandí dab566d973 Mail: Set a better error code when triggering `wp_mail_failed`.
This error code is now... wait for it... `wp_mail_failed`. Previously, this would have been the originating PHPMailer error code, which could be `0`, which would then fail (pass?) the `empty()` check in the `WP_Error` constructor, thereby rendering the error object fairly useless. The PHPMailer error code is now located within the `WP_Error` data.

props Kau-Boy, stephenharris.
fixes #35598.

Built from https://develop.svn.wordpress.org/trunk@39086


git-svn-id: http://core.svn.wordpress.org/trunk@39028 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-02 04:27:34 +00:00
Ryan McCue ba039f7546 REST API: Remove the Location redirect for the /users/me endpoint.
This is a re-commit of [38980], which was reverted in [38990].

Props youknowriad, jnylen0, pento.
Fixes #38521.

Built from https://develop.svn.wordpress.org/trunk@39085


git-svn-id: http://core.svn.wordpress.org/trunk@39027 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-02 03:44:30 +00:00
Ryan McCue 08ea66490b REST API: Only expose formats supported by the current theme.
While it's valid to save any format to the database, and WordPress is totally fine with that, we should only include the formats specified by the theme in the schema.

Props danielbachhuber.
Fixes #38610.

Built from https://develop.svn.wordpress.org/trunk@39084


git-svn-id: http://core.svn.wordpress.org/trunk@39026 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-02 03:37:32 +00:00
Gary Pendergast 933d5cf733 Docs: Add the parameter name for the `wp_roles_init` action.
[39082] missed adding the name of the parameter to the docs of the `wp_roles_init` action.

Props johnbillion for the catch.
See #23016.


Built from https://develop.svn.wordpress.org/trunk@39083


git-svn-id: http://core.svn.wordpress.org/trunk@39025 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-02 00:57:31 +00:00
Gary Pendergast e79fa03329 Roles/Capabilities: Add a new `wp_roles_init` filter.
Historically, it's been difficult to extend user roles, but reasonable to work around by waiting until after `init` has fired, to add custom roles and capabilities. With the addition of Locale Switching, Core now potentially loads roles before `init` has fired, leaving a window where custom roles and capabilities are not handled.

The new filter allows plugins to add their own custom roles whenever they're initialised (on page load, or when switching sites, for example), so that they can always be obeyed.

`WP_Roles` has also been tidied up a little bit, to remove duplicate code.

Props johnjamesjacoby, pento.
Fixes #23016.


Built from https://develop.svn.wordpress.org/trunk@39082


git-svn-id: http://core.svn.wordpress.org/trunk@39024 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-02 00:31:32 +00:00
David A. Kennedy 4b3a9de5b5 Twenty Seventeen: Fix `supportsInlineSVG()` being unnecessarily called twice
* Also, fix spacing inconsistency in comment.

Props tywayne.

Fixes #38556.

Built from https://develop.svn.wordpress.org/trunk@39081


git-svn-id: http://core.svn.wordpress.org/trunk@39023 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-01 21:24:30 +00:00
Tammie Lister 9cf5aa4381 Twenty Seventeen: Sticky icon fix to stop appearing in regular post flow
The sticky icon was appearing in posts it shouldn't have, not just when stuck. This fixes that.

Props laurelfulford, mageshp, davidakennedy
Fixes #38534


Built from https://develop.svn.wordpress.org/trunk@39080


git-svn-id: http://core.svn.wordpress.org/trunk@39022 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-01 20:56:30 +00:00
Tammie Lister 2b611c2b1d Twenty Seventeen: Fixes ul inside ol being wrongly ordered.
Now the listing displays correctly.

Props tg29359, Soean, laurelfulford, davidakennedy
Fixes #38515


Built from https://develop.svn.wordpress.org/trunk@39079


git-svn-id: http://core.svn.wordpress.org/trunk@39021 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-01 20:53:30 +00:00
David A. Kennedy 9510f68efa Twenty Seventeen: Update page layout setting for all use cases
* Makes sure the page layout setting also applies to pages, and is not completely hidden from them when a sidebar widget is present. Pages do not have a sidebar, so that was incorrect.
* Updates description in Customizer for brevity and accuracy.
* Applies setting to archive pages as well.
* Updates CSS to reflect changes.

Props celloexpressions, laurelfulford.

Fixes #38538.

Built from https://develop.svn.wordpress.org/trunk@39078


git-svn-id: http://core.svn.wordpress.org/trunk@39020 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-01 20:40:31 +00:00
Ella Iseulde Van Dorpe feb8ccf3d6 TinyMCE: wptextpattern: Fix undo shortcut for inline patterns
Fixes #37092.


Built from https://develop.svn.wordpress.org/trunk@39077


git-svn-id: http://core.svn.wordpress.org/trunk@39019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-01 20:34:32 +00:00
Helen Hou-Sandí 2d07c3196e Only set `fresh_site` during an actual fresh install.
props westonruter.
fixes #38533.

Built from https://develop.svn.wordpress.org/trunk@39076


git-svn-id: http://core.svn.wordpress.org/trunk@39018 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-01 20:16:31 +00:00
Ella Iseulde Van Dorpe 84c108db02 TinyMCE: wptextpattern: Handle unconverted inline patterns
Make sure the right text is matched when it already contains characters of the pattern.
Adds two more unit tests.

Fixes #37693.


Built from https://develop.svn.wordpress.org/trunk@39075


git-svn-id: http://core.svn.wordpress.org/trunk@39017 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-01 20:06:36 +00:00
John Blackbourn 5c7aa3c5b8 Editor: Correct the description of the parameter passed to the `wp_default_editor` filter.
Props goto10
Fixes #38327

Built from https://develop.svn.wordpress.org/trunk@39074


git-svn-id: http://core.svn.wordpress.org/trunk@39016 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-01 19:56:30 +00:00
David A. Kennedy 906eb80953 Twenty Seventeen: Remove unnecessary l10n variables
* Relies on header skip link instead of l10n variables in JavaScript.
* Fixes issue where scroll down arrow appeared next to the navigation on the front page with no header image or video. It now only appears with a big header.

Props enodekciw, laurelfulford.

Fixes #38502.

Built from https://develop.svn.wordpress.org/trunk@39073


git-svn-id: http://core.svn.wordpress.org/trunk@39015 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-01 19:00:32 +00:00
David A. Kennedy 3711c0664d Twenty Seventeen: Replace remaining Genericons with Font Awesome icons
* Replaces: icon-pinned with icon-thumb-tack
* Replaces: icon-next with icon-arrow-right
* Replaces: icon-previous with icon-arrow-left
* Replaces: icon-expand with icon-angle-down
* Removes: Path, Polldaddy

Props sami.keijonen, melchoyce, laurelfulford.

Fixes #38488.

Built from https://develop.svn.wordpress.org/trunk@39072


git-svn-id: http://core.svn.wordpress.org/trunk@39014 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-01 17:26:32 +00:00
Jeremy Felt 04f376e0aa Multisite: Use `get_network()` in `WP_UnitTest_Factory_For_Network`.
`wp_get_network()` was deprecated in 4.6.

Props johnjamesjacoby.
Fixes #38602.

Built from https://develop.svn.wordpress.org/trunk@39071


git-svn-id: http://core.svn.wordpress.org/trunk@39013 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-01 16:52:33 +00:00
John Blackbourn 766ff15532 I18N: Revert [39069] as it needs some more work.
See #38485

Built from https://develop.svn.wordpress.org/trunk@39070


git-svn-id: http://core.svn.wordpress.org/trunk@39012 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-01 16:07:32 +00:00
Pascal Birchler 8bdd37fc58 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.

Fixes #38485.
Built from https://develop.svn.wordpress.org/trunk@39069


git-svn-id: http://core.svn.wordpress.org/trunk@39011 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-01 09:24:29 +00:00
Pascal Birchler 8df80ae3ee I18N: Show available timezones in the user's locale on the settings screen.
Adds a `$locale` parameter to `wp_timezone_choice()` to only reload translations when necessary.

Props yale01.
See #38485.
Built from https://develop.svn.wordpress.org/trunk@39068


git-svn-id: http://core.svn.wordpress.org/trunk@39010 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-01 09:16:31 +00:00
Pascal Birchler d7d8768ffd I18N: Remove unused `$wpdb` global from `get_locale()` after [39005].
Originally added in [38976], but reverted soon after.

Props johnjamesjacoby.
Fixes #38601.
Built from https://develop.svn.wordpress.org/trunk@39067


git-svn-id: http://core.svn.wordpress.org/trunk@39009 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-01 07:38:31 +00:00
Aaron Jorbin 1aae56f53a Update link in register_meta about 4.6 changes
The blog post, while originally canonical, was later updated to include additional changes. The ticket includes all the changes and alot of rational for why things changed.

Props Mista-Flo, DrewAPicture, morganestes.
Fixes #38254.


Built from https://develop.svn.wordpress.org/trunk@39066


git-svn-id: http://core.svn.wordpress.org/trunk@39008 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-01 06:54:34 +00:00
Dion Hulse 69c9d9222e Themes: Update the unit tests to handle [39064] and #31550.
`test_default_theme_in_default_theme_list()` was always being skipped after #31550, this causes it to once again check that the unit tests are up to date and include the latest default theme.
`test_default_themes_have_textdomain()` didn't play happy when a default theme wasn't installed on a site.

See #31550, #29925, #38551.

Built from https://develop.svn.wordpress.org/trunk@39065


git-svn-id: http://core.svn.wordpress.org/trunk@39007 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-01 03:14:32 +00:00
Dion Hulse 70b1d2071b Upgrade: Install new themes upon upgrade again.
This partially reverts [35738], which has shown to provide a bad user experience for users seeking to experiment with TwentySeventeen.

This will result in TwentySixteen being installed in addition to TwentySeventeen.

See #38551.

Built from https://develop.svn.wordpress.org/trunk@39064


git-svn-id: http://core.svn.wordpress.org/trunk@39006 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-11-01 01:24:35 +00:00
John Blackbourn 0ff0dcc7de Plugins: Correct the `since` docs for the various `plugin_action_links` filters.
Props tfrommen, SergeyBiryukov

Built from https://develop.svn.wordpress.org/trunk@39063


git-svn-id: http://core.svn.wordpress.org/trunk@39005 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-31 19:38:47 +00:00
John Blackbourn babd79fb36 Posts, Post Types: Prevent users from being able to delete a protected meta field from a post.
Previously a user could remove a protected meta field by using their browser developer tools to alter the form field properties in the Custom Fields meta box, given that they know the ID of the protected meta field. This change prevents this by preventing any change to a protected meta field, including changing its key.

Props ajoah, johnbillion, peterwilsoncc
Fixes #38293

Built from https://develop.svn.wordpress.org/trunk@39062


git-svn-id: http://core.svn.wordpress.org/trunk@39004 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-31 19:30:32 +00:00
Joe Hoyle 6ee8f33660 REST API: Sanitize arrays being sent as CSVs.
In #38586 the ability to parse arrays as csv was introduced, however it didn't add any support for validating csv arrays. This adds such sanitization, and also a good amount of unit tests for all sanitization baed off schema.

See #38586.

Built from https://develop.svn.wordpress.org/trunk@39061


git-svn-id: http://core.svn.wordpress.org/trunk@39003 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-31 17:08:31 +00:00
Weston Ruter 1c45ae618c Customize: Ensure state query params persist in preview through calls to `history.pushState()` & `history.replaceState()`.
Allow history to be manipulated before DOM ready by sourcing state params from the current URL instead of from the `wp.customize.settings` object, since they will be the same anyway. This fixes a JS error since `wp.customize.settings` is not defined before DOM ready.

Amends [38810].
See #30937.
Fixes #38592.

Built from https://develop.svn.wordpress.org/trunk@39060


git-svn-id: http://core.svn.wordpress.org/trunk@39002 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-31 16:42:30 +00:00
Andrea Fercia 4356a28b52 Administration: remove a leftover check from get_submit_button.
Props sstoqnov.
Fixes #34891.

Built from https://develop.svn.wordpress.org/trunk@39059


git-svn-id: http://core.svn.wordpress.org/trunk@39001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-31 16:39:32 +00:00
Joe Hoyle f1591eccca REST API: Add support for "integer" type for meta and options
Previously Settings only supported "number" which meant it was possible to push floats to things like posts_per_page. This means now developers can also specify `type => ineger` in meta nad settings resgration.

Props flixos90.
Fixes #38393.

Built from https://develop.svn.wordpress.org/trunk@39058


git-svn-id: http://core.svn.wordpress.org/trunk@39000 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-31 16:07:31 +00:00
Boone Gorges 1dd88e334b Taxonomy: Remove redundant 'get_terms_args' filter call from `WP_Term_Query`.
Introduced in [37572]. The correct 'get_terms_args' filter call is in
`WP_Term_Query::get_terms()`.

Props Tkama.
Fixes #38589.
Built from https://develop.svn.wordpress.org/trunk@39057


git-svn-id: http://core.svn.wordpress.org/trunk@38999 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-31 15:47:33 +00:00
Gary Pendergast 03e34ab461 REST API: Allow a CSV list of user roles to be passed to `/users`.
After [39048], this changes explicitly parses the list of user roles as slugs, and adds tests.

Props jnylen0.
Fixes #38557.


Built from https://develop.svn.wordpress.org/trunk@39056


git-svn-id: http://core.svn.wordpress.org/trunk@38998 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-31 11:11:29 +00:00
Gary Pendergast 9862543913 REST API: Allow a CSV list of term IDs to be passed to `/posts`.
[39048] added CSV support to array types, this change explicitly parses term lists as IDs, and adds tests.

Props timmydcrawford, pento.
Fixes #38553.


Built from https://develop.svn.wordpress.org/trunk@39055


git-svn-id: http://core.svn.wordpress.org/trunk@38997 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-31 11:06:31 +00:00
Drew Jaynes 33b8bb3cf3 Docs: Clarify descriptions for `home_url()` and `get_home_url()` on the true effect of the `$scheme` parameter.
Part props thomaswm.
Props stevenlinx.
Fixes #36468.

Built from https://develop.svn.wordpress.org/trunk@39054


git-svn-id: http://core.svn.wordpress.org/trunk@38996 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-31 07:06:32 +00:00
Drew Jaynes 3a02481d9e Docs: Fix an incorrect pseudo-parameter referenced in the hook doc for the `widget_tag_cloud_args` filter.
Props backermann.
Fixes #37654.

Built from https://develop.svn.wordpress.org/trunk@39053


git-svn-id: http://core.svn.wordpress.org/trunk@38995 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-31 06:40:49 +00:00
Drew Jaynes 568838bebd Docs: Update the DocBlock description for `WP_Query::is_single()` to mention that it works for any post types excluding pages.
Props ryankienstra.
Fixes #38225.

Built from https://develop.svn.wordpress.org/trunk@39052


git-svn-id: http://core.svn.wordpress.org/trunk@38994 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-31 06:34:34 +00:00
Drew Jaynes 5f4497f0af Docs: Fix multiple trivial typos throughout a variety of core files.
Props ottok.
Fixes #38489.

Built from https://develop.svn.wordpress.org/trunk@39051


git-svn-id: http://core.svn.wordpress.org/trunk@38993 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-31 06:28:32 +00:00
Peter Wilson c7691ceb36 Themes: Exit `wp-custom-header.js` early in browsers wihout modern events.
Adds a check for `window.addEventListener` support before attempting to use it. In browsers without support, the file is exited early to avoid throwing a JavaScript error.

Fixes #38585.

Built from https://develop.svn.wordpress.org/trunk@39050


git-svn-id: http://core.svn.wordpress.org/trunk@38992 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-31 06:17:29 +00:00
Drew Jaynes 9635867540 Docs: The `query_vars` filter used in the REST posts controller should be notated as a duplicate rather than a new hook.
See #38398.

Built from https://develop.svn.wordpress.org/trunk@39049


git-svn-id: http://core.svn.wordpress.org/trunk@38991 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-31 05:50:29 +00:00
Gary Pendergast 54b378e411 REST API: Allow parameters defined as `array` to be sent as CSVs.
This allows parameters that are often handled as CSVs to be properly parsed.

Fixes #38586.


Built from https://develop.svn.wordpress.org/trunk@39048


git-svn-id: http://core.svn.wordpress.org/trunk@38990 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-31 05:45:32 +00:00
Ryan McCue 4dab905dba REST API: Support password on non-post post types.
The password field was incorrectly only added to "post" post types, but is supported for all post types in the Dashboard UI.

Props jnylen0.
Fixes #38582.

Built from https://develop.svn.wordpress.org/trunk@39047


git-svn-id: http://core.svn.wordpress.org/trunk@38989 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-31 03:53:32 +00:00
Gary Pendergast 6c1e98d1fb REST API: Add support for arrays in schema validation and sanitization.
By allowing more fine-grained validation and sanitisation of endpoint args, we can ensure the correct data is being passed to endpoints.

This can easily be extended to support new data types, such as CSV fields or objects.

Props joehoyle, rachelbaker, pento.
Fixes #38531.


Built from https://develop.svn.wordpress.org/trunk@39046


git-svn-id: http://core.svn.wordpress.org/trunk@38988 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-31 01:48:41 +00:00
John Blackbourn 8c811f8f90 XML-RPC: Correctly handle empty and duplicate comments.
This prevents `wp_die()` being sent in response to an XML-RPC call that attempts to submit a duplicate comment, and correctly returns an error in response to an attempt to submit an empty comment.

Props markoheijnen, websupporter.
Fixes #14452, #38466.
See #36901

Built from https://develop.svn.wordpress.org/trunk@39045


git-svn-id: http://core.svn.wordpress.org/trunk@38987 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-31 01:27:31 +00:00
Gary Pendergast dbc4b87b7f REST API: Allow Content-Type on CORS requests.
This allows `POST` requests with a wider variety of `Content-Type' headers - `Content-Type: application/json`, for example.

Props jnylen0.
Fixes #37994.


Built from https://develop.svn.wordpress.org/trunk@39044


git-svn-id: http://core.svn.wordpress.org/trunk@38986 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-31 00:34:33 +00:00
Rachel Baker b7e6c43c64 REST API: Correctly test the roles parameter when creating a user in `WP_Test_REST_Users_Controller`.
Props jnylen0.
Fixes #38575.
Built from https://develop.svn.wordpress.org/trunk@39043


git-svn-id: http://core.svn.wordpress.org/trunk@38985 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-31 00:28:29 +00:00
Gary Pendergast 69539eb2a7 REST API: Add `PATCH` to CORS allowed methods.
Editable resources in the REST API accept the `PATCH` method, but the CORS headers don't mention it.

Props jnylen0.
Fixes #38546.


Built from https://develop.svn.wordpress.org/trunk@39042


git-svn-id: http://core.svn.wordpress.org/trunk@38984 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-31 00:19:30 +00:00
Rachel Baker d15f7b5f44 REST API: Delete temporary files during teardown of `WP_Test_REST_Attachments_Controller`.
Props jnylen0.
Fixes #38574.
Built from https://develop.svn.wordpress.org/trunk@39041


git-svn-id: http://core.svn.wordpress.org/trunk@38983 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 23:32:35 +00:00
Dominik Schilling ba9b3cf6a6 I18N: Don't use `get_user_option()` for retrieving user's language.
`get_user_option()` checks for both option types, site and network. Since `locale` is only a network option we can directly access the field via `WP_User`s magic getter.

Props johnjamesjacoby.
Fixes #38578.
Built from https://develop.svn.wordpress.org/trunk@39040


git-svn-id: http://core.svn.wordpress.org/trunk@38982 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 22:26:31 +00:00
Dominik Schilling cf571b12c1 I18N: Use correct value for the `for` attribute of the user language setting label.
Props johnjamesjacoby.
Fixes #38576.
Built from https://develop.svn.wordpress.org/trunk@39039


git-svn-id: http://core.svn.wordpress.org/trunk@38981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 21:58:38 +00:00
Weston Ruter 015cb27b87 Customize: Prevent auto-draft post/page stubs from being saved with empty slugs or published with non-unique slugs.
* Allow `WP_Customize_Nav_Menus::insert_auto_draft_post()` to take full post array to pass to `wp_insert_post()`, except for `post_status`. Require `post_title`. 
* Ensure empty `post_name` gets explicitly set to slugified `post_title`.
* Explicitly allow only `post_type` and `post_title` params in `WP_Customize_Nav_Menus::ajax_insert_auto_draft_post()`.
* Use `wp_update_post()` instead of `wp_publish_post()` to ensure unique slugs are assigned to published auto-draft posts.
* Re-use `WP_Customize_Nav_Menus::insert_auto_draft_post()` when inserting stubs from starter content.
 
See #38114, #38013, #34923.
Fixes #38539.

Built from https://develop.svn.wordpress.org/trunk@39038


git-svn-id: http://core.svn.wordpress.org/trunk@38980 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 20:21:33 +00:00
Drew Jaynes 0181e937c5 Docs: Add a slightly less ambiguous list of return types for `rest_ensure_response()`.
See #38398.

Built from https://develop.svn.wordpress.org/trunk@39037


git-svn-id: http://core.svn.wordpress.org/trunk@38979 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 18:53:29 +00:00
Drew Jaynes 993b3a5c6e Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_Users_Controller` class.
Props Soean, mrahmadawais, flixos90.
See #38398.

Built from https://develop.svn.wordpress.org/trunk@39036


git-svn-id: http://core.svn.wordpress.org/trunk@38978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 18:52:30 +00:00
John Blackbourn 5b0d11791f Role/Capability: Introduce capability tests for promoting, removing, and deleting users, and capability tests for editing comments.
Also introduces a shared fixture for a super admin user.

See #38236

Built from https://develop.svn.wordpress.org/trunk@39035


git-svn-id: http://core.svn.wordpress.org/trunk@38977 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 18:31:33 +00:00
Drew Jaynes b8f14e00ef Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_User_Meta_Fields` class.
Props Soean, mrahmadawais, flixos90.
See #38398.

Built from https://develop.svn.wordpress.org/trunk@39034


git-svn-id: http://core.svn.wordpress.org/trunk@38976 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 18:28:30 +00:00
Drew Jaynes 90c17ccbf1 Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_Terms_Controller` class.
Props Soean, mrahmadawais, flixos90.
See #38398.

Built from https://develop.svn.wordpress.org/trunk@39033


git-svn-id: http://core.svn.wordpress.org/trunk@38975 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 18:21:30 +00:00
Drew Jaynes b71e62b9eb Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_Term_Meta_Fields` class.
Props Soean, mrahmadawais, flixos90.
See #38398.

Built from https://develop.svn.wordpress.org/trunk@39032


git-svn-id: http://core.svn.wordpress.org/trunk@38974 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 18:09:32 +00:00
Drew Jaynes 7d7d0c8599 Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_Taxonomies_Controller` class.
Props Soean, mrahmadawais, flixos90.
See #38398.

Built from https://develop.svn.wordpress.org/trunk@39031


git-svn-id: http://core.svn.wordpress.org/trunk@38973 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 18:07:33 +00:00
Drew Jaynes 5dfa0c4cee Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_Settings_Controller` class.
Props Soean, mrahmadawais, flixos90.
See #38398.

Built from https://develop.svn.wordpress.org/trunk@39030


git-svn-id: http://core.svn.wordpress.org/trunk@38972 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 18:01:30 +00:00
Drew Jaynes 2452f69485 REST: Fix some errant `else if` conditions and add a few missing periods on inline comments.
Props mrahmadawais.
See #38398.

Built from https://develop.svn.wordpress.org/trunk@39029


git-svn-id: http://core.svn.wordpress.org/trunk@38971 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 17:54:30 +00:00
Drew Jaynes 596ee8bc9d Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_Revisions_Controller` class.
Props Soean, mrahmadawais, flixos90.
See #38398.

Built from https://develop.svn.wordpress.org/trunk@39028


git-svn-id: http://core.svn.wordpress.org/trunk@38970 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 17:50:29 +00:00
Drew Jaynes 1ef0a5514e REST: Fix a yoda condition in `WP_REST_Request::get_parameter_order()` and add a missing period for an inline comment in `WP_REST_Request::from_url().
Props mrahmadawais.
See #38398.

Built from https://develop.svn.wordpress.org/trunk@39027


git-svn-id: http://core.svn.wordpress.org/trunk@38969 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 17:42:45 +00:00
Drew Jaynes e84b257852 Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_Posts_Controller` class.
Props Soean, mrahmadawais, flixos90, DrewAPicture.
See #38398.

Built from https://develop.svn.wordpress.org/trunk@39026


git-svn-id: http://core.svn.wordpress.org/trunk@38968 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 17:37:35 +00:00
Drew Jaynes 7d488bd2b1 Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_Post_Types_Controller` class.
Props Soean, mrahmadawais, flixos90.
See #38398.

Built from https://develop.svn.wordpress.org/trunk@39025


git-svn-id: http://core.svn.wordpress.org/trunk@38967 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 16:51:30 +00:00
Drew Jaynes 04f0340a96 Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_Post_Statuses_Controller` class.
Props Soean, mrahmadawais, flixos90.
See #38398.

Built from https://develop.svn.wordpress.org/trunk@39024


git-svn-id: http://core.svn.wordpress.org/trunk@38966 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 16:44:38 +00:00
Drew Jaynes c4df9d63ba Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_Post_Meta_Fields` class.
Props Soean, mrahmadawais, flixos90.
See #38398.

Built from https://develop.svn.wordpress.org/trunk@39023


git-svn-id: http://core.svn.wordpress.org/trunk@38965 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 16:36:32 +00:00
Drew Jaynes 9ce98d98ac Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_Meta_Fields` class.
Props Soean, mrahmadawais, flixos90.
See #38398.

Built from https://develop.svn.wordpress.org/trunk@39022


git-svn-id: http://core.svn.wordpress.org/trunk@38964 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 16:33:30 +00:00
Drew Jaynes 718f9fe868 Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_Controller` class.
Props Soean, mrahmadawais, flixos90.
See #38398.

Built from https://develop.svn.wordpress.org/trunk@39021


git-svn-id: http://core.svn.wordpress.org/trunk@38963 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 16:20:29 +00:00
John Blackbourn 2d0d9cfbf9 Customize: Avoid using `assertNotFalse()` in tests because it's not available in PHPUnit 3.6.
See #35395

Built from https://develop.svn.wordpress.org/trunk@39020


git-svn-id: http://core.svn.wordpress.org/trunk@38962 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 15:42:36 +00:00
Andrea Fercia 791c72dd4d Accessibility: Remove target=_blank from the help tab links in network.php.
Stop taking control of users' browsers.

Props wolly.
Fixes #38572. See #23432.

Built from https://develop.svn.wordpress.org/trunk@39019


git-svn-id: http://core.svn.wordpress.org/trunk@38961 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 15:19:37 +00:00
Weston Ruter ddea523daf Customize: Prevent toggling edit shortcuts when doing shift-click or when clicking on a descendent of an interactive element.
See #38532, #27403.
Fixes #38554.

Built from https://develop.svn.wordpress.org/trunk@39018


git-svn-id: http://core.svn.wordpress.org/trunk@38960 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 14:59:31 +00:00
John Blackbourn 328922cc82 Customize: Correct the CRUD tests for custom CSS on multisite.
See #35395

Built from https://develop.svn.wordpress.org/trunk@39017


git-svn-id: http://core.svn.wordpress.org/trunk@38959 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 14:04:30 +00:00
John Blackbourn 2b6ceeb465 Customize: Correct the capability mapping and associated tests for the `unfiltered_css` capability.
Fixes #35395

Built from https://develop.svn.wordpress.org/trunk@39016


git-svn-id: http://core.svn.wordpress.org/trunk@38958 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 12:47:31 +00:00
Drew Jaynes e2e47a192d Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_Comments_Controller` class.
Props Soean, mrahmadawais, flixos90.
See #38398.

Built from https://develop.svn.wordpress.org/trunk@39015


git-svn-id: http://core.svn.wordpress.org/trunk@38957 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 06:55:30 +00:00
Drew Jaynes 7d25657c01 Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_Comment_Meta_Fields` class.
Props Soean, mrahmadawais, flixos90.
See #38398.

Built from https://develop.svn.wordpress.org/trunk@39014


git-svn-id: http://core.svn.wordpress.org/trunk@38956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 06:34:31 +00:00
Drew Jaynes 4247471355 Tests: Helps to also update the hour and not just the timezone to temporarily fix a test broken due to Daylight Saving Time changes in Europe.
Built from https://develop.svn.wordpress.org/trunk@39013


git-svn-id: http://core.svn.wordpress.org/trunk@38955 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 05:54:29 +00:00
Drew Jaynes e94d4a2589 Tests: Temporarily fix a test failing due to European Daylight Saving Time changes.
Built from https://develop.svn.wordpress.org/trunk@39012


git-svn-id: http://core.svn.wordpress.org/trunk@38954 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 05:44:36 +00:00
Drew Jaynes 08b0407367 Docs: Add much more complete and syntactically correct documentation throughout the `WP_REST_Attachments_Controller` class.
Props Soean, mrahmadawais, flixos90.
See #38398.

Built from https://develop.svn.wordpress.org/trunk@39011


git-svn-id: http://core.svn.wordpress.org/trunk@38953 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 05:40:37 +00:00
Weston Ruter 5015bd55a2 Customize: Reveal controls pane when clicking on edit shortcuts in mobile preview.
Re-use `paneVisible` state to also manage whether the mobile `preview-only` class is applied to the overlay.

Props seancjones.
See #36678, #36678, #27403.
Fixes #38080.

Built from https://develop.svn.wordpress.org/trunk@39010


git-svn-id: http://core.svn.wordpress.org/trunk@38952 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 04:23:44 +00:00
Weston Ruter 2dd904df5e Customize: Fix message grammar for `custom_css` validity error when imbalanced characters possibly due to `content` CSS property.
Props Presskopp.
See #35395.
Fixes #38564.

Built from https://develop.svn.wordpress.org/trunk@39009


git-svn-id: http://core.svn.wordpress.org/trunk@38951 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 04:04:32 +00:00
John Blackbourn 2f7f2c68f0 Role/Capability: Reuse a fixture in a couple more unit tests.
See #30017

Built from https://develop.svn.wordpress.org/trunk@39008


git-svn-id: http://core.svn.wordpress.org/trunk@38950 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-30 00:33:42 +00:00
Dominik Schilling 102273e472 XML-RPC: Fix truncated warning message added in [38883].
See #37122.
Built from https://develop.svn.wordpress.org/trunk@39007


git-svn-id: http://core.svn.wordpress.org/trunk@38949 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-29 21:32:33 +00:00
Andrea Fercia fd40a16ad1 Accessibility: Improve the form labels on the Add New User screen.
On the Multisite - single site "Add New User" screen, some form fields have more
than one label associated with them. Form controls should have at most one
associated label element. If more than one label element is associated to the
control, assistive technologies may not read the appropriate label.

Additionally, labels can be associated to their related form fields either
explicitly (using a `for` attribute referencing the field ID) or implicitly
(using the label to wrap the field). As a best practice, never do both and
prefer explicitly associated labels when possible.

Props Ankit K Gupta.
Fixes #38459.

Built from https://develop.svn.wordpress.org/trunk@39006


git-svn-id: http://core.svn.wordpress.org/trunk@38948 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-29 12:54:30 +00:00
Dominik Schilling a1d18b7b8a I18N: Don't initialize `WP_Locale_Switcher` in `wp_load_translations_early()`.
`wp_load_translations_early()` is used when WordPress isn't fully initialized. Therefore using the `WP_Locale_Switcher` with `get_locale()`/`get_user_locale()` can cause PHP fatal errors.
This reverts [38976] and [38977], and instead removes `WP_Locale_Switcher` from `wp_load_translations_early()`.

See #29783.
Fixes #38535.
Built from https://develop.svn.wordpress.org/trunk@39005


git-svn-id: http://core.svn.wordpress.org/trunk@38947 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-29 11:23:33 +00:00
Tammie Lister 67bd634b69 Twenty Seventeen: Fixes unexpected behaviour of scroll down arrow
This ensures the arrorw disappears once the top menu sticks.

Props LittleBigThing, davidakennedy
Fixes #38555


Built from https://develop.svn.wordpress.org/trunk@39004


git-svn-id: http://core.svn.wordpress.org/trunk@38946 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-29 09:45:31 +00:00
Weston Ruter 9da43bc2c8 Customize: Move Additional CSS section toward end of list by assigning priority higher than default.
Props Mista-Flo.
Fixes #38524.

Built from https://develop.svn.wordpress.org/trunk@39003


git-svn-id: http://core.svn.wordpress.org/trunk@38945 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-29 05:11:29 +00:00
Weston Ruter d71afc0d9a Customize: Mark newly-added page/post stubs as added (with checkmark) when they are inserted into the list of available items.
Props ryankienstra, celloexpressions.
See #34923.
Fixes #38499.

Built from https://develop.svn.wordpress.org/trunk@39002


git-svn-id: http://core.svn.wordpress.org/trunk@38944 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-29 05:06:31 +00:00
David A. Kennedy ce81b7a849 Twenty Seventeen: Adds missing theme text domains to starter content
* Also, changes the top menu label so it has better context when read alone by assistive technology.

Props anilbasnet.

Fixes #38542.

Built from https://develop.svn.wordpress.org/trunk@39001


git-svn-id: http://core.svn.wordpress.org/trunk@38943 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-28 23:44:33 +00:00
David A. Kennedy 42f804e4cb Twenty Seventeen: Don't modify excerpt link in admin
* Since this is a filter the original value is returned if `is_admin()` is true.
* Removes portion of the doc block since function is not pluggable.

Props mangeshp.

Fixes #38510.

Built from https://develop.svn.wordpress.org/trunk@39000


git-svn-id: http://core.svn.wordpress.org/trunk@38942 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-28 23:16:34 +00:00
David A. Kennedy f7552bbf53 Twenty Seventeen: Remove excessive escaping in `color-patterns.php`
Uses `absint()` to escape when getting value. Removes `esc_attr` from each instance of the variable.

Props fencer04.

Fixes #38449.

Built from https://develop.svn.wordpress.org/trunk@38999


git-svn-id: http://core.svn.wordpress.org/trunk@38941 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-28 21:53:46 +00:00
Tammie Lister 9fccac28d8 Twenty Seventeen: Hidden article tags on home page fix
This prevents the issue of hidden article tags on home page.

Props ElectricFeet, iv.dimova. morettigeorgiev, davidakennedy
Fixes #38404

M    twentyseventeen/inc/template-tags.php
M    twentyseventeen/style.css

Built from https://develop.svn.wordpress.org/trunk@38998


git-svn-id: http://core.svn.wordpress.org/trunk@38940 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-28 21:01:34 +00:00
Andrew Ozz 3807829ac4 TinyMCE: if the current editor configuration is without toolbars, prevent errors when adding the labels for custom shortcuts.
Fixes #38063.
Built from https://develop.svn.wordpress.org/trunk@38997


git-svn-id: http://core.svn.wordpress.org/trunk@38939 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-28 20:07:32 +00:00
David A. Kennedy a8b19ca223 Twenty Seventeen: Fix broken and crowded pagination navigation on small screens
* Hides page numbers visually at smaller screen sizes.
* Reduced padding around `.wrap` class on smaller screens.
* Fixed issue with the page numbers not displaying the underline on `:hover`. This has been updated in the custom colors files, too.

Props laurelfulford, caspie.

Fixes #38394.

Built from https://develop.svn.wordpress.org/trunk@38996


git-svn-id: http://core.svn.wordpress.org/trunk@38938 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-28 17:38:42 +00:00
Helen Hou-Sandí 529ca4d134 Post-4.7 beta 1 bump.
Built from https://develop.svn.wordpress.org/trunk@38995


git-svn-id: http://core.svn.wordpress.org/trunk@38937 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-28 04:33:42 +00:00
Helen Hou-Sandí 7343b3bf40 WordPress 4.7 Beta 1.
Built from https://develop.svn.wordpress.org/trunk@38992


git-svn-id: http://core.svn.wordpress.org/trunk@38935 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-28 03:01:43 +00:00
Weston Ruter 75535c596b Customize: Introduce starter content and site freshness state.
A theme can opt-in for tailored starter content to apply to the customizer when previewing the theme on a fresh install, when `fresh_site` is at its initial `1` value. Starter content is staged in the customizer and does not go live unless the changes are published. Initial starter content is added to Twenty Seventeen.

* The `fresh_site` flag is cleared when a published post or page is saved, when widgets are modified, or when the customizer state is saved.
* Starter content is registered via `starter-content` theme support, where the argument is an array containing `widgets`, `posts`, `nav_menus`, `options`, and `theme_mods`. Posts/pages in starter content are created with the `auto-draft` status, re-using the page/post stubs feature added to nav menus and the static front page controls.
* A `get_theme_starter_content` filter allows for plugins to extend a theme's starter content.
* Starter content in themes can/should re-use existing starter content items in core by using named placeholders.
* Import theme starter content into customized state when fresh site.
* Prevent original_title differences from causing refreshes if title is present.
* Ensure nav menu item url is set according to object when previewing.
* Make sure initial saved state is false if there are dirty settings without an existing changeset.
* Ensure dirty settings are cleaned upon changeset publishing.

Props helen, westonruter, ocean90.
Fixes #38114, #38533.

Built from https://develop.svn.wordpress.org/trunk@38991


git-svn-id: http://core.svn.wordpress.org/trunk@38934 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-28 02:57:35 +00:00
Gary Pendergast 60eb1ddc5c REST API: Revert [38980].
`/users/me` still needs attention, but this change wasn't quite ready.

See #38521.


Built from https://develop.svn.wordpress.org/trunk@38990


git-svn-id: http://core.svn.wordpress.org/trunk@38933 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-28 02:07:35 +00:00
Joe McGill f9f6dd7958 Customizer: Fix name of a partial in `export_header_video_settings()`
Following [38985], this updates a check for partials being set in
`export_header_video_settings()` to use the correct name.

Props bradyvercher.
See #38172.
Built from https://develop.svn.wordpress.org/trunk@38989


git-svn-id: http://core.svn.wordpress.org/trunk@38932 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-28 01:51:31 +00:00
David A. Kennedy 69c8c4ede0 Twenty Seventeen: Make border colors for panels match WordPress UI
Also, fixes the visibility of the borders for panels after the header videos commit.

Props celloexpressions.

Fixes #38408.
See #38172.

Built from https://develop.svn.wordpress.org/trunk@38988


git-svn-id: http://core.svn.wordpress.org/trunk@38931 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 23:24:32 +00:00
David A. Kennedy 1ccea74e32 Twenty Seventeen: Fix issue with missing background color in dark color scheme.
A background color style that was added to the front page during video header implementation did not get included in the `colors-dark.css`, causing a display issue with the dark color scheme.

Props laurelfulford.

See #38172.

Built from https://develop.svn.wordpress.org/trunk@38987


git-svn-id: http://core.svn.wordpress.org/trunk@38930 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 23:01:30 +00:00
David A. Kennedy 769e718d2c Twenty Seventeen: Improve user and developer experience with the customizer integration
* Rename customizer JS files to customize-preview.js and customize-controls.js to align with the core file naming and make it clearer where each file runs.
* Only show the colorscheme_hue control when there's a custom color scheme.
* Update preview JS handling for revised front page section handling, see below.
* Remove all references to "Theme Customizer" in code comments. It hasn't been called that since before 4.0.
* Clarify the purpose of the JS files by updated the code comments in the file headers.
* Improve code readability.
* Make the arbitrary number of front page sections filterable, for UI registration and output.
* Rename twentyseventeen_sanitize_layout to twentyseventeen_sanitize_page_layout to be clearer about what it sanitizes in case child themes or plugins consider reusing it.
* Rename page_options setting/control to page_layout as that's more reflective of what that option does; and again, helps for potential extensions.
* Make the page layout option contextual to pages and the sidebar being inactive, as the option only applies when there is no sidebar (per its description).
* Condense options into a single section.
* Add selective refresh for front page sections.
* Locate active_callback functions within customizer.php so that they're easier to find when editing customizer registrations, similarly to sanitize callbacks.
* Adjust the styling for placeholders for panels that aren't active. 
* Ensure that the new visible edit shortcuts don't have any issues.

Props celloexpressions.

Fixes #38426.

Built from https://develop.svn.wordpress.org/trunk@38986


git-svn-id: http://core.svn.wordpress.org/trunk@38929 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 22:09:40 +00:00
Joe McGill 030bc377dd Themes: Enable video in custom headers.
This adds the ability for themes to add support for videos in custom headers
by passing `'video' => true` as an argument when adding theme support for
custom headers.

Custom video headers are managed through the “Header Visuals” (i.e. “Header Image”)
panel in the Customizer where you can select a video from the media library or set a
URL to an external video (YouTube for now) for use in custom headers.

This introduces several new functions:

`has_header_video()` – Check whether a header video is set or not.
`get_header_video_url()` – Retrieve header video URL for custom header.
`the_header_video_url()` – Display header video URL.
`get_header_video_settings()` – Retrieve header video settings.
`has_custom_header()` – Check whether a custom header is set or not.
`get_custom_header_markup()` – Retrieve the markup for a custom header.
`the_custom_header_markup()` – Print the markup for a custom header.

And a new file, `wp-includes/js/wp-custom-header.js` that handles loading videos
in custom headers.

This also enables video headers in the Twenty Seventeen and Twenty Fourteen themes.

Props davidakennedy, celloexpressions, bradyvercher, laurelfulford, joemcgill.
Fixes #38172.
Built from https://develop.svn.wordpress.org/trunk@38985


git-svn-id: http://core.svn.wordpress.org/trunk@38928 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 21:51:31 +00:00
Andrea Fercia 7b0abd1cea Accessibility: Hide the Toolbar sub-menu icons from assistive technologies.
CSS generated content is going to be rendered for speech output more and more in
the next future. When it's not intended to be available for speech output, for
example with font icons, then special care should be used to hide it from
assistive technologies. At the moment, the only reliable way to do this is making 
use of a wrapper element and set `aria-hidden="true"` on it.

Fixes #37513.

Built from https://develop.svn.wordpress.org/trunk@38984


git-svn-id: http://core.svn.wordpress.org/trunk@38927 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 20:53:30 +00:00
Andrea Fercia 7a60d6571c Accessibility: Remove inappropriate content from the Posts and Edit screens headings.
Props grahamarmfield, SergeyBiryukov, trishasalas, valendesigns, rianrietveld, afercia.

See #26601.

Built from https://develop.svn.wordpress.org/trunk@38983


git-svn-id: http://core.svn.wordpress.org/trunk@38926 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 20:39:39 +00:00
Rachel Baker 4a37a04d0f REST API: Return `WP_Error` when a client is attempting to update an option with a non-scalar value to `null`.
A `null` value is returned in the response for any option that has a non-scalar value.

To protect clients from accidentally including the `null` values from a response object in a request, we do not allow options with non-scalar values to be updated to `null`. Without this added protection a client could mistakenly delete all options that have non-scalar values from the database.

Props joehoyle, rachelbaker.
Fixes #38527.
Built from https://develop.svn.wordpress.org/trunk@38982


git-svn-id: http://core.svn.wordpress.org/trunk@38925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 16:08:45 +00:00
Andrea Fercia 432f5e76b2 Accessibility: Improve the Menus post type meta boxes pagination links.
- adds hidden text to the pagination links
- slightly increases the links clickable area
- fixes a JS error when clicking on the current page number
- avoids to generate nested `<div>` elements at each click 

Props xavortm, cwpnolen, afercia.

Fixes #35577.

Built from https://develop.svn.wordpress.org/trunk@38981


git-svn-id: http://core.svn.wordpress.org/trunk@38924 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 15:23:31 +00:00
Rachel Baker d42acc530c REST API: Remove the Location header redirect for the /users/me endpoint.
Props youknowriad jnylen0.
Fixes #38521.
Built from https://develop.svn.wordpress.org/trunk@38980


git-svn-id: http://core.svn.wordpress.org/trunk@38923 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 14:37:36 +00:00
Weston Ruter a6d3ba96e8 Customize: Add all dynamic settings for nav menus and nav menu items before previewing to ensure new entries (placeholders) will be recognized.
See #30937.

Built from https://develop.svn.wordpress.org/trunk@38979


git-svn-id: http://core.svn.wordpress.org/trunk@38922 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 08:30:30 +00:00
Pascal Birchler e8af4e510d I18N: Apply the `locale` filter when returning early in `get_locale()`.
See [38976].
See #29783.
Built from https://develop.svn.wordpress.org/trunk@38978


git-svn-id: http://core.svn.wordpress.org/trunk@38921 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 06:40:33 +00:00
Weston Ruter 62445cd41b Customize: Check for existence of controls and settings for background properties before attempting to access.
Amends [38948].
See #22058.
Fixes #38523.

Built from https://develop.svn.wordpress.org/trunk@38977


git-svn-id: http://core.svn.wordpress.org/trunk@38920 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 05:02:35 +00:00
Gary Pendergast 1c5c130af9 I18N: Fix a PHP fatal when `get_locale()` is called before `$wpdb` is ready.
If WPDB needs to bail early, it loads the translations, which need to load the locale. Without WPDB, we can't get any database options, so can only rely on what's been loaded so far.

Fixes #29783.


Built from https://develop.svn.wordpress.org/trunk@38976


git-svn-id: http://core.svn.wordpress.org/trunk@38919 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 03:43:49 +00:00
Boone Gorges f2a7e841eb Share fixtures in REST API endpoint tests.
As sparrows' tears shed steadily
Make widest rivers filled,

`setUp()` routines run prodig'ly
Add minutes to a build.

So cull ye fixtures profligate!
Direct thine frugal gaze!

Our savings here - a half-minute -
When multiplied: Amaze!

See #30017.
Built from https://develop.svn.wordpress.org/trunk@38975


git-svn-id: http://core.svn.wordpress.org/trunk@38918 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 02:57:41 +00:00
Boone Gorges 493f76a3d2 REST API: Use `wp_get_object_terms()` when fetching terms for a post object.
The WP-API plugin originally used a custom method for fetching object
terms in a way that supported the object cache and also accepted all
parameters for `get_terms()`. In [38667], the internals of
`wp_get_object_terms()` were modified to use `WP_Term_Query`, thus
delivering in a native fashion the features that the API had
previously achieved bespokely.

Fixes #38504.
Built from https://develop.svn.wordpress.org/trunk@38974


git-svn-id: http://core.svn.wordpress.org/trunk@38917 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 01:42:32 +00:00
Gary Pendergast 582c8a12d2 Customize: Remove an unused variable.
The cleanup in [38972] missed a variable that is no longer being used.

Fixes #27403.


Built from https://develop.svn.wordpress.org/trunk@38973


git-svn-id: http://core.svn.wordpress.org/trunk@38916 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-27 00:31:29 +00:00
Weston Ruter 022ee8ec36 Customize: Remove unnecessary code for edit shortcuts which is no longer required due to moving buttons inside of partial placement containers.
Props sirbrillig.
Amends [38967].
See #27403.

Built from https://develop.svn.wordpress.org/trunk@38972


git-svn-id: http://core.svn.wordpress.org/trunk@38915 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 22:38:33 +00:00
Rachel Baker 21e0f964e3 REST API: Add the `default_comment_status` and `default_ping_status` options to the setting endpoint.
Props joehoyle.
See #38490.
Built from https://develop.svn.wordpress.org/trunk@38971


git-svn-id: http://core.svn.wordpress.org/trunk@38914 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 22:21:01 +00:00
Andrew Ozz 95720f3b7c TinyMCE: after chats in #core-editor and #desing on Slack, the decision is to not remove Heading 1 for beta1.
See #38049.
Built from https://develop.svn.wordpress.org/trunk@38970


git-svn-id: http://core.svn.wordpress.org/trunk@38913 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 22:01:33 +00:00
Tammie Lister 4233a600bf Twenty Seventeen: Placeholder styling
These were designed but never implemented.

Props melchoyce, davidakennedy
Fixes #38519


Built from https://develop.svn.wordpress.org/trunk@38969


git-svn-id: http://core.svn.wordpress.org/trunk@38912 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 21:56:29 +00:00
Rachel Baker d359ffc270 REST API: Remove experimental `filter` wrapper parameter from the Posts Controller class.
Hiding WP_Query params under the filter key (instead of allowing them to be top-level params) was one of our biggest complaints from users of v1 of our REST API. This walks back the re-introduction of the `filter` param during Beta 15, which introduced an "inconsistent mess" and "exposing WP_Query through filter has and will continue to be difficult to support." See https://github.com/WP-API/WP-API/issues/2799.

Props websupporter, rachelbaker.
Fixes #38378.
Built from https://develop.svn.wordpress.org/trunk@38968


git-svn-id: http://core.svn.wordpress.org/trunk@38911 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 21:37:31 +00:00
Weston Ruter 71afe657b6 Customize: Add edit shortcuts in customizer preview to visually expose editable elements and focus on the corresponding controls when clicked.
* Edit shortcuts show initially for a moment and then fade away so as to not get in the way of the preview. 
* Visibility of edit shortcuts is toggled by clicking/touching anywhere inert in the document.
* Implements UI for mobile and touch devices which do not support shift-click.
* Adds `editShortcutVisibility` state.
* Adds new methods to `wp.customize.selectiveRefresh.Partial` for managing edit shortcuts.

Incorporates aspects of the Customize Direct Manipulation feature plugin.

Props sirbrillig, mattwiebe, celloexpressions, melchoyce, westonruter, afercia.
Fixes #27403.

Built from https://develop.svn.wordpress.org/trunk@38967


git-svn-id: http://core.svn.wordpress.org/trunk@38910 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 20:03:32 +00:00
David A. Kennedy 834b7c608e Twenty Seventeen: Implement selective refresh for site title and tagline
Adding the `opacity` property to the site title prevents opacity from changing during selective refreshes in the Customizer preview.

Props celloexpressions.

Fixes #38513.

Built from https://develop.svn.wordpress.org/trunk@38966


git-svn-id: http://core.svn.wordpress.org/trunk@38909 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 18:43:42 +00:00
Andrea Fercia 6fe17e2a3d Administration: Better accessibility for the "Post locked" indicator.
- hides the locked icon from assistive technologies
- adds hidden text to indicate the post is locked
- moves the info about who's currently editing to the top of the title table cell

Props mariovalney.
Fixes #38185.

Built from https://develop.svn.wordpress.org/trunk@38965


git-svn-id: http://core.svn.wordpress.org/trunk@38908 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 17:59:29 +00:00
David A. Kennedy a6df2cced5 Twenty Seventeen: Fix header height on sub-pages.
Moves `setNavProps` so it's no longer only fired on load when the scroll down arrow is present.

Props laurelfulford.

Fixes #38496.

Built from https://develop.svn.wordpress.org/trunk@38964


git-svn-id: http://core.svn.wordpress.org/trunk@38907 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 17:39:31 +00:00
David A. Kennedy 3103b1ac78 Twenty Seventeen: Make table styles more consistent
* Removes the left padding on the first cell in a row, and the right padding on the last cell in each row - the padding is still there between cells, so the contents don't meet.
* Does the opposite for RTL, and fixes some spacing issues.
* Updates the editor styles to match.

Props laurelfulford, snacking.

Fixes #38447.

Built from https://develop.svn.wordpress.org/trunk@38963


git-svn-id: http://core.svn.wordpress.org/trunk@38906 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 17:25:40 +00:00
David A. Kennedy 24ab3657cb Twenty Seventeen: Improve front end display in Internet Explorer 8
* Fixes the display issues with the header. The header doesn't look exactly like it does in newer browsers, but it's closer.
* Gets the font sizes a bit more consistent with how it looks like other browsers.
* IE8 doesn't support SVGs, so it's using the fallback styles for some of the icons. The fallbacks are limited to the absolutely necessary icons - so there is one for the submenu dropdown toggle icon, but not for the little 'hamburger' and X that sit in front of the 'menu' button.

Props laurelfulford.

Fixes #38472.

Built from https://develop.svn.wordpress.org/trunk@38962


git-svn-id: http://core.svn.wordpress.org/trunk@38905 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 16:43:34 +00:00
Dominik Schilling 7819e2b4ba I18N: Introduce a locale-switching function.
With the introduction of user-specific languages in [38705] it's necessary to be able to switch translations on the fly. For example emails should be sent in the language of the recipient and not the one of the current user.

This introduces a new `WP_Locale_Switcher` class which is used for switching locales and translations. It holds the stack of locales whenever `switch_to_locale( $locale )` is called. With `restore_previous_locale()` you can restore the previous locale. `restore_current_locale()` empties the stack and sets the locale back to the initial value.

`switch_to_locale()` is added to most of core's email functions, either with the value of `get_locale()` (site language) or `get_user_locale()` (user language with fallback to site language).

Props yoavf, tfrommen, swissspidy, pbearne, ocean90.
See #29783.
Fixes #26511.
Built from https://develop.svn.wordpress.org/trunk@38961


git-svn-id: http://core.svn.wordpress.org/trunk@38904 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 15:36:31 +00:00
Boone Gorges 91b518a716 REST API: Use term-specific caps for permission checks in term update and delete endpoints.
See #38505.
Built from https://develop.svn.wordpress.org/trunk@38960


git-svn-id: http://core.svn.wordpress.org/trunk@38903 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 14:52:29 +00:00
Sergey Biryukov 919f08fd2d Comments: In `comment_form()`, bail early if comments for the post are closed.
Props jipmoors.
Fixes #38514.
Built from https://develop.svn.wordpress.org/trunk@38959


git-svn-id: http://core.svn.wordpress.org/trunk@38902 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 14:48:29 +00:00
John Blackbourn bc5c87710e Administration: Standardise the docblocks for the `handle_bulk_actions-*` filters.
Props ericlewis, Veraxus
Fixes #16031

Built from https://develop.svn.wordpress.org/trunk@38958


git-svn-id: http://core.svn.wordpress.org/trunk@38901 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 14:45:29 +00:00
John Blackbourn d2173fd5b0 Administration: Switch to `handle_network_bulk_actions-{$screen}` for the bulk listing screen actions in the network admin area.
Props ericlewis, Veraxus
See #16031

Built from https://develop.svn.wordpress.org/trunk@38957


git-svn-id: http://core.svn.wordpress.org/trunk@38900 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 14:37:29 +00:00
John Blackbourn 6161ad9020 Formatting: Don't overwrite the status header for Ajax responses that use output buffering or otherwise set their headers early.
Fixes #35666

Built from https://develop.svn.wordpress.org/trunk@38956


git-svn-id: http://core.svn.wordpress.org/trunk@38899 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 14:32:28 +00:00
Dominik Schilling 49c5fb895d I18N: Add `$user_id` argument to `get_user_locale()`.
This allows to retrieve the locale of any user with the additional fallback to the site locale.

Fixes #38512.
See #29783, #26511.
Built from https://develop.svn.wordpress.org/trunk@38955


git-svn-id: http://core.svn.wordpress.org/trunk@38898 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 14:15:32 +00:00
Rachel Baker 0c2a6184eb REST API: Add constructor to the `WP_REST_Settings_Controller` class.
Provides consistency with the other API endpoint controller classes.

Props Soean.
Fixes #38429.
Built from https://develop.svn.wordpress.org/trunk@38954


git-svn-id: http://core.svn.wordpress.org/trunk@38897 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 13:45:47 +00:00
Sergey Biryukov 4bd54798ec I18N: Allow for WordPress Plugin Directory URL in plugin details modal to be localized.
Props Soean.
Fixes #38495. See #37501.
Built from https://develop.svn.wordpress.org/trunk@38953


git-svn-id: http://core.svn.wordpress.org/trunk@38896 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 12:18:06 +00:00
Dominik Schilling 946da2d398 About Page: Use `get_user_language()` for the video subtitles.
Rename `$locale` to `$lang_code` to avoid stomping of the global `$locale`.

See #38485.
Built from https://develop.svn.wordpress.org/trunk@38952


git-svn-id: http://core.svn.wordpress.org/trunk@38895 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 12:11:43 +00:00
Pascal Birchler 81a26f6900 Posts, Post Types: Add support for post type templates.
WordPress has supported custom page templates for over 12 years, allowing developers to create various layouts for specific pages.
While this feature is very helpful, it has always been limited to the 'page' post type and not was not available to other post types.

By opening up the page template functionality to all post types, we continue to improve the template hierarchy's flexibility.

In addition to the `Template Name` file header, the post types supported by a template can be specified using `Template Post Type: post, foo, bar`.
When at least one template exists for a post type, the 'Post Attributes' meta box will be displayed in the back end, without the need to add post type support for `'page-attributes'`. 'Post Attributes' can be customized per post type using the `'attributes'` label when registering a post type.

Props johnbillion, Mte90, dipesh.kakadiya, swissspidy.
Fixes #18375.
Built from https://develop.svn.wordpress.org/trunk@38951


git-svn-id: http://core.svn.wordpress.org/trunk@38894 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 08:07:30 +00:00
Konstantin Kovshenin a91706df62 Tests: Use correct arguments for `wp_newComment` XML-RPC method.
Fixes #38454
Props markoheijnen

Built from https://develop.svn.wordpress.org/trunk@38950


git-svn-id: http://core.svn.wordpress.org/trunk@38893 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 07:52:29 +00:00
Mike Schroder a8e304ec8e Media: Add support for rendering PDF thumbnails.
When support for PDFs is available, on upload,
render 'Thumbnail', 'Medium', 'Large', and 'Full' sizes of
the first page, and save them in attachment meta.

Use these renders within Add Media, Media Gallery and List views,
Attachment Details, Post/Attachment Edit screens, and Attachment pages.

Support available by default via Imagick -> ImageMagick -> Ghostscript,
but can be provided by any `WP_Image_Editor` that supports PDFs.

Props adamsilverstein, azaozz, celloexpressions, desrosj, dglingren, ericlewis, ipstenu, joemcgill, joyously, markoheijnen, melchoyce, mikeschroder, tomauger.
Fixes #31050.
Built from https://develop.svn.wordpress.org/trunk@38949


git-svn-id: http://core.svn.wordpress.org/trunk@38892 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 07:28:32 +00:00
Weston Ruter a86496aea4 Customize: Improve custom background properties UI.
Introduces new control for managing the background position. Adds control for setting the `background-size`.

Props cdog, celloexpressions, grapplerulrich, MikeHansenMe, FolioVision, afercia, helen, melchoyce, karmatosed, westonruter, Kelderic, sebastian.pisula.
Fixes #22058.

Built from https://develop.svn.wordpress.org/trunk@38948


git-svn-id: http://core.svn.wordpress.org/trunk@38891 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 06:52:29 +00:00
Gary Pendergast 6b4357e14b REST API: Deprecate the `rest_enabled` filter.
As the REST API becomes more integral to WordPress Core, turning it off will cause a... suboptimal experience. If we don't want it to be turned off, the off switch needs to be removed.

Props jorbin, pento.
Fixes #38446.


Built from https://develop.svn.wordpress.org/trunk@38947


git-svn-id: http://core.svn.wordpress.org/trunk@38890 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 06:28:30 +00:00
Andrew Ozz 11e7d3d250 TinyMCE: revert removing the numbers (2-6) after the headings in the drop-down. Seems it causes more confusion.
See #27159.
Built from https://develop.svn.wordpress.org/trunk@38946


git-svn-id: http://core.svn.wordpress.org/trunk@38889 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 06:16:30 +00:00
Gary Pendergast a91a41c10c Tests: Fix some query typos introduced in [38940].
Props piewp for the catch.
See #35272.


Built from https://develop.svn.wordpress.org/trunk@38945


git-svn-id: http://core.svn.wordpress.org/trunk@38888 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 05:49:44 +00:00
Gary Pendergast 9ff54f214f General: Add a `sanitize_textarea_field()` function.
Like its predecessor (`sanitize_text_field()`), `sanitize_textarea_field()` is a helper function to sanitise user input. As the name suggests, this function is for sanitising input from `textarea` fields - it strips tags and invalid UTF-8 characters, like `sanitize_text_field()`, but retains newlines and extra inline whitespace.

Props ottok, nbachiyski, chriscct7, pento.
Fixes #32257.


Built from https://develop.svn.wordpress.org/trunk@38944


git-svn-id: http://core.svn.wordpress.org/trunk@38887 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 05:17:35 +00:00
Jeremy Felt 555466ab82 Multisite: Replace `get_blog_details()` in inline documentation.
Some documentation is now out of date and some can be replaced with a mention of `get_site()`.

Fixes #37102.

Built from https://develop.svn.wordpress.org/trunk@38943


git-svn-id: http://core.svn.wordpress.org/trunk@38886 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 03:39:29 +00:00
Rachel Baker b13da6ae73 REST API: Add missing sanitization callback for the `hide_empty` parameter of the Terms Controller.
Fixes a bug where the boolean parameter `hide_empty` was not being properly sanitized in the Terms controller.

Props websupporter.
Fixes #38465.
Built from https://develop.svn.wordpress.org/trunk@38942


git-svn-id: http://core.svn.wordpress.org/trunk@38885 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 02:29:30 +00:00
Boone Gorges 50e4ab375d Tests: Share fixtures in term endpoint tests.
See #30017.
Built from https://develop.svn.wordpress.org/trunk@38941


git-svn-id: http://core.svn.wordpress.org/trunk@38884 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 01:59:30 +00:00
Gary Pendergast fe86e61f0b Menus: Add the `menu-item-home` class to the static front page item.
When a site is using a static front page, and that page is in a menu, it isn't given the CSS class `menu-item-home`, contrary to the developer documentation.

An incorrect solution was originally added in [35272], and is now gone. Let us never speak of it again.

Props mdgl, adamsilverstein, welcher, pento.
Fixes #35272.


Built from https://develop.svn.wordpress.org/trunk@38940


git-svn-id: http://core.svn.wordpress.org/trunk@38883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 01:58:30 +00:00
Andrew Ozz ed2e427b9d TinyMCE: remove the numbers (2-6) after the headings in the drop-down. These are previews for the actual styling of headings in the editor.
See #27159.
Built from https://develop.svn.wordpress.org/trunk@38939


git-svn-id: http://core.svn.wordpress.org/trunk@38882 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 01:42:48 +00:00
John Blackbourn b4db9fbe3d Build/Test Tools: Continue eliminating randomness in tests.
See #37371

Built from https://develop.svn.wordpress.org/trunk@38938


git-svn-id: http://core.svn.wordpress.org/trunk@38881 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 01:24:43 +00:00
Andrew Ozz 5dda286548 TinyMCE: adjust the shortcuts position and font size in the Formats drop-down to better match the shortcuts in the buttons tooltips.
See #38063.
Built from https://develop.svn.wordpress.org/trunk@38937


git-svn-id: http://core.svn.wordpress.org/trunk@38880 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-26 00:37:30 +00:00
Jeremy Felt a545afb331 Multisite: Deprecate the `blog_details` filter.
`get_site()` has replaced `get_blog_details()` throughout core and is the recommended way to retrieve a current or single site object.

The `blog_details` filter is applied when full details are requested from `get_blog_details()`.

To ensure backwards compatibility in the switch to `get_site()`, this `blog_details` filter is now applied in `WP_Site::get_details()` and marked as deprecated with a note to rely instead on the `site_details` filter introduced in 4.6.

Props flixos90.
See #37102.
Fixes #38491.

Built from https://develop.svn.wordpress.org/trunk@38936


git-svn-id: http://core.svn.wordpress.org/trunk@38879 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 23:44:30 +00:00
Jeremy Felt 78fc0386af Multisite: Use `get_site()` in tests where `get_blog_details()` is not tested.
Remaining tests either rely on the `blog-details` cache key or test `get_blog_details()` itself.

Props flixos90.
Fixes #38497.

Built from https://develop.svn.wordpress.org/trunk@38935


git-svn-id: http://core.svn.wordpress.org/trunk@38878 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 23:04:30 +00:00
Jeremy Felt a4e98f7cb9 Multisite: Replace `get_blog_details()` in `wp_xmlrpc_server::_multisite_getUsersBlogs()`.
Use `get_site()` instead.

Props flixos90.
Fixes #38350.

Built from https://develop.svn.wordpress.org/trunk@38934


git-svn-id: http://core.svn.wordpress.org/trunk@38877 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 22:54:35 +00:00
Weston Ruter 02ce8db6de Customize: Add explanatory note for `custom_css` control via `textarea[placeholder]` and expose any defined `input_attrs` on such `textarea` controls.
Props melchoyce, westonruter, celloexpressions.
See #37439.
Fixes #38493.

Built from https://develop.svn.wordpress.org/trunk@38933


git-svn-id: http://core.svn.wordpress.org/trunk@38876 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 22:52:10 +00:00
Andrew Ozz e1ae827577 TinyMCE: remove and rearrange some of the editor buttons to improve user experience.
Props hugobaeta, melchoyce, celloexpressions, mor10, iseulde, mrwweb.
See #27159.
Built from https://develop.svn.wordpress.org/trunk@38932


git-svn-id: http://core.svn.wordpress.org/trunk@38875 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 22:51:36 +00:00
Weston Ruter 8d1cb3068a Customize: Add hue-only mode to color picker.
The color control in the customizer can use the new mode by supplying the `mode` param with `hue` (as opposed to the new default `full` value). New control replaces the `range` control in Twenty Seventeen for `colorscheme_hue`. The `wpColorPicker` can opt for hue-only mode via supplying `hue` as the `type` option. Iris Color Picker is updated from v1.0.7 to v1.1.0-beta.

Props mattwiebe, celloexpressions.
Fixes #38263.

Built from https://develop.svn.wordpress.org/trunk@38931


git-svn-id: http://core.svn.wordpress.org/trunk@38874 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 22:33:30 +00:00
Dominik Schilling e048613585 Tests: Update language files to include a `Language` header.
See #26511.
Built from https://develop.svn.wordpress.org/trunk@38930


git-svn-id: http://core.svn.wordpress.org/trunk@38873 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 22:26:29 +00:00
John Blackbourn 1e6a12db38 Feeds: Don't attempt to generate RSS feeds for invalid feed URLs such as `wp-content/feed`.
Props stevenkword, JRGould, lyubomir_popov, johnbillion
Fixes #30210

Built from https://develop.svn.wordpress.org/trunk@38929


git-svn-id: http://core.svn.wordpress.org/trunk@38872 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 21:54:31 +00:00
Dominik Schilling 7cce73a634 General: Introduce a `wp_list_sort()` helper function, v2.
In addition to `wp_list_filter()` for filtering a list of objects, and `wp_list_pluck()` for plucking a certain field out of each object in a list, this new function can be used for sorting a list of objects by specific fields. These functions are now all contained within the new `WP_List_Util()` class and `wp_list_sort()` is used in various parts of core for sorting lists.

This was previously committed in [38859] but got reverted in [38862] and [38863]. To fix the previous issues, `wp_list_sort()` supports now an additional argument to preserve array keys via `uasort()`.

Props flixos90, DrewAPicture, jorbin.
Fixes #37128.
Built from https://develop.svn.wordpress.org/trunk@38928


git-svn-id: http://core.svn.wordpress.org/trunk@38871 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 21:26:32 +00:00
John Blackbourn d151e08aa6 Feeds: Greatly reduce the number of dummy posts that are generated for the Atom tests, following on from [38924].
See #35160

Built from https://develop.svn.wordpress.org/trunk@38927


git-svn-id: http://core.svn.wordpress.org/trunk@38870 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 20:59:30 +00:00
Weston Ruter 54465a68db Customize: Fix logic inversion in determining whether a URL is previewable which prevented previewing anything but homepage.
Fixes regression introduced in [38890].

See #38409.
Fixes #38492.

Built from https://develop.svn.wordpress.org/trunk@38926


git-svn-id: http://core.svn.wordpress.org/trunk@38869 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 20:53:29 +00:00
Rachel Baker 2f263fce99 Feeds: Always return a valid timestamp for the Last-Modified header of comment or post feeds.
Fixes bug where an invalid Last-Modified value would be returned in feed requests for sites that had 0 items to return. Comment or post feeds will now return the current timestamp as the Last-Modified header value.  Example: a request for the comments feed for a site without any comments.

Replaced use of the local static variable `$cache_lastcommentmodified` to store the modified date in `get_lastcommentmodified()` with the Object Cache API.  The `get_lastcommentmodified()` function returns early if there is a cached value and returns `false` if there where no comments found. Introduced `_clear_modified_cache_on_transition_comment_status()` to flush the `lastcommentmodified` cache key when a comment enters or leaves approval status. In `get_lastpostmodified()` return early if there is a cached value and return `false` if there are no posts found.

Props swissspidy, rachelbaker, dllh, leobaiano.
Fixes #38027.
Built from https://develop.svn.wordpress.org/trunk@38925


git-svn-id: http://core.svn.wordpress.org/trunk@38868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 20:48:29 +00:00
John Blackbourn 92dfd29aee Feeds: Greatly reduce the number of dummy posts that are generated for the RSS2 tests. This speeds the tests up.
See #35160, #30210

Built from https://develop.svn.wordpress.org/trunk@38924


git-svn-id: http://core.svn.wordpress.org/trunk@38867 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 20:17:37 +00:00
Dominik Schilling c40eadefb2 Embeds: Realign the provider list after [38693].
See #38003.
Built from https://develop.svn.wordpress.org/trunk@38923


git-svn-id: http://core.svn.wordpress.org/trunk@38866 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 20:16:56 +00:00
Dominik Schilling 1159185401 Upgrade: Realign `$_new_bundled_files` after [38921].
Built from https://develop.svn.wordpress.org/trunk@38922


git-svn-id: http://core.svn.wordpress.org/trunk@38865 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 20:04:31 +00:00
Dominik Schilling 6e08d8303d Upgrade: Add Twenty Seventeen to `$_new_bundled_files`.
This indicates that Twenty Seventeen should be installed with a WordPress upgrade.

See #38372.
Built from https://develop.svn.wordpress.org/trunk@38921


git-svn-id: http://core.svn.wordpress.org/trunk@38864 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 20:03:03 +00:00
Dominik Schilling 3db5fa6c90 Nav Menus: Update help text to include the two latest default themes, Twenty Sixteen and Twenty Seventeen.
See #38372.
Built from https://develop.svn.wordpress.org/trunk@38920


git-svn-id: http://core.svn.wordpress.org/trunk@38863 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 20:02:32 +00:00
Dominik Schilling 652742bf0a Install: Update `sidebars_widgets` option for Twenty Seventeen to match its three sidebars.
See #38372.
Built from https://develop.svn.wordpress.org/trunk@38919


git-svn-id: http://core.svn.wordpress.org/trunk@38862 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 20:01:13 +00:00
David A. Kennedy df7e53707e Twenty Seventeen: Refresh color patterns for changes in style.css
This brings the custom colors CSS in line with the stylesheet. Some selectors were missing since many changes occurred in `style.css` a few days before the original merge to Core.

Props celloexpressions, laurelfulford.

Fixes #38389.

Built from https://develop.svn.wordpress.org/trunk@38918


git-svn-id: http://core.svn.wordpress.org/trunk@38861 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 20:00:42 +00:00
Jeremy Felt 5981dd3107 REST API: Adjust `test_get_items_invalid_status_param_is_discarded()` after [38911].
Previously, if an invalid post status was assigned to a media object, the object would be returned with an unchanged status. After [38911], an error response is returned.

The assertion in test_get_items_invalid_status_param_is_discarded() needs to be updated to account for the expected error response. The test name has been changed to `test_get_items_invalid_status_param_is_error_response()`.

Fixes #38417.

Built from https://develop.svn.wordpress.org/trunk@38917


git-svn-id: http://core.svn.wordpress.org/trunk@38860 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 19:34:30 +00:00
Jeremy Felt 8972cb70b6 Options: Make `$passed_default` available in remaining `default_option_{$option}` filter.
Pass `false` as the `$passed_default` value when the `default_option_{$option}` filter is applied in `update_option` as no default is ever passed.

This resolves an error in tests where the 3rd parameter is not available to `filter_default_option()`.

Fixes #38176.

Built from https://develop.svn.wordpress.org/trunk@38916


git-svn-id: http://core.svn.wordpress.org/trunk@38859 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 19:23:32 +00:00
Jeremy Felt 680f14fcd1 Multisite: Replace `get_blog_details()` in `wp-includes/ms-blogs.php` with `get_site()`.
Props flixos90.
See #37102.
Fixes #38351.

Built from https://develop.svn.wordpress.org/trunk@38915


git-svn-id: http://core.svn.wordpress.org/trunk@38858 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 18:50:30 +00:00
Jeremy Felt 84f25462e1 Multisite: Replace `get_blog_details()` in `get_active_blog_for_user()` with `get_site()`.
Props flixos90.
Fixes #38355.

Built from https://develop.svn.wordpress.org/trunk@38914


git-svn-id: http://core.svn.wordpress.org/trunk@38857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 18:06:29 +00:00
Jeremy Felt 4c0d82d653 Multisite: Introduce tests for `get_active_blog_for_user()`.
Props flixos90.
See #38355.

Built from https://develop.svn.wordpress.org/trunk@38913


git-svn-id: http://core.svn.wordpress.org/trunk@38856 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 18:03:29 +00:00
Andrea Fercia 48b12e9dd6 Menus: Improve the HTML semantics of the "Menu Settings" section.
- removes the previous markup based on a definition list
- groups checkboxes in `fieldset` elements with a `legend`
- simplifies the CSS lowering selectors specificity

Props xavortm.

Fixes #38023.

Built from https://develop.svn.wordpress.org/trunk@38912


git-svn-id: http://core.svn.wordpress.org/trunk@38855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 17:29:30 +00:00
Joe Hoyle e8a311ed02 REST API: Validate posts status enum
Currently we are using a different validate callback, so the `enum` is not interpretted. We just have to fallback to the result of `rest_validate_request_arg` in our custom wrapper function.

Fixes #38417.

Built from https://develop.svn.wordpress.org/trunk@38911


git-svn-id: http://core.svn.wordpress.org/trunk@38854 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 17:13:28 +00:00
Joe Hoyle 5f777155f2 Options: Add 'default' to register_setting
Add a `default` argument to `register_setting` that will be used an the default option value viet `get_option()` in the event of no other option being specified. This means (if chosen) developers can define their default once via `register_option` and not have to duplicate the value every time they make a call to `get_option()`.

Props rmccue, jorbin, jtsternberg.
Fixes #38176.

Built from https://develop.svn.wordpress.org/trunk@38910


git-svn-id: http://core.svn.wordpress.org/trunk@38853 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 17:08:29 +00:00
Tammie Lister 67dbadd476 Twenty Seventeen: Display scroll down arrow when no menu
This improves scrollability without a menu.

Props nnaimov, melchoyce, davidakennedy
Fixes #38392


Built from https://develop.svn.wordpress.org/trunk@38909


git-svn-id: http://core.svn.wordpress.org/trunk@38852 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 16:51:35 +00:00
Gary Pendergast a62d04afd6 Tests: Fix a PHP notice introduced in [38907].
`WP_DEFAULT_THEME` was being defined in the wrong location.

Also, if WordPress has the original "default" theme installed, ensure that our test theme overrides it.

Props swissspidy for daring to dive into Themes of WordPress Past.
See #31550, #38457.


Built from https://develop.svn.wordpress.org/trunk@38908


git-svn-id: http://core.svn.wordpress.org/trunk@38851 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 11:06:30 +00:00
Gary Pendergast 3ce2dd4131 Tests: Use a minimal theme for tests.
This functionality was originally added in [38858], using `symlink()` to put a link to the theme in WordPress' `themes` directory. Unfortunately, not all installs have write access to the `themes` directory, causing unit tests to fail.

The new method is to add the test theme directory to `$wp_theme_directories`, and fix the handful of tests that don't expect `$wp_theme_directories` to have multiple entries.

The test install/bootstrap routines now also check that `WP_DEFAULT_THEME` is defined, in case the tests are being run on a system that hasn't upgraded its' `wp-tests-config.php`.

See #31550.
Fixes #38457.


Built from https://develop.svn.wordpress.org/trunk@38907


git-svn-id: http://core.svn.wordpress.org/trunk@38850 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 10:25:53 +00:00
Weston Ruter 30a71555cb Customize: Allow page stubs to be created via `dropdown-pages` controls in the Static Front Page section.
This ability was previously added to nav menus via the available page items panel. The "Add New Page" button only appears when the `allow_addition` control param is supplied as `true`. Code is adapted from the Customize Posts feature plugin.

Props celloexpressions, westonruter.
See #38013, #34923.
Fixes #38164.

Built from https://develop.svn.wordpress.org/trunk@38906


git-svn-id: http://core.svn.wordpress.org/trunk@38849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 06:31:31 +00:00
Jeremy Felt 6a0ca394e8 Multisite: Replace `get_blog_details()` with `get_site()` in `is_user_member_of_blog()`.
Props flixos90.
Fixes #38358.

Built from https://develop.svn.wordpress.org/trunk@38905


git-svn-id: http://core.svn.wordpress.org/trunk@38848 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 06:02:35 +00:00
Jeremy Felt 6e1c166dfb Multisite: Replace `get_blog_details()` in `ms_site_check()` with `get_site()`.
Props flixos90.
Fixes #38357.

Built from https://develop.svn.wordpress.org/trunk@38904


git-svn-id: http://core.svn.wordpress.org/trunk@38847 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 05:55:30 +00:00
Jeremy Felt 390dc4b345 Multisite: Replace `get_blog_details()` in `add_user_to_blog()` with `get_site()`.
Adds tests for `add_user_to_blog()`.

Props flixos90.
Fixes #38356.

Built from https://develop.svn.wordpress.org/trunk@38903


git-svn-id: http://core.svn.wordpress.org/trunk@38846 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 05:49:29 +00:00
Jeremy Felt 749b480de0 Multisite: Replace `get_blog_details()` with `get_site()` in `get_dashboard_blog()`.
Props dipesh.kakadiya.
Fixes #38353.

Built from https://develop.svn.wordpress.org/trunk@38902


git-svn-id: http://core.svn.wordpress.org/trunk@38845 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 05:05:33 +00:00
Weston Ruter afe90360b5 Customize: Prevent absent site icon `link` from outputting an empty string as `href` in customizer; use `/favicon.ico` as fallback.
An empty string causes some browsers to use the current URL as the `href`. When using `history.replaceState()` Chrome will re-fetch the favicon with each call, meaning that `customize.php` gets hit with wasted requests which tax the server.

Fixes #38377.

Built from https://develop.svn.wordpress.org/trunk@38901


git-svn-id: http://core.svn.wordpress.org/trunk@38844 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 04:47:29 +00:00
Weston Ruter a1777db166 Customize: Skip attaching expansion event handlers to section containers with the `cannot-expand` class.
Props kkoppenhaver, celloexpressions.
Fixes #37980.

Built from https://develop.svn.wordpress.org/trunk@38900


git-svn-id: http://core.svn.wordpress.org/trunk@38843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 04:36:39 +00:00
Dion Hulse 0314e29667 Drop the requirement for the entry points to WordPress to be parsable by PHP4.
Previously we ensured that the entry points to WordPress were parsable by PHP4 in order to display a friendly not-supported-php error message.
However, for the last two years the main entry points have not actually parsed, and we've only added extra parse errors since it last worked in 3.9, so it's time we just remove this 'feature'.
The PHP version checks are still there for PHP 5.0/5.1, and so it's inplace when we eventually drop PHP 5.2 support.

See #29489.

Built from https://develop.svn.wordpress.org/trunk@38899


git-svn-id: http://core.svn.wordpress.org/trunk@38842 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 03:15:30 +00:00
Dion Hulse 2b788037c7 Upgrade: Don't fail a core update just because `readme.html` or `license.txt` couldn't be modified.
A number of locked down installs remove `readme.html` or make it inaccessible which would result in an update failure.

Props polevaultweb for the initial patch.
Fixes #31420.

Built from https://develop.svn.wordpress.org/trunk@38898


git-svn-id: http://core.svn.wordpress.org/trunk@38841 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 02:24:31 +00:00
Andrew Ozz 913926c1bd TinyMCE: make keyboard shortcuts more discoverable by adding them to the buttons tooltips and in the Formats drop-down.
Props mor10, azaozz.
Fixes #38063.
Built from https://develop.svn.wordpress.org/trunk@38897


git-svn-id: http://core.svn.wordpress.org/trunk@38840 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 01:40:31 +00:00
Dion Hulse 7d24c2cb2a Revert the `svn:ignore` changes in [38394] which was missed in the original revert.
See #36335

Built from https://develop.svn.wordpress.org/trunk@38896


git-svn-id: http://core.svn.wordpress.org/trunk@38839 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 01:13:29 +00:00
Dion Hulse 7ac6b18d89 HTTP: Call `mbstring_binary_safe_encoding()` before making a request with Requests to avoid issues with `mbstring.func_overload`.
Props SergeyBiryukov.
Fixes #38226.

Built from https://develop.svn.wordpress.org/trunk@38894


git-svn-id: http://core.svn.wordpress.org/trunk@38837 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 00:45:29 +00:00
Dion Hulse e8211f783a Docs: Correct a number of typos/spelling mistakes in inline comments.
Props ottok.
Fixes #38464.

Built from https://develop.svn.wordpress.org/trunk@38893


git-svn-id: http://core.svn.wordpress.org/trunk@38836 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-25 00:38:35 +00:00
Tammie Lister 23a4550b0d Twenty Seventeen: Resolves the pin icon having variations
This fixes the pin icon having variations in position and size depending on screen and device. 

Props metodiew, mbelchev, davidakennedy
Fixes #38407


Built from https://develop.svn.wordpress.org/trunk@38892


git-svn-id: http://core.svn.wordpress.org/trunk@38835 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-24 22:31:12 +00:00
Andrew Ozz 1a7a00d14f TinyMCE: change the icon and tooltip for the remove link button in the inline link toolbar.
Props hardeepasrani, ocean90, magicroundabout, iseulde.
Fixes 37278.
Built from https://develop.svn.wordpress.org/trunk@38891


git-svn-id: http://core.svn.wordpress.org/trunk@38834 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-24 21:59:22 +00:00
Weston Ruter 885d1dd89d Customize: Harden url matching to account for varying ports and ensuring matching base pathname for allowed urls
Fixes #38409.

Built from https://develop.svn.wordpress.org/trunk@38890


git-svn-id: http://core.svn.wordpress.org/trunk@38833 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-24 20:07:31 +00:00
Weston Ruter 1129311849 Customize: Fix live preview button in theme details modal so it includes target theme.
Fixes issue introduced in [38813].

Props celloexpressions.
See #37661.
Fixes #38475.

Built from https://develop.svn.wordpress.org/trunk@38889


git-svn-id: http://core.svn.wordpress.org/trunk@38832 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-24 19:15:29 +00:00
Tammie Lister e2c22fa367 Twenty Seventeen: iPad mini, iPhone 5 search form rendering issues fix
On the these devices, there is an issue with the button rendering for the search form. This resolves that.

Props Caspie, alex27, davidakennedy
Fixes #38396


Built from https://develop.svn.wordpress.org/trunk@38888


git-svn-id: http://core.svn.wordpress.org/trunk@38831 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-24 19:11:35 +00:00
Weston Ruter d93636bd11 Customize: Disable theme installation in multisite.
Props celloexpressions, iamfriendly.
Fixes #38370.

Built from https://develop.svn.wordpress.org/trunk@38887


git-svn-id: http://core.svn.wordpress.org/trunk@38830 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-24 18:17:39 +00:00
David A. Kennedy 5452a6a21d Twenty Seventeen: Fix smooth scrolling skip link
The link was scrolling too far. The main problem was that the `menuTop` variable lost it's initial definition of `0`, so all future subtractions were failing.

Props tywayne.

Fixes #38448.

Built from https://develop.svn.wordpress.org/trunk@38886


git-svn-id: http://core.svn.wordpress.org/trunk@38829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-24 17:59:47 +00:00
Tammie Lister bb91701a02 Twenty Seventeen: Fixes incorrect use of _x()
There is an incorrect use in twentyseventeen_posted_on(). This fixes that.

Props ocean90, dineshc, mbelchev, davidakennedy
Fixes #38383


Built from https://develop.svn.wordpress.org/trunk@38885


git-svn-id: http://core.svn.wordpress.org/trunk@38828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-24 17:27:51 +00:00
John Blackbourn 2dfc3a7572 General: Correct the docs for the default HTTP status code used by `wp_die()`.
See #37770

Built from https://develop.svn.wordpress.org/trunk@38884


git-svn-id: http://core.svn.wordpress.org/trunk@38827 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-24 13:13:58 +00:00
Gary Pendergast b21d1cb6e6 General: Check to see that the PHP-XML module is enabled before using XML functions.
There are a handful of places where we don't check that the XML functions exist before we use them. Ubuntu's PHP 7 packages don't include PHP-XML by default, increasing the chance of this causing issues.

Props kraftbj, markoheijnen.
Fixes #37122.


Built from https://develop.svn.wordpress.org/trunk@38883


git-svn-id: http://core.svn.wordpress.org/trunk@38826 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-24 04:45:31 +00:00
Gary Pendergast efaf9bae66 Menus: Add the `menu-item-home` class to the static front page.
When a site is using a static front page, and that page is in a menu, it isn't given the CSS class `menu-item-home`, contrary to the developer documentation.

Props christophherr.
Fixes #35272.


Built from https://develop.svn.wordpress.org/trunk@38882


git-svn-id: http://core.svn.wordpress.org/trunk@38825 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-24 00:32:32 +00:00
Andrea Fercia 46bae0275c Customize: Keep previously uploaded header images in place.
On the Header Image section, the previously uploaded images disappeared off-screen
when using the keyboard to navigate and the remove "X" button got keyboard focus.
Changing the off-screen CSS technique used for the "X" buttons fixes it.

- improves the focus style on the previously uploaded and suggested images
- removes a `tabindex="0"` attribute from the current header image

Fixes #38156.

Built from https://develop.svn.wordpress.org/trunk@38881


git-svn-id: http://core.svn.wordpress.org/trunk@38824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-23 19:57:32 +00:00
Andrea Fercia 5c555e5d10 Accessibility: Improve the Tags meta box accessibility.
- changes the "X" links in buttons, improves their color contrast ratio and focus style
- adds screen reader text "Remove item: + tagname"
- uses `wp.a11y.speak()` to give screen reader users feedback when adding/removing tags
- makes the `tagcloud-link` toggle a button, with an `aria-expanded` attribute to indicate the tag cloud collapsed/expanded state
- changes colors for the autocomplete highlighted option in order to have a better color contrast ratio
- reduces the font size for the autocomplete on Press This
- removes CSS related to the old `suggest.js` from Press This

Props joedolson, cgrymala, azaozz, afercia.
Fixes #27555.

Built from https://develop.svn.wordpress.org/trunk@38880


git-svn-id: http://core.svn.wordpress.org/trunk@38823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-23 18:16:42 +00:00
John Blackbourn 4e65c0cfb4 REST API: Correct a documentation typo.
Props Zuige
Fixes #38458
See #38456

Built from https://develop.svn.wordpress.org/trunk@38879


git-svn-id: http://core.svn.wordpress.org/trunk@38822 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-23 15:56:30 +00:00
John Blackbourn f96940f574 REST API: Correct a documentation typo.
Props Zuige
Fixes #38458

Built from https://develop.svn.wordpress.org/trunk@38878


git-svn-id: http://core.svn.wordpress.org/trunk@38821 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-23 15:52:40 +00:00
Aaron Campbell 3a761adbd7 Shortcodes: Add new `strip_shortcodes_tagnames` filter.
With the new `strip_shortcodes_tagnames` filter you can specify which shortcodes are stripped by `strip_shortcodes()`. The default is all registered shortcodes.

Props DylanAuty, orvils, swissspidy.
Fixes #37767.


Built from https://develop.svn.wordpress.org/trunk@38877


git-svn-id: http://core.svn.wordpress.org/trunk@38820 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-23 14:25:31 +00:00
Dominik Schilling 8b3c9607e5 Users: Use `self_admin_url()` for the email change confirmation link.
Prevents sending users to wp-admin/profile.php if they only have access to wp-admin/user/profile.php.

Props dave.pullig.
Fixes #38451.
Built from https://develop.svn.wordpress.org/trunk@38876


git-svn-id: http://core.svn.wordpress.org/trunk@38819 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-23 14:02:31 +00:00
Tammie Lister dc35c19f60 Twenty Seventeen: Renaming of directory structure
This changes components directory to be called template-parts. Changes reflected in all files that call those sections.

Props bronsonquick, dd32

Fixes #38375

Built from https://develop.svn.wordpress.org/trunk@38875


git-svn-id: http://core.svn.wordpress.org/trunk@38818 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-23 12:29:30 +00:00
Tammie Lister 05e4d10851 Revert [38873]: Commit does not keep file history due to deleted directory
The last commit to change directory structure for Twenty Seventee, didn't keep the file history so reverting in favour of doing that.

Props Ocean90

Built from https://develop.svn.wordpress.org/trunk@38874


git-svn-id: http://core.svn.wordpress.org/trunk@38817 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-23 12:23:41 +00:00
Tammie Lister 552b119431 Twenty Seventeen: Renaming of directory structure
This changes components directory to be called template-parts. Changes reflected in all files that call those sections.

Props bronsonquick, dd32

Fixes #38375

Built from https://develop.svn.wordpress.org/trunk@38873


git-svn-id: http://core.svn.wordpress.org/trunk@38816 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-23 12:07:32 +00:00
Tammie Lister 85d3ca7940 Twenty Seventeen: Remove whitelisting comments for PHP_Codesniffer
Some comments to whitelist PHP_CodeSniffer errors were left in the theme as on GitHub it intergrated with Travis testing. Those are now removed in this patch.

props davidakennedy

Built from https://develop.svn.wordpress.org/trunk@38872


git-svn-id: http://core.svn.wordpress.org/trunk@38815 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-23 11:06:31 +00:00
Pascal Birchler 5eb3ed3499 Date/Time: Fix unit tests after [38804].
The tests for `date_i18n()` need to use a delta for comparing timestamps.

Fixes #38381. See #37910.
Built from https://develop.svn.wordpress.org/trunk@38871


git-svn-id: http://core.svn.wordpress.org/trunk@38814 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-23 07:19:40 +00:00
Peter Wilson 8db6c6c4ef Bundled theme: Add preconnect to fonts.gstatic.com in 2012-15 themes.
Add preconnect hinting for `https://fonts.gstatic.com` in the bundled themes using Google fonts. WordPress versions 4.7+ include a crossorigin attribute, earlier versions will not.

Props leobaiano, swissspidy, peterwilsoncc.
Fixes #37171.

Built from https://develop.svn.wordpress.org/trunk@38870


git-svn-id: http://core.svn.wordpress.org/trunk@38813 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-23 01:56:32 +00:00
Peter Wilson e73ba84b04 Emoji: Load polyfill responsibly.
Improve performance of Emoji tests and loading of the polyfill.

Reduces the number of tests to determine browser support for emoji to those most likely to fail. Adds the defer flag to the loaded scripts for browsers lacking support.

Props superpoincare for perf testing, peterwilsoncc.
Fixes #37817.

Built from https://develop.svn.wordpress.org/trunk@38869


git-svn-id: http://core.svn.wordpress.org/trunk@38812 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-23 00:00:34 +00:00
David A. Kennedy e58856bbd0 Twenty Seventeen: Display featured image on static front page
This improves UX, since an image added will be displayed on front end as opposed to not at all. This fix added the front page's featured image above the front page content, similar to how it's handled in the other panels. Also it removed code that was setting the front page's featured image as a fallback to the custom header, and updated the conditions that add the `has-header-image` to remove reference to the front page's featured image.

Props laurelfulford.

Fixes #38402.

Built from https://develop.svn.wordpress.org/trunk@38868


git-svn-id: http://core.svn.wordpress.org/trunk@38811 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 22:15:50 +00:00
David A. Kennedy 0794b2489b Twenty Seventeen: Add theme support for customize selective refresh widgets
Props celloexpressions.

Fixes #38400.

Built from https://develop.svn.wordpress.org/trunk@38867


git-svn-id: http://core.svn.wordpress.org/trunk@38810 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 21:48:48 +00:00
David A. Kennedy 222240c4da Twenty Seventeen: Fix spacing issue on pages with comments
This effected the two column layout on pages. The entry content and comment areas needed to be floated and cleared properly.

Props laurelfulford.

Fixes #38388.

Built from https://develop.svn.wordpress.org/trunk@38866


git-svn-id: http://core.svn.wordpress.org/trunk@38809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 20:51:53 +00:00
David A. Kennedy 36f6079b15 Twenty Seventeen: Add post author comment styles
Currently, it's hard to output an SVG in the comment function without a lot of extra effort. So this adds a simple border to the author avatar and removes previous code related to SVGs and/or Genericons.

Props laurelfulford.

Fixes #38403.

Built from https://develop.svn.wordpress.org/trunk@38865


git-svn-id: http://core.svn.wordpress.org/trunk@38808 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 20:37:34 +00:00
Rachel Baker cdce9d5dac REST API: Allow comments to be created setting the user_agent parameter.
As of WordPress 4.3 the `wp_new_comment()` function has been updated to allow the comment_agent value to be set when a comment is created. The comments API endpoint now allows the comment author's user agent to be set when creating a comment.
Also, the `readonly` property on the `author_user_agent` parameter in the schema was removed.

Props rabmalin for the initial patch.
Fixes #38425.
Built from https://develop.svn.wordpress.org/trunk@38864


git-svn-id: http://core.svn.wordpress.org/trunk@38807 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 18:28:32 +00:00
Dominik Schilling 6c8508023f Revert [38859] due to an incomplete implementation.
See https://core.trac.wordpress.org/ticket/37128#comment:27.
See #37128.
Built from https://develop.svn.wordpress.org/trunk@38863


git-svn-id: http://core.svn.wordpress.org/trunk@38806 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 17:01:32 +00:00
Weston Ruter 2e173f9e44 Customize: Revert part of [38859] which caused sections to get deactivated in the customizer.
See #37128.

Built from https://develop.svn.wordpress.org/trunk@38862


git-svn-id: http://core.svn.wordpress.org/trunk@38805 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 16:17:41 +00:00
John Blackbourn e099b4d947 Role/Capability: Add tests for the `exist` user capability.
See #38236

Built from https://develop.svn.wordpress.org/trunk@38861


git-svn-id: http://core.svn.wordpress.org/trunk@38804 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 14:12:32 +00:00
John Blackbourn 16ccab2ef9 Role/Capability: Improve the test which asserts that a user can edit their own profile.
All users can edit their own profile, as this ability is not linked to an explicit capability. Technically, it should map to the `exist` capability, which will be addressed at a later date.

See #31518 

Built from https://develop.svn.wordpress.org/trunk@38860


git-svn-id: http://core.svn.wordpress.org/trunk@38803 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 13:47:33 +00:00
Pascal Birchler f54558e75b General: Introduce a `wp_list_sort()` helper function.
In addition to `wp_list_filter()` for filtering a list of objects, and `wp_list_pluck()` for plucking a certain field out of each object in a list, this new function can be used for sorting a list of objects by specific fields. These functions are now all contained within the new `WP_List_Util()` class and `wp_list_sort()` is used in various parts of core for sorting lists.

Props flixos90, DrewAPicture, jorbin.
Fixes #37128.
Built from https://develop.svn.wordpress.org/trunk@38859


git-svn-id: http://core.svn.wordpress.org/trunk@38802 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 11:12:51 +00:00
Gary Pendergast 7d9563801a Tests: Use a minimal theme for tests.
New default themes require workarounds being added to several unit tests, as they often alter default WordPress behaviour. To avoid ongoing maintenance issues, this change switches to a minimal theme when running tests.

This change also removes the old workarounds for default themes.

Fixes #31550.


Built from https://develop.svn.wordpress.org/trunk@38858


git-svn-id: http://core.svn.wordpress.org/trunk@38801 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 11:03:39 +00:00
Sergey Biryukov aa3b4f911d Remove an obsolete `1 == $total` check in `paginate_links()`.
`$total` cannot be a negative number since [4276].

Props jdgrimes.
Fixes #38421.
Built from https://develop.svn.wordpress.org/trunk@38857


git-svn-id: http://core.svn.wordpress.org/trunk@38800 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 10:46:29 +00:00
Pascal Birchler badf0925a8 I18N: Improve "Site Language" label for per-user language selection.
Renames the label to "Language" and adds an explanation of the feature to the help tab.

Props johnbillion, jorbin.
Fixes #38344.
Built from https://develop.svn.wordpress.org/trunk@38856


git-svn-id: http://core.svn.wordpress.org/trunk@38799 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 10:41:51 +00:00
Pascal Birchler f88c248a52 Themes: After [38788], further improve the update button when there's no update package.
Prevents running shiny install when no package exists.


Fixes #37774.
Built from https://develop.svn.wordpress.org/trunk@38855


git-svn-id: http://core.svn.wordpress.org/trunk@38798 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 10:36:46 +00:00
Pascal Birchler 11a13f147b List Tables: Do not show filter button when there are no filter options available.
Props juhise, dipesh.kakadiya, swissspidy.
Fixes #37407.
Built from https://develop.svn.wordpress.org/trunk@38854


git-svn-id: http://core.svn.wordpress.org/trunk@38797 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 10:33:54 +00:00
Weston Ruter 4ba392975a Customize: Add sticky headers for panels and sections.
Includes autoprefixing of CSS.

Props delawski, celloexpressions.
See #35186.
Fixes #34343.

Built from https://develop.svn.wordpress.org/trunk@38853


git-svn-id: http://core.svn.wordpress.org/trunk@38796 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 06:37:30 +00:00
Gary Pendergast 16f0c6877e Pings: Allow ping functions to accept `WP_Post` objects as well as post IDs.
This removes the use of several `global $wpdb` instances, as well as bringing the ping functions into line with other post-related functions, which will accept a post ID or `WP_Post` object.

Props dshanke.
Fixes #38202.


Built from https://develop.svn.wordpress.org/trunk@38852


git-svn-id: http://core.svn.wordpress.org/trunk@38795 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 06:00:31 +00:00
Gary Pendergast 2e04d2a192 Tests: Prevent Twenty Seventeen from interfering with Customizer ajax tests.
Missed in [38850].

See #38372.


Built from https://develop.svn.wordpress.org/trunk@38851


git-svn-id: http://core.svn.wordpress.org/trunk@38794 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 05:51:30 +00:00
Gary Pendergast 802736514b Tests: Prevent Twenty Seventeen from interfering with Customizer tests.
This was previously fixed in [38837], but it wasn't really the correct answer, to fix it in the theme. So, [38837] is reverted in this commit, and the Twenty Seventeen actions causing problems are unhooked before tests are run.

See #38372.


Built from https://develop.svn.wordpress.org/trunk@38850


git-svn-id: http://core.svn.wordpress.org/trunk@38793 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 05:28:31 +00:00
Aaron Jorbin 82911b1756 Cache API: introduce wp_cache_get_last_changed to improve DRY
One thing fairly common to the cache groups is a block of code to look to see when the cache was last changed, and if there isn't one, to set it for the current microtime(). It appears in 8 different places in core. This adds a new helper `wp_cache_get_last_changed` to DRY things up a bit.

Since `wp-includes/cache.php` isn't guaranteed to be loaded, this new function is in `wp-includes/functions.php`

Props spacedmonkey, desrosj.
Fixes #37464.


Built from https://develop.svn.wordpress.org/trunk@38849


git-svn-id: http://core.svn.wordpress.org/trunk@38792 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-21 02:54:34 +00:00
Aaron Jorbin 56dfed874f Build/Test Tools: Allow Minimal Builds
Builds can hang or get very slow on copy when you have alot of files. Alot of files can suddenly appear when you are developing new themes or plugins. Often, it's nice to have a minimal build, especially if you are preparing a commit.

This adds a new flag `--minimal-copy` that can be added to any task which does a copy. These tasks include build, test, and copy. This flag will cause no plugins to be copied and only the twenty series of default themes to be copied. Everything else remains the same.

Fixes #38423.

Built from https://develop.svn.wordpress.org/trunk@38848


git-svn-id: http://core.svn.wordpress.org/trunk@38791 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-20 22:24:40 +00:00
David A. Kennedy 8cfe2973d3 Twenty Seventeen: Replace inline control structure to improve code readability
Props vrundakansara, aaroncampbell.

Fixes #38384.

Built from https://develop.svn.wordpress.org/trunk@38847


git-svn-id: http://core.svn.wordpress.org/trunk@38790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-20 22:18:29 +00:00
David A. Kennedy 89b20fcf8f Twenty Fifteen, Twenty Seventeen: Add documentation to filters in themes.
Documents a missing one Twenty Fifteen and all four missing ones in Twenty Seventeen.

Props brainstormforce.

Fixes #38382.

Built from https://develop.svn.wordpress.org/trunk@38846


git-svn-id: http://core.svn.wordpress.org/trunk@38789 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-20 20:34:31 +00:00
Boone Gorges 3dc7e8a97c Comments: Fix description for `reverse_top_level` argument in `wp_list_comments()`.
It's a boolean, not a string. Introduced in [25567].

Props bcole808.
Fixes #38371.
Built from https://develop.svn.wordpress.org/trunk@38845


git-svn-id: http://core.svn.wordpress.org/trunk@38788 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-20 18:59:29 +00:00
Boone Gorges bcc26664ed Query: Allow the prefix used for search term exclusion to be filtered.
[38792] allowed `WP_Query`'s hyphen-as-exclusion-prefix feature to be
disabled via filter. A more general solution is to allow the prefix to
be filtered; returning an empty value from a filter callback works to
disable the feature.

Props dlh.
Fixes #38099.
Built from https://develop.svn.wordpress.org/trunk@38844


git-svn-id: http://core.svn.wordpress.org/trunk@38787 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-20 18:42:29 +00:00
Boone Gorges 2265f1a07e Tests: Skip `strip_invalid_text()` test for big5 charset on MariaDB.
MariaDB doesn't support the tested configuration.

Props ocean90.
Fixes #33171.
Built from https://develop.svn.wordpress.org/trunk@38843


git-svn-id: http://core.svn.wordpress.org/trunk@38786 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-20 18:30:31 +00:00
Gary Pendergast 89544cc03d Tests: Fix ajax tests that fail when Twenty Seventeen is the default theme.
There are some tests who's outcome can be affected by the default theme, so we need to ensure the Twenty Seventeen functionality is unhooked while the tests are running.

See #38372.


Built from https://develop.svn.wordpress.org/trunk@38842


git-svn-id: http://core.svn.wordpress.org/trunk@38785 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-20 10:48:40 +00:00
Gary Pendergast bf5d081fe4 Twenty Seventeen: Remove some whitespace accidentally introduced in [38837].
See #38372.


Built from https://develop.svn.wordpress.org/trunk@38841


git-svn-id: http://core.svn.wordpress.org/trunk@38784 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-20 09:27:32 +00:00
John Blackbourn 7696a3a8c6 oEmbed: Remove the oEmbed provider unit tests.
This reverts [38454] along with its follow-up commits, [38512], [38514], and [38692]. These tests are currently not pass
ing, and maybe they never will. The tests are in a group which does not run by default without a flag, making them quest
ionably useful.

We can re-visit this at a later date.

See #32360

Built from https://develop.svn.wordpress.org/trunk@38840


git-svn-id: http://core.svn.wordpress.org/trunk@38783 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-20 09:16:30 +00:00
Gary Pendergast 0e0af249be Themes: Twenty Seventeen is now the default theme.
It's party time!

Fixes #38372.


Built from https://develop.svn.wordpress.org/trunk@38839


git-svn-id: http://core.svn.wordpress.org/trunk@38782 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-20 09:13:29 +00:00
Gary Pendergast 2ac1c4cc92 Tests: Fix tests that don't pass when Twenty Seventeen is the default theme.
There are some tests who's outcome can be affected by the default theme, so we need to ensure the Twenty Seventeen functionality is unhooked while the tests are running.

See #38372.


Built from https://develop.svn.wordpress.org/trunk@38838


git-svn-id: http://core.svn.wordpress.org/trunk@38781 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-20 09:07:29 +00:00
Gary Pendergast 35186cff65 Twenty Seventeen: Fix a PHP warning on fresh installs.
When setting the `transport` parameter on Customizer settings, we need to ensure the setting exists, particularly on new sites.

See #38372.


Built from https://develop.svn.wordpress.org/trunk@38837


git-svn-id: http://core.svn.wordpress.org/trunk@38780 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-20 09:04:31 +00:00
Gary Pendergast e51531a425 Build: Ignore JSHint errors in Twenty Seventeen's third party libraries.
`html5.js` and `jquery.scrollTo.js` are external libraries, so don't need to be checked by JSHint.

Props kadamwhite.
Fixes #38376.


Built from https://develop.svn.wordpress.org/trunk@38836


git-svn-id: http://core.svn.wordpress.org/trunk@38779 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-20 05:44:30 +00:00
Rachel Baker 6b46336251 REST API: Fix comment option leak causing another test failure.
Set the 'comment_whitelist' option back to the default when tearing down wpAllowComment tests.

See #38373.
Built from https://develop.svn.wordpress.org/trunk@38835


git-svn-id: http://core.svn.wordpress.org/trunk@38778 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-20 05:25:29 +00:00
Rachel Baker 6a94e72369 REST API: Fix test failures.
- Fix leak in setup_notify_comment() test help by removing the comment_flood_filter.
- Correct uses of $term_taxonomy_id -> $term_id in Category and Tags routing.
- Temporarily remove the metadata tests for canola.jpg as that file does not have an exifdata.  Will need to update the test.

Props jorbin, rmccue, nacin
See #38373.
Built from https://develop.svn.wordpress.org/trunk@38834


git-svn-id: http://core.svn.wordpress.org/trunk@38777 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-20 05:13:29 +00:00
David A. Kennedy 7fbb094586 Importing Twenty Seventeen, our new default theme for 2017, set for 4.7.
With a focus on business sites, it will let you get down to business in style. Initial development occurred on GitHub. See: https://github.com/WordPress/twentyseventeen

Props melchoyce, laurelfulford, davidakennedy, grapplerulrich, manishsongirkar36, joefusco, smyoon315, b-07, rabmalin, mrahmadawais, hardeepasrani, implenton, acmethemes, claudiosanches, valeriutihai, pressionate, sgr33n, doughamlin, zodiac1978, tsl143, nikschavan, joshcummingsdesign, enodekciw, jordesign, patilvikasj, ryelle, mahesh901122, williampatton, juanfra, imnok, littlebigthing, mor10, samikeijonen, celloexpressions, akshayvinchurkar, davidmosterd, hiddenpearls, netweb, pratikchaskar, taggon, nukaga, ranh, yoavf, karmatosed, sandesh055, adammacias, noplanman, yogasukma, binarymoon, swapnilld, swissspidy, joyously, allancole, rianrietveld, sixhours, alex27, themeshaper, mapk, leobaiano.

See #38372.

Built from https://develop.svn.wordpress.org/trunk@38833


git-svn-id: http://core.svn.wordpress.org/trunk@38776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-20 04:12:31 +00:00
Rachel Baker e4a7c0a397 REST API: Introduce the Content API endpoints.
REST API endpoints for your WordPress content. These endpoints provide machine-readable external access to your WordPress site with a clear, standards-driven interface, allowing new and innovative apps for interacting with your site. These endpoints support all of the following:
- Posts: Read and write access to all post data, for all types of post-based data, including pages and media.
- Comments: Read and write access to all comment data. This includes pingbacks and trackbacks.
- Terms: Read and write access to all term data.
- Users: Read and write access to all user data. This includes public access to some data for post authors.
- Meta: Read and write access to metadata for posts, comments, terms, and users, on an opt-in basis from plugins.
- Settings: Read and write access to settings, on an opt-in basis from plugins and core. This enables API management of key site content values that are technically stored in options, such as site title and byline.

Love your REST API, WordPress!  The infrastructure says, "Let's do lunch!" but the content API endpoints say, "You're paying!"

Props rmccue, rachelbaker, danielbachhuber, joehoyle, adamsilverstein, afurculita, ahmadawais, airesvsg, alisspers, antisilent, apokalyptik, artoliukkonen, attitude, boonebgorges, bradyvercher, brianhogg, caseypatrickdriscoll, chopinbach, chredd, christianesperar, chrisvanpatten, claudiolabarbera, claudiosmweb, cmmarslender, codebykat, coderkevin, codfish, codonnell822, daggerhart, danielpunkass, davidbhayes, delphinus, desrosj, dimadin, dotancohen, DrewAPicture, Dudo1985, duncanjbrown, eherman24, eivhyl, eliorivero, elyobo, en-alis, ericandrewlewis, ericpedia, evansobkowicz, fjarrett, frozzare, georgestephanis, greatislander, guavaworks, hideokamoto, hkdobrev, hubdotcom, hurtige, iandunn, ircrash, ironpaperweight, iseulde, Japh, jaredcobb, JDGrimes, jdolan, jdoubleu, jeremyfelt, jimt, jjeaton, jmusal, jnylen0, johanmynhardt, johnbillion, jonathanbardo, jorbin, joshkadis, JPry, jshreve, jtsternberg, JustinSainton, kacperszurek, kadamwhite, kalenjohnson, kellbot, kjbenk, kokarn, krogsgard, kuchenundkakao, kuldipem, kwight, lgedeon, lukepettway, mantismamita, markoheijnen, matrixik, mattheu, mauteri, maxcutler, mayukojpn, michael-arestad, miyauchi, mjbanks, modemlooper, mrbobbybryant, NateWr, nathanrice, netweb, NikV, nullvariable, oskosk, oso96_2000, oxymoron, pcfreak30, pento, peterwilsoncc, Pezzab, phh, pippinsplugins, pjgalbraith, pkevan, pollyplummer, pushred, quasel, QWp6t, schlessera, schrapel, Shelob9, shprink, simonlampen, Soean, solal, tapsboy, tfrommen, tharsheblows, thenbrent, tierra, tlovett1, tnegri, tobych, Toddses, toro_unit, traversal, vanillalounge, vishalkakadiya, wanecek, web2style, webbgaraget, websupporter, westonruter, whyisjake, wonderboymusic, wpsmith, xknown, zyphonic.
Fixes #38373.
Built from https://develop.svn.wordpress.org/trunk@38832


git-svn-id: http://core.svn.wordpress.org/trunk@38775 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-20 02:55:32 +00:00
John Blackbourn f5a3446e4d Customize: Improve the labelling of background and header images in the list mode of the media library.
Props deltafactory, coreymcollins, desrosj
Fixes #22857

Built from https://develop.svn.wordpress.org/trunk@38831


git-svn-id: http://core.svn.wordpress.org/trunk@38774 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 23:03:31 +00:00
Weston Ruter 8abba71d47 Customize: Fix unit tests when `twentyfifteen` is `WP_DEFAULT_THEME` instead of `twentysixteen`.
Use an inactive core theme for previewing theme switch instead of assuming `twentysixteen` is installed and active and `twentyfifteen` is not.

See #30937.

Built from https://develop.svn.wordpress.org/trunk@38830


git-svn-id: http://core.svn.wordpress.org/trunk@38773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 19:39:31 +00:00
Weston Ruter 1ccd9e7a6c Customize: Introduce custom CSS for extending theme styles.
* Custom CSS is associated with a given theme and is displayed in an inline `style` element at the `wp_head` hook after the `wp_print_styles` is called so that it overrides any enqueued stylesheets.
* A `wp_get_custom_css()` function is used for accessing the CSS associated with the current theme (or another theme) and a `wp_get_custom_css` filter for manipulating it.
* CSS is managed in customizer via a new "Additional CSS" section with a single `textarea` control. 
* `WP_Customize_Section::$description_hidden` is introduced for hiding extended descriptions in customizer sections behind a help toggle as done with panels.
* CSS is stored in a `custom_css` post type with the theme (stylesheet) slug as the `post_name`.
* `WP_Customize_Custom_CSS_Setting` is introduced to handle validation of CSS, previewing, and persisting the CSS to the `custom_css` post type.
* The `custom_css` setting is tied to a new `unfiltered_css` capability which maps to `unfiltered_html` by default.
* Escaping the message in the notification template is removed to allow markup (`code` tags) to be rendered.

See https://make.wordpress.org/core/2016/10/11/feature-proposal-better-theme-customizations-via-custom-css-with-live-previews/

Props johnregan3, celloexpressions, folletto, westonruter.
Fixes #35395.

Built from https://develop.svn.wordpress.org/trunk@38829


git-svn-id: http://core.svn.wordpress.org/trunk@38772 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 18:15:31 +00:00
Sergey Biryukov ec5782bed5 Docs: Fix typo in `in_category()` description.
Props Kenshino, mbootsman.
Fixes #38363.
Built from https://develop.svn.wordpress.org/trunk@38828


git-svn-id: http://core.svn.wordpress.org/trunk@38771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 13:46:44 +00:00
Pascal Birchler e4d7dd2b8a Upgrade/Install: Refresh update counts after page load.
By enqueuing the updates script in the footer and passing the number of available updates to it after page load, the update bubbles will be more accurate.

Props ocean90, swissspidy.
Fixes #13071.
Built from https://develop.svn.wordpress.org/trunk@38827


git-svn-id: http://core.svn.wordpress.org/trunk@38770 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 10:27:29 +00:00
Pascal Birchler deda5d9796 Resource Hints: Allow passing custom attributes to resource hints.
[37920] introduced resource hints that allow browsers to prefetch specific pages or render them in the background. With this change, the `as`, `crossorigin`, `pr`, and `type` attributes can be passed in addition to the URLs/hosts.

Props peterwilsoncc, swissspidy.
Fixes #38121.
Built from https://develop.svn.wordpress.org/trunk@38826


git-svn-id: http://core.svn.wordpress.org/trunk@38769 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 09:29:30 +00:00
Pascal Birchler 39433ad092 Dashboard: Do not show 'Popular Plugin' UI if `DISALLOW_FILE_MODS` is set.
Props Mte90.
Fixes #37436.
Built from https://develop.svn.wordpress.org/trunk@38825


git-svn-id: http://core.svn.wordpress.org/trunk@38768 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 08:44:30 +00:00
Jeremy Felt 64886517b9 Multisite: Replace `get_blog_details()` with `get_site()` in network admin screens.
Props iamfriendly.
See #37102.
Fixes #38349.

Built from https://develop.svn.wordpress.org/trunk@38824


git-svn-id: http://core.svn.wordpress.org/trunk@38767 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 06:08:28 +00:00
Jeremy Felt f2ad579440 Multisite: Replace `get_blog_details()` in `wp-admin/my-sites.php` with `get_site()`.
Props spacedmonkey, iamfriendly.
See #37102.
Fixes #38348.

Built from https://develop.svn.wordpress.org/trunk@38823


git-svn-id: http://core.svn.wordpress.org/trunk@38766 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 06:02:29 +00:00
Jeremy Felt 325c7411fc Multisite: Replace `get_blog_details()` in `/wp-admin/ms-delete-site.php` with `get_site()`.
Props spacedmonkey, iamfriendly.
See #37102.
Fixes #38347.

Built from https://develop.svn.wordpress.org/trunk@38822


git-svn-id: http://core.svn.wordpress.org/trunk@38765 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 05:54:29 +00:00
Jeremy Felt 7eece8b106 Multisite: Replace `get_blog_details()` usage in `wpmu_delete_blog()` with `get_site()`.
Props spacedmonkey, iamfriendly.
See #37102.
Fixes #38346.

Built from https://develop.svn.wordpress.org/trunk@38821


git-svn-id: http://core.svn.wordpress.org/trunk@38764 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 05:50:28 +00:00
Jeremy Felt be6e98426b Multisite: Replace `get_blog_details()` in `WP_Importer::set_blog()` with `get_site()`.
Props spacedmonkey, iamfriendly.
See #37102.
Fixes #38345.

Built from https://develop.svn.wordpress.org/trunk@38820


git-svn-id: http://core.svn.wordpress.org/trunk@38763 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 05:45:31 +00:00
Jeremy Felt 4d44eeadd6 Multisite: Use correct types in `get_sites()` during network upgrade.
`spam`, `deleted`, and `archived` query args should be integers, not strings.

Props ocean90.
See #37823.

Built from https://develop.svn.wordpress.org/trunk@38819


git-svn-id: http://core.svn.wordpress.org/trunk@38762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 05:11:28 +00:00
Jeremy Felt 432d90050b Multisite: Add `$network_id` parameter to hooks in `delete_network_option()`.
Props flixos90.
Fixes #38322.

Built from https://develop.svn.wordpress.org/trunk@38818


git-svn-id: http://core.svn.wordpress.org/trunk@38761 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 05:02:29 +00:00
Jeremy Felt eb382b29ae Multisite: Add `$network_id` parameter to hooks in `update_network_option()`.
Props flixos90.
Fixes #38321.

Built from https://develop.svn.wordpress.org/trunk@38817


git-svn-id: http://core.svn.wordpress.org/trunk@38760 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 05:00:29 +00:00
Jeremy Felt 213a0a2477 Multisite: Add $network_id parameter to hooks in `add_network_option()`.
Props flixos90.
Fixes #38320.

Built from https://develop.svn.wordpress.org/trunk@38816


git-svn-id: http://core.svn.wordpress.org/trunk@38759 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 04:56:28 +00:00
Jeremy Felt df6675d1ec Multisite: Add `$network_id` parameter to filters in `get_network_option()`.
Props flixos90.
Fixes #38319.

Built from https://develop.svn.wordpress.org/trunk@38815


git-svn-id: http://core.svn.wordpress.org/trunk@38758 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 04:54:29 +00:00
Jeremy Felt 1560fbcbc5 Multisite: Use `get_network()` and `get_current_network_id()` for current network data.
`get_network()` falls back to the current network when called without any arguments. Between this and `get_current_network_id()`, we can replace almost all instances of the global `$current_site` and all instances of `get_current_site()`.

This effectively deprecates `get_current_site()`, something that we'll do in a future ticket.

Props flixos90.
Fixes #37414.

Built from https://develop.svn.wordpress.org/trunk@38814


git-svn-id: http://core.svn.wordpress.org/trunk@38757 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 04:47:30 +00:00
Weston Ruter 1c3b96537f Customize: Introduce a new experience for discovering, installing, and previewing themes within the customizer.
Unify the theme-browsing and theme-customization experiences by introducing a comprehensive theme browser and installer directly accessible in the customizer. Replaces the customizer theme switcher with a full-screen panel for discovering/browsing and installing themes available on WordPress.org. Themes can now be installed and previewed directly in the customizer without entering the wp-admin context.

For details, see https://make.wordpress.org/core/2016/10/03/feature-proposal-a-new-experience-for-discovering-installing-and-previewing-themes-in-the-customizer/

Fixes #37661, #34843.
Props celloexpressions, folletto, westonruter, karmatosed, afercia.

Built from https://develop.svn.wordpress.org/trunk@38813


git-svn-id: http://core.svn.wordpress.org/trunk@38756 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 03:20:29 +00:00
Joe McGill 8ed022b568 Media: Remove `alt` fallbacks to improve accessibility.
This removes the fallbacks in `wp_get_attachment_image()` and in
`wp.media.string.props` which attempt to generate an `alt` value
from the image caption or title if an `alt` attribute isn't explicitly
set.

This allows for image HTML to be generated that contains an empty `alt`
value, i.e., `alt=""` which is much preferable for screen readers than
reading redundant content in the case of a caption, or when reading the
image title, which is often generated from the filename and not helpful
as `alt` text.

Props odie2, joedolson, rianrietveld, afercia, iamjolly, joemcgill.
Fixes #34635.
Built from https://develop.svn.wordpress.org/trunk@38812


git-svn-id: http://core.svn.wordpress.org/trunk@38755 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 03:06:28 +00:00
Weston Ruter e8bd9645df Customize: Split out link `click.preview` and form `submit.preview` event handlers from anonymous functions into named methods on `wp.customize.Preview` for extensibility.
See #30937.

Built from https://develop.svn.wordpress.org/trunk@38811


git-svn-id: http://core.svn.wordpress.org/trunk@38754 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-19 02:06:30 +00:00
Weston Ruter f1ba1918c9 Customize: Implement customized state persistence with changesets.
Includes infrastructure developed in the Customize Snapshots feature plugin.

See https://make.wordpress.org/core/2016/10/12/customize-changesets-technical-design-decisions/

Props westonruter, valendesigns, utkarshpatel, stubgo, lgedeon, ocean90, ryankienstra, mihai2u, dlh, aaroncampbell, jonathanbardo, jorbin.
See #28721.
See #31089.
Fixes #30937.
Fixes #31517.
Fixes #30028.
Fixes #23225.
Fixes #34142.
Fixes #36485.

Built from https://develop.svn.wordpress.org/trunk@38810


git-svn-id: http://core.svn.wordpress.org/trunk@38753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-18 20:05:31 +00:00
Gary Pendergast f6d85de626 Charset: Allow `_canonical_charset()` to handle mixed-case strings.
Add improved unit tests, and collect existing unit tests together.

Props pbearne.
Fixes #38337.


Built from https://develop.svn.wordpress.org/trunk@38809


git-svn-id: http://core.svn.wordpress.org/trunk@38752 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-17 23:54:30 +00:00
Andrew Ozz f76fa00288 TinyMCE wplink:
- Remove the calls to getBookmark() and moveToBookmark() in IE. This is handled automatically when blurring and focusing the editor.
- When inserting a link, move it out of the caret position element. If not, it may be removed with that element on clean-up before save.

Fixes #38335.
Built from https://develop.svn.wordpress.org/trunk@38808


git-svn-id: http://core.svn.wordpress.org/trunk@38751 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-17 20:01:31 +00:00
Weston Ruter 11cb0c06a7 Customize: Skip triggering initial click on pages section for available nav menu items if already open.
Fixes race condition if user opens Pages section before the ajax request to load items finishes.

Props ryankienstra, celloexpressions.
Fixes #36984.

Built from https://develop.svn.wordpress.org/trunk@38807


git-svn-id: http://core.svn.wordpress.org/trunk@38750 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-17 16:23:28 +00:00
Aaron Jorbin 969e4255a9 REST API: Include `Vary: Origin` in cors headers
`vary: origin` is a W3 CORS implementation recommendation( https://www.w3.org/TR/cors/#resource-implementation ). It's used by default in frameworks such as hapi and Laravel-cors. Overall, it helps sites siting behind a cache such as varnish.

Fixes #38060.
Props procodewp, pdufour for research.


Built from https://develop.svn.wordpress.org/trunk@38806


git-svn-id: http://core.svn.wordpress.org/trunk@38749 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-17 16:11:30 +00:00
Pascal Birchler 1e54943b0f Docs: Improve documentation for `install_plugin_install_status()`.
Props clarionwpdeveloper, sudar.
Fixes #36912.
Built from https://develop.svn.wordpress.org/trunk@38805


git-svn-id: http://core.svn.wordpress.org/trunk@38748 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-17 08:30:29 +00:00
Pascal Birchler ffdef38f5b Date/Time: Remove some legacy logic in `date_i18n()`.
Since there's no difference between using `date()` and `gmdate()` in WordPress, we can simply use the former in `date_i18n()` to reduce its complexity.

Adds tests.

Props jdgrimes for initial patch.
Fixes #37910.
Built from https://develop.svn.wordpress.org/trunk@38804


git-svn-id: http://core.svn.wordpress.org/trunk@38747 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-17 08:10:30 +00:00
Andrew Ozz 4996d05355 TinyMCE:
- When editing pages, add body class with the page template, or `page-template-default`.
- Change the page template class when the users select another template, similarly to changing the post type class for posts.

Props webmandesign.
Fixes #37599.
Built from https://develop.svn.wordpress.org/trunk@38803


git-svn-id: http://core.svn.wordpress.org/trunk@38746 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-17 01:10:28 +00:00
John Blackbourn 374a079746 Role/Capability: Disregard the order of capabilities when testing that single site and multisite capability tests match.
See #38191

Built from https://develop.svn.wordpress.org/trunk@38802


git-svn-id: http://core.svn.wordpress.org/trunk@38745 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-16 23:36:28 +00:00
Andrew Ozz c388eeca8d TinyMCE: restore the monospace font in textareas in the TinyMCE UI. Make it same as in the Text editor.
Fixes #38125.
Built from https://develop.svn.wordpress.org/trunk@38801


git-svn-id: http://core.svn.wordpress.org/trunk@38744 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-16 22:51:28 +00:00
Andrea Fercia 7be7d396f1 Editor: Add a role `button` to the Tags meta box tag cloud links.
For better accessibility, the tag cloud links in the Tags meta box should be
reported to assistive technologies as buttons. They don't navigate to a new
resource, instead they perform an action.

Fixes #38318.

Built from https://develop.svn.wordpress.org/trunk@38800


git-svn-id: http://core.svn.wordpress.org/trunk@38743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-16 20:09:28 +00:00
Andrea Fercia 8aef143d80 Menus: Fix the posts-categories quick search.
On the Menus screen, events that trigger the posts-categories search need to be
delegated. This "boxes" may get dynamically rebuilt so events directly attached
to the search input field need to be delegated.

Fixes #38324.

Built from https://develop.svn.wordpress.org/trunk@38799


git-svn-id: http://core.svn.wordpress.org/trunk@38742 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-16 20:03:29 +00:00
Sergey Biryukov 4a95bfa4c2 Docs: In `get_pages()` and `wp_list_pages()`, note that `post_status` argument can also be an array.
Adjust the alignment of default argument values for better readability.

Props birgire, desrosj.
Fixes #38136.
Built from https://develop.svn.wordpress.org/trunk@38798


git-svn-id: http://core.svn.wordpress.org/trunk@38741 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-16 01:10:31 +00:00
Andrew Ozz d91da52588 Accessible Tags autocomplete:
- Replace suggest.js with UI Autocomplete.
- Use the same settings like in the editor link toolbar.
- Abstract it and add in a new file, tags-suggest.js. Then make it a dependency for the Tags postbox(es) and Quick and Bulk Edit.
- Add `data-wp-taxonomy` on all input elements to improve handling in the UI for custom taxonomies.

Props afercia, azaozz.
See #33902.
Built from https://develop.svn.wordpress.org/trunk@38797


git-svn-id: http://core.svn.wordpress.org/trunk@38740 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-14 22:40:28 +00:00
Andrew Ozz e2e22580db TinyMCE:
- Prevent applying Indent and Outdent while an image with a caption is selected. It doesn't do anything and breaks the caption elements.
- Keep all of the text when a caption `<dl>` was somehow changed.

Fixes #38313.
Built from https://develop.svn.wordpress.org/trunk@38796


git-svn-id: http://core.svn.wordpress.org/trunk@38739 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-14 21:38:28 +00:00
Andrea Fercia da4da31af1 Administration: Better consistency for the Media, Add Plugins, and Add Themes toolbars.
Fixes the Add Themes toolbar padding. Standardizes the placeholders to no title
case and three trailing dots. Expands the Media search placeholder in
"Search media items..." for consistency with the Plugins and Themes toolbars.

Props mikeviele, jamesacero, mattking5000, koenschipper, dungengronovius.

Fixes #38010.

Built from https://develop.svn.wordpress.org/trunk@38795


git-svn-id: http://core.svn.wordpress.org/trunk@38738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-14 21:33:28 +00:00
Weston Ruter 07b97c1d57 Customize: Move Pages below Custom Links in available nav menu items panel.
Props ryankienstra, celloexpressions.
See #36984.

Built from https://develop.svn.wordpress.org/trunk@38794


git-svn-id: http://core.svn.wordpress.org/trunk@38737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-14 21:21:28 +00:00
Andrew Ozz 2f45415c73 Media modal: make it possible to reorder images by dragging on devices with both touch screen and mouse support.
Props adamsilverstein.
Fixes #31652.
Built from https://develop.svn.wordpress.org/trunk@38793


git-svn-id: http://core.svn.wordpress.org/trunk@38736 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-14 20:29:28 +00:00
Boone Gorges 9783a3df6b Query: Allow the hyphen-prefix-for-search-exclusion feature to be disabled by filter.
WordPress 4.4 introduced "hyphen exclusion" for search terms, so that
"foo -bar" would return posts containing "foo" AND not containing "bar".
The new filter 'wp_query_use_hyphen_for_exclusion' allows developers
to disable this feature when it's known that their content will contain
semantically important leading hyphens.

Props chriseverson, choongsavvii.
Fixes #38099.
Built from https://develop.svn.wordpress.org/trunk@38792


git-svn-id: http://core.svn.wordpress.org/trunk@38735 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-14 20:06:28 +00:00
Rachel Baker 8cbb988196 Pings/Trackbacks: Add new `pre_trackback_post` action before a trackback is added to a post.
Props dshanske, rachelbaker.
Fixes #37007.
Built from https://develop.svn.wordpress.org/trunk@38791


git-svn-id: http://core.svn.wordpress.org/trunk@38734 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-14 19:39:28 +00:00
Rachel Baker a6f0fb6d2a REST API: Support sites with index-style permalinks in `get_rest_url()`.
Support the index-style permalinks (http://example.com/index.php/postName) when registering the REST API rewrite rules and within the `get_rest_url()` function. This allows sites that do not have mod_rewrite support to have almost pretty urls and have access to their REST API endpoints.

Props kraftbj.
Fixes #38182.
Built from https://develop.svn.wordpress.org/trunk@38790


git-svn-id: http://core.svn.wordpress.org/trunk@38733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-14 19:30:29 +00:00
John Blackbourn afff60c378 Themes: Improve the inline documentation for the `get_*_template()` functions by providing examples instead of verbose explanations.
Fixes #38249
See #37770

Built from https://develop.svn.wordpress.org/trunk@38789


git-svn-id: http://core.svn.wordpress.org/trunk@38732 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-14 14:20:29 +00:00
Pascal Birchler a60ac4684b Themes: Do not show an update button if there's no update package.
This updates the list view to match the existing behaviour in the single theme modal.

Props tristangemus for initial patch.
Fixes #37774.
Built from https://develop.svn.wordpress.org/trunk@38788


git-svn-id: http://core.svn.wordpress.org/trunk@38731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-14 13:33:29 +00:00
John Blackbourn dec7dd74ea Users: Use the role name instead of the role display name when fetching the list of users with no role. This avoids false positives when dealing with user roles that, for example, contain spaces in the display name.
Props procodewp, choongsavvii
Fixes #38234

Built from https://develop.svn.wordpress.org/trunk@38787


git-svn-id: http://core.svn.wordpress.org/trunk@38730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-14 12:05:30 +00:00
Jeremy Felt 295e48baa9 Multisite: Maintain switched state in site icon/logo functions.
Adjusts `get_custom_logo()`, `get_site_icon_url()`, and `has_custom_logo()` so that when called in a switched state, the original switched stack is not adjusted.

Props achbed, flixos90.
Fixes #38253.

Built from https://develop.svn.wordpress.org/trunk@38786


git-svn-id: http://core.svn.wordpress.org/trunk@38729 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-13 22:28:28 +00:00
Gary Pendergast 456f8015b7 KSES: Deprecate `wp_kses_js_entities()`.
This function was originally introduced to fix an XSS attack in Netscape 4, which never affected any other browsers, or later versions of Netscape.

I'm willing to go out on a limb, and say that we've officially dropped security support for Netscape 4.

Props dmsnell, desrosj.
Fixes #33848.


Built from https://develop.svn.wordpress.org/trunk@38785


git-svn-id: http://core.svn.wordpress.org/trunk@38728 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-13 22:25:31 +00:00
Boone Gorges acd764a1d3 Taxonomy: Cache results of term count queries.
Fixes #38295.
Built from https://develop.svn.wordpress.org/trunk@38784


git-svn-id: http://core.svn.wordpress.org/trunk@38727 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-12 15:30:31 +00:00
Boone Gorges 9935b60e72 Comments: When checking comments, returned error object should include HTTP status code.
The status code in the `WP_Error` `data` array is needed to send
headers in wp-comments-post.php, and was erroneously not included in
[38778].

Props needle, websupporter.
Fixes #36901.
Built from https://develop.svn.wordpress.org/trunk@38783


git-svn-id: http://core.svn.wordpress.org/trunk@38726 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-12 13:50:30 +00:00
Andrew Ozz 5f5c85c510 TinyMCE: prevent iOS Safari from expanding the iframe width beyond the container width.
Fixes #38289.
Built from https://develop.svn.wordpress.org/trunk@38782


git-svn-id: http://core.svn.wordpress.org/trunk@38725 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-12 03:36:30 +00:00
Jeremy Felt a9290f631b Multisite: Clarify that `get_site_by_path()` does not return exact matches.
Props stevenlinx.
Fixes #38152.

Built from https://develop.svn.wordpress.org/trunk@38781


git-svn-id: http://core.svn.wordpress.org/trunk@38724 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-12 01:10:29 +00:00
Andrew Ozz 61c95f84f6 TinyMCE: update the `charmap` plugin to the latest dev. version. Fixes problems with inserting white space characters.
Fixes #37936.
Built from https://develop.svn.wordpress.org/trunk@38780


git-svn-id: http://core.svn.wordpress.org/trunk@38723 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-11 23:56:31 +00:00
Boone Gorges 220c0589da Taxonomy: Specify taxonomy when populating cached object terms.
[38776] introduced a call to `get_term()` using only the term ID. This
causes problems in cases where shared terms have not been split. Since
we have the taxonomy available, there's no harm in passing it along to
`get_term()`.

Props dd32.
See #37291.
Built from https://develop.svn.wordpress.org/trunk@38779


git-svn-id: http://core.svn.wordpress.org/trunk@38722 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-11 04:06:28 +00:00
Boone Gorges 0bdfa2ab1e Comments: Abstract `die()` calls from comment submission routine.
Since 4.4, comment submission has been mostly abstracted into a function,
rather than being processed inline in wp-comments-post.php. This change
made it easier to write automated tests against the bulk of the comment
submission process. `wp_allow_comment()` remained untestable, however:
when a comment failed one of its checks (flooding, duplicates, etc),
`die()` or `wp_die()` would be called directly. This shortcoming posed
problems for any application attempting to use WP's comment verification
functions in an abstract way - from PHPUnit to the REST API.

The current changeset introduces a new parameter, `$avoid_die`, to the
`wp_new_comment()` stack. When set to `true`, `wp_new_comment()` and
`wp_allow_comment()` will return `WP_Error` objects when a comment check
fails. When set to `false` - the default, for backward compatibility -
a failed check will result in a `die()` or `wp_die()`, as appropriate.

Prior to this changeset, default comment flood checks took place in the
function `check_comment_flood_db()`, which was hooked to the
'check_comment_flood' action. This design allowed the default comment
flood routine to be bypassed or replaced using `remove_action()`.
In order to maintain backward compatibility with this usage, while
simultaneously converting the comment flood logic into something that
returns a value rather than calling `die()` directly,
`check_comment_flood_db()` has been changed into a wrapper function for
a call to `add_filter()`; this, in turn, adds the *actual* comment flood
check to a new filter, 'wp_is_comment_flood'. Note that direct calls
to `check_comment_flood_db()` will no longer do anything in isolation.

Props websupporter, rachelbaker.
Fixes #36901.
Built from https://develop.svn.wordpress.org/trunk@38778


git-svn-id: http://core.svn.wordpress.org/trunk@38721 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-11 03:43:28 +00:00
Dion Hulse f40c2a62a6 Taxonomy: Avoid a fatal error in `the_tags()` in the event that `get_the_term_list()` returns a WP_Error.
Props michalzuber.
See #37291.

Built from https://develop.svn.wordpress.org/trunk@38777


git-svn-id: http://core.svn.wordpress.org/trunk@38720 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-11 03:27:31 +00:00
Boone Gorges e97ab5362b Taxonomy: Better error handling when fetching object terms from cache.
Since [37573], `get_object_term_cache()` has expected term IDs to be
stored in the taxonomy relationship cache. The function would then
reach directly into the 'terms' cache to fetch the data corresponding
to a given term, before returning a `WP_Term` object. This caused
problems when, for one reason or another, term data was cached
inconsistently:

* If the 'terms' cache is empty for a given term ID, despite the earlier call to `_prime_term_caches()`, `get_term()` would return an error object.
* If the array of cached term IDs contains an invalid ID, `get_term()` would return an error object.

We avoid these errors by no longer touching the 'terms' cache directly,
but running term IDs through `get_term()` and allowing that function to
reference the cache (and database, as needed). If `get_term()` returns
an error object for any of the cached term IDs, `get_object_term_cache()`
will return that error object alone. This change ensures that upstream
functions, like `get_the_terms()`, return `WP_Error` objects in a
predictable fashion.

Props dd32, michalzuber.
Fixes #37291.
Built from https://develop.svn.wordpress.org/trunk@38776


git-svn-id: http://core.svn.wordpress.org/trunk@38719 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-11 01:56:29 +00:00
Gary Pendergast 7c1cb69e7a XML-RPC: Re-add a `global $wpdb` missed in [38768].
See #37699.


Built from https://develop.svn.wordpress.org/trunk@38775


git-svn-id: http://core.svn.wordpress.org/trunk@38718 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-11 01:43:31 +00:00
Andrew Ozz af8eaef148 TinyMCE: add support for custom dashicon for wp.mce.View.setLoader().
Props procodewp.
Fixes #37900.
Built from https://develop.svn.wordpress.org/trunk@38774


git-svn-id: http://core.svn.wordpress.org/trunk@38717 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-11 00:56:29 +00:00
Andrew Ozz cb966db094 TiinyMCE: update to 4.4.3, changelog: https://www.tinymce.com/docs/changelog/#version443-september12016
Fixes #38081, #38245, #37507, #37808 and #38000.
Built from https://develop.svn.wordpress.org/trunk@38773


git-svn-id: http://core.svn.wordpress.org/trunk@38716 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-11 00:10:32 +00:00
Andrew Ozz c69916d57d Editor: do not send the request for releasing the post lock on unload when post_ID or active_post_lock is missing.
Props dlh, adamsilverstein.
Fixes #38271.
Built from https://develop.svn.wordpress.org/trunk@38772


git-svn-id: http://core.svn.wordpress.org/trunk@38715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-10 22:42:30 +00:00
Rachel Baker 84de4937b1 REST API: Remove reference to the plugin in infrastructure activation test.
Also adds class exists checks for WP_REST_Request and WP_REST_Response.

Props kraftbj.
Fixes #38279.
Built from https://develop.svn.wordpress.org/trunk@38771


git-svn-id: http://core.svn.wordpress.org/trunk@38714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-10 21:51:08 +00:00
Andrea Fercia 1905ea030a Accessibility: Improve the UI controls to move the Menu items.
On the Menus screen, the links to move menu items behave like buttons: they
perform an action so they should be real buttons to be correctly reported to
assistive technologies. Since they're logically grouped controls, they should
also be wrapped in a `<fieldset>` element for better semantics and accessibility.

Props Cheffheid.
Fixes #35578.

Built from https://develop.svn.wordpress.org/trunk@38770


git-svn-id: http://core.svn.wordpress.org/trunk@38713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-10 16:26:12 +00:00
John Blackbourn 35e1f5faa5 Role/Capability: Add tests for all user roles that check custom capabilities that do not have any form of handling (eg. in a `map_meta_cap` filter).
See #38191

Built from https://develop.svn.wordpress.org/trunk@38769


git-svn-id: http://core.svn.wordpress.org/trunk@38712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-10 14:40:30 +00:00
Gary Pendergast af69f4ab1a General: Restore usage of `$wpdb`, instead of `$this->db`.
Hiding the `$wpdb` global behind a property decreases the readability of the code, as well as causing irrelevant output when dumping an object.

Reverts [38275], [38278], [38279], [38280], [38387].
See #37699.


Built from https://develop.svn.wordpress.org/trunk@38768


git-svn-id: http://core.svn.wordpress.org/trunk@38711 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-10 06:38:31 +00:00
Weston Ruter 2064e34833 Customize: Show Pages section first and pre-expanded in list of available nav menu items.
Props ryankienstra, westonruter.
Fixes #36984.

Built from https://develop.svn.wordpress.org/trunk@38767


git-svn-id: http://core.svn.wordpress.org/trunk@38710 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-09 23:41:30 +00:00
Weston Ruter d6f9cb01d9 Customize: Improve message displayed in widgets panel when there are no widget areas currently displayed in the preview.
Props karmatosed, westonruter.
Fixes #36922.

Built from https://develop.svn.wordpress.org/trunk@38766


git-svn-id: http://core.svn.wordpress.org/trunk@38709 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-09 21:09:31 +00:00
Weston Ruter 28795e8dc2 Customize: Ensure `customize_validate_{$setting->id}` filters apply on input post values for `WP_Customize_Setting` subclasses that neglect to apply the filter themselves.
Fixes #37638.

Built from https://develop.svn.wordpress.org/trunk@38765


git-svn-id: http://core.svn.wordpress.org/trunk@38708 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-09 20:08:32 +00:00
Peter Wilson ffb703c002 Emoji: Update Emoji CDN filter default for resource hints.
Updates the default value for the filter `emoji_svg_url` used in `wp_resource_hints()` to match the default used for the filter in `_print_emoji_detection_script()`.

See [38717], #38724.

Built from https://develop.svn.wordpress.org/trunk@38764


git-svn-id: http://core.svn.wordpress.org/trunk@38707 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-09 04:24:31 +00:00
John Blackbourn 45edc9ec57 Build/Test Tools: Continue eliminating randomness in tests.
See [38762]
See #37371

Built from https://develop.svn.wordpress.org/trunk@38763


git-svn-id: http://core.svn.wordpress.org/trunk@38706 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-09 01:30:29 +00:00
John Blackbourn 72ccdfd70b Build/Test Tools: Begin eliminating unnecessary randomness in tests.
Although unlikely, clashes in randomly generated strings could cause unexpected failures. In addition, most randomness is entirely unnecessary, is bad practice, and increases test time (however small it may be).

See #37371

Built from https://develop.svn.wordpress.org/trunk@38762


git-svn-id: http://core.svn.wordpress.org/trunk@38705 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-09 01:12:31 +00:00
John Blackbourn 0b0868efc3 Build/Test Tools: Revert [38759]. PHPUnit's `@requires` syntax was introduced in PHPUnit 3.7, but the tests for PHP 5.2 use PHPUnit 3.6 because it's the latest version that supports PHP 5.2.
Fixes #38256

Built from https://develop.svn.wordpress.org/trunk@38761


git-svn-id: http://core.svn.wordpress.org/trunk@38704 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-08 22:43:31 +00:00
John Blackbourn 282864e2fc Media: Correct the hostname used in the `wp_get_attachment_metadata()` test.
See #36246

Built from https://develop.svn.wordpress.org/trunk@38760


git-svn-id: http://core.svn.wordpress.org/trunk@38703 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-08 12:05:30 +00:00
John Blackbourn 615b70b45f Build/Test Tools: Make use of PHPUnit's `@requires` notation.
Fixes #38256

Built from https://develop.svn.wordpress.org/trunk@38759


git-svn-id: http://core.svn.wordpress.org/trunk@38702 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-08 01:20:29 +00:00
John Blackbourn ebe86537ce HTTP API: Remove an unnecessary duplicate HTTP request in the HTTP tests.
See #30017

Built from https://develop.svn.wordpress.org/trunk@38758


git-svn-id: http://core.svn.wordpress.org/trunk@38701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-08 01:03:29 +00:00
John Blackbourn e82de0c7fb HTTP API: Convert the POST redirect test to use a dataProvider in order for its speed to be more accurately measured.
See #38237

Built from https://develop.svn.wordpress.org/trunk@38757


git-svn-id: http://core.svn.wordpress.org/trunk@38700 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-08 00:30:30 +00:00
Andrew Ozz 470c5a1f2a TinyMCE: Allow pasting in image captions. Remove blocks and insert `<br>` tags instead, also remove elements that would break the caption like other images, video, audio, etc.
See #36211.
Built from https://develop.svn.wordpress.org/trunk@38756


git-svn-id: http://core.svn.wordpress.org/trunk@38699 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-07 21:41:29 +00:00
John Blackbourn c0f1a49575 Themes: Remove `paged.php` from the theme template hierarchy.
The position of this template within the hierarchy is of so little use that zero themes in the WordPress.org theme directory make use of it. It's second only to `index.php` in the hierarchy, meaning that any archive template such as `category.php` or `archive.php` will be chosen before it.

Fixes #38162
Props ryankienstra for initial patch

Built from https://develop.svn.wordpress.org/trunk@38755


git-svn-id: http://core.svn.wordpress.org/trunk@38698 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-07 21:03:31 +00:00
Dominik Schilling 5fd943f49c Menus: Hide controls in the search tab if no items are found.
Props sayedwp, afercia, tywayne, abrightclearweb.
Fixes #35576.
Built from https://develop.svn.wordpress.org/trunk@38754


git-svn-id: http://core.svn.wordpress.org/trunk@38697 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-07 20:56:29 +00:00
Dominik Schilling 859498efd3 Taxonomy: On `wp-admin/term.php`, don't show a 'Back to' link which links to the current page.
Fixes #37573.
Built from https://develop.svn.wordpress.org/trunk@38753


git-svn-id: http://core.svn.wordpress.org/trunk@38696 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-07 20:13:28 +00:00
Dominik Schilling 32516036db Taxonomy: Remove `paged` argument from referer and add it only if current page is greater than 1.
Props swissspidy.
See #38194.
Built from https://develop.svn.wordpress.org/trunk@38752


git-svn-id: http://core.svn.wordpress.org/trunk@38695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-07 20:06:28 +00:00
Aaron Jorbin a8802232ec Make sure rewrite rules are not written until `wp_loaded` has fired
If a plugin attempts to change the rewrite rules to early, other plugins may have their rules inadvertently discarded. Additionally, some function such as `url_to_post_id` cause a rewrite rule lookup that could cause this accidental flushing. This forces the flushing to only occur once `wp_loaded` has been fired.

Fixes #37892.
Props Chouby.


Built from https://develop.svn.wordpress.org/trunk@38751


git-svn-id: http://core.svn.wordpress.org/trunk@38694 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-07 19:44:28 +00:00
Dominik Schilling 0dcd49e6fc Taxonomy: Don't drop term order and current page when bulk deleting terms.
* Removes special handling for `edit-tags.php` which is no longer required because of `term.php`. Related: [34202] and [36308].
* Sets `$referer` to `$_SERVER['REQUEST_URI']` because `wp_get_referer()` returns false if `$_SERVER['REQUEST_URI'] === $_REQUEST['_wp_http_referer']`.
* Sets `paged` always to `$pagenum` which is the value of `$wp_list_table->get_pagenum();`. This avoids an additional redirect when you delete an item which was previously on the last page.

Fixes #38194.
Built from https://develop.svn.wordpress.org/trunk@38750


git-svn-id: http://core.svn.wordpress.org/trunk@38693 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-07 19:39:29 +00:00
Dominik Schilling ae2ff33c91 Docs: Improve formatting of filter docs added in [38689].
Fixes #35590.
Built from https://develop.svn.wordpress.org/trunk@38749


git-svn-id: http://core.svn.wordpress.org/trunk@38692 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-07 19:24:28 +00:00
Dominik Schilling fc79800fc5 Comments: Pass `$comment` to the `comment_max_links_url` filter.
Props rachelbaker.
Fixes #37955.
Built from https://develop.svn.wordpress.org/trunk@38748


git-svn-id: http://core.svn.wordpress.org/trunk@38691 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-07 18:32:29 +00:00
Pascal Birchler ef8f9168b6 Taxonomy: Introduce `WP_Taxonomy` and use it in `register_taxonomy()` and `unregister_taxonomy()`.
This changes the global `$wp_taxonomies` to an array of `WP_Taxonomy ` objects. `WP_Taxonomy ` includes methods to handle rewrite rules and hooks.
Each taxonomy argument becomes a property of `WP_Taxonomy`. Introducing such a class makes further improvements in the future much more feasible.

Props boonebgorges for review.
Fixes #36224. See #36217.
Built from https://develop.svn.wordpress.org/trunk@38747


git-svn-id: http://core.svn.wordpress.org/trunk@38690 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-07 17:12:29 +00:00
Pascal Birchler 561c136b8f Docs: Document global variables used by `get_the_content()`.
Props goranseric, morganestes.
Fixes #37173.
Built from https://develop.svn.wordpress.org/trunk@38746


git-svn-id: http://core.svn.wordpress.org/trunk@38689 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-07 17:00:29 +00:00
Pascal Birchler 319d885ea0 Plugins: Correctly display the current plugin in the plugin editor.
When editing a plugin file, show the correct plugin as being edited in the dropdown with the correct activation status.

Props aniketpant, dd32, DrewAPicture, jayarjo, MattyRob, mt8.biz, solarissmoke, swissspidy, WraithKenny.
Fixes #24122, #17552.
Built from https://develop.svn.wordpress.org/trunk@38745


git-svn-id: http://core.svn.wordpress.org/trunk@38688 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-07 16:58:28 +00:00
Pascal Birchler ff411ed5f4 Menus: Do not show trashed posts in nav menus.
Trashed posts cannot be accessed by site visitors and thus should not be visible on the front end. By marking menu items of trashed posts as invalid, they are excluded from the output.

Props solarissmoke, swissspidy.
Fixes #19038.
Built from https://develop.svn.wordpress.org/trunk@38744


git-svn-id: http://core.svn.wordpress.org/trunk@38687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-07 16:50:29 +00:00
Pascal Birchler d7c994d1bf Upgrade/Install: Show correct time of last checked update.
Props PieWP for initial patch.
Fixes #37554.
Built from https://develop.svn.wordpress.org/trunk@38743


git-svn-id: http://core.svn.wordpress.org/trunk@38686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-07 16:37:31 +00:00
Weston Ruter 2f52e4db9b Customize: Add workaround for Safari bug causing preview frame to be unscrollable via `mousewheel` after a refresh.
Props westonruter, tristangemus.
Fixes #38149.

Built from https://develop.svn.wordpress.org/trunk@38742


git-svn-id: http://core.svn.wordpress.org/trunk@38685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-06 20:17:29 +00:00
Rachel Baker 6cab59e945 Trackbacks: Allow the error message strings passed to `trackback_response()` to be translatable.
Localize the error messages in wp-trackback.php.

Props websupporter.
Fixes #38214.
Built from https://develop.svn.wordpress.org/trunk@38741


git-svn-id: http://core.svn.wordpress.org/trunk@38684 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-06 18:09:29 +00:00
Rachel Baker 4ca1385b60 Comments: Account for the `comment_order` option in `get_page_of_comment()`.
Use the value of the `comment_order` setting to determine the date_query key to pass to `WP_Comment_Query`.
Fixes a bug where sites that had comments ordered "newest" first would have the incorrect page number returned.

Props tyxla, boonebgorges.
Fixes #31101.
Built from https://develop.svn.wordpress.org/trunk@38740


git-svn-id: http://core.svn.wordpress.org/trunk@38683 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-06 17:42:29 +00:00
Helen Hou-Sandí e4bfe48ebc Login: Don't rely on `wp_is_mobile()` for functionality.
Making behavior changes based on some broad definition of what mobile is rarely, if ever, makes sense. Each bit of functionality should be more clearly targeted, whether that's for screen size, performance, or some kind of touch capability.

props akibjorklund.
see #33704.

Built from https://develop.svn.wordpress.org/trunk@38739


git-svn-id: http://core.svn.wordpress.org/trunk@38682 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-06 15:52:30 +00:00
Rachel Baker 0438d27410 Comments: Improve check for previous comments for authenticated users in `check_comment()`.
When the 'comment_whitelist' option is enabled and the commenter is an authenticated user, query for the existence of an approved comment with a matching `user_id`.  This allows authenticated users that have changed their email address to bypass having their comment held for moderation.

Props voldemortensen, rachelbaker.
Fixes #28603.
Built from https://develop.svn.wordpress.org/trunk@38738


git-svn-id: http://core.svn.wordpress.org/trunk@38681 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-06 15:51:31 +00:00
Boone Gorges 35be5138e9 Docs: Improvements to `register_taxonomy()` docblock.
* Fix spelling and whitespace.
* Remove `$label` argument documentation. This argument hasn't worked since [14614], despite the documentation added in [14619].

Props bobbingwide.
Fixes #38007.
Built from https://develop.svn.wordpress.org/trunk@38737


git-svn-id: http://core.svn.wordpress.org/trunk@38680 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-06 01:30:30 +00:00
Dion Hulse a71c15f0c8 Updates: Remove the 'Download' button on the Updates screen.
Props swissspidy.
Fixes #36811.

Built from https://develop.svn.wordpress.org/trunk@38736


git-svn-id: http://core.svn.wordpress.org/trunk@38679 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-06 01:06:31 +00:00
Helen Hou-Sandí 10323e5e22 Taxonomy: Remove the popular tag cloud from `edit-tags.php`.
Sorting by count (which wasn't possible at the time the tag cloud was introduced) is more effective, though we should likely make count sort by `DESC` initially rather than `ASC`.

props ramiy.
fixes #36964.

Built from https://develop.svn.wordpress.org/trunk@38735


git-svn-id: http://core.svn.wordpress.org/trunk@38678 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-05 21:26:31 +00:00
Joe McGill eed325bbc2 Media: Improve docs for `image_send_to_editor` filter.
This updates inline docs for the `image_send_to_editor` filter to better
describe when it is fired.

Props adamsilverstein.
Fixes #34823.
Built from https://develop.svn.wordpress.org/trunk@38734


git-svn-id: http://core.svn.wordpress.org/trunk@38677 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-05 19:57:28 +00:00
Joe McGill 173f9b6f22 Media: Better handling of JOINs when searching filenames.
Following [38625], any media searches that already included JOINs,
e.g., `tax_queries`, would get trampled when we joined the post meta
table to search for filenames. This preserves existing JOINs and
also only applies the `_filter_query_attachment_filenames()` filter
when a search query is being performed.

Props flixos90, joemcgill.
Fixes #22744.
Built from https://develop.svn.wordpress.org/trunk@38733


git-svn-id: http://core.svn.wordpress.org/trunk@38676 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-05 19:51:30 +00:00
John Blackbourn 0383319aef Role/capability: Add more complete capability and role assertions to existing user capability tests. Also reuses one more user account fixtures.
Fixes #38236
See #38235

Built from https://develop.svn.wordpress.org/trunk@38732


git-svn-id: http://core.svn.wordpress.org/trunk@38675 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-05 17:18:28 +00:00
John Blackbourn 7869eaa0c6 Role/Capability: Reuse some user account fixtures in the user capability tests.
See #38235

Built from https://develop.svn.wordpress.org/trunk@38731


git-svn-id: http://core.svn.wordpress.org/trunk@38674 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-05 16:57:30 +00:00
Dion Hulse 93f7f904ec HTTP: Document that the return value of `wp_remote_retrieve_headers()` changed from a simple array to an object which implements ArrayAccess.
Props mrahmadawais, sudar, swissspidy.
Fixes #37722

Built from https://develop.svn.wordpress.org/trunk@38730


git-svn-id: http://core.svn.wordpress.org/trunk@38673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-05 03:51:28 +00:00
Dion Hulse b83a62217e Plugins: Display 'Less Than 10' active installs of a plugin rather than '0+' active installs.
Props ovann86.
Fixes #37509.

Built from https://develop.svn.wordpress.org/trunk@38729


git-svn-id: http://core.svn.wordpress.org/trunk@38672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-05 03:33:29 +00:00
Dion Hulse d317fa487f HTTP: Update Requests to master (0048f3c) which fixes a number of outstanding issues.
Fixes #38070, #37733 by reverting part of [38429] and using the fix in Requests.
Fixes #37992 allowing for connecting to SSL resources on ports other than 443.
Fixes #37991 by not sending default ports in the `Host:` header.
Fixes #37839 to match and decode Chunked responses correctly.
Fixes #38232 allowing a SSL connection to ignore the hostname of the certificate when verification is disabled.

Built from https://develop.svn.wordpress.org/trunk@38727


git-svn-id: http://core.svn.wordpress.org/trunk@38670 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-05 03:24:37 +00:00
Peter Wilson 7a52a3aac7 HTTP API: Simplify `wp_parse_url()` to ensure consistent results.
[38694] revealed some URL formats were been parsed incorrectly, including those used by Google Fonts. This change simplifies the function to use placeholder values which cause PHP's parsing to behave consistently.

Props jrf, peterwilsoncc.
Fixes #36356.

Built from https://develop.svn.wordpress.org/trunk@38726


git-svn-id: http://core.svn.wordpress.org/trunk@38669 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-04 20:33:29 +00:00
Andrea Fercia 86ad7855be Accessibility: Remove target=_blank from the help tab links on several admin screens.
Stop taking control of users' browsers.

Props rianrietveld.
Fixes #38145. See #23432.

Built from https://develop.svn.wordpress.org/trunk@38725


git-svn-id: http://core.svn.wordpress.org/trunk@38668 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-04 20:27:33 +00:00
Gary Pendergast 62a43623a4 Emoji: Update some failing unit tests.
The changes in [38717] weren't reflected in the associated unit tests.

See #38113.


Built from https://develop.svn.wordpress.org/trunk@38724


git-svn-id: http://core.svn.wordpress.org/trunk@38667 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-04 10:38:30 +00:00
Andrea Fercia 2eda436430 Accessibility: Remove target=_blank from the Users and Widgets screens help tabs links.
Stop taking control of users' browsers.

Props rianrietveld.
Fixes #38217. See #23432.

Built from https://develop.svn.wordpress.org/trunk@38723


git-svn-id: http://core.svn.wordpress.org/trunk@38666 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-04 07:10:31 +00:00
Andrea Fercia d65a038ca3 Accessibility: Remove target=_blank from the Plugins, Themes, Media, Update, and Tools screens help tabs links.
Stop taking control of users' browsers.

Props rianrietveld.
Fixes #38215. See #23432.

Built from https://develop.svn.wordpress.org/trunk@38722


git-svn-id: http://core.svn.wordpress.org/trunk@38665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-04 07:08:29 +00:00
Andrea Fercia 902cb70328 Accessibility: Remove target=_blank from the Network screens help tabs links.
Stop taking control of users' browsers.

Props rianrietveld.
Fixes #38159. See #23432.

Built from https://develop.svn.wordpress.org/trunk@38721


git-svn-id: http://core.svn.wordpress.org/trunk@38664 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-04 07:03:31 +00:00
Andrea Fercia f5b1f4ceba Accessibility: Remove target=_blank from the Settings screens help tabs links.
Stop taking control of users' browsers.

Props rianrietveld.
Fixes #38143. See #23432.

Built from https://develop.svn.wordpress.org/trunk@38720


git-svn-id: http://core.svn.wordpress.org/trunk@38663 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-04 06:59:29 +00:00
Andrea Fercia 25a882fc08 Accessibility: Remove target=_blank from the old custom background/header help tabs links.
Stop taking control of users' browsers.

Props rianrietveld.
Fixes #38141. See #23432.

Built from https://develop.svn.wordpress.org/trunk@38719


git-svn-id: http://core.svn.wordpress.org/trunk@38662 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-04 06:57:30 +00:00
Andrea Fercia dc560984ba Accessibility: Remove target=_blank from the comment/edit-comments help tabs links.
Stop taking control of users' browsers.

Props rianrietveld.
Fixes #38140. See #23432.

Built from https://develop.svn.wordpress.org/trunk@38718


git-svn-id: http://core.svn.wordpress.org/trunk@38661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-04 06:54:30 +00:00
Gary Pendergast 84aebb9896 Emoji: Add support for the upcoming Emoji 4 release.
Emoji 4 adds 32 new professions, (with variations for gender and skin tone), and updates 33 existing character for male and female variations.

Fixes #38113 for trunk.


Built from https://develop.svn.wordpress.org/trunk@38717


git-svn-id: http://core.svn.wordpress.org/trunk@38660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-04 03:24:30 +00:00
Boone Gorges c4d3f20870 Docs: Improve description for `term_exists()` `$term` param.
Props Kenshino.
Fixes #37224.
Built from https://develop.svn.wordpress.org/trunk@38716


git-svn-id: http://core.svn.wordpress.org/trunk@38659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-04 02:29:29 +00:00
Boone Gorges e96c617c03 Query: Add nicename and login params to user query.
New parameters are: `login`, `login__in`, `login__not_in`, `nicename`,
`nicename__in`, `nicename__not_in`.

`login__in` and `nicename__in` are also now valid values for the
'orderby' parameter.

Props ryanplas.
Fixes #36624.
Built from https://develop.svn.wordpress.org/trunk@38715


git-svn-id: http://core.svn.wordpress.org/trunk@38658 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-04 02:27:29 +00:00
Sergey Biryukov 63d73b30a8 Unit Tests: Remove unused variable in `Tests_oEmbed::dataShouldNotMatchOembedRegex()`.
Props jrf.
See #38187.
Built from https://develop.svn.wordpress.org/trunk@38714


git-svn-id: http://core.svn.wordpress.org/trunk@38657 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-04 00:51:28 +00:00
Gary Pendergast 2d76b94be8 Shortcodes: Add a `do_shortcode_tag` filter.
The addition of the `pre_do_shortcode_tag` in [38506] allows plugins to short-circuit the shortcode execution process, which is particularly helpful for caching expensive shortcodes.

The `do_shortcode_tag` is the corresponding part of that system - when a shortcode hasn't been executed previously, there needs to be a clean method of populating the cache.

Props flixos90.
Fixes #32790.


Built from https://develop.svn.wordpress.org/trunk@38713


git-svn-id: http://core.svn.wordpress.org/trunk@38656 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-04 00:39:37 +00:00
Konstantin Obenland 0e2e239734 Tests: Add newly introduced theme to theme list.
Introduced in [38710].

See #37924.


Built from https://develop.svn.wordpress.org/trunk@38712


git-svn-id: http://core.svn.wordpress.org/trunk@38655 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-03 18:45:30 +00:00
Konstantin Obenland e0669dc255 wpLists: Pass the current element to `process()` to properly register event handlers.
Fixes a bug where new categories couldn't be added from the post edit screen.
Introduced in [38599].

Props dlh.
Fixes #38174.

Built from https://develop.svn.wordpress.org/trunk@38711


git-svn-id: http://core.svn.wordpress.org/trunk@38654 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-03 18:39:30 +00:00
Konstantin Obenland 6335e08ab2 Themes: Account for uppercase chars when managing themes.
Fixes a bug where the UI wasn't updated after deleting/updating a theme.

Also introduces unit tests for theme management ajax handlers. For now they're
focused on `wp_ajax_update_theme()` but they can include tests for other
handlers as well.

Props chrisjean for initial patch.
Fixes #37924.
 

Built from https://develop.svn.wordpress.org/trunk@38710


git-svn-id: http://core.svn.wordpress.org/trunk@38653 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-03 18:13:31 +00:00
Andrea Fercia 6a2d446d9c Customize: Improve the widgets and menu items search.
- adds a "search" icon into the search fields
- adds a hidden description for the widget search field, targeted by `aria-describedby`
- adds the "clear-results" button to the widgets search
- removes the `change` and `search` events bound on the widget search, for these "live searches" WordPress should standardize on `input` (+ `keyup` when needed)
- adds property and function to keep track and update the number of the widgets search results
- the widgets search results are now announced via `wp.a11y.speak()`
- adds a visible and audible message when there are no widgets search results
- moves some CSS to `customize-controls.css`

Props ryankienstra, melchoyce, afercia.
Fixes #36908.

Built from https://develop.svn.wordpress.org/trunk@38709


git-svn-id: http://core.svn.wordpress.org/trunk@38652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-03 16:28:31 +00:00
Pascal Birchler ba22977b29 Toolbar: Be more strict about adding a 'View Posts' link to the toolbar.
After [38634], this adjusts the behaviour to remove redundancy by not displaying the link if the latest posts are shown on the front page. In that scenario, the 'Visit Site' link already points to the latest posts.

Fixes #34113.
Built from https://develop.svn.wordpress.org/trunk@38708


git-svn-id: http://core.svn.wordpress.org/trunk@38651 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-03 08:38:29 +00:00
Pascal Birchler bca93619a5 Editor: Improve documentation for `user_can_richedit()`.
Clarifies the various global variables used in the function.

Props gma992.
Fixes #37321.
Built from https://develop.svn.wordpress.org/trunk@38707


git-svn-id: http://core.svn.wordpress.org/trunk@38650 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-03 07:55:27 +00:00
Pascal Birchler 555d9f3025 Plugins: Fix odd typo introduced in [38703].
`even` should of course be `event`.

See #37973.
Built from https://develop.svn.wordpress.org/trunk@38706


git-svn-id: http://core.svn.wordpress.org/trunk@38649 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-03 07:07:29 +00:00
Pascal Birchler 4a88d55054 I18N: Introduce a user-specific language setting.
By enabling the user to select their preferred locale when editing the profile, we allow for greater personalization of the WordPress admin and therefore a better user experience.

The back end will be displayed in the user's individual locale while the locale used on the front end equals the one set for the whole site. If the user didn't specify a locale, the site's locale will be used as a fallback. The new `locale` property of the `WP_User` class can be used to retrieve the user's locale setting.

Props ocean90, ipm-frommen, swissspidy.
Fixes #29783.
Built from https://develop.svn.wordpress.org/trunk@38705


git-svn-id: http://core.svn.wordpress.org/trunk@38648 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-03 07:04:29 +00:00
Pascal Birchler bd03add624 Import: Fix plugin activation link after installing an importer on multisite.
When installing the importer via Ajax, the activation link should be the same as if the page were reloaded.

Props joelcj91 for initial patch.
Fixes #37943.
Built from https://develop.svn.wordpress.org/trunk@38704


git-svn-id: http://core.svn.wordpress.org/trunk@38647 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-03 06:42:29 +00:00
Pascal Birchler b570b4b18c Plugins: Fix checkbox selection when searching for installed plugins.
Since the plugin search works via Ajax, the JavaScript events need to delegated in order for the checkboxes to work properly.

Props afercia.
Fixes #37973.
Built from https://develop.svn.wordpress.org/trunk@38703


git-svn-id: http://core.svn.wordpress.org/trunk@38646 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-03 06:37:30 +00:00
Weston Ruter f424977028 Menus: Restore checkboxes in post type search which were lost in [38584].
The `$args` variable was being overridden instead of extended, therefore causing the `walker` to be dropped.

Fixes #33742.

Built from https://develop.svn.wordpress.org/trunk@38702


git-svn-id: http://core.svn.wordpress.org/trunk@38645 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-03 02:35:28 +00:00
Sergey Biryukov a5f62988f5 Docs: Correct default value for `next_text` in `paginate_links()`.
Props truongwp.
Fixes #38212.
Built from https://develop.svn.wordpress.org/trunk@38701


git-svn-id: http://core.svn.wordpress.org/trunk@38644 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-02 19:10:28 +00:00
Andrea Fercia 5ab4753564 Accessibility: Editor, Publish meta box: remove a stray label and redundant CSS.
Also, adds a `role="button"` attribute to the "Edit" links.

Props iseulde.
Fixes #28411.

Built from https://develop.svn.wordpress.org/trunk@38700


git-svn-id: http://core.svn.wordpress.org/trunk@38643 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-02 14:38:31 +00:00
Peter Wilson 3c814b5468 Meta: Improve ID casting when getting, updating or deleting meta data.
Blindly casting IDs to absolute integers in `get_metadata_by_mid()`, `update_metadata_by_mid()` and `delete_metadata_by_mid()` can cause unexpected behaviour when a floating or negative number is passed.

Fixes #37746.

Built from https://develop.svn.wordpress.org/trunk@38699


git-svn-id: http://core.svn.wordpress.org/trunk@38642 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-01 06:28:30 +00:00
John Blackbourn b84023ea33 Taxonomy: Introduce more fine grained capabilities for managing taxonomy terms.
This introduces the singular `edit_term`, `delete_term`, and `assign_term` meta capabilities for terms, and switches the base capability name for tags from `manage_categories` to `manage_post_tags` and the corresponding `edit_post_tags`, `delete_post_tags`, and `assign_post_tags`.

All of these capabilities ultimately map to `manage_categories` so by default there is no change in the behaviour of the capabilities for categories, tags, or custom taxonomies. The `map_meta_cap` filter and the `capabilities` argument when registering a taxonomy now allow for control over editing, deleting, and assigning individual terms, as well as a separation of capabilities for tags from those of categories.

Fixes #35614
Props johnjamesjacoby for feedback

Built from https://develop.svn.wordpress.org/trunk@38698


git-svn-id: http://core.svn.wordpress.org/trunk@38641 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-30 22:40:28 +00:00
John Blackbourn 16674f715f Role/Capability: Introduce tests that assert the primitive and meta capability tests test the correct capabilities.
Fixes #38191

Built from https://develop.svn.wordpress.org/trunk@38697


git-svn-id: http://core.svn.wordpress.org/trunk@38640 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-30 22:12:28 +00:00
John Blackbourn 8ee12405a5 Role/Capability: Correct some meta capabilities that were incorrectly listed as primitive capabilities in the role and capability tests.
See #38191

Built from https://develop.svn.wordpress.org/trunk@38696


git-svn-id: http://core.svn.wordpress.org/trunk@38639 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-30 22:11:28 +00:00
John Blackbourn 52cf3d3d0f Role/Capability: Add explicit cases to `map_meta_cap()` for various meta capabilities that are used in core. This will allow more complete meta and primitive capability unit tests in #38191.
Fixes #38201

Built from https://develop.svn.wordpress.org/trunk@38695


git-svn-id: http://core.svn.wordpress.org/trunk@38638 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-30 22:06:28 +00:00
John Blackbourn a51267269b HTTP API: Add a `$component` parameter to `wp_parse_url()` to give it parity with PHP's `parse_url()` function.
Fixes #36356
Props jrf

Built from https://develop.svn.wordpress.org/trunk@38694


git-svn-id: http://core.svn.wordpress.org/trunk@38637 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-30 21:47:28 +00:00
Dominik Schilling b154ab767e Embeds: Add oEmbed support for User, List and Like Twitter timelines.
Props earnjam.
Fixes #38003.
Built from https://develop.svn.wordpress.org/trunk@38693


git-svn-id: http://core.svn.wordpress.org/trunk@38636 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-30 21:42:28 +00:00
Dominik Schilling 9d73dfdc56 Embeds: Update the oEmbed provider test suite.
* Dailymotion: Use an URL for an existing video.
* Facebook: Remove URLs which don't exist and update provider map for [38691].

See #32360.
Built from https://develop.svn.wordpress.org/trunk@38692


git-svn-id: http://core.svn.wordpress.org/trunk@38635 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-30 21:02:28 +00:00
Dominik Schilling 2e4748c544 Embeds: Add support for embedding Facebook photos of a user/page.
See #34737.
Built from https://develop.svn.wordpress.org/trunk@38691


git-svn-id: http://core.svn.wordpress.org/trunk@38634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-30 20:40:28 +00:00
Joe Hoyle ee97e3deb1 Options: Add Unit tests for register_setting.
Test `register_setting` with old and new style of arguments.

Props rmccue.
Fixes #37885.

Built from https://develop.svn.wordpress.org/trunk@38690


git-svn-id: http://core.svn.wordpress.org/trunk@38633 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-30 20:24:28 +00:00
Joe Hoyle d72da116be REST API: Add filters to allow creating REST API middleware plugins.
Introduce two new filters: `rest_request_before_callbacks` and `rest_request_after_callbacks` to
assist REST API middleware plugins to perform pre-callback and cleanup hooks such as `switch_to_blog()`
or caching implementations.

Props jnylen0.
Fixes #35590.

Built from https://develop.svn.wordpress.org/trunk@38689


git-svn-id: http://core.svn.wordpress.org/trunk@38632 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-30 20:12:28 +00:00
Aaron Jorbin 36219c4f95 Build/Test: Bump Autoprefixer to 6.5.0
Also includes a new prefixed value.

Changes:
6.5 “Einigkeit und Recht und Freiheit”
- Add defaults keyword to browsers requirements.
- Fix CSS Grid Layout support.
- Fix align-self cleaning.

6.4.1
- Fix node cloning after some PostCSS plugins.

6.4 “Hic et ubique terrarum”
- Add :any-link selector support.
- Add text-decoration-skip support.
- Add transition: duration property support.
- Fix -webkit- prefix for backface-visibility.
- Fix rad unit support in gradients (by 刘祺).
- Fix transition support in Opera 12.
- Removed Safari TP Grid prefixes support.

6.3.7
- Fix rare Cannot read property 'constructor' of null issue.

6.3.6
- Add Safari TP prefix support for Grid Layout.

6.3.5
- Fix duplicate prefixes for -ms-interpolation-mode.

6.3.4
- Show users coverage for selected browsers in info().

28.0
- Happy Birthday @nacin

See #38199



Built from https://develop.svn.wordpress.org/trunk@38688


git-svn-id: http://core.svn.wordpress.org/trunk@38631 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-30 17:34:33 +00:00
Ryan McCue 7cd7c828cc Options: Move register_setting() from wp-admin to wp-includes.
With [38635], register_setting is now a more generic setting registration function and is usable outside of the admin.

See #37885.

Built from https://develop.svn.wordpress.org/trunk@38687


git-svn-id: http://core.svn.wordpress.org/trunk@38630 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-30 15:53:29 +00:00
Dominik Schilling 30573dc7b2 Add 'urn' to the list of URI protocols whitelisted by default.
Props geekysoft, jorbin.
Fixes #37300.
Built from https://develop.svn.wordpress.org/trunk@38686


git-svn-id: http://core.svn.wordpress.org/trunk@38629 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-30 13:15:28 +00:00
Dominik Schilling ad613ca119 Add test for each whitelisted URI protocol in `wp_allowed_protocols()`.
Move test from [25301] to the new file.

Fixes #38198.
Built from https://develop.svn.wordpress.org/trunk@38685


git-svn-id: http://core.svn.wordpress.org/trunk@38628 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-30 13:12:28 +00:00
Sergey Biryukov 31f0fd5a54 Embeds: Escape periods in oEmbed regex.
Props jrf.
Fixes #38187.
Built from https://develop.svn.wordpress.org/trunk@38684


git-svn-id: http://core.svn.wordpress.org/trunk@38627 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-30 11:25:30 +00:00
Jeremy Felt 01e0a645cc Admin Bar: Remove unused ID `ab-awaiting-mod` from comment count.
This selector has been unused since [19516]. The (now) more appropriate `.awaiting-mod` is used instead.

Props Presskopp.
Fixes #37901.

Built from https://develop.svn.wordpress.org/trunk@38683


git-svn-id: http://core.svn.wordpress.org/trunk@38626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-30 05:02:27 +00:00
Jeremy Felt 1e9f495a18 Multisite: Use `get_sites()` in `get_blogs_of_user()`.
Previously, we looped through all of the site IDs found via user meta and ran `get_blog_details()` for each site. Now, we can pass all of the site IDs at once to `get_sites()` and receive full `WP_Site` objects.

To avoid possible issues with return type, sites are still processed into a standard object that also has a `userblog_id` property attached. Nothing is changed for non-multisite configurations.

Props flixos90.
Fixes #37061.

Built from https://develop.svn.wordpress.org/trunk@38682


git-svn-id: http://core.svn.wordpress.org/trunk@38625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-30 04:35:27 +00:00
Jeremy Felt 5c038aefb3 Multisite: Ensure a consistent `WP_Site` return from `get_site_by_path()`.
It is possible to short circuit `get_site_by_path()` using the `pre_get_site_by_path` filter. When this happens and a standard site object is provided, we can make sure it is upgraded to a proper `WP_Site` object before passing it on.

Props flixos90.
Fixes #37053.

Built from https://develop.svn.wordpress.org/trunk@38681


git-svn-id: http://core.svn.wordpress.org/trunk@38624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-30 04:10:27 +00:00
Jeremy Felt 0dc18d3ffb Multisite: Use `get_sites()` in network upgrade.
Use `get_sites()` to generate the same query that was previously performed manually.

Props spacedmonkey, flixos90.
Fixes #37823.

Built from https://develop.svn.wordpress.org/trunk@38680


git-svn-id: http://core.svn.wordpress.org/trunk@38623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-30 03:51:30 +00:00
Boone Gorges 0aca312697 Tests: Move `get_the_excerpt()` tests to their own file.
See #36934. Fixes #38196.

Built from https://develop.svn.wordpress.org/trunk@38679


git-svn-id: http://core.svn.wordpress.org/trunk@38622 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-30 03:24:29 +00:00
Boone Gorges cb68ce1fc4 Tests: Reset post-related globals after each test.
Globals like `$pages` were leaking between tests, resulting in various
bits of weirdness.

Globals will kill WordPress. Globals are killing WordPress.

See #38196.
Built from https://develop.svn.wordpress.org/trunk@38678


git-svn-id: http://core.svn.wordpress.org/trunk@38621 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-30 03:16:29 +00:00
Dominik Schilling 324748a854 Taxonomy: Use `WP_Term_Query` in `get_term_by()`.
`WP_Term_Query` already supports querying terms by 'slug', 'name', and 'term_taxonomy_id'. Its additional arguments allow us to generate nearly the same SQL queries as before.
This change has one yuge benefit: the term queries are now cached. 

Add tests to increase coverage of `get_term_by()`.

Props spacedmonkey, boonebgorges, johnjamesjacoby, pento, ocean90.
Fixes #21760.
Built from https://develop.svn.wordpress.org/trunk@38677


git-svn-id: http://core.svn.wordpress.org/trunk@38620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-29 22:36:30 +00:00
Ryan McCue e53b79b726 Options: Add missing since for register_setting argument.
[38635] added support for extra arguments on registration, but was not documented.

See #37885.

Built from https://develop.svn.wordpress.org/trunk@38676


git-svn-id: http://core.svn.wordpress.org/trunk@38619 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-29 21:12:27 +00:00
Sergey Biryukov 6c2d92c19f Docs: Correct 'Since' version number for Cloudup in `oembed_providers` filter description.
Props jrf.
Fixes #38188.
Built from https://develop.svn.wordpress.org/trunk@38675


git-svn-id: http://core.svn.wordpress.org/trunk@38618 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-29 17:13:29 +00:00
Rachel Baker bf21f3f62f Comments: Introduce the `wp_update_comment_data` filter.
Filters the comment data immediately before it is updated in the database. 

Props frankiet, dshanske, DrewAPicture.
Fixes #36302.
Built from https://develop.svn.wordpress.org/trunk@38674


git-svn-id: http://core.svn.wordpress.org/trunk@38617 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-29 13:47:31 +00:00
Joe McGill 498040b809 Media: Use `wp_basename()` to create attachment titles from filenames.
In [38294], `pathinfo()` was used with the `PATHINFO_BASENAME` constant to
get the basename of the file to be used as an attachment title, which depends
on PHP locale and can cause issues with UTF-8 characters. This uses
`wp_basename()` instead, which is a more i18n-friendly version of `basename()`.

Props SergeyBiryukov.
Fixes #37608, #37989.
Built from https://develop.svn.wordpress.org/trunk@38673


git-svn-id: http://core.svn.wordpress.org/trunk@38616 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-29 01:21:31 +00:00
Andrea Fercia eeefec932f Administration: Improve the usage of the button CSS classes.
Introduces some consistency in the usage of the button CSS classes, fixes the
focus style for accessibility and responsiveness of the buttons.

- Adds the `button` class to all primary buttons make them responsive
- Removes all `secondary-button` classes and replaces it with button when needed. `button-secondary` shouldn't be used and exists just for backward compatibility reasons
- Replaces classes inside `submit_button()` with a shorthand for some buttons, and use an empty string for the default `button` class. Passing `button` is unnecessary
- Adjusts `get_submit_button()` to remove empty items

Props iseulde, dimchik, chris_d2d, mhowell, afercia.
Fixes #27314, #37138, #37448.

Built from https://develop.svn.wordpress.org/trunk@38672


git-svn-id: http://core.svn.wordpress.org/trunk@38615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-28 19:54:28 +00:00
Aaron Jorbin 232be98c0e Pings/Trackbacks: Add filter argument to fetching of pingbacks_url in `X-pingback` header
It is possible to delegate pingback processing to a service function outside of WordPress itself. All other calls in default themes (and likely other themes) uses `bloginfo` which automatically adds the filter argument of "display".  This adds consistency.

Props dshanske.
Fixes #34633.


Built from https://develop.svn.wordpress.org/trunk@38671


git-svn-id: http://core.svn.wordpress.org/trunk@38614 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-28 19:28:30 +00:00
Pascal Birchler cfa32db674 Docs: Improve parameter description for `wp_parse_args()`.
Props dimadin for initial patch.
Fixes #38167.
Built from https://develop.svn.wordpress.org/trunk@38670


git-svn-id: http://core.svn.wordpress.org/trunk@38613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-28 08:41:29 +00:00
Boone Gorges 0d01992968 Set default value of 'max_depth' in `get_comment_reply_link()`.
Introduced in [8878].

Props d4z_c0nf.
Fixes #38170.
Built from https://develop.svn.wordpress.org/trunk@38669


git-svn-id: http://core.svn.wordpress.org/trunk@38612 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-28 04:20:55 +00:00
Weston Ruter 9a9af068e5 Customize: Fix focusing on controls for widgets and nav menu items after [38648].
Shift-click on nav menu items was not expanding the nav menu section, and shift-clicking on widgets would not always result in focus being added to an element in the control's container.

See #34391.

Built from https://develop.svn.wordpress.org/trunk@38668


git-svn-id: http://core.svn.wordpress.org/trunk@38611 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-28 04:20:29 +00:00
Boone Gorges 3b6314e032 Taxonomy: Use `WP_Term_Query` when querying for object terms.
The new 'object_ids' parameter for `WP_Term_Query` allows queries for
terms that "belong to" a given object. This change makes it possible
to use `WP_Term_Query` inside of `wp_get_object_terms()`, rather than
assembling a SQL query.

The refactor has a couple of benefits:
* Less redundancy.
* Better consistency in accepted arguments between the term query functions. See #31105.
* Less redundancy.
* Object term queries are now cached. The `get_object_term_cache()` cache remains, and will be a somewhat less fragile secondary cache in front of the query cache (which is subject to frequent invalidation).
* Less redundancy.

A small breaking change: Previously, if a non-hierarchical taxonomy had
terms that had a non-zero 'parent' (perhaps because of a direct SQL
query), `wp_get_object_terms()` would respect the 'parent' argument.
This is in contrast to `WP_Term_Query` and `get_terms()`, which have
always rejected 'parent' queries for non-hierarchical taxonomies. For
consistency, the behavior of `get_terms()` is being applied across the
board: passing 'parent' for a non-hierarchical taxonomy will result in
an empty result set (since the cached taxonomy hierarchy will be empty).

Props flixos90, boonebgorges.
See #37198.
Built from https://develop.svn.wordpress.org/trunk@38667


git-svn-id: http://core.svn.wordpress.org/trunk@38610 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-28 03:55:33 +00:00
Sergey Biryukov ee109482db Text Changes: Unify two more permission error messages.
Props ramiy.
Fixes #38158. See #34521.
Built from https://develop.svn.wordpress.org/trunk@38666


git-svn-id: http://core.svn.wordpress.org/trunk@38609 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-28 00:17:28 +00:00
Sergey Biryukov ddd0456020 Text Changes: Unify two permission error messages in `wp-admin/network/site-users.php`.
Props ramiy.
Fixes #38178. See #34521.
Built from https://develop.svn.wordpress.org/trunk@38665


git-svn-id: http://core.svn.wordpress.org/trunk@38608 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-27 23:52:28 +00:00
Jeremy Felt 1084773c1c Multisite: Use `get_home_url()` instead of `get_blogaddress_by_id()` in `wp-activate.php`.
`get_home_url()` is a better fit for the "View your site" link and can be properly filtered. This is the last remaining use of `get_blogaddress_by_id()` in core.

Props boboudreau, spacedmonkey.
Fixes #26855.

Built from https://develop.svn.wordpress.org/trunk@38664


git-svn-id: http://core.svn.wordpress.org/trunk@38607 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-27 21:36:28 +00:00
Dominik Schilling 8cb4991bcf Toolbar: Split tests added in [38660] and add a multisite specific test.
See #37949.
Built from https://develop.svn.wordpress.org/trunk@38663


git-svn-id: http://core.svn.wordpress.org/trunk@38606 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-27 20:11:28 +00:00
Jeremy Felt 7d6c7b441d Multsite: Flush output buffer after `readfile()` in `ms-files.php`.
Props fuscata, MikeLittle for testing, iamfriendly for testing.
Fixes #14730.

Built from https://develop.svn.wordpress.org/trunk@38662


git-svn-id: http://core.svn.wordpress.org/trunk@38605 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-27 20:05:28 +00:00
Dominik Schilling d3b9431ab9 Toolbar: Don't run the test from [38660] for multisite.
See #37949.
Built from https://develop.svn.wordpress.org/trunk@38661


git-svn-id: http://core.svn.wordpress.org/trunk@38604 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-27 19:38:27 +00:00
Dominik Schilling 7627255d7e Toolbar: Update links to the about page if current user can't access the dashboard of the current site.
Add missing focus styling for menu items with an icon.

Fixes #37949.
Built from https://develop.svn.wordpress.org/trunk@38660


git-svn-id: http://core.svn.wordpress.org/trunk@38603 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-27 19:01:29 +00:00
Jeremy Felt b5d68be194 Multisite: Use `get_sites()` instead of a database lookup in `get_id_from_blogname()`.
Because queries generated via `get_sites()` are cached, we can remove the `get_id_from_blogname` cache key.

Props flixos90.
Fixes #38175.

Built from https://develop.svn.wordpress.org/trunk@38659


git-svn-id: http://core.svn.wordpress.org/trunk@38602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-27 18:18:28 +00:00
Jeremy Felt 7fe5b6d182 Multisite: Handle `get_id_from_blogname()` lookups when the network domain has `www.`.
Previously, if a network's domain started with `www.` in a subdomain configuration, a slug lookup with `get_id_from_blogname()` would not match an existing site. A similar lookup in a subdirectory configuration would work fine.

This strips `www.` from the network's domain in a subdomain configuration during the lookup and returns the site as expected.

Adds tests which would previously fail in a subdomain configuration, but now pass in both configurations.

Props igmoweb, flixos90.
Fixes #34450.

Built from https://develop.svn.wordpress.org/trunk@38658


git-svn-id: http://core.svn.wordpress.org/trunk@38601 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-27 17:57:30 +00:00
Jeremy Felt 3d19ab1ce2 Multisite: Remove redundant `is_multisite()` checks in network admin templates.
`wp-admin/network/admin.php` is required by all of the individual network templates and begins with an `is_multisite()` check of its own. Because of this, we can remove the 26 other checks in the individual templates.

Props flixos90.
Fixes #37447.

Built from https://develop.svn.wordpress.org/trunk@38657


git-svn-id: http://core.svn.wordpress.org/trunk@38600 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-27 15:39:29 +00:00
Jeremy Felt 03dd15bf7f Multisite: Replace `die()` with `wp_die()` in site users list table.
`wp_die()` is available and appropriate when checking capabilities while processing list table actions.

Props imath.
Fixes 38151.

Built from https://develop.svn.wordpress.org/trunk@38656


git-svn-id: http://core.svn.wordpress.org/trunk@38599 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-27 15:27:30 +00:00
Dominik Schilling 4a6f90db58 Multisite: Allow to set the site language of a new site to English.
An empty string in `WPLANG` is used to define the site language as `en_US`. The `! empty()` check didn't catch this case so that `wpmu_create_blog()` fell back to the network setting.

Fixes #36918.
Built from https://develop.svn.wordpress.org/trunk@38655


git-svn-id: http://core.svn.wordpress.org/trunk@38598 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-26 18:39:32 +00:00
John Blackbourn a1ef815d04 Built/Test Tools: Unify the way the permastructure is set when used in conjunction with re-registering the initial taxonomies. This ensure that rewrite rules for taxonomies are consistently available.
Fixes #35452

Built from https://develop.svn.wordpress.org/trunk@38654


git-svn-id: http://core.svn.wordpress.org/trunk@38597 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-26 17:02:29 +00:00
John Blackbourn 61ff4980a4 Administration: Remove the `input` qualifier for the `.regular-text` class rule. This allows for other elements such as textareas to be styled with the same width as regular text inputs.
Fixes #20928
Props curdin

Built from https://develop.svn.wordpress.org/trunk@38653


git-svn-id: http://core.svn.wordpress.org/trunk@38596 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-26 16:46:33 +00:00
Andrea Fercia c3ad2eee78 Accessibility: Handle focus when closing the media modal.
When closing the media modal, by default focus should be moved back to the UI
control that was clicked to open the modal. The only exception is when inserting
images into the Visual or Text editor.

Fixes #38142.

Built from https://develop.svn.wordpress.org/trunk@38652


git-svn-id: http://core.svn.wordpress.org/trunk@38595 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-25 21:33:31 +00:00
Boone Gorges 13f243747f Allow 'role' parameters to be passed to `wp_dropdown_users()`.
`wp_dropdown_users()` contains a whitelist of function params that are
passed through to `get_users()`. `role`, `role__in`, and `role__not_in`
have now been added to this whitelist.

Props sillybean.
Fixes #38135.
Built from https://develop.svn.wordpress.org/trunk@38651


git-svn-id: http://core.svn.wordpress.org/trunk@38594 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-25 17:45:28 +00:00
Boone Gorges 0d1d1c4d06 Pass comment ID to `get_page_of_comment` filter.
Introduced in [34808].

Props zhildzik.
Fixes #38155.
Built from https://develop.svn.wordpress.org/trunk@38650


git-svn-id: http://core.svn.wordpress.org/trunk@38593 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-25 17:33:32 +00:00
Weston Ruter 76681c40e3 Customize: Opt to disable IE8 support via conditional comments instead of using unreliable `Array.prototype.indexOf` feature detection.
Deprecate/remove `WP_Customize_Manager::customize_preview_html5()` and remove `document.head` polyfill, both of which were only in place for IE8 support.

Props ryankienstra, westonruter.
Fixes #38021.

Built from https://develop.svn.wordpress.org/trunk@38649


git-svn-id: http://core.svn.wordpress.org/trunk@38592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-25 04:35:32 +00:00
Weston Ruter 9fe024cd3f Customize: Re-architect and harden panel/section UI logic.
Removes contents for sections and panels from being logically nested (in the DOM) in order to eliminate many issues related to using `margin-top` hacks. The element containing the link to expand the content element for panels and sections is now a sibling element to its content element: the content is removed from being nested at initialization. The content element is now available in a `contentContainer` property whereas the head element (containing the link to open the construct) is in a `headContainer` property. The existing `container` property is now a jQuery collection that contains both of these elements. Since the head element is no longer in an ancestor element to the `content` element, the `aria-owns` property is now used to maintain the relationship between the `headContainer` and the `contentContainer`. These changes are also accompanied by an improvement to the animation performance for the sliding panes.

Props delawski, celloexpressions.
Fixes #34391.
Fixes #34344.
Fixes #35947.

Built from https://develop.svn.wordpress.org/trunk@38648


git-svn-id: http://core.svn.wordpress.org/trunk@38591 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-23 22:23:30 +00:00
Eric Lewis d27606936b Allow custom bulk actions in admin list tables.
Bulk action filtering was introduced in 3.1, but only to remove default bulk actions, not add new ones.

Bulk actions can now be registered for all admin list table dropdowns via the `bulk_actions-{get_current_screen()->id}` filter. Handling custom bulk actions can be performed in the corresponding and newly introduced `handle_bulk_actions-${get_current_screen()->id}` filter.

Props scribu, flixos90, Veraxus.
See #16031.


Built from https://develop.svn.wordpress.org/trunk@38647


git-svn-id: http://core.svn.wordpress.org/trunk@38590 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-23 20:33:30 +00:00
Sergey Biryukov c3ad13e72e I18N: Add support for Serbian crossed D in `remove_accents()`.
Props Krstarica for the report.
Fixes #38078.
Built from https://develop.svn.wordpress.org/trunk@38646


git-svn-id: http://core.svn.wordpress.org/trunk@38589 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-23 00:07:29 +00:00
Sergey Biryukov bae2b337f0 Docs: Add `home` and `commentpaged` as accepted values for `user_trailingslashit` filter.
Props sebastian.pisula.
Fixes #37734.
Built from https://develop.svn.wordpress.org/trunk@38645


git-svn-id: http://core.svn.wordpress.org/trunk@38588 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-22 22:54:29 +00:00
Sergey Biryukov bb0cec0bfe Docs: Add documentation for `wp-admin/js/inline-edit-tax.js`.
Props atimmer, boblinthorst.
Fixes #37571.
Built from https://develop.svn.wordpress.org/trunk@38644


git-svn-id: http://core.svn.wordpress.org/trunk@38587 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-22 18:50:28 +00:00
Sergey Biryukov 78138cd2c7 Docs: Add documentation for `wp-admin/js/postbox.js`.
Props atimmer, andizer.
Fixes #37365.
Built from https://develop.svn.wordpress.org/trunk@38643


git-svn-id: http://core.svn.wordpress.org/trunk@38586 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-22 18:47:31 +00:00
Andrea Fercia b558fbec6f Accessibility: Fix the Customizer available menu items toggles focus for Safari and VoiceOver.
In rare circumstances, for example buttons with icons and no visible text,
`user-select: none;` may trigger a bug that happens only when using Safari and
VoiceOver and doesn't allow focusable elements to receive focus correctly.
Worth reminding `user-select: none;` is a non-standard property and should be
used with care especially now that `::selection` is almost universally supported.

Fixes #37589.

Built from https://develop.svn.wordpress.org/trunk@38642


git-svn-id: http://core.svn.wordpress.org/trunk@38585 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-22 14:59:30 +00:00
Sergey Biryukov d790e246d5 Docs: Correct `@see` entry for `clean_url()`.
Props rabmalin.
Fixes #38126.
Built from https://develop.svn.wordpress.org/trunk@38641


git-svn-id: http://core.svn.wordpress.org/trunk@38584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-22 09:40:31 +00:00
Andrea Fercia 88c7224355 Accessibility: Add Themes Feature Filter form improvements.
- adds "Apply Filters" and "Clear" at the end of the form
- changes the "Feature Filter", "Apply Filters", "Clear", and "Edit" links in `<button>` elements
- removes a leftover from [27963]
- clarifies one button text and adds an `aria-label` attribute
- adds a `wp.a11y.speak()` message when clicking on "Apply Filters" and no features are selected

Fixes #38086.

Built from https://develop.svn.wordpress.org/trunk@38640


git-svn-id: http://core.svn.wordpress.org/trunk@38583 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-21 17:54:28 +00:00
Dominik Schilling 1babe4b968 Comments: Revert [38298].
Instead use the correct comparison operator which was changed in [38297].

Fixes #37416.
Built from https://develop.svn.wordpress.org/trunk@38639


git-svn-id: http://core.svn.wordpress.org/trunk@38582 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-21 17:38:28 +00:00
Andrea Fercia d885e3cfb0 Administration: Fix the main background color for the Light color scheme.
Props trepmal.
Fixes #38004.

Built from https://develop.svn.wordpress.org/trunk@38638


git-svn-id: http://core.svn.wordpress.org/trunk@38581 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-21 17:36:31 +00:00
Sergey Biryukov fd091e7ced Editor: Improve `post.js` documentation.
Props jipmoors, boblinthorst.
Fixes #38118.
Built from https://develop.svn.wordpress.org/trunk@38637


git-svn-id: http://core.svn.wordpress.org/trunk@38580 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-21 08:57:30 +00:00
Jeremy Felt 58f107fa95 Multisite: Revert [38388].
Restore `get_current_site()` to a multisite only function. Providing this in single site may be a possibility in the future, but should have a dedicated ticket and discussion.

See #37699.

Built from https://develop.svn.wordpress.org/trunk@38636


git-svn-id: http://core.svn.wordpress.org/trunk@38579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-20 21:39:29 +00:00
Joe Hoyle 2ec9f4b369 Options: Build out register_setting like register_meta.
`register_setting` can now be passed an array arguments to specify meta-data about the setting,
much like using the `register_meta` API. Of note, it will now accept a `show_in_rest` arg to
hint the inclusion of the setting in the REST API. `get_registered_settings()` is available
as a utility to get all registered settings.

Props rmccue, aaroncampbell.
Fixes #37885.



Built from https://develop.svn.wordpress.org/trunk@38635


git-svn-id: http://core.svn.wordpress.org/trunk@38578 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-20 20:52:28 +00:00
Pascal Birchler 8fe586ad57 Toolbar: Add a 'View Posts' link to the toolbar when on the post listing screen.
This adds a new link to visit the post type archive if the post type supports it. Also introduces a new `view_items` label to `get_post_type_labels()`.

Props paulwilde, akibjorklund, swissspidy.
Fixes #34113.
Built from https://develop.svn.wordpress.org/trunk@38634


git-svn-id: http://core.svn.wordpress.org/trunk@38577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-20 20:02:28 +00:00
Dominik Schilling 7cbecfa33e Multisite: Show always domain and path when deleting a site.
Add a missing translators comment.

Props ian.edington.
Fixes #37309.
Built from https://develop.svn.wordpress.org/trunk@38633


git-svn-id: http://core.svn.wordpress.org/trunk@38576 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-20 19:55:29 +00:00
Jeremy Felt 63664c1282 Multisite: Use `get_networks()` in `get_main_network_id()`.
The manual query for the main network ID can now be replaced with a cached `get_networks()` query. This allows us to eliminate the `primary_network_id` cache key entirely.

Props spacedmonkey.
Fixes #37218.

Built from https://develop.svn.wordpress.org/trunk@38632


git-svn-id: http://core.svn.wordpress.org/trunk@38575 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-20 18:47:27 +00:00
Jeremy Felt 02c8bd1909 Multisite: Provide `$join` as a possible SQL clause to the `sites_clauses` filter.
Previously, `compact()` provided a non existent `$join` and could cause confusion for anyone attempting to extend `WP_Site_Query` with their own tables. This aligns with the current behavior in `WP_Network_Query`.

Props johnjamesjacoby.
Fixes #37922.

Built from https://develop.svn.wordpress.org/trunk@38631


git-svn-id: http://core.svn.wordpress.org/trunk@38574 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-20 17:49:28 +00:00
Jeremy Felt 1adca14cd7 Multisite: Add annotations for extended `WP_Site` properties.
Props ryanplas.
Fixes #37932.

Built from https://develop.svn.wordpress.org/trunk@38630


git-svn-id: http://core.svn.wordpress.org/trunk@38573 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-20 17:22:29 +00:00
Sergey Biryukov 3c5204f9f4 Docs: Correct the description of `{$taxonomy}_term_new_form_tag` hook, making it more consistent with other `*_form_tag` hooks.
Props BjornW.
Fixes #38104.
Built from https://develop.svn.wordpress.org/trunk@38629


git-svn-id: http://core.svn.wordpress.org/trunk@38572 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-20 13:33:29 +00:00
Dominik Schilling f05c688ec7 Customize: Add `wp-util` as a dependency for `customize-controls`.
Fixes #38107.
Built from https://develop.svn.wordpress.org/trunk@38628


git-svn-id: http://core.svn.wordpress.org/trunk@38571 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-20 13:24:31 +00:00
Weston Ruter 4c4271a691 Customize: Remove IE8 access to customizer to discontinue support.
Uses feature detection for `Array.prototype.indexOf` since it is not implemented in IE8.

Props ryankienstra.
See #38021.

Built from https://develop.svn.wordpress.org/trunk@38627


git-svn-id: http://core.svn.wordpress.org/trunk@38570 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-20 04:02:31 +00:00
Joe McGill 0a906543af Media: Align input and button heights in attachment details.
This tweaks the padding of the text inputs in image settings boxes on
image edit screens to match the height of the scale button.

Props eliorivero.
Fixes #37806.
Built from https://develop.svn.wordpress.org/trunk@38626


git-svn-id: http://core.svn.wordpress.org/trunk@38569 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-20 02:18:30 +00:00
Joe McGill 8f36a570cb Media: Make media library searchable by filename.
This applies a new private function, `_filter_query_attachment_filenames()`,
to the `post_clauses` filter hook during `wp_ajax_query_attachments()` and
`wp_edit_attachments_query_vars()` to include `_wp_attached_file` post meta
in search queries performed from the media library or in a `WP_Media_List_Table`.

Props wonderboymusic, DrewAPicture, joemcgill, swissspidy.
Fixes #22744.
Built from https://develop.svn.wordpress.org/trunk@38625


git-svn-id: http://core.svn.wordpress.org/trunk@38568 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-20 01:45:31 +00:00
Weston Ruter d84c343cc6 Customize: Let `static_front_page` section be contextually active based on whether there are any published pages.
If there are no pages when the customizer is opened, the `static_front_page` section will be hidden. As soon as a page is created in the customizer session, the `static_front_page` section will be revealed. Previously the section would not be registered if there were no pages. Page stubs created via nav menus will appear in the `dropdown-pages` controls for `page_for_posts` and `page_on_front`, and such page stubs will thus cause the `static_front_page` section to appear. Plugins that facilitate page creation in the customizer by filtering `get_pages` will also cause the section to appear.

See #34923.
Fixes #38013.

Built from https://develop.svn.wordpress.org/trunk@38624


git-svn-id: http://core.svn.wordpress.org/trunk@38567 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-20 00:47:30 +00:00
Sergey Biryukov 94ff5710ce Docs: Correct two references to plugins in the `$args` parameter description for `themes_api()`.
Props hideokamoto.
Fixes #37939.
Built from https://develop.svn.wordpress.org/trunk@38623


git-svn-id: http://core.svn.wordpress.org/trunk@38566 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-19 16:46:30 +00:00
Sergey Biryukov 05a947c05a Docs: Correct a comment and `@return` entry in `WP_Upgrader::create_lock()`.
Props markshep.
Fixes #38089.
Built from https://develop.svn.wordpress.org/trunk@38622


git-svn-id: http://core.svn.wordpress.org/trunk@38565 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-18 20:16:29 +00:00
Boone Gorges 65bc3d39e6 Pass taxonomy name to actions in term-relationship CRUD functions.
Props Takahashi_Fumiki.
Fixes #38006.
Built from https://develop.svn.wordpress.org/trunk@38621


git-svn-id: http://core.svn.wordpress.org/trunk@38564 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-18 18:53:30 +00:00
Sergey Biryukov 788c3680f9 XML-RPC: Avoid a PHP notice in `::pingback_ping()` if page title was not found.
Props RedSand.
Fixes #36727.
Built from https://develop.svn.wordpress.org/trunk@38620


git-svn-id: http://core.svn.wordpress.org/trunk@38563 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-18 14:26:29 +00:00
John Blackbourn 34a7bc4e67 Upgrade/Install: Automatically log users in after installation.
This change means that after entering their site's settings upon installation, users are immediately logged in and redirected to the admin dashboard, instead of being presented with the 'Success!' screen and then being asked to log in. This reduces friction and reduces the number of steps for installation.

Fixes #34084

Built from https://develop.svn.wordpress.org/trunk@38619


git-svn-id: http://core.svn.wordpress.org/trunk@38562 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-18 11:42:30 +00:00
Weston Ruter 037a236e42 Customize: Ensure nav menu items lacking a label use the title from the original object.
Use original title as placeholder for label and in control title. Prevent original title from overriding empty label in initial setting values.

Fixes #38015.

Built from https://develop.svn.wordpress.org/trunk@38618


git-svn-id: http://core.svn.wordpress.org/trunk@38561 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-17 21:50:30 +00:00
Andrea Fercia ea69657b59 Plugins: style the primary action link in the non-js "Installing Plugin" page.
Props curdin, ericlewis, melchoyce, karmatosed.
Fixes #36430.

Built from https://develop.svn.wordpress.org/trunk@38617


git-svn-id: http://core.svn.wordpress.org/trunk@38560 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-17 16:23:27 +00:00
Andrea Fercia 576bdf9f8c Accessibility: Standardize the remove/delete/cancel links in the Menus screen and Publish meta boxes.
The `submitdelete` CSS class is used in various places across the admin for some
"red" action links. It is worth simplifying this rule for further improvements
related to color contrast.

- simplifies a non-standard styling for the "Remove/Cancel" links in the Menus screen
- underlines all the "Move to trash/Delete" red links in all the Publish meta boxes
- fixes CSS classes usage for all the Publish meta boxes primary buttons
- fixes broken layout for the old Link Manager publish meta box

Props karmatosed, hugobaeta, monikarao, afercia.
Fixes #37969, #37018. See #37448, #37138, #27314.

Built from https://develop.svn.wordpress.org/trunk@38616


git-svn-id: http://core.svn.wordpress.org/trunk@38559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-17 15:39:30 +00:00
Aaron Campbell 405def3da4 Media: Improved media titles when created from filename.
Preserves spaces and generally creates more accurate, cleaner titles from filenames of uploaded media.

Props joemcgill.
Fixes #37989.


Built from https://develop.svn.wordpress.org/trunk@38614


git-svn-id: http://core.svn.wordpress.org/trunk@38557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-17 05:42:31 +00:00
Pascal Birchler 15df6d24eb Menus: Use strict comparison for the condition added in [38612].
See #37846.
Built from https://develop.svn.wordpress.org/trunk@38613


git-svn-id: http://core.svn.wordpress.org/trunk@38556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-15 16:56:29 +00:00
Pascal Birchler a0ce261a24 Menus: Remove 'sub item' label when removing the sub item's parent.
Props rnoakes3rd, adamsilverstein.
Fixes #37846.
Built from https://develop.svn.wordpress.org/trunk@38612


git-svn-id: http://core.svn.wordpress.org/trunk@38555 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-15 16:10:31 +00:00
Sergey Biryukov 0bae73682b I18N: Correct context for Next/Previous strings in `get_the_posts_pagination()`.
Props FlorianBrinkmann.
Fixes #37952.
Built from https://develop.svn.wordpress.org/trunk@38611


git-svn-id: http://core.svn.wordpress.org/trunk@38554 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-15 09:20:29 +00:00
Sergey Biryukov d4d8ae2422 Docs: Use a third-person singular verb for `register_post_type_args` filter added in [34242].
See #37770.
Built from https://develop.svn.wordpress.org/trunk@38610


git-svn-id: http://core.svn.wordpress.org/trunk@38553 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-14 21:58:29 +00:00
Sergey Biryukov f348f9a59c Docs: Use a third-person singular verb for `{$type}_template_hierarchy` filter added in [38385].
See #14310.
Built from https://develop.svn.wordpress.org/trunk@38609


git-svn-id: http://core.svn.wordpress.org/trunk@38552 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-14 21:54:30 +00:00
Sergey Biryukov 9c6da56cc7 Docs: Use a third-person singular verb for `smilies` filter added in [38504].
See #35905.
Built from https://develop.svn.wordpress.org/trunk@38608


git-svn-id: http://core.svn.wordpress.org/trunk@38551 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-14 21:53:29 +00:00
Sergey Biryukov 7196188459 Docs: Use a third-person singular verb for `wp_doing_ajax` filter added in [38334].
See #25669.
Built from https://develop.svn.wordpress.org/trunk@38607


git-svn-id: http://core.svn.wordpress.org/trunk@38550 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-14 21:51:28 +00:00
Sergey Biryukov b6397b4fda Docs: Use a third-person singular verb in the DocBlock summary for `get_theme_file_uri()`, `get_parent_theme_file_uri()`, `get_theme_file_path()`, and `get_parent_theme_file_path()`, introduced in [38578].
See #18302.
Built from https://develop.svn.wordpress.org/trunk@38606


git-svn-id: http://core.svn.wordpress.org/trunk@38549 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-14 21:48:28 +00:00
Sergey Biryukov 4d7e41653e Docs: Use a third-person singular verb for `theme_file_uri`, `parent_theme_file_uri`, `theme_file_path`, and `parent_theme_file_path` filters added in [38578].
See #18302.
Built from https://develop.svn.wordpress.org/trunk@38605


git-svn-id: http://core.svn.wordpress.org/trunk@38548 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-14 21:45:29 +00:00
Sergey Biryukov 4058b11ccd Docs: Add a `@since` entry for the `post_password_required` filter introduced in [38603].
Use a third-person singular verb for the filter description.

See #38056.
Built from https://develop.svn.wordpress.org/trunk@38604


git-svn-id: http://core.svn.wordpress.org/trunk@38547 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-14 21:37:29 +00:00
Aaron Jorbin d31057a009 Posts: Add filter to allow overriding `post_password_required` return
Post Passwords are incredibly inflexible. One Password per site at a time and other limitations that can't really be changed without a backwards compatibility break.  This adds the ability for sites to change the password behavior such as doing per post passwords or allowing multiple passwords to be set in a browser. The possibilities are YUGE.

Additionally, it allows for a behavior other than returning a html form when a password is needed. This is important for non website use cases (such as in a restful API).

Fixes #38056. See #16483.
Props rmccue.


Built from https://develop.svn.wordpress.org/trunk@38603


git-svn-id: http://core.svn.wordpress.org/trunk@38546 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-14 21:28:30 +00:00
Helen Hou-Sandí dd6da701b2 Customizer: Better hover/focus state for section titles and available widgets.
The 4px border pattern is found in a number of places across the admin, including plugins, notices, and Press This.

props celloexpressions, folletto, hugobaeta.
see #29158.


Built from https://develop.svn.wordpress.org/trunk@38602


git-svn-id: http://core.svn.wordpress.org/trunk@38545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-14 16:15:29 +00:00
Joe Hoyle 794dd5d8cb REST API: Enable sanitize_callback to return WP_Error.
Give developers the opportunity to reject incoming data without using the validation callback. It also enables us to do sanitization and validation in one function in instances where this could be useful.

Props websupporter, rmccue.
Fixes #37560.

Built from https://develop.svn.wordpress.org/trunk@38601


git-svn-id: http://core.svn.wordpress.org/trunk@38544 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-14 15:50:29 +00:00
Sergey Biryukov d7f840a211 XML-RPC: Check the minimum number of arguments in `::wp_getUsersBlogs()` and `::blogger_getUsersBlogs()`.
Props kitchin for initial patch.
Fixes #29750.
Built from https://develop.svn.wordpress.org/trunk@38600


git-svn-id: http://core.svn.wordpress.org/trunk@38543 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-13 23:17:28 +00:00
Konstantin Obenland 320fe3a2b6 Make wpList easier to contribute to.
Uses more semantic variable names and adds function and inline documentation.

Props rommelxcastro for parallel work in #34917.
Fixes #36264.

Built from https://develop.svn.wordpress.org/trunk@38599


git-svn-id: http://core.svn.wordpress.org/trunk@38542 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-13 22:24:30 +00:00
Sergey Biryukov 84cf528449 Media: Adjust `test_video_shortcode_body()` after [38597].
See #38040.
Built from https://develop.svn.wordpress.org/trunk@38598


git-svn-id: http://core.svn.wordpress.org/trunk@38541 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-13 14:09:29 +00:00
Sergey Biryukov 893f9487d4 Media: Remove an extra space in `style` attribute in `wp_video_shortcode()` after [30082].
Props danielpietrasik.
Fixes #38040.
Built from https://develop.svn.wordpress.org/trunk@38597


git-svn-id: http://core.svn.wordpress.org/trunk@38540 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-13 13:45:31 +00:00
Sergey Biryukov b434cda3a6 Docs: Synchronize docblocks for `WP_Site_Query::__construct()` and `get_sites()` after the changes in [37735], [38008], [38103], and [38336].
Props MaximeCulea.
Fixes #38039.
Built from https://develop.svn.wordpress.org/trunk@38596


git-svn-id: http://core.svn.wordpress.org/trunk@38539 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-13 13:20:35 +00:00
Sergey Biryukov 1cdb4b52af Docs: Correct description for `domain` and `path` arguments in `WP_Network_Query::__construct()`.
See #32504.
Built from https://develop.svn.wordpress.org/trunk@38595


git-svn-id: http://core.svn.wordpress.org/trunk@38538 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-13 13:10:32 +00:00
Gary Pendergast 3e08cf2b66 Formatting: Update `autop()` to match `wpautop()`.
[38592] changed the behaviour of `wpautop()` , so it's nice to change `autop()` to match.

Interestingly, this change isn't necessary for the functionality to work - #4857 didn't affect content that had been run through `autop()` at some point, as `autop()` would add a single line break before block elements, then `wpautop()` would later add a second line break, making it work correctly.

Props nacin for finding out about [38592] on Twitter, and DMing me to remind me to review `autop()`.
See #4857.


Built from https://develop.svn.wordpress.org/trunk@38594


git-svn-id: http://core.svn.wordpress.org/trunk@38537 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-13 06:03:31 +00:00
Gary Pendergast e1d553e20a Docs: Fix an outdated comment.
[38592] changed the functionality of `wpautop()`, but didn't update the associated comment to match.

Fixes #4857.


Built from https://develop.svn.wordpress.org/trunk@38593


git-svn-id: http://core.svn.wordpress.org/trunk@38536 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-13 04:01:30 +00:00
Gary Pendergast 109ffb9390 Formatting: Add an extra line break before block elements in `wpautop()`.
`wpautop()` considers double line breaks to be the separator between block level HTML elements. By adding two line breaks before a block element, this allows us to process the text before a block element correctly.

Fixes #4857.


Built from https://develop.svn.wordpress.org/trunk@38592


git-svn-id: http://core.svn.wordpress.org/trunk@38535 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-12 07:06:30 +00:00
Gary Pendergast a18b133c01 Database: Normalise index names in `dbDelta()`.
When comparing index definitions, normalise the index names to lower case, as they are not case sensitive within MySQL.

Fixes #34874.


Built from https://develop.svn.wordpress.org/trunk@38591


git-svn-id: http://core.svn.wordpress.org/trunk@38534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-12 05:09:30 +00:00
Gary Pendergast 65fa220a08 Database: Increase the size of `wp_posts.post_password` to 255 characters.
Longer passwords and passphrases are much more common than when post passwords were introduced all those eons ago, so let's increase the length of the `post_password` field from 20 to 255 characters.

The password will continue to be stored in plaintext, as the ability for the post author to view the password is a commonly used feature.

Trivia: this was the last 3 digit Trac ticket to be closed.

Props skippy, nazgul, iandunn, adamsilverstein, pento.
Fixes #881.


Built from https://develop.svn.wordpress.org/trunk@38590


git-svn-id: http://core.svn.wordpress.org/trunk@38533 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-12 02:28:30 +00:00
Gary Pendergast 4dcb7a0fa9 Bootstrap: Use `dirname()` when loading `class-wp-hook.php` from `plugin.php`.
To allow `plugin.php` to be loaded before the rest of WordPress is loaded, it cannot rely on WordPress constants, such as `ABSPATH` and `WPINC`.

Instead, we can assume that `class-wp-hook.php` will be in the same directory as `plugin.php`, so `dirname( __FILE__ )` will give us the correct path to load from.

Props pento, dd32.
Fixes #37707.


Built from https://develop.svn.wordpress.org/trunk@38589


git-svn-id: http://core.svn.wordpress.org/trunk@38532 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-12 01:50:30 +00:00
Weston Ruter 4156988a3c Docs: Fix phpdoc and jsdoc typos introduced in [38584] and [38587], respectively.
See #33742.
See #20714.

Built from https://develop.svn.wordpress.org/trunk@38588


git-svn-id: http://core.svn.wordpress.org/trunk@38531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-11 18:46:30 +00:00
Weston Ruter edf170c943 Customize: Implement previewing of form submissions which use the GET method.
This finally allows the search results template to navigated to in the customizer preview.

Fixes #20714.

Built from https://develop.svn.wordpress.org/trunk@38587


git-svn-id: http://core.svn.wordpress.org/trunk@38530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-11 05:05:30 +00:00
Boone Gorges 132f3d0d19 Query: Eliminate unnecessary `wp_list_filter()` call in `get_queried_object()`.
The refactor in [30711] swapped out the old `queries` property for the
new `queried_terms`, but should also have gotten rid of the now-
superfluous `wp_list_filter()` call.

Fixes #37962.
Built from https://develop.svn.wordpress.org/trunk@38586


git-svn-id: http://core.svn.wordpress.org/trunk@38529 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-09 19:49:29 +00:00
Boone Gorges 163d59f8e1 Query: Avoid PHP notice in `get_queried_object()` when query contains `NOT EXISTS` tax query.
Props johnjamesjacoby.
See #37962.
Built from https://develop.svn.wordpress.org/trunk@38585


git-svn-id: http://core.svn.wordpress.org/trunk@38528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-09 19:37:38 +00:00
Weston Ruter 84f9592f88 Menus: Prevent non-published posts/pages from being returned in search results for adding as nav menu items.
Re-use the same query vars in searching as when listing posts. Aligns with behavior of nav menus in customizer.

Fixes #33742.
Props welcher, westonruter.

Built from https://develop.svn.wordpress.org/trunk@38584


git-svn-id: http://core.svn.wordpress.org/trunk@38527 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-09 04:59:31 +00:00
John Blackbourn e482549183 Themes: Add the non-encoded form of the queried item slug to the template hierarchy when the slug contains non-ASCII characters.
This affects category, tag, and custom taxonomy archives, and single posts, pages, and custom post types.

Fixes #37655

Built from https://develop.svn.wordpress.org/trunk@38583


git-svn-id: http://core.svn.wordpress.org/trunk@38526 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-09 00:48:28 +00:00
Gary Pendergast f54dafc2b7 Tests: Use `add_filter()` when it's available.
The `tests_add_filter()` helper function directly manipulates the `$wp_filter` global, instead of using `add_filter()`. We can use `add_filter()` when it's available, and fall back to manipulating `$wp_filter` when it isn't, relying on the `$wp_filter` bootstrap code at the top of `plugin.php` to handle conversion.

Props boonebgorges, dd32 and pento: WordPress Thought Leadership Triumvirate.
Fixes #17817.


Built from https://develop.svn.wordpress.org/trunk@38582


git-svn-id: http://core.svn.wordpress.org/trunk@38525 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-09 00:34:31 +00:00
Gary Pendergast 2dee7cdffc Database: Fall back to `utf8` when `utf8mb4` isn't supported.
Sometimes, `DB_CHARSET` will be set to `utf8mb4`, even if the current setup doesn't support `utf8mb4`. After [38442], this can cause significant character set failures, causing the connection to fall back to `latin1`.

Instead of doing this, we now check that the connection supports `utf8mb4` before trying to use it, and fall back to `utf8` when we need to.

Fixes #37982 for trunk.

Built from https://develop.svn.wordpress.org/trunk@38580


git-svn-id: http://core.svn.wordpress.org/trunk@38523 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-08 23:49:30 +00:00
John Blackbourn e6e6cbf21f Taxonomy: Revert accidental changes introduced in [38578].
See #18302

Built from https://develop.svn.wordpress.org/trunk@38579


git-svn-id: http://core.svn.wordpress.org/trunk@38522 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-08 22:58:28 +00:00
John Blackbourn c0bb9c2562 Themes: Improve child theme file inheritance by introducing functions for locating and fetching the URL or path to files within child and parent themes.
The most useful function this introduces is `get_theme_file_uri()`, which returns the URL to the specified file in the child theme if it exists, and falls back to the URL to the specified file in the parent theme. This allows parent themes to reference files (including enqueuing CSS and JavaScript files) that can be overridden by the child theme simply by existing.

This change also introduces `get_theme_file_path()`, which is the file path equivalent of `get_theme_file_uri()`.

Finally, `get_parent_theme_file_uri()` and `get_parent_theme_file_path()` are also introduced, which allow a theme to specifically reference a file URL or file path in the parent theme. These can be used as replacements for `get_template_directory_uri()` and `get_template_directory()` respectively, for consistency.

Props johnbillion, georgestephanis, gma992.
Fixes #18302

Built from https://develop.svn.wordpress.org/trunk@38578


git-svn-id: http://core.svn.wordpress.org/trunk@38521 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-08 22:54:32 +00:00
Weston Ruter c1a0ed8540 Customize: Prevent widget previewing logic from building invalid jQuery selectors when sidebars are registered without a class name in `before_widget`.
Fixes #37993.

Built from https://develop.svn.wordpress.org/trunk@38577


git-svn-id: http://core.svn.wordpress.org/trunk@38520 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-08 15:45:31 +00:00
John Blackbourn 3afaf2147c Formatting: Don't send an HTTP status code in `wp_send_json()` by default. This avoids clobbering an HTTP status code that may have been set prior to calling this function.
Props westonruter
See #35666

Built from https://develop.svn.wordpress.org/trunk@38576


git-svn-id: http://core.svn.wordpress.org/trunk@38519 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-08 13:45:34 +00:00
Peter Wilson 06c51c0042 Menus: Fix notices thrown by classes extending `Walker_Nav_Menu`.
Methods in `Walker_Nav_Menu` can be called with multiple, incompatible `$args` objects so an `insset()` check is required to avoid throwing notices.

Introduced in [38523].

Fixes #35206.

Built from https://develop.svn.wordpress.org/trunk@38575


git-svn-id: http://core.svn.wordpress.org/trunk@38518 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-08 07:06:30 +00:00
Peter Wilson 6cdab630cd Menus: Improve documentation of new `$item_spacing` argument.
Adds `@since` tags for and improves description of the new `$item_spacing` argument added to `wp_nav_menu()`, `wp_list_pages()`, and `wp_page_menu()` in [38523].

Props johnbillion for copy.
See #35206.

Built from https://develop.svn.wordpress.org/trunk@38574


git-svn-id: http://core.svn.wordpress.org/trunk@38517 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-08 05:32:03 +00:00
Drew Jaynes f5db425059 Docs: Fix minor formatting for inline docs in `WP_Hook` following its introduction in [38571].
See #17817.

Built from https://develop.svn.wordpress.org/trunk@38573


git-svn-id: http://core.svn.wordpress.org/trunk@38516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-08 04:17:30 +00:00
Aaron Jorbin 7e811d7120 Permalinks: Ensure Pending Review Posts permalink posts link to the draft
[34670] made the displayed permalink clickable. For posts that were pending review, the permalink wasn't being properly generated so the link wouldn't go to the preview.

Props knutsp, enshrined.
Fixes #37423.


Built from https://develop.svn.wordpress.org/trunk@38572


git-svn-id: http://core.svn.wordpress.org/trunk@38515 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-08 04:05:31 +00:00
Gary Pendergast 5a632be944 Hooks: Add the new class `WP_Hook`, and modify hook handling to make use of it.
Filters and actions have been the basis of WordPress' plugin functionality since time immemorial, they've always been a reliable method for acting upon the current state of WordPress, and will continue to be so.

Over the years, however, edge cases have cropped up. Particularly when it comes to recursively executing hooks, or a hook adding and removing itself, the existing implementation struggled to keep up with more complex use cases.

And so, we introduce `WP_Hook`. By changing `$wp_filter` from an array of arrays, to an array of objects, we reduce the complexity of the hook handling code, as the processing code (see `::apply_filters()`) only needs to be aware of itself, rather than the state of all hooks. At the same time, we're able te handle more complex use cases, as the object can more easily keep track of its own state than an array ever could.

Props jbrinley for the original architecture and design of this patch.
Props SergeyBiryukov, cheeserolls, Denis-de-Bernardy, leewillis77, wonderboymusic, nacin, jorbin, DrewAPicture, ocean90, dougwollison, khag7, pento, noplanman and aaroncampbell for their testing, suggestions, contributions, patch maintenance, cajoling and patience as we got through this.
Fixes #17817.


Built from https://develop.svn.wordpress.org/trunk@38571


git-svn-id: http://core.svn.wordpress.org/trunk@38514 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-08 03:55:31 +00:00
John Blackbourn 8bec516c18 Menus: Correct the docblocks for `Walker_Nav_Menu`, `wp_nav_menu()`, and `walk_nav_menu_tree()`.
This corrects the parameter type for the `$args` and `$item` parameters passed throughout these functions, class methods, and hooks.

See #24587
See #35206
See #37770

Built from https://develop.svn.wordpress.org/trunk@38559


git-svn-id: http://core.svn.wordpress.org/trunk@38502 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-07 16:15:30 +00:00
Jeremy Felt c9e60dab17 Media: Sanitize upload filename.
Built from https://develop.svn.wordpress.org/trunk@38538


git-svn-id: http://core.svn.wordpress.org/trunk@38481 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-07 13:55:36 +00:00
Andrea Fercia 4a06a09310 Widgets: Make the Delete/Remove links red.
For consistency and accessibility, all the UI controls that perform destructive
actions should be red.

Props monikarao, lukecavanagh, patilswapnilv, ibachal.
See #35622.
Fixes #37016.

Built from https://develop.svn.wordpress.org/trunk@38536


git-svn-id: http://core.svn.wordpress.org/trunk@38479 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-07 09:52:30 +00:00
Pascal Birchler 18a8cf475b Revert [38401] after [38480].
See #36335.
Built from https://develop.svn.wordpress.org/trunk@38535


git-svn-id: http://core.svn.wordpress.org/trunk@38476 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-06 18:13:35 +00:00
Pascal Birchler 54720a14d8 Upgrade/Install: Sanitize file name in `File_Upload_Upgrader`.
Built from https://develop.svn.wordpress.org/trunk@38524


git-svn-id: http://core.svn.wordpress.org/trunk@38465 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-06 17:26:31 +00:00
Peter Wilson 4131900722 Menus: Add white space option to `wp_nav_menu()` and `wp_list_pages()`.
Adds an `item_spacing` option to the arguments array for the functions `wp_nav_menu()`, `wp_list_pages()`, and `wp_page_menu()`. `item_spacing` is a boolean accepting either `preserve` or `discard`.

Previously, certain CSS choices could result in a site's layout changing if `wp_nav_menu()` fell back to the default `wp_list_pages()` due to differences in the whitespace within the HTML. The new argument ensures a function outputs consistant HTML while maintaining backward compatibility.

Fixes #35206.

Built from https://develop.svn.wordpress.org/trunk@38523


git-svn-id: http://core.svn.wordpress.org/trunk@38464 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-06 09:06:31 +00:00
John Blackbourn cfe941cd6f Role/Capability: Correct the multisite cap tests after [38521].
See #35614
See #32394

Built from https://develop.svn.wordpress.org/trunk@38522


git-svn-id: http://core.svn.wordpress.org/trunk@38463 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-05 12:09:30 +00:00
John Blackbourn 9cf899d6f9 Role/Capability: Split meta and primitive capabilities in the helper functions in the roles and capability tests so primitive capability tests can be made more accurate.
See #35614
See #32394

Built from https://develop.svn.wordpress.org/trunk@38521


git-svn-id: http://core.svn.wordpress.org/trunk@38462 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-05 11:00:32 +00:00
Andrea Fercia 3c1d571cd7 Accessibility: Improve the Customizer and Theme Installer initial focus.
The Customizer and Theme Installer open in full overlays that need to receive 
focus. Also, keyboard navigation should be constrained within the overlays. Using
CSS `visibility` to hide all the content except the overlays, makes them the only
available and focusable content and allows browsers to handle focus natively.

See #29158.
Fixes #33228, #27705.

Built from https://develop.svn.wordpress.org/trunk@38520


git-svn-id: http://core.svn.wordpress.org/trunk@38461 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-04 21:51:31 +00:00