Commit Graph

9555 Commits

Author SHA1 Message Date
Andrea Fercia f8f12bf78a Accessibility: Remove title attributes from the Media Library list table.
Fixes #35136.

git-svn-id: https://develop.svn.wordpress.org/trunk@36331 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-17 14:45:26 +00:00
Eric Andrew Lewis a3dda7e716 Docs: Nav menu location functions relate to nav menu locations, not nav menus.
Fixes #35471.


git-svn-id: https://develop.svn.wordpress.org/trunk@36330 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-17 01:42:16 +00:00
Pascal Birchler 3541f7b90b Posts: Correctly pass `$post` to `post_password_required()` in `get_the_excerpt()`.
Corrects the relevant test.

Props sebastian.pisula for initial patch.
Fixes #35486.

git-svn-id: https://develop.svn.wordpress.org/trunk@36329 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-16 10:13:27 +00:00
Dominik Schilling (ocean90) 54abada4cc Media: Update some attach/detach strings in the columns view.
* Show a "Media attachment reattached."/"Media attachment detached." message when only one attachment was attached/detached. 
* Use the string placeholder as `number_format_i18n()` returns a string.
* Add translator comments.
* Update help text to refer to the new dropdown menus.
* Add a more generic title to the attach modal.

Fixes #33237.

git-svn-id: https://develop.svn.wordpress.org/trunk@36328 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 22:28:15 +00:00
Boone Gorges 7ee3e02d72 Correct documentation for `post_author` param of `WP_Comment_Query`.
Props chriscct7.
Fixes #35481.

git-svn-id: https://develop.svn.wordpress.org/trunk@36327 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 20:13:33 +00:00
Boone Gorges ac9e991dc8 Respect all post-related filters in `WP_Comment_Query`.
The refactor of `WP_Comment_Query`'s SQL generation in [34542] introduced a bug
that caused only the last post-related filter to be respected in comment
queries. In other words, if querying for comments using params
`post_status=draft&post_author=3`, only the last-processed of these params
would be respected. The current changeset fixes the logic so that these clauses
don't overwrite each other.

Props chriscct7.
Fixes #35478.

git-svn-id: https://develop.svn.wordpress.org/trunk@36326 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 20:09:36 +00:00
Rachel Baker 63e9eb7e5e Comments: Use TEXT column type in fallback for `wp_get_comment_column_max_length()`.
Fixes #10377.


git-svn-id: https://develop.svn.wordpress.org/trunk@36325 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 20:09:08 +00:00
Boone Gorges 50068ee5b9 Respect custom pagination params when using `wp_list_comments()` in a query loop.
[36157] fixed a problem, introduced in 4.4, that caused custom pagination
parameters passed to `wp_list_comments()`. However, the fix introduced in that
changeset was limited to the `is_singular()` context, so that the bug remained
when `wp_list_comments()` is used within a non-singular `WP_Query` loop. We
fix this by removing the `is_singular()` check and using the more general
`get_the_ID()` to identify the correct post_id to use for the secondary
comment query.

Fixes #35402.

git-svn-id: https://develop.svn.wordpress.org/trunk@36324 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 19:47:17 +00:00
Boone Gorges 4d17d22a47 Populate term cache with proper clone of term objects.
[34999] modified the cache strategy for terms in the context of
`wp_get_object_terms()`. As part of these changes, the `object_id` property of
term objects had to be unset before being cached. To avoid modifying passed-by-
reference terms, `update_term_cache()` attempted to make a copy of the terms
passed to the function; however, it failed to use the `clone` keyword, and thus
only created a reference instead of a copy.

Props berengerzyla.
Fixes #35462.

git-svn-id: https://develop.svn.wordpress.org/trunk@36323 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 19:34:16 +00:00
Pascal Birchler 03efa5ca83 Comments: Remove unneeded `$req` variable in `comments_template()`.
Props Latz.
Fixes #35473.

git-svn-id: https://develop.svn.wordpress.org/trunk@36322 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 19:32:23 +00:00
Pascal Birchler 20580bed82 Post: After [36319], add `$post` parameter to the `get_the_excerpt` filter.
Props sebastian.pisula.
Fixes #35474.

git-svn-id: https://develop.svn.wordpress.org/trunk@36321 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 19:27:57 +00:00
Pascal Birchler 57978063cf Posts: Add a `$post` parameter to `get_the_excerpt()`.
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
2016-01-15 14:47:00 +00:00
Pascal Birchler 63e442bbb8 Comments: Add a new `pre_wp_update_comment_count_now` filter.
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
2016-01-15 13:41:35 +00:00
Eric Andrew Lewis cdae7b8214 Docs: Use "site" rather than "blog" in `get_current_blog_id()` docs.
Fixes #35415.


git-svn-id: https://develop.svn.wordpress.org/trunk@36317 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 13:17:08 +00:00
Pascal Birchler a111eafd41 Post Types: Introduce `unregister_post_type()`.
This new function can be used to completely unregister non built-in post types.

Fixes #14761.

git-svn-id: https://develop.svn.wordpress.org/trunk@36316 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 12:19:15 +00:00
Dominik Schilling (ocean90) 57a589fef5 Docs: Fix `@return` type for `wp_get_current_user()` after [36313].
See #19615.

git-svn-id: https://develop.svn.wordpress.org/trunk@36314 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 11:15:51 +00:00
Pascal Birchler 40c948c1a6 Users: Always return `$current_user` in `wp_get_current_user()`, never a boolean.
Fixes unit tests affected by [36311].

See #19615.

git-svn-id: https://develop.svn.wordpress.org/trunk@36313 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 10:46:38 +00:00
Pascal Birchler 29147d223a Script Loader: Add `Etag: $wp_version` header in `load-scripts.php` and `load-styles.php`.
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
2016-01-15 10:22:24 +00:00
Pascal Birchler c7ae3fb3ee Users: Deprecate the `get_currentuserinfo()` pluggable function.
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
2016-01-15 10:15:21 +00:00
Pascal Birchler 053733f8c0 Filesystem API: Add a filter to `wp_unique_filename()`.
Props SergeyBiryukov, MikeHansenMe, johnbillion, swissspidy.
Fixes #19121.

git-svn-id: https://develop.svn.wordpress.org/trunk@36310 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 09:38:30 +00:00
Pascal Birchler 2241519865 Taxonomy: Introduce `wp-admin/term.php` for editing single terms.
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
2016-01-15 08:26:06 +00:00
Pascal Birchler d80a3c7ccd Embeds: Allow embedding static front pages and pages having a child page with an `embed` slug.
This makes `embed` a special slug that can't be used for new pages/posts. When `https://example.com/foo/embed/` is an existing page, embeds fall back to `https://example.com/foo/?embed=true`.
Adds unit tests.

Fixes #34971.

git-svn-id: https://develop.svn.wordpress.org/trunk@36307 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 07:55:19 +00:00
Pascal Birchler ee60e36a2c Users: Decode special characters in password and email change notification emails.
Fixes #35283.

git-svn-id: https://develop.svn.wordpress.org/trunk@36306 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-15 07:28:48 +00:00
Eric Andrew Lewis 03e28bae68 In wp.Backbone.Subviews, extract subviews with proper Underscore.js functions.
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
2016-01-15 04:02:00 +00:00
Andrea Fercia a165561dde Accessibility: Improve focus handling on the Taxonomies Quick Edit.
Moves focus back to a proper place when saving or closing the form.

Fixes #35460.

git-svn-id: https://develop.svn.wordpress.org/trunk@36304 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-14 23:02:05 +00:00
Andrea Fercia 78adbe0bd0 Accessibility: Improve focus handling and audible feedback on the Posts Quick-Bulk Edit.
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
2016-01-14 22:57:09 +00:00
Pascal Birchler cc6fe1179d Allow searching for `0` throughout the admin.
Fixes #31025.

git-svn-id: https://develop.svn.wordpress.org/trunk@36302 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-14 20:05:06 +00:00
Pascal Birchler 5209de6052 Plugins: Prevent a warning when searching in the plugins list table.
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
2016-01-14 19:59:06 +00:00
Drew Jaynes 4e9f90caa1 Docs: Add a changelog entry to the DocBlock for `get_post_type_archive_link()` denoting that posts support was added in 4.5.
See [36225]. See #19902.


git-svn-id: https://develop.svn.wordpress.org/trunk@36300 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-14 17:55:46 +00:00
Drew Jaynes 740cab2a4b Docs: Adjust formatting for an added-parameter changelog entry in the hook doc for the `cron_request` filter.
See #32246.


git-svn-id: https://develop.svn.wordpress.org/trunk@36299 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-14 17:29:04 +00:00
Andrea Fercia 0eed5e07d8 Accessibility: Remove title attributes from the Comments screen.
Fixes #35304.

git-svn-id: https://develop.svn.wordpress.org/trunk@36298 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-14 16:03:47 +00:00
Pascal Birchler d2b96ce6b9 Plugins: Make sure the 'Beta testing' tab is first in the plugin installer.
This makes feature plugins more discoverable for people running development builds.

Fixes #29631.

git-svn-id: https://develop.svn.wordpress.org/trunk@36297 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-14 09:06:12 +00:00
Pascal Birchler 038668d5ec Administration: After [36295], mark `postBoxL10n` as a global to please JSHint.
See #26399.

git-svn-id: https://develop.svn.wordpress.org/trunk@36296 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-14 08:39:37 +00:00
John Blackbourn 2e6fb68b2a Administration: Add a "Drag boxes here" message to empty dashboard meta boxes so it's clear to users that it's possible to drag meta boxes into empty spaces.
Props xavortm
Fixes #26399


git-svn-id: https://develop.svn.wordpress.org/trunk@36295 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-14 04:12:16 +00:00
Joe Hoyle a22e4be31d Add response status code aliases on WP_Http for convenience.
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
2016-01-14 03:15:24 +00:00
John Blackbourn f8923e3e07 Networks and Sites: Clarify the docblock for `get_current_site()` so it's clear that it returns the current network object, not anything to do with the current site. As a further exercise, the reader is invited to fix the nomenclature surrounding blogs, sites, and networks in WordPress.
Props ericlewis
Fixes #35414


git-svn-id: https://develop.svn.wordpress.org/trunk@36293 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-14 00:01:10 +00:00
Andrea Fercia d4af1b036e Customizer: Aggregate similar CSS rules.
Fixes #34333.

git-svn-id: https://develop.svn.wordpress.org/trunk@36291 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-13 22:35:05 +00:00
John Blackbourn c36a972acc I18N: Correct an argument description and return value for `wp_dropdown_languages()`.
Props realloc
See #35294


git-svn-id: https://develop.svn.wordpress.org/trunk@36290 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-13 20:32:47 +00:00
John Blackbourn d438831da3 Taxonomy: Correct the accetped types for the `taxonomy` element in the arguments passed to `wp_dropdown_categories()`.
Props grapplerulrich
Fixes #35446


git-svn-id: https://develop.svn.wordpress.org/trunk@36289 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-13 20:15:19 +00:00
Dominik Schilling (ocean90) 017550ea8e jQuery: Replace `$( document ).on( 'ready', fn )` with `$( fn )`.
The 'ready' event is deprecated since jQuery 1.8.

See https://github.com/jquery/jquery-migrate/blob/1.3.0/warnings.md#jqmigrate-ready-event-is-deprecated.
See #35380.

git-svn-id: https://develop.svn.wordpress.org/trunk@36288 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-13 17:38:18 +00:00
Dominik Schilling (ocean90) e5223b57b4 jQuery: Replace use of the `.load()` method for the "load" event with `.on( 'load', handler )`.
The shortcut is deprecated since jQuery 1.8.

See http://api.jquery.com/load-event/.
See #35380.

git-svn-id: https://develop.svn.wordpress.org/trunk@36287 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-13 17:21:36 +00:00
Dominik Schilling (ocean90) ceb892533f jQuery: Replace the use of the `.size()` method with the `.length` property.
The `.size()` method is deprecated since jQuery 1.8. The `.length` property is preferred because it doesn't have the overhead of a function call.

See https://api.jquery.com/size/.
See #35380.

git-svn-id: https://develop.svn.wordpress.org/trunk@36286 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-13 16:16:15 +00:00
Dominik Schilling (ocean90) 3e571a393f External Libraries: Update jQuery to 1.12.0 and jQuery Migrate to 1.3.0.
jQuery:
* Release post: http://blog.jquery.com/2016/01/08/jquery-2-2-and-1-12-released/
* Changes: https://github.com/jquery/jquery/compare/1.11.3...1.12.0

jQuery Migrate:
* Release post: http://blog.jquery.com/2016/01/13/jquery-migrate-1-3-0-released/
* Changes: https://github.com/jquery/jquery-migrate/compare/1.2.1...1.3.0

See #35380.

git-svn-id: https://develop.svn.wordpress.org/trunk@36285 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-13 15:51:25 +00:00
Dominik Schilling (ocean90) 185387f915 Set `svn:eol-style` to native on "jquery-migrate.js" and "jquery-migrate.min.js".
git-svn-id: https://develop.svn.wordpress.org/trunk@36284 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-13 15:44:39 +00:00
Dominik Schilling (ocean90) 2efcaf2921 Plugins: In `_get_plugin_data_markup_translate()` remove the fallback to the "default" textdomain for Akismet.
Akismet has its own language files since WordPress 3.9.

Props jrf.
Fixes #35436.

git-svn-id: https://develop.svn.wordpress.org/trunk@36283 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-13 13:55:42 +00:00
Dominik Schilling (ocean90) c86ffe454a Plugins: In `_get_plugin_data_markup_translate()` don't reload translations if they're already loaded.
Props jrf.
Fixes #35439.

git-svn-id: https://develop.svn.wordpress.org/trunk@36282 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-13 13:03:21 +00:00
Boone Gorges 0b564d48df Support searching for `'0'` in `WP_Query`.
Props swissspidy.
See #31025.

git-svn-id: https://develop.svn.wordpress.org/trunk@36278 602fd350-edb4-49c9-b593-d223f7449a82
2016-01-13 04:36:54 +00:00
Boone Gorges bf2f6f8104 Use the post-filter WHERE clause when querying for comment descendants.
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
2016-01-13 04:00:36 +00:00
Boone Gorges 1880b466c7 Always respect `$comments` array passed to `wp_list_comments()`.
[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
2016-01-13 03:26:31 +00:00
Boone Gorges f7d238dfe3 Ignore hierarchy in pagination calculation when comment threading is disabled.
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
2016-01-13 03:12:34 +00:00