This allows getting the excerpt for a specific post, similar to how most other template tags work.
A deprecation notice is thrown if a boolean value is passed, which is deprecated since 2.3 and has not been used for a long time.
Adds unit tests.
Fixes#27246.
git-svn-id: https://develop.svn.wordpress.org/trunk@36319 602fd350-edb4-49c9-b593-d223f7449a82
This allows filtering a post's comment count before it is queried and updated in the database.
Props peterwilsoncc for initial patch.
Fixes#35060.
git-svn-id: https://develop.svn.wordpress.org/trunk@36318 602fd350-edb4-49c9-b593-d223f7449a82
This improves performance since browsers won't re-download the scripts and styles when there was no change in `$wp_version`.
Props sergej.mueller, dd32, swissspidy.
Fixes#28722.
git-svn-id: https://develop.svn.wordpress.org/trunk@36312 602fd350-edb4-49c9-b593-d223f7449a82
It encourages an ugly pattern like `global $userdata; get_currentuserinfo();` in plugins/themes. `wp_get_current_user()` should be used instead, e.g. `$current_user = wp_get_current_user();`.
Props scribu for initial patch.
Fixes#19615.
git-svn-id: https://develop.svn.wordpress.org/trunk@36311 602fd350-edb4-49c9-b593-d223f7449a82
This is similar to `edit.php` -> `post.php` and `users.php` -> `user-edit.php` and fixes a bug where screen options for the list table were shown while editing a term.
Fixes#34988.
git-svn-id: https://develop.svn.wordpress.org/trunk@36308 602fd350-edb4-49c9-b593-d223f7449a82
Subviews are stored internally on the Subview manager as an object. The object
is composed of key-value pairs where the key is a jQuery selector for a view,
and the value is an array of views that matching the selector.
To extract subviews, `_.flatten()` was used to collate the nested arrays of
views into a single view. However, `_.flatten()` is not intended to be used
for objects, and this unintended functionality breaks in newer versions of
Underscore.js.
Instead, we'll use `_.values()` to extract the arrays of views first,
and then flatten the array of arrays.
Props adamsilverstein.
See #34350.
git-svn-id: https://develop.svn.wordpress.org/trunk@36305 602fd350-edb4-49c9-b593-d223f7449a82
Avoids a focus loss when saving or closing the form moving focus back to a proper place.
Uses `wp.a11y.speak()` to dispatch successful edits and error messages to screen readers.
Fixes#34756.
git-svn-id: https://develop.svn.wordpress.org/trunk@36303 602fd350-edb4-49c9-b593-d223f7449a82
After [36182], plugin data contains compatibility info from the API, which is an array and cannot be searched.
Fixes#35461.
git-svn-id: https://develop.svn.wordpress.org/trunk@36301 602fd350-edb4-49c9-b593-d223f7449a82
These provide a more descriptive way to set response codes elsewhere,
so it's readable and less chance for the wrong response code to be
used such as 401 vs 403.
Props rmccue for the idea.
Fixes#35426.
git-svn-id: https://develop.svn.wordpress.org/trunk@36294 602fd350-edb4-49c9-b593-d223f7449a82
The descendant query in `WP_Comment_Query::fill_descendants()` uses the clauses
of the main `get_comment_ids()` query as a basis, discarding the `parent`,
`parent__in`, and `parent__not_in` clauses. As implemented in WP 4.4 [34546],
the WHERE clause was assembled in such a way that any modifications applied
using the `comments_clauses` filter were not inherited by `fill_descendants()`.
This resulted in descendant queries that did not always properly filter
results, and sometimes contained syntax errors.
The current changeset fixes the problem by using the post-filter WHERE clause
as the basis for the `fill_descendants()` query. This change requires a new
approach for eliminating the unneeded parent-related clauses: instead of
eliminating values in an associative array, we must use regular expressions.
Props boonebgorges, firebird75.
Fixes#35192.
git-svn-id: https://develop.svn.wordpress.org/trunk@36277 602fd350-edb4-49c9-b593-d223f7449a82
[36157] fixed a bug whereby `wp_list_comments()` would not properly recognize
custom pagination arguments. See #35175. However, it inadvertently introduced
a bug that caused any `$comments` array explicitly passed to the function to be
ignored, when that array was accompanied by pagination arguments that differ
from those in `$wp_query`. We address this bug by moving the logic introduced
in [36157] inside a block that only fires when no `$comments` array has been
provided to the function.
Props ivankristianto.
Fixes#35356.
git-svn-id: https://develop.svn.wordpress.org/trunk@36276 602fd350-edb4-49c9-b593-d223f7449a82
In order to calculate comment pagination when newest comments are displayed
first, `comments_template()` must perform a separate query to determine the
total number of paginating comments available on a post. See [34729], #8071,
pagination calculation - can be defined as a top-level comment, or a comment
with `parent=0`. However, when comment threading is disabled, yet comments
exist in the database that have parents, all comments - even those with a
parent - are "paginating". (This typically happens when comments threading was
once enabled, but has since been turned off.) As such, the total-paginating-
comments query should only be limited to top-level comments when
'thread_comments' is disabled.
Props jmdodd.
Fixes#35419.
git-svn-id: https://develop.svn.wordpress.org/trunk@36275 602fd350-edb4-49c9-b593-d223f7449a82
Though this is technically still in the proposal stage, there is support from the core team and precedent in #16914
Props andizer.
Fixes#35333.
git-svn-id: https://develop.svn.wordpress.org/trunk@36273 602fd350-edb4-49c9-b593-d223f7449a82
Added hardcoded maxlength attributes on the author, author_email, author_url, and comment_field input markup. These can be modified via the comment_form_defaults filter. Added logic in wp_handle_comment_submission() to return a WP_Error when the comment_author, comment_author_url, or comment_content values exceed the max length of their columns. Introduces wp_get_comment_column_max_length() which returns the max column length for a given column name, and is filterable. Unit tests included for the error conditions in wp_handle_comment_submission()
Fixes#10377.
Props westonruter rachelbaker.
git-svn-id: https://develop.svn.wordpress.org/trunk@36272 602fd350-edb4-49c9-b593-d223f7449a82
Also maintains visual separation for Broken Themes table on searches that
return no results.
See [36171] for `.wp-clearfix`.
Props 5um17, obenland, valendesigns, afercia.
Fixes#26646.
git-svn-id: https://develop.svn.wordpress.org/trunk@36270 602fd350-edb4-49c9-b593-d223f7449a82