Commit Graph

22377 Commits

Author SHA1 Message Date
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
Sergey Biryukov 2bb27252f9 Script Loader: Correct default value for `$src` in `wp_enqueue_script()` and `wp_enqueue_style()`.
Props Frank Klein for initial patch.
See #37770.
Built from https://develop.svn.wordpress.org/trunk@38519


git-svn-id: http://core.svn.wordpress.org/trunk@38460 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-04 04:09:28 +00:00
Drew Jaynes f0bb2bc3c0 Docs: Update the `$message` parameter for `_default_wp_die_handler()` to notate that it can also accept a `WP_Error` object.
Additionally, update the `$message` parameter description in the DocBlock for `wp_die()` to make it explicitly clear messages derived from a passed `WP_Error` object will only be evaluated if not performing an Ajax or XML-RPC request (as both default handlers completely ignore `WP_Error` object messages).

See #37770.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38459 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-04 03:41:31 +00:00
Sergey Biryukov 59b186febd Upload: Correct encoding issue in `swfupload.js`, introduced in [29479].
See #29199.
Built from https://develop.svn.wordpress.org/trunk@38517


git-svn-id: http://core.svn.wordpress.org/trunk@38458 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-03 15:02:36 +00:00
John Blackbourn d098687501 Taxonomy: Introduce some taxonomy capability tests in preparation for introducing more fine grained capabilities for terms.
See #35614

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


git-svn-id: http://core.svn.wordpress.org/trunk@38457 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-03 02:15:36 +00:00
Jeremy Felt 58bca49227 Multisite: Deprecate `wp_get_network()`.
`wp_get_network()` was converted into a wrapper for `get_network()` in 4.6.0 and can now be deprecated.

This moves `wp_get_network()` to the bottom of `ms-load.php` as `ms-deprecated.php` is not available early enough.

Props PieWP, flixos90.
Fixes #37553.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38456 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-02 23:48:31 +00:00
John Blackbourn a3b581ce64 Embeds: Clarify some assertion failure messages and correct a test URL for Twitter timelines.
See #32360

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


git-svn-id: http://core.svn.wordpress.org/trunk@38455 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-02 22:53:30 +00:00
Weston Ruter 91f583c9af Customize: Fix php warning due to `WP_Customize_Manager::prepare_setting_validity_for_js()` incorrectly assuming that `WP_Error` will only ever have arrays in its `$error_data`.
* Eliminates the server mutating the a `WP_Error`'s `$error_data` to merge-in a `$from_server` flag (since it may not be an array to begin with). Instead it defers to the client to add a `fromServer` param on any `Notification` instances created from server-sent errors.
* Ensures that notifications will be re-rendered if a notification's `message` changes but the `data` and `type` remain the same.
* Adds explicit support for the `Notification` class to have a `setting` property, ensuring that the property is set whereas previously it was dropped.

Fixes #37890.
Props westonruter, dlh.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38454 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-02 22:35:44 +00:00
John Blackbourn 2559ade0ae Embeds: Update the oEmbed provider test suite.
* Remove the manual flag for HTTPS support and replace it with a simple check on the URL format.
* Ensure `testOembedTestsCoverAllProviders()` actually fails when a new provider is added without a corresponding test.

See #32360

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


git-svn-id: http://core.svn.wordpress.org/trunk@38453 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-02 21:36:44 +00:00
Aaron Jorbin dd983343d3 Formatting: Allow KSES custom elements with hyphens
The W3C Custom Elements spec (http://www.w3.org/TR/custom-elements/#concepts) allows you to use your own custom DOM elements/tags. One of the main requirements is that the tag name "must contain a U+002D HYPHEN-MINUS character". This adjusts KSES to allow it.

Fixes #34105.
Props batmoo.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38452 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-02 04:16:28 +00:00
Sergey Biryukov e318b5bf1d I18N: Add translator comments for XML-RPC strings with placeholders.
See #37792.
Built from https://develop.svn.wordpress.org/trunk@38510


git-svn-id: http://core.svn.wordpress.org/trunk@38451 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-02 04:13:28 +00:00
Aaron Jorbin 7a8f0f10ad Text Changes: Improve Error messages in XML-RPC
Three changes to the error message strings:
 * add some missing periods.
 * merge similar translation strings.
 * remove the "Something wrong happened" suffix.

Fixes #37792.
Props ramiy.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38450 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-02 03:57:28 +00:00
Aaron Jorbin 17f21e28f9 Toolbar: Add unit tests for edit links.
When there is no post ID, there should be no edit link. This adds unit tests for it.

Fixes #22247.
Props akibjorklund.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38449 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-02 03:51:29 +00:00
Gary Pendergast 0cff37abf5 Database: Find the correct table names in `DELETE` queries with table aliases
Previously, `wpdb::get_table_from_query()` would not find the correct table name in the query `DELETE a FROM table a`, due to not recognising the table alias immediately after the `DELETE` as correct syntax.

Fixes #37660.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38448 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-02 00:19:28 +00:00
Gary Pendergast 75c1875587 Shortcodes: Add the `pre_do_shortcode_tag` filter.
This filter allows the shortcode generation process to be short-circuited, so expensive short codes can be cached and returned immediately.

Props ideag.
Fixes #37906.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38447 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-02 00:10:28 +00:00
Sergey Biryukov 8682603166 Docs: Correct `@since` entry for the `smilies` filter added in [38504].
See #35905.
Built from https://develop.svn.wordpress.org/trunk@38505


git-svn-id: http://core.svn.wordpress.org/trunk@38446 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-02 00:08:30 +00:00
Gary Pendergast cce2ffaed5 Smilies: Add the `smilies` filter.
This new filter allows the smilies array to be modified with a filter, instead of having to directly access the global.

Props mte90, jorbin.
Fixes #35905.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38445 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-02 00:00:30 +00:00
Andrea Fercia c01c23c4f7 Accessibility: Make links in the Customizer underlined by default.
Links within lines or blocks of text should always be underlined since they can't
rely on color alone to be distinguished from the surrounding text. Exceptions
can be handled on a case-by-case basis.

Props Presskopp for the initial patch.
Fixes #37527.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38444 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-01 22:02:30 +00:00
Aaron Jorbin 22e6d59c67 Administration: Use a bool when when a bool is called for
The third parameter of `date_i18n` is a bool.  Currently, it's a weak check, otherwise the call showing the universal time on the "General Settings" screen would be messed up. Use an actual bool so we call our own functions correctly.

Fixes #37634.
Props fronaldaraujo.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38443 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-01 18:34:28 +00:00
Aaron Jorbin 93ad7eab80 Administration: Use #fff instead of `white`
Cleans up a few places where the CSS coding standards were not being followed.

Fixes #37576.
Props Presskopp, johnpgreen, netweb


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


git-svn-id: http://core.svn.wordpress.org/trunk@38442 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-01 18:14:31 +00:00
Boone Gorges 77a3cc733e Query: 'orderby=include' should support comma-separated lists.
[30052] assumed that 'include' would be an array.

Props TimothyBlynJacobs.
Fixes #37904.
Built from https://develop.svn.wordpress.org/trunk@38500


git-svn-id: http://core.svn.wordpress.org/trunk@38441 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-01 16:51:30 +00:00
Gary Pendergast 4babadb704 Bootstrap: `class-wp-locale.php` needs to be `require_once()`-ed.
After [38364], the inclusion of `class-wp-locale.php` was changed from a `require_once()` to a `require()`. This caused problems for anything that called `load_text_domain_early()` prior to the `require()` but didn't bail, as it was now being `require()`-ed a second time.

With the use of `require_once()`, it doesn't really matter where it's loaded, so it has been moved next to the related `l10n.php` load.

See #37827.


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


git-svn-id: http://core.svn.wordpress.org/trunk@38437 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-01 12:36:28 +00:00
Sergey Biryukov 616eb41287 Docs: Move `term_description()` reference from filter docblock to `get_the_archive_description()` function docblock.
Props dlh.
See #37259.
Built from https://develop.svn.wordpress.org/trunk@38495


git-svn-id: http://core.svn.wordpress.org/trunk@38436 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-01 12:32:28 +00:00
Sergey Biryukov 2b5d7555b4 Users: After [33766], don't reset the password when clicking "Show Password" and then "Cancel" on Add New User screen.
Props smerriman for reporting.
Fixes #37902. See #33419.
Built from https://develop.svn.wordpress.org/trunk@38494


git-svn-id: http://core.svn.wordpress.org/trunk@38435 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-01 12:24:29 +00:00
Sergey Biryukov 7aa79d3705 Template: After [38486], actually use the `$description` variable in `get_the_archive_description()`.
Props dlh.
Fixes #37259.
Built from https://develop.svn.wordpress.org/trunk@38493


git-svn-id: http://core.svn.wordpress.org/trunk@38434 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-01 11:47:30 +00:00
Weston Ruter 94e8a9cfa0 Customize: Introduce `paneVisible` state and ensure pane is visible when a construct is expanded (or focused).
Fixes issue whereby a user would see nothing happen if the pane is collapsed while they shift-click to edit an element in the preview.

Props curdin, celloexpressions, westonruter.
See #27403.
Fixes #36678.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38433 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-01 05:55:27 +00:00
Dion Hulse 227a80eba3 Query: Use `AND` in a SQL query rather than `&&`.
This appears to have been the only instance of `&&` being used in SQL, so for consistency lets remove it.

Props scrappy@hub.org.
Fixes #37903.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38432 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-01 05:11:31 +00:00
John Blackbourn 69c152cee7 Taxonomy: Correct the function description for `wp_ajax_add_link_category()`.
See #37770

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


git-svn-id: http://core.svn.wordpress.org/trunk@38431 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-01 00:49:29 +00:00
John Blackbourn 01c3ae084b Taxonomy: Update various docs for parameters which are now `WP_Term` objects.
See #37770
See #14162

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


git-svn-id: http://core.svn.wordpress.org/trunk@38430 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-09-01 00:40:29 +00:00
Sergey Biryukov bfe8ba91b6 Template: In `get_the_archive_description()`, add support for author archives.
Props henry.wright.
Fixes #37259.
Built from https://develop.svn.wordpress.org/trunk@38486


git-svn-id: http://core.svn.wordpress.org/trunk@38427 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 23:01:29 +00:00
Sergey Biryukov a4f8854a46 Taxonomy: Introduce `wp_insert_term_data` and `wp_update_term_data` filters for altering term data before it is inserted/updated in the database.
Props atimmer, SergeyBiryukov.
Fixes #22293.
Built from https://develop.svn.wordpress.org/trunk@38484


git-svn-id: http://core.svn.wordpress.org/trunk@38425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 21:41:27 +00:00
Andrea Fercia c451e71d42 Text Changes: Improve the timezone setting description in General Settings.
Makes more clear users can set either a city or a UTC timezone offset.

Props GrantDerepas, andrew.p.
Fixes #34789.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38424 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 21:37:27 +00:00
John Blackbourn 14e40fd20c Role/Capability: Add two missing meta capabilities to the caps tests.
See #32394

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


git-svn-id: http://core.svn.wordpress.org/trunk@38423 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 21:34:30 +00:00
Sergey Biryukov a2582f50cc Users: Pass `$profileuser` parameter to `user_profile_picture_description` filter on "Edit User" screen.
Props turtlepod, deremohan.
Fixes #37379.
Built from https://develop.svn.wordpress.org/trunk@38481


git-svn-id: http://core.svn.wordpress.org/trunk@38422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 21:13:32 +00:00
Scott Taylor f1631f4e03 Bootstrap: goodnight sweet prince.
See #36335.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 20:36:30 +00:00
Weston Ruter 03adca4299 Customize: Fix i18n by re-using the `add_new_item` post type label instead of using a post type name in a generic string.
Props afercia, westonruter.
See #34923.
Fixes #37895.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38420 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 19:15:28 +00:00
Weston Ruter bce5ea9494 Customize: Use new `$status_code` parameter for `wp_send_json_error()` instead of calling `status_header()` separately.
Props johnbillion.
See #35666.
Fixes #37897.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 19:01:28 +00:00
Sergey Biryukov b4aaf3925d Login and Registration: Change login label to `Username or Email Address` for clarity.
Props GaryJ.
Fixes #37871.
Built from https://develop.svn.wordpress.org/trunk@38477


git-svn-id: http://core.svn.wordpress.org/trunk@38418 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 18:51:28 +00:00
Sergey Biryukov fe12301ca9 Help/About: Remove an outdated help sentence on "My Sites" screen.
Props johnjamesjacoby.
Fixes #37896.
Built from https://develop.svn.wordpress.org/trunk@38474


git-svn-id: http://core.svn.wordpress.org/trunk@38415 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 17:44:29 +00:00
Scott Taylor af71985625 Query: r38356, you were not long for this world.
Fixes #37830.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38412 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 16:53:29 +00:00
Scott Taylor a3ffebce30 Bootstrap: do not go gentle into that good night r38411, r38412, and parts of r38389.
See #36335.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38411 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 16:31:29 +00:00
Scott Taylor 7e8d7f8a81 General: revert [38386], `functions.php` was probably too tempting for some people to not load by itself.
See #36335.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 15:24:29 +00:00
Scott Taylor 0eebbed6b2 General: revert [38467], `wp_is_IE()` should not exist.
See #37699.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38409 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 15:22:31 +00:00
Scott Taylor 021e23e70b General: use a new function, `wp_is_IE()`, instead of the `$is_IE` global in a number of places.
See #37699.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38408 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 06:42:33 +00:00
Scott Taylor 69e7fe3c5b Press This: don't check for already-hoisted global in `press-this.php`.
See #37699.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38407 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 06:29:28 +00:00
Scott Taylor 0419d1e318 Press This: in `wp_ajax_press_this_save_post()` and `wp_ajax_press_this_add_category()`, don't check for a global instance. `WP_Press_This` is a Controller, but not really a Singleton. This also keeps it from being a pluggable class, which it is right now.
See #37699.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38406 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 06:25:29 +00:00
Weston Ruter 9546303342 Customize: Improve handling of active state for dynamically-created controls/sections/panels.
When a customizer construct (panel, section, control) is not added in PHP, the JS has interpreted this to mean that a given construct should be deactivated (because it is gone). This is problematic for dynamically-created constructs in JS, as it has meant that the construct would also have to be created in PHP to ensure the `active` callback is called, or else a hack would be required to add a `construct.active.validate = function() { return true };` to forcibly prevent the construct from getting deactivated. 

These workarounds can be eliminated by treating constructs differently when they are created dynamically in JS (after page load) as opposed to being created statically in PHP (on the server). Namely, if a construct is dynamically-created then its absence in a preview refresh should not signal that the construct should be deactivated. Rather, a dynamic construct should only have its activation state toggled if it has a corresponding construct created in PHP when the preview refreshes to explicitly indicate its `active` state. Otherwise, the management of the `active` state for a construct created in JS should also be the responsibility of client-side code.

Props westonruter, sayedwp.
Fixes #37270.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38405 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 06:22:23 +00:00
Scott Taylor 153ba4a832 Query: in `wp_old_slug_redirect()`, use `get_query_var()` instead of importing and touching the global `$wp_query` directly.
See #37699.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 06:21:41 +00:00
Scott Taylor 1dc37b77ef Press This: in `get_shortcut_link()`, just check a class constant on `WP_Press_This` instead of instantiating the object and reading an instance prop.
See #37699.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38403 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 06:08:00 +00:00
Scott Taylor 9383bf8f74 General: use `get_bloginfo( 'version' )` instead of `global $wp_version` in several locations - excluding those locations which reload `version.php` mid-flight.
See #37699.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 05:49:37 +00:00
Scott Taylor cabb4a03c8 Multisite: use `get_current_site()` instead of `$GLOBALS['current_site']` (stop yelling!) in a few remaining spots.
See #37699.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38399 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 05:04:29 +00:00
Scott Taylor e5225324a2 Multisite: use `get_current_blog_id()` where applicable, in lieu of plucking the `$blog_id` global from outer space.
See #37699.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38398 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 04:55:54 +00:00
John Blackbourn 049c36d11f HTTP API: Revert changes to `wp_parse_url()` while PHP 5.2 errors are investigated.
See #36356

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


git-svn-id: http://core.svn.wordpress.org/trunk@38397 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-31 00:24:31 +00:00
Scott Taylor 5d94d97b29 List Tables: AJAX actions for List Tables do not need to declare `global $wp_list_table`. List tables on admin screens are in global scope, and they contain hooks that don't pass the the list table as context, hence using globals there so that functions can import them. That problem does not exist in the AJAX actions, which are virtually impossible to hook into as is.
See #37699.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38396 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-30 20:07:29 +00:00
Scott Taylor 800fb85d1e OEmbed: add unit tests. `@group external-oembed` is not run by default.
Props johnbillion, wonderboymusic.
See #32360.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38395 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-30 18:55:28 +00:00
John Blackbourn d412234bc1 HTTP API: Separate the test for `wp_parse_url()` with `-1` as its component into a separate test, so the remaining tests can use strict type checking. This helps avoid gotches with the potentially empty values (ie. `null`) that we're testing for.
See #36356

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


git-svn-id: http://core.svn.wordpress.org/trunk@38394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-30 18:31:30 +00:00
John Blackbourn fad4b94bab HTTP API: The tests for `wp_parse_url()` can't be strict on type because this causes the tests to fail on PHP 5.2 which, bizarrely, returns the results of `parse_url()` (when called with a `$component` parameter) in a different order to later PHP versions.
Fixes #36356

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


git-svn-id: http://core.svn.wordpress.org/trunk@38393 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-30 17:49:29 +00:00
John Blackbourn 3a9cc4bf11 Posts, Post Types: Introduce a missing private query var that should have been introduced as part of #15459.
This private query var allows the hierarchical page query on the Pages listing screen to query for `wp_posts.ID, wp_posts.post_parent` instead of `wp_posts.*`. This introduces large memory and time savings when the site contains a large number of Pages. Combined with the processing time savings introduced in [31730] this makes the Pages listing screen considerably more performant.

Fixes #34982
Props rodrigosprimo

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


git-svn-id: http://core.svn.wordpress.org/trunk@38392 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-30 17:40:30 +00:00
John Blackbourn ebe159a4bc HTTP API: Prevent a fatal error on PHP < 5.4.7 due to changes introduced in [38449].
Fixes #36356

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


git-svn-id: http://core.svn.wordpress.org/trunk@38391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-30 17:16:30 +00:00
John Blackbourn 4fd9ad1ce2 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@38449


git-svn-id: http://core.svn.wordpress.org/trunk@38390 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-30 16:36:28 +00:00
Andrea Fercia 99be6ffd3c Accessibility: Hide the "No activity yet" smiley from assistive technologies.
Fixes #37511.

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


git-svn-id: http://core.svn.wordpress.org/trunk@38389 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-30 16:14:30 +00:00
Pascal Birchler 4753f6e127 Script Loader: Properly adjust tests missed in [38443].
See #37800.
Built from https://develop.svn.wordpress.org/trunk@38447


git-svn-id: http://core.svn.wordpress.org/trunk@38388 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-30 14:51:28 +00:00
Boone Gorges 3a4169d7ab Comments: Don't do direct SQL query when fetching decendants.
The SQL query was built using the clauses compiled when querying for
top-level comments. But in cases where the top-level comment query
results are already in the cache, the SQL clauses are not built, and
so are unavailable for `fill_descendants()`. Instead, we call
`get_comments()`, using modified versions of the parameters passed
to the main `WP_Comment_Query` class.

Props Akeif, Rarst for testing.
Fixes #37696.
Built from https://develop.svn.wordpress.org/trunk@38446


git-svn-id: http://core.svn.wordpress.org/trunk@38387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-08-30 14:48:29 +00:00