* specify globals in more files
* add missing `wp.media.*` namespace docs
* add doc blocks to files that had none
See #28510.
git-svn-id: https://develop.svn.wordpress.org/trunk@31492 602fd350-edb4-49c9-b593-d223f7449a82
Make sure that the build file for `grid` doesn't load `views/media-details.js`, it already exists in the `audio-video` build.
See #29267, #28510.
git-svn-id: https://develop.svn.wordpress.org/trunk@31487 602fd350-edb4-49c9-b593-d223f7449a82
`add_option()` and `update_option()` both call `get_option()` to compare the
value passed to the function with any existing value for the given option name.
When a `'default_option_'` filter is in place to change the default value of
an option, `add_option()` and `update_option()` ought to check against the
filtered value, rather than a hardcoded `false`, in order to determine whether
a prior value exists.
Props GregLone, tyxla.
Fixes#31047.
git-svn-id: https://develop.svn.wordpress.org/trunk@31473 602fd350-edb4-49c9-b593-d223f7449a82
* 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
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
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
`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
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
`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
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
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