Commit Graph

29039 Commits

Author SHA1 Message Date
Boone Gorges
086e03e8e2 Improved handling of expectedDeprecated and expectedIncorrectUsage annotations in unit tests.
* Do the `expectedDeprecated()` check in `assertPostConditions()` instead of `tearDown()`. Previously, `fail`ing inside of `tearDown()` was causing the rest of the teardown process to be aborted, resulting in inter-test leakage.
* Collect all `expectedDeprecated` and `expectedIncorrectUsage` annotations in an entire method and display them all when `fail`ing, instead of showing only the first one.

Props jdgrimes.
Fixes #31362.

git-svn-id: https://develop.svn.wordpress.org/trunk@31469 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-17 16:11:09 +00:00
Boone Gorges
8bf5fce78f Improve 'orderby' syntax for WP_Comment_Query.
Since [29027], `WP_Query` has supported an array of values for the `$orderby`
parameter, with field names as array keys and ASC/DESC as the array values.
This changeset introduces the same syntax to `WP_Comment_Query`.

We leverage the new support for multiple ORDER BY clauses to fix a bug that
causes comments to be queried in an indeterminate order when sorting by the
default `comment_date_gmt` and comments share the same value for
`comment_date_gmt`. By always including a `comment_ID` subclause at the end of
the ORDER BY statement, we ensure that comments always have a unique fallback
for sorting.

This changeset also includes improvements paralleling those introduced to
`WP_Query` in [31312] and [31340], which allow `$orderby` to accept array keys
from specific `$meta_query` clauses. This change lets devs sort by multiple
clauses of an associated meta query. See #31045.

Fixes #30478. See #31265.

git-svn-id: https://develop.svn.wordpress.org/trunk@31467 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-16 14:09:40 +00:00
Andrew Ozz
0dd81fe134 TinyMCE wpView: fire nodeChanged when an embedded iframe is resized so we can adjust the editor height and other UI components. Props iseulde, fixes #30646.
git-svn-id: https://develop.svn.wordpress.org/trunk@31466 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-15 18:18:06 +00:00
Dominik Schilling (ocean90)
73a85825fb grunt autoprefixer for [31333].
see ##29820.

git-svn-id: https://develop.svn.wordpress.org/trunk@31465 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-15 12:17:41 +00:00
Lance Willett
9e3fffdf09 Bundled themes: update CSS rules for .screen-reader-text to be consistent with current accessibility guidelines. Fixes #31279.
git-svn-id: https://develop.svn.wordpress.org/trunk@31464 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-14 17:28:19 +00:00
Drew Jaynes
c77e726eef Add inline documentation to clarify the reasoning behind the various conditions that control how WP is loaded.
Props mattheweppelsheimer for the initial patch.
Fixes #30935.


git-svn-id: https://develop.svn.wordpress.org/trunk@31463 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-14 11:38:41 +00:00
Sergey Biryukov
9b463c5a45 Don't try to read a non-existent Exif:Title tag in wp_read_image_metadata(), as it's not a part of the Exif standard.
props tyxla.
fixes #31043.

git-svn-id: https://develop.svn.wordpress.org/trunk@31462 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-14 09:13:36 +00:00
Drew Jaynes
0653d029f2 Update the descriptions for transition_post_status() and the {$new_stats}_{$post->post_type} hook with more information about the expected behavior of transitioning post statuses.
In some cases, the values of `$old_status` and `$new_status` may be the same thing before and after a post status is "transitioned". An example of this would be the scenario where a published post is being updated: the status before and after the update both equal 'publish'.

Further, the documentation clarifies that if the intent is to only execute code when initially transitioningto a post status from something else, the 'transition_post_status' hook should be used instead of one of the dynamic hooks to avoid confusion.

Props Idealien for the initial patch.
Fixes #31099.


git-svn-id: https://develop.svn.wordpress.org/trunk@31461 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-14 09:10:29 +00:00
Sergey Biryukov
ef04afe4bf Customizer: Remove margin for hidden controls.
props dlh.
fixes #31330.

git-svn-id: https://develop.svn.wordpress.org/trunk@31460 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-14 08:45:50 +00:00
Sergey Biryukov
5aac59d178 Replace hardcoded usage of comment-page with the comment pagination base.
props johnbillion, SergeyBiryukov, webord.
fixes #18084.

git-svn-id: https://develop.svn.wordpress.org/trunk@31459 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-14 03:47:02 +00:00
Boone Gorges
4138275df9 More careful type conversion in WP_Query is_*() methods.
`is_array( 1, '1-foo' )` returns true, which means that `is_page( 1 )`
was returning true when on a page with the slug '1-foo'. We avoid this odd
behavior by casting the queried object ID to a string before testing against
the value passed to the conditional function.

This also helps to avoid a problem where an arbitrary value for `$page` would
cause `is_page( $page )` to return true if the query had been manipulated by
a plugin to show that the current page's ID is 0.

Props boonebgorges, r-a-y, nunomorgadinho, wonderboymusic, clifgriffin.
Fixes #24674.

git-svn-id: https://develop.svn.wordpress.org/trunk@31458 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-14 02:08:46 +00:00
Sergey Biryukov
78b02ec722 Use more descriptive names for register_post_type() and register_taxonomy() tests with too long and too short names.
see #31134, #31135.

git-svn-id: https://develop.svn.wordpress.org/trunk@31457 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-13 23:33:56 +00:00
Sergey Biryukov
b52cb0346e Toolbar: Remove title attributes from 'About WordPress', 'Add New', and 'My Account' items.
props afercia.
fixes #31324.

git-svn-id: https://develop.svn.wordpress.org/trunk@31456 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-13 20:19:09 +00:00
Sergey Biryukov
35ae49f843 Toolbar: Add a label for search field on front-end.
props afercia.
fixes #31323.

git-svn-id: https://develop.svn.wordpress.org/trunk@31455 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-13 19:20:53 +00:00
Lance Willett
fc35ef690b Bundled themes: remove URLs from reset credits. Closes #30764.
git-svn-id: https://develop.svn.wordpress.org/trunk@31454 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-13 18:01:30 +00:00
Lance Willett
27ed2ce07c Bundled themes: replace array_shift() with current() for performance.
Props SergeyBiryukov, fixes #31260.

git-svn-id: https://develop.svn.wordpress.org/trunk@31453 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-13 17:51:22 +00:00
Boone Gorges
487d65ad78 Provide a secondary sort order for wp_get_archives() when type=postbypost.
Sorting by post_date alone can cause indeterminacy problems on different
versions of MySQL when post_date ties need to be broken. Using `ID` as a
secondary sort ensures that the order is always determinate.

Props herbmillerjr for an initial patch.
Fixes #30480.

git-svn-id: https://develop.svn.wordpress.org/trunk@31452 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-13 16:59:51 +00:00
Boone Gorges
0efce8c89c Improve documentation for return value of wp_list_pluck().
`wp_list_pluck()` will preserve the original array keys if no `$index_key`
parameter is provided. This changeset updates the documentation accordingly.

Props adamsilverstein.
Fixes #31316.

git-svn-id: https://develop.svn.wordpress.org/trunk@31451 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-13 16:51:55 +00:00
John Blackbourn
f4d6d4e66b Return a WP_Error if an empty name is provided when registering a post type.
Fixes #31134
Props tyxla, MikeHansenMe


git-svn-id: https://develop.svn.wordpress.org/trunk@31450 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-13 16:42:36 +00:00
John Blackbourn
22fc19e06d Return a WP_Error if an empty name is provided when registering a taxonomy.
Fixes #31135
Props tyxla, MikeHansenMe


git-svn-id: https://develop.svn.wordpress.org/trunk@31449 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-13 16:26:37 +00:00
Sergey Biryukov
83d5751a33 Use get_admin_url() to get the correct My Sites URL without calling switch_to_blog() directly.
props ocean90.
see #31314.

git-svn-id: https://develop.svn.wordpress.org/trunk@31448 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-13 12:52:10 +00:00
Sergey Biryukov
bde2a220d9 Avoid a PHP notice in wp_install_language_form() and wp_dropdown_languages() if the language doesn't have a ISO 639-1 code.
props barrykooij.
fixes #31319.

git-svn-id: https://develop.svn.wordpress.org/trunk@31447 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-13 11:22:38 +00:00
Sergey Biryukov
997b9733c9 Use correct default values for some admin template functions.
props ipm-frommen.
fixes #31308.

git-svn-id: https://develop.svn.wordpress.org/trunk@31446 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-13 06:50:49 +00:00
Jeremy Felt
2002097f6f Create the My Sites URL in the context of a user's primary site.
Switch to the user's primary (or active) site before creating the My Sites URL. This previously linked to the current site's dashboard, even if a user was not a member of that site.

Props simonwheatley for the initial patch.

Fixes #31314.


git-svn-id: https://develop.svn.wordpress.org/trunk@31445 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-13 06:29:57 +00:00
Sergey Biryukov
5ec46121cd Rename unused argument and remove obsolete global in iframe_header().
props ipm-frommen.
fixes #31309.

git-svn-id: https://develop.svn.wordpress.org/trunk@31443 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-13 05:30:53 +00:00
Sergey Biryukov
5f360a12a7 _list_meta_row() should always return a string.
props ipm-frommen.
fixes #31310.

git-svn-id: https://develop.svn.wordpress.org/trunk@31442 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-13 04:21:47 +00:00
Sergey Biryukov
e3728870fb Correct parameter types for Plugin_Upgrader::bulk_upgrade() and Theme_Upgrader::bulk_upgrade().
props ipm-frommen.
fixes #31312.

git-svn-id: https://develop.svn.wordpress.org/trunk@31441 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-13 04:18:45 +00:00
Sergey Biryukov
100e1e4b20 Terminate JS statements in two admin files.
props ipm-frommen.
fixes #31311.

git-svn-id: https://develop.svn.wordpress.org/trunk@31440 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-13 04:08:33 +00:00
Boone Gorges
ab10e5fe71 Add tests for some of WP_Query's sticky post logic.
See #27282.

git-svn-id: https://develop.svn.wordpress.org/trunk@31439 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-13 02:24:57 +00:00
Helen Hou-Sandi
8e1df9dab2 Posts list table: Add a filter to disable the months dropdown.
It was previously possible to prevent it from displaying by filtering everything out from the results, but if one really doesn't want it, they should be able to short-circuit before the query even runs.

props norcross, SergeyBiryukov.
fixes #30254.


git-svn-id: https://develop.svn.wordpress.org/trunk@31438 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-12 18:37:06 +00:00
Dion Hulse
afef491a75 Avoid a PHP Warning when add_args is passed as false to paginate_links().
Props boonebgorges for the unit test.
See #30831 [31203].


git-svn-id: https://develop.svn.wordpress.org/trunk@31432 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-12 01:38:26 +00:00
Dion Hulse
d17168583d Prevent IE9 and lower displaying the download file dialogue when attempting to upload using the html4 Plupload handler.
The HTML4 Plupload handler uses a hidden iframe to POST the upload form,
Unfortunately Internet Explorer 9 doesn't support the `application/json` 
content-type which `wp_send_json_success()` and requires `text/html` instead.

This partially reverts [30354], keeping the better error messages.

Fixes #31037 for trunk.


git-svn-id: https://develop.svn.wordpress.org/trunk@31429 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-12 01:14:47 +00:00
Dominik Schilling (ocean90)
ea44136764 Customizer: Don't focus new widgets if they are added programmatically.
props westonruter.
fixes #31295.

git-svn-id: https://develop.svn.wordpress.org/trunk@31428 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-11 23:31:20 +00:00
Dominik Schilling (ocean90)
a4eb4880b4 Escape Customizer links in the admin menu. Fix usage of add_query_arg().
props iseulde.
fixes #30952.

git-svn-id: https://develop.svn.wordpress.org/trunk@31427 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-11 22:47:44 +00:00
Dominik Schilling (ocean90)
d4c47d6364 Fix failing Tests_Dependencies_jQuery::test_wp_script_is_dep_enqueued test.
[31370] has broken the test because the Customizer test enqueues some scripts. Unset `$GLOBALS['wp_scripts']` on tearDown() so other tests will start with zero enqueued scripts.

see #30936.
fixes #31302.

git-svn-id: https://develop.svn.wordpress.org/trunk@31426 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-11 22:44:20 +00:00
Dominik Schilling (ocean90)
0b1463c6f4 Update grunt-cssjanus to 0.2.4, we no longer need the fork.
Upstream changes:
* https://github.com/cssjanus/cssjanus/compare/v1.0.2...v1.1.2
* https://github.com/cssjanus/grunt-cssjanus/compare/v0.2.2...v0.2.4

fixes #30997.

git-svn-id: https://develop.svn.wordpress.org/trunk@31425 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-11 22:27:53 +00:00
Helen Hou-Sandi
fbdb7685fa Admin menu: Ensure top level menu item keeps hover color when hovering over or focusing on the submenu.
props stevehickeydesign, melchoyce.
fixes #31275.


git-svn-id: https://develop.svn.wordpress.org/trunk@31424 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-11 22:24:49 +00:00
Scott Taylor
a93805f6bb Use RegEx instead of DOMDocument when protecting <pre> tags in WP_oEmbed::_strip_newlines(). It is incredibly difficult to maintain character encoding and whitespace when parsing via DOMDocument.
See #31214.


git-svn-id: https://develop.svn.wordpress.org/trunk@31423 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-11 22:17:27 +00:00
Helen Hou-Sandi
d00ef0f076 Update the default admin color scheme for more unity and refinement.
This removes the red channel from blues and cools the grays a bit for a more cohesive and purposeful color scheme.

props hugobaeta.
fixes #31234.


git-svn-id: https://develop.svn.wordpress.org/trunk@31422 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-11 22:17:02 +00:00
Dominik Schilling (ocean90)
4463917f68 Customizer: Restore showing a login form inside the previewer if an user is logged out.
Broken since [31370].

props westonruter.
see #31294.

git-svn-id: https://develop.svn.wordpress.org/trunk@31421 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-11 22:12:47 +00:00
Dominik Schilling (ocean90)
1ddd9cad9b Widgets: Add return param for widgets admin page to the "Manage in Customizer" link.
props tywayne.
fixes #30888.

git-svn-id: https://develop.svn.wordpress.org/trunk@31420 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-11 20:56:21 +00:00
Dominik Schilling (ocean90)
0f5458ec6d Customizer: Improve [31252] to show the move-widget buttons only if there is more than one *rendered* sidebar.
fixes #30690.

git-svn-id: https://develop.svn.wordpress.org/trunk@31419 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-11 20:44:19 +00:00
Boone Gorges
ed639b408a Split shared taxonomy terms on term update.
When updating an existing taxonomy term that shares its `term_id` with
another term, we generate a new row in `wp_terms` and associate the updated
term_taxonomy_id with the new term. This separates the terms, such that
updating the name of one term does not change the name of any others.

In cases where a plugin or theme stores term IDs in the database, term splitting
can cause backward compatibility issues. The current changeset introduces
two utilities to aid developers with the transition. The `'split_shared_term'`
action fires when the split takes place, and should be used to catch changes in
term_id. In cases where `'split_shared_term'` cannot be used, the
`wp_get_split_term()` function gives developers access to data about terms
that have previously been split. Documentation for these functions, with
examples, can be found in the Plugin Developer Handbook. WordPress itself
stores term IDs in this way in two places; `_wp_check_split_default_terms()`
and `_wp_check_split_terms_in_menus()` are hooked to `'split_shared_term'` to
perform the necessary cleanup.

See [30241] for a previous attempt at the split. It was reverted in [30585]
for 4.1.0.

Props boonebgorges, mboynes.
See #5809.

git-svn-id: https://develop.svn.wordpress.org/trunk@31418 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-11 19:41:54 +00:00
John Blackbourn
66548dcb82 Introduce a logout_redirect filter so the redirect destination can be changed when a user logs out. Parameters:
* string  $redirect_to           The redirect destination URL.
 * string  $requested_redirect_to The requested redirect destination URL passed as a parameter.
 * WP_User $user                  The WP_User object for the user that's logging out. 

Fixes #27617
Props SergeyBiryukov, johnbillion


git-svn-id: https://develop.svn.wordpress.org/trunk@31417 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-11 19:18:19 +00:00
Scott Taylor
4fb31473e8 After [31415], make sure str_replace() only occurs once for each matched tag to avoid overwriting until <pre>s.
See #31214.


git-svn-id: https://develop.svn.wordpress.org/trunk@31416 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-11 19:14:09 +00:00
Scott Taylor
18610ef0ad Protect <pre> tags when parsing oEmbed responses in WP_oEmbed::_strip_newlines() in DOMDocument is available.
Fixes #31214.


git-svn-id: https://develop.svn.wordpress.org/trunk@31415 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-11 19:10:46 +00:00
John Blackbourn
b384c8cf25 Add $expiration as a parameter to the pre_set_transient_{$transient} filter.
Props mgibbs189
Fixes #30576


git-svn-id: https://develop.svn.wordpress.org/trunk@31414 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-11 17:11:18 +00:00
Scott Taylor
4f8c251c45 oEmbed discovery fails on encoded link URLs: decode HTML chars in the HTML-encoded URLs that are returned.
Props cweiske.
Fixes #31213.


git-svn-id: https://develop.svn.wordpress.org/trunk@31413 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-11 16:12:48 +00:00
Sergey Biryukov
5d35c181dc Add .comment-reply-login class to get_post_reply_link(), for consistency with get_comment_reply_link().
props johnjamesjacoby.
fixes #31298.

git-svn-id: https://develop.svn.wordpress.org/trunk@31412 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-11 16:10:54 +00:00
Sergey Biryukov
0fdfb101db Use require_once() to prevent a fatal error if _wp_admin_bar_init() is called twice.
props danielbachhuber.
fixes #31287.

git-svn-id: https://develop.svn.wordpress.org/trunk@31411 602fd350-edb4-49c9-b593-d223f7449a82
2015-02-11 15:58:22 +00:00