Commit Graph

7676 Commits

Author SHA1 Message Date
Boone Gorges
8a2341335b Taxonomy: Improve precision of duplicate name checks when inserting terms.
`wp_insert_term()` does not allow for terms with the same name to exist
at the same hierarchy level, unless the second term has a unique slug.
When this logic was refactored in [31792] and [34809], a bug was
introduced whereby it was possible to bypass the no-same-named-sibling
check in cases where the first term had a non-auto-generated slug
(ie, where the name was 'Foo' but the slug something other than 'foo',
such that the second term would get the non-matching slug 'foo').

This changeset fixes this issue by ensuring that the duplicate name
check runs both in cases where there's an actual slug clash *and* in
cases where no explicit `slug` has been provided to `wp_insert_term()`.
The result is a more reliable error condition:
`wp_insert_term( 'Foo' ... )` will always fail if there's a sibling
'Foo', regardless of the sibling's slug.

Props mikejolley.
See #39984.

git-svn-id: https://develop.svn.wordpress.org/trunk@40144 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-03 02:39:09 +00:00
Boone Gorges
242f4e5201 Improve formatting in wp_term_is_shared() docblock.
Props netweb.
Fixes #40004.

git-svn-id: https://develop.svn.wordpress.org/trunk@40143 602fd350-edb4-49c9-b593-d223f7449a82
2017-03-02 02:27:10 +00:00
Mike Schroder
8e39edfdf6 Media: After [40123], Feature check setImageOrientation.
In [40123], `WP_Image_Editor_Imagick` started using
`Imagick::setImageOrientation` and `Imagick::ORIENTATION_TOPLEFT`,
but had no equivalent feature check.

While they were introduced more than 9 years ago, it's important
to double-check everything is available before using with Imagick.

Fixes #37140.

git-svn-id: https://develop.svn.wordpress.org/trunk@40129 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-27 04:21:41 +00:00
John Blackbourn
5ab0154647 Comments: When commenting on a draft post, display a friendly error message if the user can view the post.
This prevents the unhelpful white screen of death when a user who can view the post (eg. preview it) leaves a comment while the post is in draft.

Props sagarprajapati, milindmore22, mayurk, swissspidy
Fixes #39650


git-svn-id: https://develop.svn.wordpress.org/trunk@40128 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-27 00:22:02 +00:00
Andrea Fercia
cc8b551d69 Media: Restore correct upload errors displaying after [37610].
Props codegeass, MatheusGimenez, joemcgill.
Fixes #39516.


git-svn-id: https://develop.svn.wordpress.org/trunk@40126 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-26 18:14:07 +00:00
Joe McGill
7684a241b3 Media: Reduce failing uploads following 4.7.1.
[39831] introduced more strict MIME type checking for uploads, which
resulted in unintetionally blocking several filetypes that were
previously valid. This change uses  a more targeted approach to MIME
validation to restore previous behavior for most types.

Props blobfolio, iandunn, ipstenu, markoheijnen, xknown, joemcgill.
Fixes #39550, #39552.

git-svn-id: https://develop.svn.wordpress.org/trunk@40124 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-25 16:07:25 +00:00
Mike Schroder
cfe271d254 Media: Reset Exif orientation after rotate in WP_Image_Editor_Imagick.
Due to inconsistencies in the way browsers handle Exif orientation data,
if a user manually rotates an image within WordPress, set the Exif orientation to
the default (1) so that the image displays with the same rotation/flip in every browser.

Props sanchothefat, triplejumper12, joemcgill, azaozz, markoheijnen, mikeschroder.
See #14459.
Fixes #37140.

git-svn-id: https://develop.svn.wordpress.org/trunk@40123 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-25 05:25:40 +00:00
James Nylen
e5d5f1058e REST API: Fix behavior of sticky posts filter when no posts are sticky.
Previously, when getting posts from the API with `sticky=true`, if there were no sticky posts set, the query would return all posts  as if the `sticky` argument was not set.  In this situation, the query should return an empty array instead.

A `sticky=true` query that should return an empty array (in the previous situation, or with `include` and no intersecting post IDs) was also broken in that it would query the post with ID 1.

Finally, this commit significantly improves test coverage for the `sticky` filter argument, including direct testing of the `WHERE` clauses generated by `WP_Query`.

Props ryelle.
Fixes #39947.


git-svn-id: https://develop.svn.wordpress.org/trunk@40122 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-25 05:02:17 +00:00
James Nylen
162e1a6f2a REST API: Allow setting post formats even if they are not supported by the theme.
A `post_format` not used by the current theme, but supported by core is not a wrong/broken piece of information.  It's just not used at this point in time.  Therefore we should allow setting and retrieving any of the standard post formats supported in core, even if the current theme doesn't use them.

After this commit, a post's `format` value can survive a round trip through the API, which is a good general design principle for an API.

Props JPry, iseulde, davidakennedy, Drivingralle.
Fixes #39232.


git-svn-id: https://develop.svn.wordpress.org/trunk@40120 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-24 23:29:04 +00:00
Andrew Ozz
e5ce2174fc TinyMCE: preserve empty image alt attributes.
Props afercia.
Fixes #39912 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@40110 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-24 20:40:45 +00:00
James Nylen
4414e3c20a REST API: Shim post_date_gmt for drafts / empty dates in the REST API.
Internally, WordPress uses a special `post_date_gmt` value of `0000-00-00 00:00:00` to indicate that a draft's date is "floating" and should be updated whenever the post is saved.  This makes it much more difficult for API clients to know the correct date of a draft post.

This commit provides a best guess at a `date_gmt` value for draft posts in this situation using the `date` field and the site's current timezone offset.

Props joehoyle.
Fixes #38883.


git-svn-id: https://develop.svn.wordpress.org/trunk@40108 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-24 18:14:21 +00:00
Felix Arntz
0f9dd5f88f REST API: Do not allow access to users from a different site in multisite.
It has been unintendedly possible to both view and edit users from a different site than the current site in multisite environments. Moreover, when passing roles to a user in an update request, that user would implicitly be added to the current site.

This changeset removes the incorrect behavior for now in order to be able to provide a proper REST API workflow for managing multisite users in the near future. Related unit tests have been adjusted as well.

Props jnylen0, jeremyfelt, johnjamesjacoby.
Fixes #39701.


git-svn-id: https://develop.svn.wordpress.org/trunk@40106 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-23 22:36:54 +00:00
James Nylen
f366757b55 REST API: Correctly parse body parameters for DELETE requests.
DELETE was inadvertently omitted from the list of non-POST HTTP methods that should be able to accept body parameters.  Parameters passed to DELETE requests as JSON are already parsed correctly; this commit fixes `application/x-www-form-urlencoded` parameters as well.

Props mnelson4.
Fixes #39933.


git-svn-id: https://develop.svn.wordpress.org/trunk@40105 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-23 20:09:11 +00:00
Sergey Biryukov
109f63fb6b Docs: Update the description of is_singular() and WP_Query::is_singular() to be parsed correctly by developer.wordpress.org.
Props grapplerulrich.
Fixes #39948.

git-svn-id: https://develop.svn.wordpress.org/trunk@40103 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-23 10:29:27 +00:00
Felix Arntz
cf93e7996d Multisite: Use WP_Network_Query in WP_Network::get_by_path().
An additional unit test has been introduced to verify the method works properly when using an external object cache.

Props spacedmonkey, jeremyfelt.
Fixes #37217.


git-svn-id: https://develop.svn.wordpress.org/trunk@40102 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-22 10:41:20 +00:00
James Nylen
83d27ba447 REST API: Fix multiple issues with setting dates of posts and comments.
This commit modifies the `rest_get_date_with_gmt` function to correctly parse local and UTC timestamps with or without timezone information.

It also ensures that the REST API can edit the dates of draft posts by setting the `edit_date` flag to `wp_update_post`.

Overall this commit ensures that post and comment dates can be set and updated as expected.

Fixes #39256.


git-svn-id: https://develop.svn.wordpress.org/trunk@40101 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-21 18:17:32 +00:00
dd32
22a410e1c5 Customize: Update the introduced version in the docs for the get_header_video_url filter to 4.7.3.
See #39512.


git-svn-id: https://develop.svn.wordpress.org/trunk@40086 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-20 06:46:34 +00:00
westonruter
e13e8bab1c Customize: Prevent vertical clipping of thumbnail in header image customizer control.
Removes some method overrides on `wp.customize.HeaderTool.ChoiceView` introduced in [27497].

See #21785.
Props bradyvercher.
Fixes #38559.


git-svn-id: https://develop.svn.wordpress.org/trunk@40082 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-20 00:09:37 +00:00
rachelbaker
bf6a689c65 REST API: Include the status property in view context responses from the Posts endpoints.
Previously the status for a Post (or other post_types) was only exposed under the `edit` context, which doesn't really make much sense considering we support querying by post status without authentication. Originally introduced in v2.0 beta 1: 69f617d749 without any explanation in the commit message.

Props dhanendran, jnylen0, rachelbaker.
Fixes #39466.


git-svn-id: https://develop.svn.wordpress.org/trunk@40080 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-19 04:31:12 +00:00
adamsilverstein
0d73b031c8 JavaScript: when starting Backbone history, stop if previously started.
Prevent a potential error condition if Backbone history is started by a plugin or theme before core tries to start it. 

Props tfrommen.
Fixes #39612.


git-svn-id: https://develop.svn.wordpress.org/trunk@40076 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-17 21:59:37 +00:00
Adam Silverstein
0efaf5ddc5 REST API: JavaScript client - improve route discovery for custom namespaces.
Fix parsing of custom namespace routes. Transform class names, removing dashes and capitalizing each word/route part so a route path of `widgets/recent-posts` becomes a collection with the name `WidgetsRecentPosts`. Correct parent route part when routes are longer than expected, reversing parse direction.

Props westonruter, jazbek.
Fixes #39561.


git-svn-id: https://develop.svn.wordpress.org/trunk@40074 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-17 20:53:57 +00:00
Pascal Birchler
c39fa0ff22 I18N: Update translators comment after [40072].
Props ocean90.
See #39898.

git-svn-id: https://develop.svn.wordpress.org/trunk@40073 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-17 10:20:38 +00:00
Pascal Birchler
c49b9ea9c2 I18N: Fix broken sprintf() after [40067].
See #39898.

git-svn-id: https://develop.svn.wordpress.org/trunk@40072 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-17 10:14:12 +00:00
Dion Hulse
82f99ca927 Media: Avoid PHP Warnings in get_post_galleries() when processing empty [gallery] shortcodes and avoid returning the incorrect results when the global $post does not match the provided post ID.
Props dd32, joemcgill, seanchayes.
Fixes #39277, #39304.


git-svn-id: https://develop.svn.wordpress.org/trunk@40070 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-17 06:45:31 +00:00
Dion Hulse
bfeda161b7 HTTP API: Restore backwards compatibility with the http_api_curl filter - it expects that the handle parameter is passed as a reference, however [39212] missed that.
Props pento.
Fixes #39783.


git-svn-id: https://develop.svn.wordpress.org/trunk@40068 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-17 05:05:03 +00:00
Sergey Biryukov
332244f7fb I18N: Remove <code> tags from translatable strings in wp-includes/customize/class-wp-customize-custom-css-setting.php.
Fixes #39898.

git-svn-id: https://develop.svn.wordpress.org/trunk@40067 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-17 02:22:40 +00:00
Weston Ruter
a01edcf0a6 Customize: Skip intercepting non-HTTP(S) links in customizer preview just as jump links are ignored.
Ensures that links with `javascript:`, `mailto:` and other protocols work as expected in the customizer preview.

Fixes #39797.


git-svn-id: https://develop.svn.wordpress.org/trunk@40064 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-16 21:20:45 +00:00
James Nylen
392fd09f82 REST API: Cast revision author ID to int.
The `post_author` field is a string internally, but we need to cast it to an integer in the REST API.  This was already done for posts, but not for revisions.  The field is already declared as an integer in both controllers.

Fixes #39871.


git-svn-id: https://develop.svn.wordpress.org/trunk@40063 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-16 20:08:23 +00:00
Sergey Biryukov
beb9d91279 Docs: Correct @return value type for wp_nav_menu().
Props chesio.
Fixes #39890.

git-svn-id: https://develop.svn.wordpress.org/trunk@40062 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-16 16:08:36 +00:00
Adam Silverstein
2e0f576156 Media: debounce the media grid search, avoiding duplicate requests.
Add a debounce wrapper to the media grid search handler. The search callback is now fired after a 300 ms typing pause.

Remove redundant handlers for 'search' and 'change', preventing multiple/duplicate search callbacks.

Props certainstrings, joemcgill, Kelderic, batmoo.
Fixes #38911.


git-svn-id: https://develop.svn.wordpress.org/trunk@40060 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-15 17:28:54 +00:00
Andrea Fercia
dccf1535a4 Buttons: Fix a few .button-link glitches after [40052].
Removes some stray underlines. Explicitly set the button text to be left aligned.

Props Cheffheid, f.staude, Presskopp.

See #34242.
Fixes #35126, #38712.


git-svn-id: https://develop.svn.wordpress.org/trunk@40059 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-14 18:41:25 +00:00
John Blackbourn
acf5ca35c8 Themes: Add template type and template candidates as parameters to the {$type}_template filter.
Props mschadegg
Fixes #39525


git-svn-id: https://develop.svn.wordpress.org/trunk@40057 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-12 21:24:16 +00:00
Weston Ruter
61752051de Customize: Ensure edit shortcuts get re-created for nested partials when a parent partial is refreshed.
Fixes issue where the edit shortcut for a nav menu gets dropped when the containing Custom Menu widget is updated.

See #39101.
Fixes #39353.


git-svn-id: https://develop.svn.wordpress.org/trunk@40055 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-11 03:34:10 +00:00
Sergey Biryukov
dae17ac91a Pings/Trackbacks: Avoid scheduling multiple do_pings events in _publish_post_hook().
Props ethitter.
Fixes #39828.

git-svn-id: https://develop.svn.wordpress.org/trunk@40054 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-10 03:08:28 +00:00
Sergey Biryukov
b4638abeda Docs: Add missing meta_type and meta_compare arguments to WP_Term_Query::__construct() and get_terms() docblocks.
Props 1naveengiri.
Fixes #39825.

git-svn-id: https://develop.svn.wordpress.org/trunk@40053 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-10 02:27:36 +00:00
Andrea Fercia
7487559dfd Buttons: Improve the .button-link CSS class for link-like buttons.
Updates `.button-link` adding color and underline to make link-like buttons look
like links by default. Introduces `.button-link-delete` as a modifier, stackable
CSS class for red button-links.

Props Cheffheid, afercia.

See #34242.
Fixes #35126.


git-svn-id: https://develop.svn.wordpress.org/trunk@40052 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-09 16:46:58 +00:00
Scott Taylor
87364b0586 Media: in wp.media.view.DeleteSelectedPermanentlyButton, move destructive async operations outside of the selection loop.
Fixes #39780.


git-svn-id: https://develop.svn.wordpress.org/trunk@40051 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-08 19:43:58 +00:00
Scott Taylor
baff296dfa Media: in wp.media.view.Toolbar.refresh(), check for a selection before iterating over models.
Props chandrapatel.
Fixes #39511.


git-svn-id: https://develop.svn.wordpress.org/trunk@40050 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-08 19:16:34 +00:00
Pascal Birchler
4004400047 Taxonomy: Disallow overriding the name property when registering a taxonomy.
Props wpfo for initial patch.
Fixes #39308.

git-svn-id: https://develop.svn.wordpress.org/trunk@40049 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-06 19:38:36 +00:00
Sergey Biryukov
912059b82f Docs: Use third-person singular verb for rest_avatar_sizes filter description.
See #39130.

git-svn-id: https://develop.svn.wordpress.org/trunk@40047 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-06 02:57:46 +00:00
Sergey Biryukov
d295ea290e Docs: Use third-person singular verb for wp_get_custom_css filter description.
See #39130.

git-svn-id: https://develop.svn.wordpress.org/trunk@40046 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-06 02:56:42 +00:00
Sergey Biryukov
b5ce5759aa Customize: Introduce get_header_video_url filter for the return value of get_header_video_url().
Props sanket.parmar, celloexpressions.
Fixes #39512.

git-svn-id: https://develop.svn.wordpress.org/trunk@40045 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-06 02:51:20 +00:00
Sergey Biryukov
bdae9cd0fd Docs: Clarify that get_the_category_list() and the_category() display links as an unordered list by default.
See #39130.

git-svn-id: https://develop.svn.wordpress.org/trunk@40043 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-05 15:15:45 +00:00
Sergey Biryukov
d20d535e24 Docs: Clarify that has_excerpt() checks if the post has a custom excerpt, not some generated excerpt.
See #35487.

git-svn-id: https://develop.svn.wordpress.org/trunk@40042 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-05 14:34:16 +00:00
Weston Ruter
647f06c2c1 Customize: Extend auto-draft life of a customize_changeset post whenever modified.
Keep bumping the date for the auto-draft to preserve it from garbage-collection via `wp_delete_auto_drafts()` after 7 days.

See #30937.
Fixes #39713.


git-svn-id: https://develop.svn.wordpress.org/trunk@40041 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-05 06:38:57 +00:00
Adam Silverstein
4b22b97004 REST API: JavaScript client should use _.extend when merging objects.
Correct an issue during the client's dynamic route discovery in `wp.api.utils.decorateFromRoute` where `_.union` potentially failed if used on objects.

Props ketuchetan.
Fixes #39341.



git-svn-id: https://develop.svn.wordpress.org/trunk@40040 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-03 21:45:06 +00:00
Sergey Biryukov
0b63252b2d Media: In wp_unique_filename(), use explicit type casting when incrementing $number.
This prevents the "non-numeric value encountered" warning in PHP 7.1, caused by trying to increment an empty string on the first loop iteration.

Props drrobotnik for initial patch.
Fixes #39774.



git-svn-id: https://develop.svn.wordpress.org/trunk@40039 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-03 20:57:38 +00:00
SergeyBiryukov
3155c8ac3e REST API: After [38947], improve the wording of the message to clarify that rest_authentication_errors is a filter.
See #38446.

git-svn-id: https://develop.svn.wordpress.org/trunk@40038 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-01 21:31:02 +00:00
Weston Ruter
7d8b03458c Customize: Ensure root values are accessible in multidimensional custom setting types.
Fixes bad conditions in `WP_Customize_Setting::get_root_value()` and `WP_Customize_Setting::set_root_value()`.

Props dlh.
Amends [35007].
See #32103.
Fixes #36952.


git-svn-id: https://develop.svn.wordpress.org/trunk@40036 602fd350-edb4-49c9-b593-d223f7449a82
2017-02-01 01:39:39 +00:00
Sergey Biryukov
43aed27058 Update/Install: Give context to "Deleted! string to allow for differentiation between theme and plugin translations.
Props swissspidy.
See #39747. See #37290.

git-svn-id: https://develop.svn.wordpress.org/trunk@40035 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-31 09:58:49 +00:00
Sergey Biryukov
b732afec11 Update/Install: Give context to some more install/update strings to allow for differentiation between theme and plugin translations.
Fixes #39747. See #37290.

git-svn-id: https://develop.svn.wordpress.org/trunk@40034 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-31 09:26:52 +00:00
Sergey Biryukov
a52789b8b9 I18N: Use a consistent translator comment ("accessibility text") for strings used in aria-label attributes.
See #32000.

git-svn-id: https://develop.svn.wordpress.org/trunk@40033 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-31 08:54:49 +00:00
Boone Gorges
3e6e1a12f6 Avoid PHP notices in get_post_type_archive_template().
The function should fail more gracefully when called in the context
where `get_query_var( 'post_type' )` doesn't represent an actual post
type.

Props technopolitica, dlh.
Fixes #38374.

git-svn-id: https://develop.svn.wordpress.org/trunk@40031 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-30 19:31:25 +00:00
Peter Wilson
99a101ff27 Feeds: Prevent empty feeds from returning 404 errors.
Partial revert of [38929].

This reverts the source code from the commit for #30210 to prevent valid but empty feeds from returning 404 file not found errors for the home and custom feeds.

The tests in the commit that remain applicable are retained.

Props pavelevap for reporting, stevenkword for initial patch.
See #30210.
Fixes #39157.


git-svn-id: https://develop.svn.wordpress.org/trunk@40030 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-29 23:08:54 +00:00
Sergey Biryukov
53670e4afc I18N: Merge similar strings in _deprecated_argument() calls.
Add translator comments.

Props ramiy, SergeyBiryukov.
Fixes #39020.

git-svn-id: https://develop.svn.wordpress.org/trunk@40028 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-29 11:49:49 +00:00
Sergey Biryukov
3f2f2c77c6 Docs: Clarify that wp_list_pages() and get_pages() only work with hierarchical post types.
Props doublehhh.
Fixes #39369.

git-svn-id: https://develop.svn.wordpress.org/trunk@40027 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-29 10:58:04 +00:00
Sergey Biryukov
a0bdc5efe4 Embeds: After [31148], list correct method in WP_oEmbed::$compat_methods.
Props LewisCowles.
Fixes #39292.

git-svn-id: https://develop.svn.wordpress.org/trunk@40026 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-29 07:31:29 +00:00
Andrea Fercia
fbbf3578b8 Accessibility: Make the inline uploader button a real button.
See `wp.media.view.UploaderWindow`.

Fixes #39305.


git-svn-id: https://develop.svn.wordpress.org/trunk@40021 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-27 18:32:00 +00:00
Andrew Ozz
1a068f2a61 TinyMCE: improve the previews for embedded WordPress posts:
- Add option to force a sandbox iframe in wpview.
- Use it to show the embedded post preview.
- Remove the deprecated `wpembed` plugin.js

Fixes #39513.

git-svn-id: https://develop.svn.wordpress.org/trunk@40019 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-27 04:24:58 +00:00
Boone Gorges
18e09d246e Revert to pre-4.7 behavior for fetching object instances by id.
This changeset reverts [38381], which caused inconsistencies in the way the
REST API fetches posts and other objects.

See #38792, #37738.

git-svn-id: https://develop.svn.wordpress.org/trunk@39992 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-26 16:52:51 +00:00
Joe Hoyle
38b400c4d7 REST API: Return an error if the page number is out of bounds.
Return an error from the REST API if a page number larger than the total pages count is requested.

Props morganestes.
Fixes #39061.

git-svn-id: https://develop.svn.wordpress.org/trunk@39967 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-26 13:52:06 +00:00
Joe Hoyle
0a82ee0a31 REST API: Unify object access handling for simplicity.
Rather than repeating ourselves, unifying the access into a single method keeps everything tidy. While we're at it, add in additional schema handling for common parameters.

See #38792.

git-svn-id: https://develop.svn.wordpress.org/trunk@39954 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-26 13:38:27 +00:00
Dominik Schilling (ocean90)
d2374614c2 Query: Ensure that queries work correctly with post type names with special characters.
git-svn-id: https://develop.svn.wordpress.org/trunk@39952 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-26 13:32:24 +00:00
Weston Ruter
8f4e0b7ed8 Customize: Always enqueue customize-preview stylesheet in the customizer preview to style selective refresh and visual edit shortcuts.
Enqueues the style along with the `customize-preview` script in the manager instead of via the `widgets` and `nav_menus` components, ensuring that the stylesheet is loaded for users who cannot manage widgets or nav menus.

Props dlh.
See #27403.
Fixes #39498.


git-svn-id: https://develop.svn.wordpress.org/trunk@39951 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-26 03:46:52 +00:00
Peter Wilson
6de7c69c0d Menus: Prevent notice thrown in class-walker-page.php.
Calling `Walker_Page::walk()` directly was causing an `Undefined index: item_spacing` notice to be thrown, this adds an `isset()` check to prevent it.

Props bhargavbhandari90.
Fixes #39564.


git-svn-id: https://develop.svn.wordpress.org/trunk@39949 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-24 23:28:13 +00:00
Felix Arntz
cf0ca2645f Multisite: Show menu items in My Sites > Network Admin admin bar menu based on more precise capability checks.
Previously the menu items would all be displayed solely based on the `manage_network` capability. This change provides parity with the network admin menu.

Unit tests for the network admin menu functionality of `wp_admin_bar_my_sites_menu()` have been added.

Props chandrapatel.
Fixes #39082.


git-svn-id: https://develop.svn.wordpress.org/trunk@39948 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-24 16:28:30 +00:00
Sergey Biryukov
cc9843a12c Docs: After [39939], "locales" should be plural.
See #39658.

git-svn-id: https://develop.svn.wordpress.org/trunk@39940 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-21 17:25:40 +00:00
Sergey Biryukov
385e9d1a78 I18N: Add support for Bosnian locale in remove_accents().
Applies "letter D with stroke" replacement made in [38646] for Serbian (`sr_RS`) to Bosnian (`bs_BA`) as well.

Props H3llas for the report.
Fixes #39658.

git-svn-id: https://develop.svn.wordpress.org/trunk@39939 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-21 17:15:57 +00:00
Felix Arntz
60f3612684 Multisite: Do not check for is_super_admin() when trying to set user settings.
The checks were introduced in [22256] to prevent user settings to be set for super admins that were not a member of the current site. However the latter should apply to any kind of user, so the `is_super_admin()` check is redundant. Furthermore, removing these checks is necessary for the ongoing effort to get rid of `is_super_admin()` checks in general.

Props chandrapatel for initial patch.
Fixes #39199. See #37616.


git-svn-id: https://develop.svn.wordpress.org/trunk@39932 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-20 17:32:13 +00:00
Sergey Biryukov
83e7606f76 Customize: Remove redundant context for "Reorder" and "Done" strings in nav menu and widget area controls to ensure consistent translations.
Props pavelevap, Presskopp.
Fixes #33747.

git-svn-id: https://develop.svn.wordpress.org/trunk@39927 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-20 05:59:32 +00:00
Weston Ruter
4e8e97983c Customize: Allow custom post types to be used in starter content.
Changes `WP_Customize_Nav_Menus::insert_auto_draft_post()` so it can be invoked for a `post_type` that is not registered (yet).

See #38615, #38114.
Fixes #39610.


git-svn-id: https://develop.svn.wordpress.org/trunk@39924 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-19 00:00:24 +00:00
Ryan McCue
7d2c104068 REST API: Correctly serve the index with PATH_INFO
When hitting the index, untrailingslashit() would make the REST route empty, which would then use the fallback inside WP_REST_Server. This isn't a problem most of the time, but WP_REST_Server contains a fallback to PATH_INFO. Combined with PATH_INFO permalinks, this would give a 404 on the API index, as it attempts to look up a route for "/wp-json/".

Props ccprog.
Fixes #39432.


git-svn-id: https://develop.svn.wordpress.org/trunk@39923 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-17 05:39:15 +00:00
Ryan McCue
bbf129c935 REST API: Allow shortcircuiting rest_pre_insert_comment
rest_pre_insert_{post_type} allows returning a WP_Error from the filter to shortcircuit actually creating the object, so it makes sense to do so for comments too.

Props dspilka.
Fixes #39578.


git-svn-id: https://develop.svn.wordpress.org/trunk@39922 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-17 05:17:15 +00:00
Sergey Biryukov
0358e8e2cf Users: Introduce signup_site_meta and signup_user_meta for filtering signup metadata in wpmu_signup_blog() and wpmu_signup_user(), respectively.
Props Mista-Flo.
Fixes #39223.

git-svn-id: https://develop.svn.wordpress.org/trunk@39920 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-17 03:52:24 +00:00
Andrew Ozz
e3ffbce181 TinyMCE: strip browser inserted <u> and <font>` tags from inside links when copying and pasting in IE and Edge.
Fixes #39570.

git-svn-id: https://develop.svn.wordpress.org/trunk@39916 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-17 01:24:35 +00:00
Gary Pendergast
8e3b56fbe3 User Query: Cast $user_total as an int.
The `$user_total` member of `WP_User_Query`, and corresponding `get_total()` method, have always been documented as returning an `int`. `$user_total`, however, is populated by `$wpdb->get_var()`, which returns 
a string (containing an integer value). Casting the return value from `get_var()` as an `int` rectifies this discrepency.

Props runciters.
Fixes #39297.



git-svn-id: https://develop.svn.wordpress.org/trunk@39915 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-16 23:23:06 +00:00
Andrew Ozz
14e5a08f5c Formatting: fix wpautop() to stop adding paragraph tags around <figcaption>.
Fixes #39307 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@39912 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-16 01:05:33 +00:00
Andrew Ozz
cc8cc98e92 TinyMCE: ensure the inline toolbar is shown and properly positioned when there are several wpview blocks in the editor and the user selects one after the other.
Props gitlost.
Fixes #38849.

git-svn-id: https://develop.svn.wordpress.org/trunk@39910 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-16 00:21:29 +00:00
Andrew Ozz
e66dc656b3 TinyMCE: prevent the inline toolbar from appearing on partially selected wpview nodes. This can happen when HTML is initially loaded in the editor and wpview is the first node, or sometimes on repeatedly pasting the same wpview.
Props gitlost.
Fixes #38849.

git-svn-id: https://develop.svn.wordpress.org/trunk@39904 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-15 02:59:45 +00:00
Andrew Ozz
7592ee11bd TinyMCE: when inserting a wpview, place the caret after is so the user can continue typing without interruption.
Props iseulde.
Fixes #39337.

git-svn-id: https://develop.svn.wordpress.org/trunk@39903 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-15 02:40:30 +00:00
Andrew Ozz
976976b4a1 TinyMCE: improve removal of spaces from empty paragraphs when loading HTML in the editor.
Fixes #39437.

git-svn-id: https://develop.svn.wordpress.org/trunk@39902 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-15 02:05:44 +00:00
Sergey Biryukov
e6ae5711e5 Docs: Add missing @param type for wp_cache_get_last_changed().
Props afzalmultani, Soean.
Fixes #39571.

git-svn-id: https://develop.svn.wordpress.org/trunk@39900 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-13 14:15:22 +00:00
Sergey Biryukov
18eab18694 REST API: Improve error messages for number relational validation.
Props jblz.
Fixes #39054.

git-svn-id: https://develop.svn.wordpress.org/trunk@39896 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-13 04:37:03 +00:00
Sergey Biryukov
bce2389633 Docs: In wp_set_object_terms(), add a note that passing an empty value as $terms argument will remove all related terms.
Props barryceelen.
Fixes #36690.

git-svn-id: https://develop.svn.wordpress.org/trunk@39893 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-12 06:53:21 +00:00
Sergey Biryukov
c2fe0f3dc1 Widgets: In unregister_sidebar(), rename the $name parameter to $sidebar_id for consistency with is_registered_sidebar().
Also correct the parameter type in `@param` entry.

Props Soean, tmatsuur.
Fixes #35147.

git-svn-id: https://develop.svn.wordpress.org/trunk@39892 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-12 06:37:06 +00:00
Sergey Biryukov
d788c3ffed Media: Use a consistent error message for file type errors on uploading.
Props pavelevap, jackreichert.
Fixes #33242.

git-svn-id: https://develop.svn.wordpress.org/trunk@39891 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-12 06:28:32 +00:00
Sergey Biryukov
02cd4a1e97 Docs: After [37083], change "HEX format" to "3- or 6-digit hexadecimal form" for clarity.
Props swissspidy, theMikeD.
Fixes #36336.

git-svn-id: https://develop.svn.wordpress.org/trunk@39888 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-12 05:55:01 +00:00
Sergey Biryukov
98657431de Docs: Make $meta parameter description in multisite signup and registration functions more consistent.
See #38781.

git-svn-id: https://develop.svn.wordpress.org/trunk@39887 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-12 05:20:57 +00:00
Sergey Biryukov
41134d34da Users: In wpmu_signup_blog() and wpmu_signup_user(), pass unserialized signup meta data to after_signup_site and after_signup_user filters introduced in [34112], to match the documented value.
Props MaximeCulea.
Fixes #38781.

git-svn-id: https://develop.svn.wordpress.org/trunk@39886 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-12 04:56:28 +00:00
Sergey Biryukov
6afc94def0 Themes: Use curly braces for variables inside strings in `get_page_template() to explicitly specify the end of the variable name.
Props kuck1u.
Fixes #38625.

git-svn-id: https://develop.svn.wordpress.org/trunk@39884 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-12 04:12:22 +00:00
Joe McGill
9d9ab96249 Media: Fix exif_imagetype check in wp_get_image_mime
This is a follow up to [39831].

Props gitlost.
See #11946.

git-svn-id: https://develop.svn.wordpress.org/trunk@39850 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-11 16:35:21 +00:00
Aaron D. Campbell
35bd561765 REST API: Change which users are shown in the users endpoint.
Only show users that have authored a post of a post type that has `show_in_rest` set to true.

Props rachelbaker, jnylen0.
See #38878.



git-svn-id: https://develop.svn.wordpress.org/trunk@39843 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-11 14:13:48 +00:00
Joe McGill
7710b3d3ec Media: Improve image filetype checking.
This adds a new function `wp_get_image_mime()` which is used by
`wp_check_filetype_and_ext()` to validate image files using
`exif_imagetype()` if available instead of `getimagesize()`.

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

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

See #11946.

git-svn-id: https://develop.svn.wordpress.org/trunk@39831 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-11 13:07:54 +00:00
Dominik Schilling (ocean90)
2fc1bde29c Themes: Fix markup for theme name fallbacks.
git-svn-id: https://develop.svn.wordpress.org/trunk@39807 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-11 10:33:33 +00:00
jeremyfelt
728ef3c678 Multisite: Use wp_rand() in signup key creation.
git-svn-id: https://develop.svn.wordpress.org/trunk@39795 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-11 05:29:20 +00:00
Dion Hulse
b1b4d49264 Update PHPMailer to 5.2.22.
The full list of changes is available here:
https://github.com/PHPMailer/PHPMailer/compare/v5.2.21...v5.2.22

Fixes #37210 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@39759 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-11 01:22:46 +00:00
Sergey Biryukov
b8f85ab388 Docs: Make @deprecated entry for wp_kses_js_entities(), deprecated in [38785], consistent with other entries.
Props stevenkword, teinertb.
Fixes #39541.

git-svn-id: https://develop.svn.wordpress.org/trunk@39758 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-10 22:08:16 +00:00
Sergey Biryukov
26514215a7 Posts, Post Types: Use an existing string for "Invalid post type" error message.
Props ramiy.
Fixes #39171.

git-svn-id: https://develop.svn.wordpress.org/trunk@39756 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-10 02:40:00 +00:00
Sergey Biryukov
ddbbd3e8a8 Docs: Use correct closing tag in submit_field description in comment_form().
Props truongwp.
Fixes #39508.

git-svn-id: https://develop.svn.wordpress.org/trunk@39753 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-07 14:50:55 +00:00
Sergey Biryukov
57dafabdc6 Customize: Correct a comment in get_theme_starter_content() added in [39561].
The item name is `link_home`, not `home_link`.

See #39104.

git-svn-id: https://develop.svn.wordpress.org/trunk@39751 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-07 13:10:40 +00:00
Sergey Biryukov
4ec8c0bcfe Docs: Add missing @since entry for Walker::unset_children().
Props chiragpatel.
Fixes #39506.

git-svn-id: https://develop.svn.wordpress.org/trunk@39741 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-06 14:52:24 +00:00
Sergey Biryukov
9e798d1bcb Docs: Correct @access entries for WP_Locale::init() and WP_Locale::register_globals().
Props keesiemeijer.
Fixes #39504.

git-svn-id: https://develop.svn.wordpress.org/trunk@39737 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-06 14:04:32 +00:00
Sergey Biryukov
d9d5174c29 Docs: Add missing @since entries for WP_Theme class methods.
Props keesiemeijer.
Fixes #39503.

git-svn-id: https://develop.svn.wordpress.org/trunk@39736 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-06 13:47:16 +00:00
Sergey Biryukov
e3dc88108d Docs: Correct @access entry for WP_User::filter property.
Add missing `@since` entries for `WP_User::back_compat_keys` and `WP_User::init()`.

Props keesiemeijer, prosti.
Fixes #39502, #39278.

git-svn-id: https://develop.svn.wordpress.org/trunk@39735 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-06 13:43:44 +00:00
Sergey Biryukov
5be7eb5ac3 Docs: Correct @access entries and duplicate hook references in WP_Customize_Selective_Refresh.
Props keesiemeijer.
Fixes #39501.

git-svn-id: https://develop.svn.wordpress.org/trunk@39734 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-06 13:37:54 +00:00
Dion Hulse
c1fc065ac4 Customizer: Don't query for postmeta for Custom CSS (for not-current-themes) and Customizer Changeset posts.
Props dlh.
Fixes #39194.


git-svn-id: https://develop.svn.wordpress.org/trunk@39692 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-05 08:11:30 +00:00
Dion Hulse
bc231804a3 Mail: In PHPMailer 5.2.7 the case of the Send() method changed to send(), update our call for consistency with the library.
Props michalzuber.
Fixes #39469.


git-svn-id: https://develop.svn.wordpress.org/trunk@39691 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-05 08:09:06 +00:00
Weston Ruter
de72bafedc Customize: Ensure theme_mod-cache of custom_css lookup of -1 short-circuits a WP_Query from being made.
Props dlh.
See #35395.
Fixes #39259.


git-svn-id: https://develop.svn.wordpress.org/trunk@39688 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-05 07:12:23 +00:00
westonruter
5aa4339693 Customize: Remove extra left padding in core for site title and widgets in preview.
These styles should only be applied by theme stylesheets as needed.

Props sirbrillig.
Reverts parts of [39202] and [39233].
See #38651.
Fixes #39349.


git-svn-id: https://develop.svn.wordpress.org/trunk@39685 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-05 04:33:01 +00:00
rmccue
485afd7017 Upgrade/Install: Avoid creating nonce during installation.
When installing and using database-saved salts, wp_create_nonce() causes database errors as wp_salt() attempts to insert into the not-yet-created options table. Since authentication isn't available during installation, we can safely skip creating a nonce.

Props nullvariable, pento, dd32.
Fixes #39047.


git-svn-id: https://develop.svn.wordpress.org/trunk@39684 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-05 04:10:03 +00:00
rmccue
48ec643441 Feeds: Don't override the Content-Type header inside fetc_feed()
SimplePie can set the Content-Type header automatically with the correct charset for convenience, but we already force the charset to match the site's, making it redundant at best. At worst, SimplePie incorrectly overrides the content-type for non-HTML content (such as API requests).

Props dlh, stevenkword.
Fixes #39066.


git-svn-id: https://develop.svn.wordpress.org/trunk@39681 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-05 03:05:53 +00:00
adamsilverstein
b55c941b37 REST API: Add error handling for fetch error in buildModelGetter of wp-api.js.
When a call to a model getter method fails, reject the returned deferred object. Enables better handling of fetch errors.

Props westonruter, adamsilverstein.
Fixes #39314.


git-svn-id: https://develop.svn.wordpress.org/trunk@39680 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-05 03:02:39 +00:00
azaozz
9c509a1eae Always add page-template-default class to the editor body when the template is not specified. This matches the behavior on the front-end.
Props timph (for the detailed bug report), azaozz.
Fixes #39368 for trunk.

git-svn-id: https://develop.svn.wordpress.org/trunk@39678 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-05 01:52:06 +00:00
SergeyBiryukov
cd97be6df7 Docs: Correct the DocBlock for get_header_video_url().
Props keesiemeijer.
Fixes #39468.

git-svn-id: https://develop.svn.wordpress.org/trunk@39676 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-04 13:43:40 +00:00
SergeyBiryukov
e2e43dade9 Docs: Correct @since and @access tags for WP_Term_Query::get_terms() and WP_Term_Query::parse_orderby_meta().
Props keesiemeijer.
Fixes #39467.

git-svn-id: https://develop.svn.wordpress.org/trunk@39675 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-04 13:38:10 +00:00
SergeyBiryukov
9369e432a5 Docs: Correct @access tag for WP_Customize_Partial::id_data property.
Props keesiemeijer.
Fixes #39464.

git-svn-id: https://develop.svn.wordpress.org/trunk@39674 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-04 13:35:22 +00:00
SergeyBiryukov
99e7e759ec Docs: Add missing @since and @access tags for WP_Widget_Form_Customize_Control::to_json() and ::render_content().
Props keesiemeijer.
Fixes #39463.

git-svn-id: https://develop.svn.wordpress.org/trunk@39673 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-04 13:33:03 +00:00
SergeyBiryukov
0df296a519 Docs: Add missing @since and @access tags for WP_Date_Query::is_first_order_clause().
Props keesiemeijer.
#39462.

git-svn-id: https://develop.svn.wordpress.org/trunk@39672 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-04 13:25:27 +00:00
SergeyBiryukov
7bd9bc5208 Docs: Correct rest_insert_* duplicate hook references in REST API.
Props keesiemeijer.
Fixes #39371.

git-svn-id: https://develop.svn.wordpress.org/trunk@39671 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-04 13:22:49 +00:00
SergeyBiryukov
10fbee7158 Docs: Add missing session_token_manager duplicate hook reference in wp-includes/class-wp-session-tokens.php.
Props keesiemeijer.
See #39371.

git-svn-id: https://develop.svn.wordpress.org/trunk@39670 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-04 13:21:41 +00:00
SergeyBiryukov
53e6e1f5d3 I18N: Add post type context to "Featured Image" post labels.
Fixes #39458.

git-svn-id: https://develop.svn.wordpress.org/trunk@39667 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-04 08:39:29 +00:00
SergeyBiryukov
0f6f7f207d Posts, Post Types: Add a @since entry for archives post type label introduced in [35382].
See #16075.

git-svn-id: https://develop.svn.wordpress.org/trunk@39666 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-04 08:20:14 +00:00
dd32
298b0d0676 Shortcodes: Clarify the docs for pre_do_shortcode_tag and do_shortcode_tag.
Props dhanendran.
Fixes #39294.


git-svn-id: https://develop.svn.wordpress.org/trunk@39665 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-03 03:57:03 +00:00
boonebgorges
80905ab4b1 Ignore the 'comment_order' setting when determining comment pagination.
[38740] incorrectly introduced logic that changed a comment's page when
'comment_order' was set to 'desc'. This is in violation of the design
of the comment pagination system: a comment's page is designed not to
change when 'comment_order' or 'default_comment_page' are changed.
See #31101.

Props rachelbaker.
Fixes #39280.

git-svn-id: https://develop.svn.wordpress.org/trunk@39663 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-02 19:58:09 +00:00
boonebgorges
3418d831a5 Don't double-escape terms payload in WP_Tax_Query::transform_query().
`terms` values are passed through `sanitize_term_field()` with the 'db'
flag, which add slashes. Because `terms` are subsequently run through
`esc_sql()`, these slashes must be removed. See [36348], which added
a similar step to sanitization in `get_terms()`.

Props bcworkz.
Fixes #39315.

git-svn-id: https://develop.svn.wordpress.org/trunk@39662 602fd350-edb4-49c9-b593-d223f7449a82
2017-01-02 19:38:07 +00:00
Dion Hulse
247e08e84a Mail: Ensure that any phpmailerException exceptions generated by setFrom() are caught to avoid PHP Fatal errors.
This change avoids a PHP fatal error that can be encountered when the specified (or generated) source email is an invalid address, such as `wordpress@_`, it makes no effort to set a valid source, only avoid the fatal error.

See #25239 for correcting the email address.
Fixes #39360.


git-svn-id: https://develop.svn.wordpress.org/trunk@39655 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-30 06:43:07 +00:00
Rachel Baker
70085bd944 REST API: Merge similiar error message strings in the Terms Controller.
Replaces the "doesn't" contraction with "does not" to be consistent with similar strings in `WP_Error` messages when a specified term or parent term is missing in `WP_REST_Terms_Controller`.

Props ramiy, ocean90.
Fixes #39176.


git-svn-id: https://develop.svn.wordpress.org/trunk@39648 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-29 18:44:59 +00:00
Rachel Baker
fa3f97449e REST API: Add the supports property to the Post Type response object.
Includes a new `supports` property in the response object and schema for the `/types` endpoints for users with the `edit_posts` capability for the given post type. The `supports` property returns an object of the features the given post type *supports*.

Props timmydcrawford, tyxla.
Fixes #39033.


git-svn-id: https://develop.svn.wordpress.org/trunk@39647 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-29 17:27:37 +00:00
Dion Hulse
e0531dcaa3 Upgrade PHPMailer from 5.2.14 to 5.2.21.
The full list of changes is available here:
https://github.com/PHPMailer/PHPMailer/compare/v5.2.14...v5.2.21

Props sebastian.pisula, MattyRob, sfpt, dd32.
Fixes #37210 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@39645 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-29 02:52:08 +00:00
Rachel Baker
7018deaf87 Comments: Fix placement of the wp_update_comment_data filter to safeguard filtered data from triggering a database error.
Introduced in [38674], the `wp_update_comment_data` filter took place after the `$data` was sliced and prepared for the database update statement. The location of the filter assumed the result of anyone applying it would not change the data type or make structural modifications or additions to the $data array. 😅

This moves the `wp_update_comment_data` filter to take place before the `$data` is sliced and prepared for the database update statement.

Props dshanske for initial patch.

Fixes #39380.


git-svn-id: https://develop.svn.wordpress.org/trunk@39640 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-27 17:21:04 +00:00
John Blackbourn
8512036e4e Docs: Misc corrections and additions to inline documentation.
See #39130
Props keesiemeijer


git-svn-id: https://develop.svn.wordpress.org/trunk@39639 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-27 09:27:38 +00:00
John Blackbourn
5f645d2f34 Docs: Add and correct @since docs for a variety of functions and methods.
Props keesiemeijer, chris_dev
Fixes #39343, #39357, #39344
See #39130


git-svn-id: https://develop.svn.wordpress.org/trunk@39638 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-27 09:20:11 +00:00
Boone Gorges
ef91d166d5 Query: Improve documentation for orderby=relevance in WP_Query.
Props dots.
Fixes #39336.

git-svn-id: https://develop.svn.wordpress.org/trunk@39636 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-23 02:30:54 +00:00
Boone Gorges
4b984b763d Taxonomy: Ensure that mods to query vars in pre_term_query callbacks have an effect.
Previously, it was possible to modify the `query_vars` array, but
the changes would be ignored after `pre_term_query` had finished
running.

Props jfarthing84.
Fixes #39354.

git-svn-id: https://develop.svn.wordpress.org/trunk@39625 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-21 03:01:32 +00:00
Weston Ruter
460c358859 Customize: Fix visible edit shortcuts for wp_nav_menu() instances using the menu arg (such as in the Custom Menu widget) instead of the theme_location arg.
Also fix logic for `focus-control-for-setting` handler to focus on the first control (lowest `priority` value) associated with a given setting instead of the last control encountered when iterating over all controls, as this ensures the first control in a `nav_menu` section is focused rather than the last one.

Props westonruter, sirbrillig.
See #27403.
Fixes #39101.


git-svn-id: https://develop.svn.wordpress.org/trunk@39622 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-20 22:04:22 +00:00
James Nylen
130adf0dc2 REST API: Improve the rest_*_collection_params filter docs and fix the terms filter.
The `rest_{$taxonomy}_collection_params` filter in 4.7 is incorrectly using
single quotes instead of double quotes, which means it is not working correctly
as a dynamic filter.  This fixes the quotes around the filter name, and also
updates the docblocks for the other 3 similar filters for better conformance to
the documentation standards.

Props shazahm1hotmailcom, JPry, jnylen0.
Fixes #39300.


git-svn-id: https://develop.svn.wordpress.org/trunk@39621 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-20 01:36:47 +00:00
James Nylen
8bbfc6ef28 REST API: Fix PHP warnings when get_theme_support( 'post-formats' ) is not an array.
If `add_theme_support( 'post-formats' )` is called with no additional
arguments, then `get_theme_support( 'post-formats' )` returns `true` rather
than an array of supported formats.  Avoid generating PHP warnings in this
situation.

Props dreamon11, ChopinBach.
Fixes #39293.


git-svn-id: https://develop.svn.wordpress.org/trunk@39620 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-20 00:55:04 +00:00
Weston Ruter
bad6ddc45d Customize: Bump wp_custom_css_cb from running at wp_head priority 11 to 101 to ensure Custom CSS overrides other CSS.
Aligns `wp_head` action priority with Jetpack's Custom CSS.

Amends [38829].
See #35395, #38672.
Fixes #39270.


git-svn-id: https://develop.svn.wordpress.org/trunk@39616 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-16 07:28:14 +00:00
Dion Hulse
a5bb301d0b Feeds: Replace the RSS2 lastBuildDate date field with the r date specifier.
See #39141.


git-svn-id: https://develop.svn.wordpress.org/trunk@39614 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-16 06:41:45 +00:00
Dion Hulse
939e806ef1 Feeds: Do not translate the lastBuildDate field in RSS feeds.
Props stevenkword, dd32.
Fixes #39141


git-svn-id: https://develop.svn.wordpress.org/trunk@39613 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-16 06:38:10 +00:00
Dion Hulse
0abe687fe8 Media: Move a variable definition outside of conditionals to ensure it's always available.
This fixes cases where the URL to a PDF preview may be incorrectly calculated when no thumbnails were generated for the PDF (and avoids a PHP Notice at the same time).

Fixes #39250.


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

Props jesseenterprises.
Fixes #39070.


git-svn-id: https://develop.svn.wordpress.org/trunk@39603 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-15 12:53:26 +00:00
Ella van Dorpe
79ded07a1a Editor: Remove target=_blank when unchecked in the link modal.
Fixes #39276 for trunk.



git-svn-id: https://develop.svn.wordpress.org/trunk@39601 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-14 20:30:00 +00:00
John Blackbourn
ca92da24da General: Use interpolation instead of concatenation for all dynamic hook names.
This fixes the rendering of the hook names on developer.wordpress.org.

Props keesiemeijer
Fixes #39148


git-svn-id: https://develop.svn.wordpress.org/trunk@39600 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-14 04:17:38 +00:00
John Blackbourn
c0bb5e4972 Posts, Post Types: Ensure is_page_template() can only return true when viewing a singular post query.
Props natereist, dlh
Fixes #39211


git-svn-id: https://develop.svn.wordpress.org/trunk@39599 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-14 03:42:58 +00:00
James Nylen
2642833293 REST API: Add support for filename search in media endpoint.
In [38625], the functionality to search for attachments by filename was added
via the `posts_clauses` filter and the `_filter_query_attachment_filenames()`
function.  This moves `_filter_query_attachment_filenames()` from
`wp-admin/includes/post.php` to `wp-includes/post.php` so that it can be
applied in the same manner in the REST API media endpoint.

Props jblz, tyxla.
Fixes #39092.


git-svn-id: https://develop.svn.wordpress.org/trunk@39598 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-13 14:08:24 +00:00
James Nylen
03c947c7fd REST API: Allow sending an empty or no-op comment update.
In general, updates that don't actually change anything should succeed.
[39371] added tests for other object types, and this commit fixes empty updates
for comments and adds the missing test.

Fixes #38700.


git-svn-id: https://develop.svn.wordpress.org/trunk@39597 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-13 13:52:49 +00:00
Gary Pendergast
25330a0220 Libraries: Update zxcvbn from version 1.0 to 4.4.1
This includes masses of bug fixes, as well as tweaks to how passwords are scored.

QUnit tests have been updated to reflect tha scoring changes.

Full changelog: https://github.com/dropbox/zxcvbn/compare/v1.0...v4.4.1

Fixes #31647.



git-svn-id: https://develop.svn.wordpress.org/trunk@39596 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-13 11:22:28 +00:00
James Nylen
9bf4440213 REST API: Do not include the password argument when getting media items
Currently, `attachment` is the only post type exposed via the REST API that
does not support password protection, but it's possible for other post types to
remove password support.

Fixes #38977.


git-svn-id: https://develop.svn.wordpress.org/trunk@39595 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-13 03:51:01 +00:00
James Nylen
68b6a6197b REST API: Do not error on empty JSON body
It's fairly common for clients to send `Content-Type: application/json` with an
empty body.  While technically not valid JSON, we've historically supported
this behaviour, so it shouldn't cause an error.

Props JPry.
Fixes #39150.


git-svn-id: https://develop.svn.wordpress.org/trunk@39594 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-13 03:33:14 +00:00
Boone Gorges
012d1977e2 Taxonomy: Use get_term_link() instead of get_category_link() in get_term_parents_list().
`get_category_link()` is a wrapper for `get_term_link()`. Using the
unwrapped function makes more sense semantically (it's taxonomy-
agnostic) and it's also more parsimonious (the `WP_Error` check in
`get_category_link()` is redundant with similar checks just before
in `get_term_link()`).

Props keesiemeijer.
Fixes #17069.

git-svn-id: https://develop.svn.wordpress.org/trunk@39593 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-13 02:56:32 +00:00
Ryan McCue
bc2d2858f9 General: Correctly detect trailing newline when prepending.
We need to check that the final line is actually an artifact of explode(), not just an empty input string.

See #37082.


git-svn-id: https://develop.svn.wordpress.org/trunk@39592 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-13 02:47:07 +00:00
Ryan McCue
32ed2a1ffa General: Remove most uses of create_function()
create_function() is equivalent to eval(), and most of our uses can be refactored. This is simpler, more secure, and slightly more performant.

Props sgolemon.
Fixes #37082.


git-svn-id: https://develop.svn.wordpress.org/trunk@39591 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-13 01:48:41 +00:00
Felix Arntz
b4317ea053 Multisite: Replace is_super_admin() with manage_network in get_dashboard_url().
Unit tests for `get_dashboard_url()` have been added.

Props iaaxpage.
Fixes #39065. See #37616.


git-svn-id: https://develop.svn.wordpress.org/trunk@39589 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 22:40:03 +00:00
Felix Arntz
539b85406d Multisite: Handle capability check for removing oneself via map_meta_cap().
Site administrators should not be able to remove themselves from a site. This moves the enforcement of this rule from `wp-admin/users.php` to `remove_user_from_blog()` via the `remove_user` capability, which furthermore allows us to get rid of two additional clauses and their `is_super_admin()` checks in `wp-admin/users.php`. A unit test for the new behavior has been added.

Fixes #39063. See #37616.


git-svn-id: https://develop.svn.wordpress.org/trunk@39588 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 21:41:44 +00:00
Weston Ruter
050eb4da17 Customize: Prevent navigation in preview when clicking on child elements of preview links that have non-previewable URLs.
Fixes #39098.


git-svn-id: https://develop.svn.wordpress.org/trunk@39584 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 08:08:08 +00:00
Weston Ruter
ae9854e338 Customize: Prevent edit shortcut from losing event handler after selective refresh.
Props sirbrillig.
See #27403.
Fixes #39100.


git-svn-id: https://develop.svn.wordpress.org/trunk@39581 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 07:52:00 +00:00
Dion Hulse
24228daabf PDF Images: Avoid a PHP Warning when attempting to process a file without an extension.
Props chandrapatel for initial patch.
Fixes #39195.


git-svn-id: https://develop.svn.wordpress.org/trunk@39580 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 06:18:30 +00:00
Dion Hulse
caa1f1f88d Taxonomy: Restore the ability to use string-based $args in wp_get_object_terms().
Props tyxla.
Fixes #39215


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

Props jorbin.
Fixes #39132.


git-svn-id: https://develop.svn.wordpress.org/trunk@39565 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-12 01:28:34 +00:00
Peter Wilson
7950b0e306 Options: Prevent unnecessary SQL updates by update_option.
Previously an option containing an object would trigger an SQL `UPDATE` on all calls to `update_option`, even if the old and new values were identical. This was due to the old and new values having differing resource IDs.

This change compares the old and new values as serialized data to remove the resource ID from the comparison.

Props salcode, bradyvercher, peterwilsoncc.
Fixes #38903.


git-svn-id: https://develop.svn.wordpress.org/trunk@39564 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-11 21:42:12 +00:00
Rachel Baker
260a88d009 REST API: Allow schema sanitization_callback to be set to null to bypass fallback sanitization functions.
The logic in WP_REST_Request->sanitize_params() added in [39091] did not account for `null` or `false` being the sanitization_callback preventing overriding `rest_parse_request_arg()`. This fixes that oversight, allowing the built in sanitization function to be bypassed. See #38593.

Props kkoppenhaver, rachelbaker, jnylen0.
Fixes #39042.


git-svn-id: https://develop.svn.wordpress.org/trunk@39563 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-11 21:25:40 +00:00
Weston Ruter
3a3ebc76a3 Customize: Fix ability to shift-click on placeholder/pre-saved nav menu items in preview to focus on corresponding control.
Fixes #39102.


git-svn-id: https://develop.svn.wordpress.org/trunk@39562 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-10 23:46:33 +00:00
Weston Ruter
1681d96a6d Customize: Deprecate page_home nav menu item starter content in favor of home_link; replace usage in Twenty Seventeen.
Props celloexpressions, westonruter.
Amends [38991].
See #38615, #38114.
Fixes #39104.


git-svn-id: https://develop.svn.wordpress.org/trunk@39561 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-10 23:38:04 +00:00
Weston Ruter
e27098f5bd Customize: Trim whitespace for URLs supplied for external_header_video to prevent esc_url_raw() from making them invalid.
Props tyxla.
See #38172.
Fixes #39125.


git-svn-id: https://develop.svn.wordpress.org/trunk@39560 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-10 06:59:24 +00:00
Weston Ruter
0369dea1e4 Customize: Prevent single quotes (apostrophes) in custom_css values from unexpectedly causing false positives for unbalanced character validation errors.
See #39218, #35395.
Fixes #39198.


git-svn-id: https://develop.svn.wordpress.org/trunk@39559 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-10 06:45:00 +00:00
Weston Ruter
be8caefd82 Customize: Fix inability to delete nav menus by preventing preview filters from being added during customize_save admin ajax request.
Also prevent setting `nav_menu_locations[...]` values to `NaN` which gets sent as `null`.

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


git-svn-id: https://develop.svn.wordpress.org/trunk@39558 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-10 06:29:12 +00:00
boonebgorges
479a743307 Docs: Correct param definition for WP_Query::query().
Props Shelob9.
Fixes #38963.

git-svn-id: https://develop.svn.wordpress.org/trunk@39550 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-09 16:22:02 +00:00
Boone Gorges
77484a0f4a Taxonomy: Introduce get_term_parents_list().
This new function is a taxonomy-agnostic version of `get_category_parents()`.

Props keesiemeijer, SergeyBiryukov, rafaehlers.
Fixes #17069.

git-svn-id: https://develop.svn.wordpress.org/trunk@39549 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-09 16:09:31 +00:00
Weston Ruter
3669b47260 Customize: Allow (optional) url parameter to be omitted in intercepted calls to history.pushState() and history.replaceState() in customize preview.
Fixes issue where calls without the `url` parameter erroneously end up rewriting the location path to `/undefined`.

Props Christian1012, westonruter.
Fixes #39175.


git-svn-id: https://develop.svn.wordpress.org/trunk@39547 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-09 01:58:18 +00:00
Weston Ruter
c8eafed944 Customize: Use esc_url_raw() instead of wp_json_encode() to eliminate extraneous slashes when outputting background image URL in CSS url().
Props tyxla, westonruter.
See #22058.
Fixes #39145.


git-svn-id: https://develop.svn.wordpress.org/trunk@39546 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-09 01:42:23 +00:00
Weston Ruter
9c5d1f6011 Customize: Use selected user language for edit shortcuts in preview instead of site language.
Props ocean90.
Fixes #39009.


git-svn-id: https://develop.svn.wordpress.org/trunk@39545 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-08 19:31:37 +00:00
Andrea Fercia
d986f9dcdc Toolbar: remove some unnecessary CSS lines.
They were commented out in `admin-bar.css` since 3 years, see [26770].

Props kafleg, ketuchetan.

Fixes #39137.


git-svn-id: https://develop.svn.wordpress.org/trunk@39533 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-07 17:44:45 +00:00
Boone Gorges
a7c429cb53 Comments: Clean up unused code after [38446].
When the direct SQL query was removed in [38446], part of the SQL
concatenation was not removed. This changeset fixes that.

Props david.binda.
Fixes #39142.

git-svn-id: https://develop.svn.wordpress.org/trunk@39532 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-07 15:51:08 +00:00
John Blackbourn
042451a9e1 Taxonomy: Correct the type for the first parameter of the the_category filter.
See #39130


git-svn-id: https://develop.svn.wordpress.org/trunk@39530 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-07 01:22:09 +00:00
Andrea Fercia
30076372d7 Accessibility: Improve keyboard accessibility avoiding confusing tab stops in the Media views.
When sections of the media modal are hidden out of view, their controls may be
still focusable and actionable. This completely hides these sections to avoid
unnecessary tab stops and potential confusion for assistive technology users.

Props SergeyBiryukov, afercia.

Fixes #30599.


git-svn-id: https://develop.svn.wordpress.org/trunk@39529 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-06 23:27:04 +00:00
Weston Ruter
385dd3fece Customize: Prevent infinite full refresh from occurring when selective refresh falls back for a nav menu that has items excluded from rendering via filtering.
See #37032.
Fixes #38612.


git-svn-id: https://develop.svn.wordpress.org/trunk@39510 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-06 02:50:13 +00:00
Dominik Schilling (ocean90)
386a0ca669 Comments: Merge a similar string between comments.php, XML-RPC and the REST API comments controller.
Props ramiy.
Fixes #39013.

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

Props westonruter, dlh for testing, helen for testing.
See #38114, #38928.
Fixes #39078.


git-svn-id: https://develop.svn.wordpress.org/trunk@39506 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-05 19:32:09 +00:00
Weston Ruter
01876b9888 Customize: Ensure textarea for Custom CSS displays as code (in LTR) when an RTL language is active.
See #35395.
Fixes #39085.


git-svn-id: https://develop.svn.wordpress.org/trunk@39499 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-05 13:54:58 +00:00
John Blackbourn
7c02c24e5f Role/Capability: Don't assign the delete_site capability to anyone on single site installs.
This capability is not relevant on single site installs; it only applies to deleting a site on a multisite installation.

Fixes #38326


git-svn-id: https://develop.svn.wordpress.org/trunk@39494 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-04 22:06:36 +00:00
Felix Arntz
40668a1c63 Multisite: Replace is_super_admin() with manage_network for admin bar permissions.
Props iaaxpage.
Fixes #39064. See #37616.


git-svn-id: https://develop.svn.wordpress.org/trunk@39492 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-04 21:20:44 +00:00
Rachel Baker
bc6b164d23 Comments: Merge similar strings between comments.php and the REST API comments controller.
Props ramiy.
Fixes #39014.


git-svn-id: https://develop.svn.wordpress.org/trunk@39490 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-04 20:31:27 +00:00
Rachel Baker
33f442f17b REST API: Merge similar date strings in the revisions and comments controllers.
Props ramiy.
Fixes #39016.


git-svn-id: https://develop.svn.wordpress.org/trunk@39488 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-04 20:24:54 +00:00
James Nylen
d2a5f48449 REST API: Treat any falsy value as false in 'rest_allow_anonymous_comments'.
Extend the check in 'rest_allow_anonymous_comments' to accept any falsy value
(previously this was an explicit check for `false`).

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

Props joehoyle, jnylen0.

Fixes #39010.


git-svn-id: https://develop.svn.wordpress.org/trunk@39487 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-04 19:29:18 +00:00
johnbillion
01a6118660 Users: Clarify the return value of get_current_user_id() for non-logged-in users.
Props ovenall
Fixes #39051


git-svn-id: https://develop.svn.wordpress.org/trunk@39486 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-04 19:23:53 +00:00
Weston Ruter
06ee519376 Customize: Ensure a custom_css post insertion gets an initial post revision.
Props georgestephanis, westonruter.
See #30854, #38672, #35395.
Fixes #39032.


git-svn-id: https://develop.svn.wordpress.org/trunk@39477 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-04 17:28:27 +00:00
Helen Hou-Sandi
980459a68b Docs: Update an @since as there will not be a 4.6.2 before 4.7.
props boonebgorges.
fixes #37291. see [38776].


git-svn-id: https://develop.svn.wordpress.org/trunk@39475 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-04 17:09:20 +00:00
Andrew Nacin
ceee0b78e1 REST API: Register the admin_email setting in single site only.
fixes #38990.


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

Props peterwilsoncc.
Fixes #39005.



git-svn-id: https://develop.svn.wordpress.org/trunk@39468 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-03 05:15:42 +00:00
Helen Hou-Sandi
97191393bc Custom CSS: Change the help link to something better for users.
fixes #39015.


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

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



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

Props ketuchetan, rahulsprajapati.
Fixes #39023.



git-svn-id: https://develop.svn.wordpress.org/trunk@39462 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-03 04:47:58 +00:00
Gary Pendergast
8e34471a11 REST API: Use the correct error message when editing a single term.
Props ramiy, johnbillion.
Fixes #39017.



git-svn-id: https://develop.svn.wordpress.org/trunk@39460 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-03 04:41:16 +00:00
Gary Pendergast
f82946ab4a REST API: Merge similar strings in a comments endpoint parameter description.
Props ramiy.
Fixes #39036.



git-svn-id: https://develop.svn.wordpress.org/trunk@39457 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-03 04:20:56 +00:00
Gary Pendergast
2516ae4d4a Load: No-op locale.php
After re-adding `locale.php` in [39455], remove the content of the file so that it can't cause errors in the event of something loading it early in the WordPress load process.

See #39027.



git-svn-id: https://develop.svn.wordpress.org/trunk@39456 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-03 04:15:33 +00:00
Gary Pendergast
7e2009642a Load: Re-add locale.php.
`locale.php` is occasionally included directly by custom external code, so should continue to be available. This behaviour is deprecated.

Partial revert of [38364].
See #37827, #39027.



git-svn-id: https://develop.svn.wordpress.org/trunk@39455 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-03 04:06:15 +00:00
Gary Pendergast
d7d48f6372 Load: Re-add session.php.
`session.php` is occasionally included directly by custom external code, so should continue to be available. This behaviour is deprecated.

Partial revert of [38373].
See #36335, #39027.



git-svn-id: https://develop.svn.wordpress.org/trunk@39453 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-03 03:50:02 +00:00
Gary Pendergast
0b1ff178a7 Load: Re-add class-feed.php.
`class-feed.php` is occasionally included directly by custom external code, so should continue to be available. This is deprecated in favour of calling `fetch_feed()`, however..

Partial revert of [38374].
See #36335, #39027.



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

Props flixos90, hnle, dd32, rachelbaker, jnylen0, ChopinBach, joehoyle, pento.

Fixes #38971.


git-svn-id: https://develop.svn.wordpress.org/trunk@39444 602fd350-edb4-49c9-b593-d223f7449a82
2016-12-02 22:43:03 +00:00