Commit Graph

31339 Commits

Author SHA1 Message Date
Scott Taylor 73c1ac8b26 Posts List Table: Use a more robust technique for calculating `$total_items` so that pagination still appears when items are removed on the last page of results and `->max_num_pages` decreases.
Props A5hleyRich.
Fixes #29870.


git-svn-id: https://develop.svn.wordpress.org/trunk@34271 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-17 21:17:16 +00:00
Boone Gorges 504deb52fc Lazy-load comment meta on single post pages.
[34268] introduced cache priming for commentmeta, enabled by default. To
ensure performance on single post pages - where commentmeta is most likely
to cause performance issues - we disable up-front cache-priming. Instead, we
prime commentmeta caches for all comments in the loop the first time
`get_comment_meta()` is called on the page.

Props bradt, dd32, wonderboymusic, boonebgorges.
Fixes #16894.

git-svn-id: https://develop.svn.wordpress.org/trunk@34270 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-17 20:00:31 +00:00
Weston Ruter 5ea07785b3 Customize: Reduce peak memory usage by JSON-encoding settings and controls individually.
When there are hundreds of settings and controls (e.g. nav menu items and widget instances) the resulting object that is JSON-encoded can become very large, and `wp_json_encode()` can consume a lot of memory to serialize it. By breaking down the serialization into multiple calls the peak memory usage can be kept in line.

Moves logic out of `wp-admin/customize.php` into the `WP_Customize_Manager` class with new methods:

 * `is_ios()`
 * `get_document_title_template()`
 * `get_preview_url()`/`set_preview_url()`
 * `get_return_url()`/`set_return_url()`
 * `get_autofocus()`/`set_autofocus()`
 * `customize_pane_settings()`

Includes unit tests for these methods, for which the logic was formerly untestable in `customize.php`.

Fixes #33898.


git-svn-id: https://develop.svn.wordpress.org/trunk@34269 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-17 19:41:35 +00:00
Boone Gorges 12329f5ef8 Prime comment meta caches in `WP_Comment_Query`.
The new 'update_comment_meta_cache' parameter, which defaults to `true`, can
be used to disable this behavior.

`update_comment_cache()` has been updated to support an `$update_meta_cache`
parameter, which also updates to true; this matches the pattern we use for
priming post caches.

See #16894.

git-svn-id: https://develop.svn.wordpress.org/trunk@34268 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-17 19:29:46 +00:00
Boone Gorges b08a176488 Tell the `insert_user_meta` filter whether user is being updated.
`insert_user_meta` was introduced in [33708]. This changeset passes the
`$update` parameter to it.

Props tharsheblows, geminorum.
Fixes #31549.

git-svn-id: https://develop.svn.wordpress.org/trunk@34266 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-17 14:34:49 +00:00
Helen Hou-Sandi 3531c0bc10 Superglobals: Revert [34059] until further notice.
see #33837.


git-svn-id: https://develop.svn.wordpress.org/trunk@34265 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-17 12:32:20 +00:00
Drew Jaynes 8c65cfc7f4 Docs: Add a reminder to the DocBlock description for `add_query_arg()` mentioning that the output is not escaped by default.
Props brentvr for the initial patch. (first props!)
See #33912. See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@34264 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-17 09:38:56 +00:00
Sergey Biryukov f9ff998d01 Revert unintended change from [34262].
See #33910.

git-svn-id: https://develop.svn.wordpress.org/trunk@34263 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-17 09:08:14 +00:00
Sergey Biryukov 45610f9464 Docs: Expand the DocBlock for `get_default_post_to_edit()`.
Props rabmalin.
Fixes #33910.

git-svn-id: https://develop.svn.wordpress.org/trunk@34262 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-17 09:05:44 +00:00
Scott Taylor 8861e38966 Media: Ensure that HTML5 captions apply the `'img_caption_shortcode_width'`.
Props joemcgill.
Fixes #31053.


git-svn-id: https://develop.svn.wordpress.org/trunk@34261 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-17 06:03:11 +00:00
Scott Taylor 189bc9b5aa Media: In `wp_ajax_send_attachment_to_editor()`, the fallback logic for `$html` should be tucked into an `else` statement so it isn't run needlessly and overwritten.
Props tychay.
Fixes #32072.


git-svn-id: https://develop.svn.wordpress.org/trunk@34260 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-17 05:54:56 +00:00
Scott Taylor 337c87e7c7 Media: In `get_image_send_to_editor()`, allow a custom value for `$rel`.
Props tychay.
Fixes #32074.


git-svn-id: https://develop.svn.wordpress.org/trunk@34259 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-17 05:45:31 +00:00
Scott Taylor 2e7277b733 Media: In `wp_prepare_attachment_for_js()`, don't call `file_exists()` and `filesize()` to retrieve `$bytes` if the data is already present in `$meta`. This is how the same code in `attachment_submitbox_metadata()` already works.
Props polevaultweb.
Fixes #33214.


git-svn-id: https://develop.svn.wordpress.org/trunk@34258 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-17 05:02:52 +00:00
Scott Taylor 79656b5fdd Uploader: Fire 'wp_handle_upload' in `wp_upload_bits()`. Thusly, the filter in `wp_xmlrpc_server::mw_newMediaObject()` is redundant.
Props dllh.
Fixes #33539.


git-svn-id: https://develop.svn.wordpress.org/trunk@34257 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-17 04:46:00 +00:00
Scott Taylor a1805ecada Media List Table: remove the counts from the "views" portion of the toolbar, which are inconsistent with grid view. Also reduces complexity and removes potentially expensive count query.
Related to the toolbar view, remove the `wp_admin_canonical_url()` action in grid mode. Grid views that result from links from the list table view are lenses into the library and need to be indicated as such vs being a full attachment query.

Fixes #29744.


git-svn-id: https://develop.svn.wordpress.org/trunk@34256 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-17 02:29:22 +00:00
Scott Taylor 25710ecc67 In `wp_mime_type_icon()`, the length of the `$wilds` array varies depending on what is passed as `$mime`. Loop over `$wilds` instead of arbitrarily checking `$wilds[0]`.
Adds unit tests.

Fixes #33012.



git-svn-id: https://develop.svn.wordpress.org/trunk@34255 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-17 00:36:12 +00:00
Scott Taylor 45c606576c Media JS: ensure that `wp.media.frame` (a static reference to the "current" `Frame`) is reset when a cached frame is opened.
Fixes #33458.


git-svn-id: https://develop.svn.wordpress.org/trunk@34254 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-17 00:09:40 +00:00
Sergey Biryukov 54835433c5 Docs: Expand the `$comment_approved` argument description for `'comment_post'` action.
Props cfinke.
Fixes #33903.

git-svn-id: https://develop.svn.wordpress.org/trunk@34253 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 22:29:15 +00:00
Boone Gorges 03ec7cc107 Improve consistency of comment notification callback signatures.
Both `wp_new_comment_notify_moderator()` and `wp_new_comment_notify_postauthor()`
now accept a single argument: `$comment_ID`.

Props SergeyBiryukov.
Fixes #33587.

git-svn-id: https://develop.svn.wordpress.org/trunk@34252 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 22:25:07 +00:00
Boone Gorges de7c9b6015 Move new user notification emails to `add_action()` callbacks.
When a new user is created in various places throughout the interface,
notifications are sent to the site admin and the new user. Previously, these
notifications were fired through direct calls to `wp_new_user_notification()`,
making it difficult to stop or modify the messages.

This changeset introduces a number of new action hooks in place of direct calls
to `wp_new_user_notification()`, and hooks the new wrapper function
`wp_send_new_user_notifications()` to these hooks.

Props dshanske, thomaswm, boonebgorges.
Fixes #33587.

git-svn-id: https://develop.svn.wordpress.org/trunk@34251 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 22:18:33 +00:00
Boone Gorges d26b868870 Don't notify post authors about spam comments.
[34106] moved post author notification to a hook, and in the process, missed
the 'spam' check. This changeset restores that check.

To make unit testing easier, the notification callbacks have been refactored
to return values: false when various conditions aren't met (eg, approved
comments should not trigger moderation emails), and the return value of the
`wp_notify_*()` function otherwise.

Props cfinke, kraftbj.
See #33587.

git-svn-id: https://develop.svn.wordpress.org/trunk@34250 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 21:59:16 +00:00
Sergey Biryukov 7c9c635a04 Add a missing Oxford comma on Export screen.
Props juhise.
Fixes #33906.

git-svn-id: https://develop.svn.wordpress.org/trunk@34249 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 21:33:29 +00:00
Boone Gorges c5f34cb4d0 Throw a notice when an invalid tax is passed to `wp_insert_post()`.
Props jdgrimes.
Fixes #25477.

git-svn-id: https://develop.svn.wordpress.org/trunk@34248 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 19:24:51 +00:00
Boone Gorges 302e3d1116 Allow taxonomies to be non-public.
[13216] introduced the 'public' argument for `register_taxonomy()`. This param
was used to set defaults for 'show_ui' and a number of other params, but it
never did anything itself.

With this changeset, taxonomies registered with `public=false` will no longer
be queryable on the front end, ie via taxonomy archive queries.

Props wpsmith, ocean90, nacin, ericlewis, boonebgorges.
Fixes #21949.

git-svn-id: https://develop.svn.wordpress.org/trunk@34247 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 19:04:57 +00:00
Boone Gorges 1b016b6dc6 Failed `get_term_by()` lookups should always return `false`.
Previously, we sometimes returned `null`.

Props charlestonsw, tyxla.
Fixes #33281.

git-svn-id: https://develop.svn.wordpress.org/trunk@34246 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 18:49:28 +00:00
Scott Taylor 3ca5bbb585 Revert [33925], by-reference array manipulation is breaking comments in some themes.
This implementation is losing its shine.

See #16894.


git-svn-id: https://develop.svn.wordpress.org/trunk@34245 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 18:13:19 +00:00
Scott Taylor 2d11d6cd90 After [34160], also upgrade objects passed to `get_avatar()`.
See #32619.



git-svn-id: https://develop.svn.wordpress.org/trunk@34244 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 17:33:34 +00:00
Sergey Biryukov 45c6094dce Docs: Update the DocBlock for `wp_page_menu()` to include `'before'`, `'after'`, and `'walker'` arguments added in [34200].
Align the `$defaults` array and include the default value for `'show_home'`.

Props stevegrunwell.
Fixes #11095.

git-svn-id: https://develop.svn.wordpress.org/trunk@34243 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 16:46:08 +00:00
Sergey Biryukov 10bc44d8fc Add `register_post_type_args` filter for changing `register_post_type()` arguments before further processing.
Does not apply to built-in post types.

Props MikeSchinkel, nickciske, engelen, swissspidy.
Fixes #17447.

git-svn-id: https://develop.svn.wordpress.org/trunk@34242 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 15:46:14 +00:00
Scott Taylor d2bb55ee92 `wp-admin/includes/template.php` is now a loader for 3 files made via `svn cp`:
* `Walker_Category_Checklist` class
* `WP_Internal_Pointers` class
* `template-functions.php`

This is BC for plugins that are loading `wp-admin/includes/template.php` for fun.

See #33413.


git-svn-id: https://develop.svn.wordpress.org/trunk@34241 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 15:34:17 +00:00
Sergey Biryukov d262ebca0a Docs: Synchronize the `$timezone` parameter description between `get_lastpostdate()`, `get_lastpostmodified()`, and `_get_last_post_time()`.
See #17455.

git-svn-id: https://develop.svn.wordpress.org/trunk@34240 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 15:28:12 +00:00
Sergey Biryukov 9ab1dfd03e Docs: Fix some syntactical issues with the DocBlock for `wp_mail_failed` action, introduced in [34221].
Fixes #18926.

git-svn-id: https://develop.svn.wordpress.org/trunk@34239 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 15:12:42 +00:00
Sergey Biryukov 1d4b8ffd1d Docs: Expand the DocBlock for the `WP_Theme::get_edit_link()` method, introduced in [34084].
Fixes #32376.

git-svn-id: https://develop.svn.wordpress.org/trunk@34238 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 15:00:04 +00:00
Drew Jaynes 2b6dc75396 Docs: Add changelog entries for parameters where `WP_Comment` object support was added in [33961].
See #33638. See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@34237 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 13:51:13 +00:00
Drew Jaynes c2d0a83330 Docs: Fix some syntactical issues with the DocBlock for the `WP_Theme->update` property, introduced in [33957].
Adds an `@since`.

See #33491. See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@34236 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 13:28:41 +00:00
Drew Jaynes bb2fc0933d 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@34235 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 13:25:05 +00:00
Drew Jaynes 7682e433fc Docs: Put "it's" in its place (again).
Props kitchin.
Fixes #33894.


git-svn-id: https://develop.svn.wordpress.org/trunk@34234 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 12:45:51 +00:00
Sergey Biryukov c57efab4f4 Add a comment to strings where the ellipsis cannot be used due to `json_encode()`, placeholders, or external dependencies.
Fixes #32875.

git-svn-id: https://develop.svn.wordpress.org/trunk@34233 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 11:58:41 +00:00
Sergey Biryukov 04c1c825e9 Reset Password: Move `<div>` out of `<p>` in `wp-login.php`.
Props ldinclaux.
Fixes #33892.

git-svn-id: https://develop.svn.wordpress.org/trunk@34232 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 11:45:09 +00:00
Sergey Biryukov 557d160ca1 Comments: Fix a fatal error in Comments meta box after [34223].
Props tyxla.
Fixes #33893. See #33413.

git-svn-id: https://develop.svn.wordpress.org/trunk@34231 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 11:36:35 +00:00
Drew Jaynes fea6142412 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@34230 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 11:01:50 +00:00
Drew Jaynes 3b3a034c11 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@34229 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 10:50:21 +00:00
Drew Jaynes f83abcbf3e 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@34228 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 10:42:08 +00:00
Drew Jaynes ff35e34fad 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@34227 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 10:02:20 +00:00
Drew Jaynes 1075ec80b8 Docs: Remove an errant change made to a `_deprecated_function()` call in `wp_cache_reset()` introduced in [34225].
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@34226 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 09:41:51 +00:00
Drew Jaynes 741bd4440c 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@34225 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 09:39:33 +00:00
Drew Jaynes f2eb739ea6 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.


git-svn-id: https://develop.svn.wordpress.org/trunk@34224 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 07:35:37 +00:00
Scott Taylor 05cd237d5e Move `WP_Post_Comments_List_Table` to its own file.
See #33413.


git-svn-id: https://develop.svn.wordpress.org/trunk@34223 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 06:52:35 +00:00
Sergey Biryukov 7e706c285b Fix a typo in `wptexturize()` and `wp_replace_in_html_tags()` comments.
Props bobbingwide.
See #15694.

git-svn-id: https://develop.svn.wordpress.org/trunk@34222 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-16 05:53:09 +00:00
Aaron Jorbin bf5f316668 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



git-svn-id: https://develop.svn.wordpress.org/trunk@34221 602fd350-edb4-49c9-b593-d223f7449a82
2015-09-15 23:50:30 +00:00