Commit Graph

5074 Commits

Author SHA1 Message Date
Sergey Biryukov
aee733684b Docs: Synchronize the $timezone parameter description between get_lastpostdate(), get_lastpostmodified(), and _get_last_post_time().
See #17455.
Built from https://develop.svn.wordpress.org/trunk@34240


git-svn-id: http://core.svn.wordpress.org/trunk@34204 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-16 15:29:39 +00:00
Sergey Biryukov
15b69a0862 Docs: Fix some syntactical issues with the DocBlock for wp_mail_failed action, introduced in [34221].
Fixes #18926.
Built from https://develop.svn.wordpress.org/trunk@34239


git-svn-id: http://core.svn.wordpress.org/trunk@34203 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-16 15:13:26 +00:00
Sergey Biryukov
d06f5817f8 Docs: Expand the DocBlock for the WP_Theme::get_edit_link() method, introduced in [34084].
Fixes #32376.
Built from https://develop.svn.wordpress.org/trunk@34238


git-svn-id: http://core.svn.wordpress.org/trunk@34202 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-16 15:01:27 +00:00
Drew Jaynes
b1f176582c Docs: Add changelog entries for parameters where WP_Comment object support was added in [33961].
See #33638. See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34201 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-16 13:52:25 +00:00
Drew Jaynes
4a69b4d275 Docs: Fix some syntactical issues with the DocBlock for the WP_Theme->update property, introduced in [33957].
Adds an `@since`.

See #33491. See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34200 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-16 13:29:25 +00:00
Drew Jaynes
fd60f500c3 Docs: Add a changelog entry for the addition of 'wp-admin', 'wp-content', and 'wp-includes' as reserved names for the subdirectory_reserved_names filter docs.
The new names were introduced in [33952].

See #33615. See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34199 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-16 13:26:26 +00:00
Drew Jaynes
13c25f5f49 Docs: Put "it's" in its place (again).
Props kitchin.
Fixes #33894.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34198 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-16 12:46:28 +00:00
Sergey Biryukov
53ac914bd5 Add a comment to strings where the ellipsis cannot be used due to json_encode(), placeholders, or external dependencies.
Fixes #32875.
Built from https://develop.svn.wordpress.org/trunk@34233


git-svn-id: http://core.svn.wordpress.org/trunk@34197 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-16 11:59:26 +00:00
Sergey Biryukov
19bcadf2a6 Reset Password: Move <div> out of <p> in wp-login.php.
Props ldinclaux.
Fixes #33892.
Built from https://develop.svn.wordpress.org/trunk@34232


git-svn-id: http://core.svn.wordpress.org/trunk@34196 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-16 11:46:25 +00:00
Sergey Biryukov
4c019c6aee Comments: Fix a fatal error in Comments meta box after [34223].
Props tyxla.
Fixes #33893. See #33413.
Built from https://develop.svn.wordpress.org/trunk@34231


git-svn-id: http://core.svn.wordpress.org/trunk@34195 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-16 11:37:25 +00:00
Drew Jaynes
faa54e4dc2 Docs: Make a minor adjustment to the description syntax for the optional $comment argument in the DocBlock for comment_link(), introduced in [34071].
See #33638. See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34194 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-16 11:02:24 +00:00
Drew Jaynes
3c73b53f66 Docs: Remove markdown from the DocBlock summary for WP_List_Table::get_primary_column(), introduced in [34166].
The PHP inline documentation standards for [https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/php/#summary-formerly-short-description summaries] call for not using an markup or markdown. Also, using the full Class::method() in this context allows for better clarity in what is being referenced.

See #33854. See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34193 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-16 10:51:25 +00:00
Drew Jaynes
c52a7d863e Docs: Add a changelog entry for the switch to using wp_get_attachment_url() instead of the guid for determining the header image URL in Custom_Image_Header::step_3().
The change was introduced in [34188].

See #33319.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34192 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-16 10:43:25 +00:00
Drew Jaynes
4279a9c39e Docs: Improve documentation for the WP_Object_Cache class.
Spaces out parameter documentation for readability, fixes some minor syntactical issues, and adds some missing `@access` tags or reorders tags according to the PHP docs standards.

Also, documents `&$found`, the fourth parameter for the `get()` method, and adds missing parameter and return descriptions for the `_exists()` utility method.

See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34191 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-16 10:03:26 +00:00
Drew Jaynes
5172621c1d Docs: Remove an errant change made to a _deprecated_function() call in wp_cache_reset() introduced in [34225].
See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34190 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-16 09:42:24 +00:00
Drew Jaynes
4e4737685e Docs: Add more complete documentation for top-level object cache functionality.
Adds some `@see` tags for corresponding `WP_Object_Cache` methods to DocBlocks for top-level functions. Also adds a standard description for the `@global` tags, spacing for parameter docs readability, and finally, properly marks optional parameters as such.

See #32246.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34189 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-16 09:40:25 +00:00
Drew Jaynes
a7ea95f53a Docs: Add documentation for $object_id, the optional second parameter in current_user_can() and WP_User::has_cap(), and the optional third parameter in map_meta_cap().
This change introduces the vernacular of "meta" vs "primitive" capabilities to core docs, and providing examples for each inline and attempts to make it clear that `$object_id` is really only useful if the passed `$capability` is of the meta cap variety.

Props jliman for the initial patch.
Fixes #32694.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34188 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-16 07:36:32 +00:00
Scott Taylor
5920e8eb13 Move WP_Post_Comments_List_Table to its own file.
See #33413.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34187 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-16 06:53:24 +00:00
Sergey Biryukov
61bef72b95 Fix a typo in wptexturize() and wp_replace_in_html_tags() comments.
Props bobbingwide.
See #15694.
Built from https://develop.svn.wordpress.org/trunk@34222


git-svn-id: http://core.svn.wordpress.org/trunk@34186 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-16 05:54:26 +00:00
Aaron Jorbin
1bd52ae1aa Fire Action when mail exception is thrown.
new action is wp_mail_failed which contains a WP_Error object with the phpmailerException code, message and an array with the mail information. Plugins can hook in and log when mails fail to send due to a phpmailer issue.

Props soulseekah
Fixes #18926


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


git-svn-id: http://core.svn.wordpress.org/trunk@34185 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 23:51:23 +00:00
Weston Ruter
628caeb487 Customizer: Smooth animation for closing accordions in the available nav menu items pane.
Props tyxla.
Fixes #33360 for trunk.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34183 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 23:40:24 +00:00
Boone Gorges
a7e229637e Improve validation of user_login and user_nicename length.
The `user_login` field only allows 60 characters, and `user_nicename` allows
50. However, there are no protections in the interface, and few in the code,
that prevent the creation of users with values in excess of these limits. Prior
to recent changes in `$wpdb`, users were generally created anyway, MySQL
having performed the necessary truncation. More recently, the `INSERT`s and
`UPDATE`s simply fail, with no real feedback on the nature of the failure.

This changeset addresses the issue in a number of ways:
* On the user-new.php and network/user-new.php panels, don't allow input in excess of the maximum field length.
* In `wp_insert_user()`, throw an error if the value provided for `'user_login'` or `'user_nicename'` exceeds the maximum field length.
* In `wp_insert_user()`, when using `'user_login'` to generate a default value for `'user_nicename'`, ensure that the nicename is properly truncated, even when suffixed for uniqueness (username-2, etc).

Props dipesh.kakadiya, utkarshpatel, tommarshall, boonebgorges.
Fixes #33793.
Built from https://develop.svn.wordpress.org/trunk@34218


git-svn-id: http://core.svn.wordpress.org/trunk@34182 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 22:14:26 +00:00
Boone Gorges
cfbd3c2cc0 Omit the ORDER BY clause when updating object term cache.
The `ORDER BY` clause was forcing filesorts on large tables, and is
unnecessary, since term order doesn't matter when updating the cache.

Props mbrandys, wonderboymusic.
Fixes #28922.
Built from https://develop.svn.wordpress.org/trunk@34217


git-svn-id: http://core.svn.wordpress.org/trunk@34181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 20:53:33 +00:00
Scott Taylor
4139daea5e Apply the new 'respond_link' filter in comments_popup_link() if $number is 0 before outputting the URL.
Props joedolson.
Fixes #29454.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34180 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 20:46:35 +00:00
Scott Taylor
8573a86def In WP::parse_request(), don't add query vars of non-viewable post types to WP::public_query_vars. In register_post_type(), don't add query vars of non-viewable post types to WP::public_query_vars.
In `_unregister_post_type()` (unit tests), don't add query vars of non-viewable post types to `WP::public_query_vars`.

Adds unit test.

Fixes #30018.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34179 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 18:54:30 +00:00
Scott Taylor
d5e02c6129 After [34188], fix unit test for image header.
See #33319.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34178 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 18:44:48 +00:00
John Blackbourn
a9e5cfddc7 Implement wp_login_url() and wp_registration_url() in places where wp-login.php is currently hard-coded.
See #31495
Props GregLone

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


git-svn-id: http://core.svn.wordpress.org/trunk@34177 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 17:11:35 +00:00
Scott Taylor
f5edeb11d0 WP_Comment_Query: add comment__in to allowed values for $orderby.
Adds unit tests.

Fixes #33883.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34176 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 16:35:44 +00:00
Scott Taylor
72651400ba Add parent__in and parent__not_in query vars to WP_Comment_Query.
Adds unit tests.

Fixes #33882.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34169 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 16:23:39 +00:00
Drew Jaynes
0a4bf88cc9 Docs: Update the hook doc summary for the wp_http_ixr_client_headers filter, introduced in [34164].
The idea is to try to reflect what the filterable value is rather than why it's filterable.

Fixes #24598.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34167 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 16:16:43 +00:00
Scott Taylor
ff3ae0e747 Don't redirect to the Term list table after submitting the form on the Edit Term page.
Props chiragswadia, UmeshSingla, rhyswynne, afercia.
Fixes #17455.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34166 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 15:59:42 +00:00
Scott Taylor
b07b68490f Allow get_lastpostdate(), get_lastpostmodified(), and _get_last_post_time() to accept $post_type and cache separately.
Props _duck, SergeyBiryukov.
See #17455.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34165 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 15:25:31 +00:00
Scott Taylor
4a34994e54 Allow wp_page_menu() to accept 'walker', 'before', and 'after' to allow custom markup.
Fixes #11095.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34164 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 15:06:30 +00:00
Scott Taylor
57d2420ae5 Similar to #33386, don't use guid when retrieving URL for a cropped header image in the Customizer.
Props polevaultweb.
Fixes #33319.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34156 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 14:46:32 +00:00
Sergey Biryukov
80165bfc4a Comments: When setting the colspan value for inline edit/reply, make sure it's actually a table and the value is not empty.
Props afercia.
Fixes #33596.
Built from https://develop.svn.wordpress.org/trunk@34179


git-svn-id: http://core.svn.wordpress.org/trunk@34147 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 13:44:34 +00:00
John Blackbourn
a5a8ae45a6 Remove outdated references to the preview_post_link filter docs.
See #24345
Props paulwilde

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


git-svn-id: http://core.svn.wordpress.org/trunk@34146 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 10:32:31 +00:00
John Blackbourn
541dbb2711 Remove the ability to view the post listing screen and post editing screen for post types with show_ui set to false. It is unexpected and unintended behaviour that this is allowed.
If your plugin or site does rely on this behaviour, the arguments that are passed to `register_post_type()` should be altered so that `show_ui` is `true`, and arguments such as `show_in_menu`, `show_in_nav_menus`, and `show_in_admin_bar` are `false`.

Fixes #33763
Props swissspidy, johnbillion

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


git-svn-id: http://core.svn.wordpress.org/trunk@34145 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 10:27:29 +00:00
John Blackbourn
caf90ec1c6 Improve the docblocks for the get_preview_post_link() function and the preview_post_link filter.
See #24345

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


git-svn-id: http://core.svn.wordpress.org/trunk@34144 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 08:25:25 +00:00
John Blackbourn
9cd91030a6 Correct the value of the preview query variable added by get_preview_post_link().
See #24345
Props kitchin

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


git-svn-id: http://core.svn.wordpress.org/trunk@34143 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 08:16:24 +00:00
John Blackbourn
fdb8400379 Place the filter docblock for http_api_transports immediately above the filter.
See #33413
Props dd32

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


git-svn-id: http://core.svn.wordpress.org/trunk@34142 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 08:12:25 +00:00
John Blackbourn
1bed706d27 Missed files from [34172].
See #33877

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


git-svn-id: http://core.svn.wordpress.org/trunk@34141 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 08:09:24 +00:00
John Blackbourn
ec0544e053 Initialise $_SERVER[ 'REMOTE_ADDR' ] during the test bootstrap so individual tests need not.
Fixes #33877
Fixes #25162

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


git-svn-id: http://core.svn.wordpress.org/trunk@34140 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 08:05:28 +00:00
Scott Taylor
ab6d1fa247 Use get_attached_file() in attachment_submitbox_metadata().
Props kitchin.
Fixes #33386.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34139 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 04:18:25 +00:00
Scott Taylor
54829b6305 Create a function, get_preview_post_link(), to DRY the logic for applying the 'preview_post_link' filter to a URL.
Props TomHarrigan, wonderboymusic.
Fixes #24345.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34138 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 04:15:25 +00:00
Scott Taylor
ee42803e21 Move WP_Screen to its own file.
See #33413.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34137 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 04:08:24 +00:00
Scott Taylor
fde014e85e Move the admin Nav Menu Walker subclasses into their own files. Load in nav-menu.php to remain BC.
See #33413.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34136 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 04:02:25 +00:00
Scott Taylor
ed25b09942 Update post thumbnail functions to allow a WP_Post to be passed.
Adds unit tests.

Props swissspidy, Rahe.
Fixes #33723.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 03:46:25 +00:00
Scott Taylor
780487556b Add a doc block to WP_List_Table::get_primary_column().
Fixes #33854.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34134 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 03:35:25 +00:00
Scott Taylor
ab777c54cc Ensure that widget carets close when dragging an expanded widget.
Props sdavis2702, mindctrl.
Fixes #33578.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34133 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 03:10:24 +00:00
Scott Taylor
1b0121a841 Add a filter to allow custom headers to be sent via the WP HTTP IXR client: 'wp_http_ixr_client_headers'.
Props ericmann.
Fixes #24598.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34132 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 02:54:24 +00:00
Scott Taylor
191400f9e6 Don't ever use the guid value when retrieving URLs for media, use wp_get_attachment_url(). Use get_attached_file() for path to file.
Fixes #33386.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34131 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 02:50:25 +00:00
Scott Taylor
d7d5789088 TwentyFifteen|Sixteen themes have a <div id="content"> in the header. Change the <div> IDs in wp-activate.php and wp-signup.php to be unique to each page.
Props jfarthing84.
Fixes #33843.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34130 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 02:09:24 +00:00
Scott Taylor
69e3a390b2 In _wp_ajax_delete_comment_response(), read the new 'all' prop returned by get_comment_count() via wp_count_comments() when setting $total. 'all' doesn't include spam in its count.
Updates unit tests.

Props dipesh.kakadiya.
Fixes #32362.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34129 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 01:47:25 +00:00
Scott Taylor
cf2aaf8393 In get_avatar_data(), promote stdClass objects to WP_Comment if passed.
Props DrewAPicture, ocean90.
Fixes #32619.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34128 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 01:34:25 +00:00
Scott Taylor
387f271ea5 After [34070], account for the new ID in Quick Edit JS.
Props afercia.
Fixes #33770.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34127 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 01:31:26 +00:00
Scott Taylor
31c2bfd69d More bonkers comment cache cleanup: toggle wp_defer_comment_counting() in wp_insert_post() and wp_insert_attachment(). Move the cache deletion in wp_update_comment_count_now() to before the get_post() call, so that the caches get deleted even if the post has already been deleted and the function returns early.
See #33875.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34126 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-15 00:58:26 +00:00
Scott Taylor
8479ff90bc Ensure that the count cache for all is in sync with comment-{$post_id} values. These are the values most often relied-upon by the list table for comments.
Adds unit tests.

See #33875.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34104 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 22:39:24 +00:00
Dominik Schilling
e932a2dc5d XMLRPC: Don't allow private posts to be sticky.
See #20662.
Built from https://develop.svn.wordpress.org/trunk@34135


git-svn-id: http://core.svn.wordpress.org/trunk@34103 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 22:38:23 +00:00
Nikolay Bachiyski
3778cae8ec Shortcodes: don't allow unclosed HTML elements in attributes
Built from https://develop.svn.wordpress.org/trunk@34134


git-svn-id: http://core.svn.wordpress.org/trunk@34102 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 22:36:24 +00:00
Nikolay Bachiyski
097c4fd2f4 List tables: escape user e-mails
Better safe than sorry.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34101 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 22:33:25 +00:00
Scott Taylor
1a01a9ab55 In the edit-comments.php admin handler, toggle wp_defer_comment_counting() so that only unique post IDs have their comment count updated. Currently, if you delete 50 comments from the same post, the count would get reset 50 times. Not joking.
See #33875.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34100 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 22:24:26 +00:00
Scott Taylor
60367d567d The "counts" cache for comments by post id is never invalidated. Neither wp_update_comment_count() nor wp_update_comment_count_now() touch the cache.
Adds unit test.
See #33875.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34099 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 22:04:26 +00:00
Scott Taylor
7639a89a1f wp_unspam_comment() can accept a full object instead of comment_ID to reduce cache/db lookups..
See #33638.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34098 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 21:47:25 +00:00
Scott Taylor
b1bc8a6522 More comment functions can accept a full object instead of comment_ID to reduce cache/db lookups.
See ##33638.


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


git-svn-id: http://core.svn.wordpress.org/trunk@34097 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 21:40:24 +00:00
Scott Taylor
b2a30103ae In WP_List_Table, make a new public method, ->get_primary_column(), and revert [34101] due to BC issues.
Fixes #33854.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34096 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 20:29:26 +00:00
Scott Taylor
4d33644373 In WP_Media_List_Table, fetch all pending comment counts at once, instead of for each row in the loop.
See #11381.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34095 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 19:25:25 +00:00
John Blackbourn
dbe4a770d5 Implement unit tests which use reflection to test functions in pluggable.php. This means any changes to these functions will need explicit changes to their corresponding tests, which helps prevent unintentional breakage.
Fixes #33867

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


git-svn-id: http://core.svn.wordpress.org/trunk@34094 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 19:15:27 +00:00
Boone Gorges
ef474c6970 Accept 'ID' as a valid $field in get_user_by().
We already accept 'id'. `ID` more closely matches the database and
`WP_User` schemas.

Props Shelob9.
Fixes #33869.
Built from https://develop.svn.wordpress.org/trunk@34125


git-svn-id: http://core.svn.wordpress.org/trunk@34093 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 18:58:26 +00:00
John Blackbourn
a78e850e9c Add the site icon meta tags to wp-login.php.
See #33597
Props iworks

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


git-svn-id: http://core.svn.wordpress.org/trunk@34092 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 18:02:24 +00:00
Scott Taylor
3a0db2a22f Fix the case-sensitivity of some HTTP class usage.
See #33413.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34091 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 17:37:25 +00:00
John Blackbourn
bc6af23302 Update links to the user profile editing screen in the admin toolbar when the current logged in user has no role on the current site. Covers single site and Multisite and introduces tests.
Fixes #25162

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


git-svn-id: http://core.svn.wordpress.org/trunk@34090 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 17:10:26 +00:00
Drew Jaynes
edd0f2b32f Docs: Add missing parameter and return descriptions for Walker::get_number_of_root_elements().
Fixes #33662.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34089 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 15:33:27 +00:00
Sergey Biryukov
d9bc36d068 Escape class attribute in edit_post_link() after [34098].
Props Offereins.
See #30563.
Built from https://develop.svn.wordpress.org/trunk@34117


git-svn-id: http://core.svn.wordpress.org/trunk@34085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 13:01:25 +00:00
Dominik Schilling
4af3a3374e Passwords: Deprecate second parameter of wp_new_user_notification().
The second parameter `$plaintext_pass` was removed in [33023] and restored as `$notify` in [33620] with a different behavior. If you have a plugin overriding `wp_new_user_notification()` which hasn't been updated you would get a notification with your username and the password "both".
To prevent this the second parameter is now deprecated and reintroduced as the third parameter.

Adds unit tests.

Props kraftbj, adamsilverstein, welcher, ocean90.
Fixes #33654.

(Don't ask for new pluggables kthxbye)
Built from https://develop.svn.wordpress.org/trunk@34116


git-svn-id: http://core.svn.wordpress.org/trunk@34084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 12:43:26 +00:00
Sergey Biryukov
97c0303f41 Docs: Add a changelog entry for the $class argument added to edit_post_link() in [34098].
Fixes #30563.
Built from https://develop.svn.wordpress.org/trunk@34115


git-svn-id: http://core.svn.wordpress.org/trunk@34083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 12:20:26 +00:00
Dominik Schilling
d36ffeb160 Passwords: Trigger a wp-check-valid-field event when the password field is filled with a password by generatePassword().
Updates event handler in `wpAjax.invalidateForm()` to support `wp-check-valid-field`.

See #33406.
Built from https://develop.svn.wordpress.org/trunk@34114


git-svn-id: http://core.svn.wordpress.org/trunk@34082 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 10:39:27 +00:00
Scott Taylor
5020135a10 Add sanity checks in map_meta_cap(), return 'do_not_allow' when posts don't exist.
Adds unit test.

Props ocean90, nerrad, filosofo.
Fixes #23162.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34081 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 04:44:26 +00:00
Boone Gorges
49803a45f3 Send multisite site/user signup emails via hooked functions.
Site and user signup notifications are moved to the new actions
`'after_signup_site'` and `'after_signup_user'`. Site and user activation
notifications are moved to the existing actions `'wpmu_activate_blog'` and
`'wpmu_activate_user'`.

Props dshanske, thomaswm, jeremyfelt.
See #33587..
Built from https://develop.svn.wordpress.org/trunk@34112


git-svn-id: http://core.svn.wordpress.org/trunk@34080 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 03:28:24 +00:00
Scott Taylor
ecc4106ed1 Add an argument to parent_dropdown(), $post, to allow it to be called for an arbitrary post.
Fixes #23162.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 03:20:25 +00:00
Scott Taylor
172e37b007 Move Walker_Category and Walker_CategoryDropdown into their own files via svn cp. Remove them from category-template.php. Load them in category.php. svn cp category.php over to category-functions.php, which also loads now in category.php.
See #33413.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 03:10:24 +00:00
Scott Taylor
4cec121d0b Move Walker_Page and Walker_PageDropdown into their own files via svn cp. Remove them from post-template.php. Load them in post.php.
`post-template.php` loads after `post.php` in `wp-settings.php`. It could probably also be loaded in `post.php`, but avoiding that for the moment.

See #33413.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34077 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 02:59:24 +00:00
Scott Taylor
07c6fad006 In wp_link_pages(), ensure that $prev is greater than 0.
Props betzster.
Fixes #25273.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34076 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 02:46:24 +00:00
Boone Gorges
b62bcef1b1 Send password-change email notifications via hook.
`wp_password_change_notification()` is now called at the 'after_password_reset'
action, rather than being invoked directly from the `reset_password()` function.

In order to make it possible to call `wp_password_change_notification()` as a
`do_action()` callback, the function signature has to be changed so that the
`$user` parameter is expected to be a value rather than a reference. Since
PHP 5.0, objects are passed by reference, so `&$user` was unnecessary anyway.

Props dshanske, thomaswm.
See #33587.
Built from https://develop.svn.wordpress.org/trunk@34107


git-svn-id: http://core.svn.wordpress.org/trunk@34075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 02:45:25 +00:00
Boone Gorges
c614849786 Send comment notification emails via a hooked function.
Previously, `wp_notify_postauthor()` and `wp_notify_moderator()` were called
directly from `wp_new_comment()`, making it difficult to modify or suppress
default notification emails.

Props dshanske, thomaswm.
See #33587.
Built from https://develop.svn.wordpress.org/trunk@34106


git-svn-id: http://core.svn.wordpress.org/trunk@34074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 02:17:26 +00:00
Scott Taylor
373d73f781 Turn off autocomplete for the new-post-slug field.
Props johnbillion.
Fixes #32752.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34073 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 02:03:25 +00:00
Dion Hulse
476b5c2046 When running on windows systems, normalise the capitalisation of the drive letter for more reliable string comparisons.
Props tyxla
Fixes #33265

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


git-svn-id: http://core.svn.wordpress.org/trunk@34072 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 01:59:25 +00:00
Scott Taylor
bae7312f03 Pass $r and $pages to the 'wp_dropdown_pages' and 'wp_list_pages' filters.
Props bigdawggi, SergeyBiryukov.
Fixes #23734.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34071 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 01:32:24 +00:00
Scott Taylor
9604c74f62 Objects are passed by-reference since PHP 5. In _get_custom_object_labels(), cast $object->labels back to object before returning. This function is weird.
Adds unit test.

Props Toro_Unit.
Fixes #33023.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 01:23:26 +00:00
Scott Taylor
ae6a3aee7f Make WP_List_Table::get_primary_column_name() public in list table classes that have it.
Fixes #33854.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34069 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 01:12:25 +00:00
Scott Taylor
5077d917a3 Check if the $post_type passed to get_post_type_object() is a scalar value. Non-scalars were producing PHP warnings.
Adds unit tests.

Props Kloon.
Fixes #30013.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34068 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-14 00:03:24 +00:00
Jeremy Felt
fa1e1a8850 Multisite: Implement the get_by_path method in WP_Network.
Move the internals of `get_network_by_path()` to `WP_Network()` and allow network objects to be retrieved by passing a requested domain and path.

Props johnjamesjacoby, jeremyfelt, drewapicture, wonderboymusic.
See #31985.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34067 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-13 23:40:24 +00:00
Scott Taylor
c745c2deb3 In edit_post_link(), add an argument for the class attribute that defaults to post-edit-link.
Props voldemortensen.
Fixes #30563.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34066 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-13 23:34:24 +00:00
Jeremy Felt
16b4096779 Multisite: Introduce the WP_Network class.
A `WP_Network` object initially matches a row from `wp_site` and is populated with additional properties used by WordPress core. The first iteration is used to retrieve an existing network based on data passed to the class.

* A network can be retrieved by its ID through `WP_Network::get_instance()`, following in the steps of `WP_Post` and `WP_Comment`.
* A network object can be created or completed by passing initial properties in as a standard object to `new WP_Network()`.

Using these methods, we are now able to populate the global `$current_site` during load via this class.

Props johnjamesjacoby, jeremyfelt, drewapicture, wonderboymusic.
See #31985.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34065 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-13 23:31:26 +00:00
Andrea Fercia
2a6793c7b2 Bump H3 headings to H2 on the Writing Settings screen for better accessibility.
Props mrahmadawais.
Fixes #33651.
Built from https://develop.svn.wordpress.org/trunk@34096


git-svn-id: http://core.svn.wordpress.org/trunk@34064 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-13 16:48:26 +00:00
Helen Hou-Sandí
7f772bdaff Comments: Fix inline edit/reply on small screens.
props ocean90, SergeyBiryukov.
fixes #33596.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34062 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-13 12:47:27 +00:00
Weston Ruter
bd801ae5db Customize: Remove redundant aria-label attributes.
Adds an `$options` array argument to `WP_Screen::render_screen_options()` to allow the `div#screen-options-wrap` element to be omitted when `wrap` value is `false`.

Props afercia, westonruter.
Fixes #33182.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34061 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-13 06:16:26 +00:00
Jeremy Felt
f7a00464d5 Tests: Update Tests_Feed_RSS::test_items to expect new comment permalink structure.
Introduced in [34075] for posts without comments.

Props netweb.
Fixes #19893.

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


git-svn-id: http://core.svn.wordpress.org/trunk@34060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-12 23:31:25 +00:00
Boone Gorges
1ff03c9d6e Fail gracefully when checking mapped cap against unregistered post type.
Post type objects are reponsible for mapping their capabilities to core caps.
As a result, when the post type is no longer registered, the caps are no
longer mapped. This causes problems when a post is left in the database after
the post type is no longer present, and WP does an 'edit_post' or other cap
check against it: a PHP notice is thrown, and the cap check always fails.

As a more graceful fallback, we map all post-type-dependent caps onto
'edit_others_posts', which allows highly privileged users to be able to
access orphaned content (such as comments belonging to disabled post types),
while minimizing the possibility of unintended privilege escalation.

We also add a `_doing_it_wrong()` notice, so that developers and site
administrators are aware that the cap mapping is failing in the absence of
the registered post type.

Props mitchoyoshitaka, DrewAPicture, imath, codeelite, boonebgorges, nofearinc, SergeyBiryukov, jorbin, dlh.
Fixes #16956.
Built from https://develop.svn.wordpress.org/trunk@34091


git-svn-id: http://core.svn.wordpress.org/trunk@34059 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-12 21:27:25 +00:00
Boone Gorges
c0a0d4ba50 Use stricter sanitization for meta query clause keys.
By forcing all clause keys to be strings, we make it possible to use strict
comparison when validating values of 'orderby' as passed to `WP_Query`. This
eliminates situations where the presence of numeric clause keys could result
in an improperly validated 'orderby' value.

Props nikolov.tmw.
Fixes #32937.
Built from https://develop.svn.wordpress.org/trunk@34090


git-svn-id: http://core.svn.wordpress.org/trunk@34058 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-12 21:06:24 +00:00
Boone Gorges
fc884dc7ec Allow setup_postdata() to accept a post ID.
Previously, it accepted only a full post object.

Props sc0ttclark, mordauk, wonderboymusic.
Fixes #30970.
Built from https://develop.svn.wordpress.org/trunk@34089


git-svn-id: http://core.svn.wordpress.org/trunk@34057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-12 20:58:23 +00:00