This provides better parity with other query classes, and makes it possible to
write more direct unit tests.
See #31265.
git-svn-id: https://develop.svn.wordpress.org/trunk@31665 602fd350-edb4-49c9-b593-d223f7449a82
This changeset ports a number of 'orderby' features from `WP_Query` and
`WP_Comment_Query`:
* Allow multiple 'orderby' values to be passed as a space-separated list.
* Allow multiple 'orderby' values to be passed as a flat array.
* Allow multi-dimensional 'orderby', with orderby fields as array keys and ASC/DESC as the corresponding values.
See #31265.
git-svn-id: https://develop.svn.wordpress.org/trunk@31663 602fd350-edb4-49c9-b593-d223f7449a82
* In `WP_Query` and `WP_Comment_Query`, ensure that 'orderby' can parse multiple values for 'orderby' when passed as a space-separated string.
* In `WP_User_Query`, ensure that "shorthand" orderbys (like 'login' and 'name') are converted to their full versions (like 'user_login' and 'display_name').
See #31265.
git-svn-id: https://develop.svn.wordpress.org/trunk@31662 602fd350-edb4-49c9-b593-d223f7449a82
Also adds a changelog entry to the DocBlock for `wp_attachment_is_image()` to denote that it serves as a wrapper for `wp_attachment_is()` as of 4.2.0.
See [31645]. See #25275.
git-svn-id: https://develop.svn.wordpress.org/trunk@31659 602fd350-edb4-49c9-b593-d223f7449a82
When the error message "You do not have permission to access this page" is used in network admin screens, return an HTTP status code of 403 to match. Previously: [30356] and [31300].
Props yo-l1982.
Fixes#31422.
git-svn-id: https://develop.svn.wordpress.org/trunk@31658 602fd350-edb4-49c9-b593-d223f7449a82
In admin views, specify a response code of 500 when using `wp_die()` to show an expanded message for a broken or missing multisite installation.
On front end views, use `dead_db()` rather than `die()` to generate the generic "Error establishing a database connection" message. `dead_db()` sets a status code of 500 by default and allows for the override of this generic error with a `db-error.php` template.
Props craig-ralston, jeremyfelt.
Fixes#30002.
git-svn-id: https://develop.svn.wordpress.org/trunk@31657 602fd350-edb4-49c9-b593-d223f7449a82
When deleting a user who is not associated with any sites, the current messaging can be confusing as only users associated with at least one site actually appear on the confirmation page for deletion.
This experience can be improved by showing all users being deleted as well as their current site associations.
* If an empty array of users is passed, don't attempt to confirm deletion.
* If one user is passed, show a message crafted for a user of one.
* If multiple users are passed, show a message crafted for many.
* Show the pending results of all users to be deleted.
* Update messaging around the deletion/confirmation process to be less misleading.
Props Idealien, HarishChaudhari, DrewAPicture.
Fixes#18132.
git-svn-id: https://develop.svn.wordpress.org/trunk@31656 602fd350-edb4-49c9-b593-d223f7449a82
This change makes the 'post_type' clause in `wp_list_authors()` redundant, so
we remove it. Third-party plugins using `get_posts_by_author_sql()` may have
similarly redundant clauses, but this won't change the results returned by the
SQL queries.
Also adds unit tests for `get_posts_by_author_sql()`.
Props pbearne.
Fixes#30354.
git-svn-id: https://develop.svn.wordpress.org/trunk@31653 602fd350-edb4-49c9-b593-d223f7449a82
- Close the sidebar on moving the focus outside of it (by clicking or by "tabbing").
- Fix a (weird) structural CSS problem where clicks go through the sidebar when it is open.
- Clean up the JS a bit.
Fixes#31457.
git-svn-id: https://develop.svn.wordpress.org/trunk@31651 602fd350-edb4-49c9-b593-d223f7449a82
This is admittedly a first pass. There needs to be a generic handler for when any other type is passed, but for now it accepts the whitelist.
See #25275.
git-svn-id: https://develop.svn.wordpress.org/trunk@31645 602fd350-edb4-49c9-b593-d223f7449a82
"Title" field is now labeled as "Link Text", to reflect how it's actually used. It's also hidden whenever the embed is updating, to make it clearer that something is happening. Embed dimension fields are shown below the preview, much like image property fields are shown below.
fixes#29476, see #31139.
git-svn-id: https://develop.svn.wordpress.org/trunk@31642 602fd350-edb4-49c9-b593-d223f7449a82
Attempting to moderate comments without context about the post is more difficult than necessary. The comment moderation screen you are sent to via email link was also in need of some better visual treatment.
props thaicloud, seanchayes, adamsilverstein.
see #23988.
git-svn-id: https://develop.svn.wordpress.org/trunk@31641 602fd350-edb4-49c9-b593-d223f7449a82
[31628] made it possible to pass an `$autoload` param to `update_option()` that
applies when the option does not yet exist in the database. The current
changeset introduces parity for existing options: the `$autoload` setting
for existing options can be changed via the `$autoload` parameter. For internal
simplicity, `$autoload` is ignored for existing options when `$value` is not
also changed.
This changeset also moves `update_option()` tests into their own class.
Props dd32.
Fixes#26394.
git-svn-id: https://develop.svn.wordpress.org/trunk@31640 602fd350-edb4-49c9-b593-d223f7449a82
Previously, it was noted that -1 would return all possible results. However, as the value of `$number` is passed through `absint()`, -1 would actually be converted to 1, thereby producing unexpected results.
Props iandunn.
Fixes#31526.
git-svn-id: https://develop.svn.wordpress.org/trunk@31638 602fd350-edb4-49c9-b593-d223f7449a82
Make the `browserify` config more dynamic to make future additions easier and to ensure proper use of `SOURCE_DIR`.
Props iseulde, wonderboymusic.
See #28510.
git-svn-id: https://develop.svn.wordpress.org/trunk@31629 602fd350-edb4-49c9-b593-d223f7449a82
When creating an option via `add_option()`, the `$autoload` param allows you to
tell WP whether the option should be loaded as part of the 'alloptions' cache
during every pageload. `update_option()`, when used with a non-existent option
calls `add_option()` internally. The new `$autoload` param in `update_option()`
is passed along to `add_option()` in cases where the option does not yet exist.
The associated unit tests are skipped on multisite due to an issue that causes
`WP_INSTALLING` to force cache misses. See #31130.
Props codix, nofearinc, MikeHansenMe.
Fixes#26394.
git-svn-id: https://develop.svn.wordpress.org/trunk@31628 602fd350-edb4-49c9-b593-d223f7449a82
`WP_UnitTestCase::tearDown()` restores the test environment to the default
conditions, including rolling back the MySQL transaction that the test takes
place in, resetting globals, and unhooking test-specific filters. As such, all
teardown routines for specific tests should happen before the parent class's
`tearDown()` method is called. Failure to do so can cause database locks on
certain configurations, among other problems.
See #31537.
git-svn-id: https://develop.svn.wordpress.org/trunk@31622 602fd350-edb4-49c9-b593-d223f7449a82
* Use `wp.shortcode()` instead of manually constructing a shortcode in `views/embed/link`
* Allow a URL to transition to a shortcode (and vice versa) when returning an embed to TinyMCE
* In `WP_Embed`, store the last URL and last set of attributes requested in class properties
* `wp_ajax_parse_embed()`, allow `[embed]`s to have attributes. Return `attr` in the response.
This is a first pass to allow broad testing with recent MCE view changes.
See #31139.
git-svn-id: https://develop.svn.wordpress.org/trunk@31620 602fd350-edb4-49c9-b593-d223f7449a82
The 'cpage' query var is only set when using `comments_template()` to display
comments. If displaying them in a context where 'cpage' is not yet set, the
default value should be 1, not 0.
Props MomDad, couturefreak.
Fixes#20319.
git-svn-id: https://develop.svn.wordpress.org/trunk@31617 602fd350-edb4-49c9-b593-d223f7449a82