Commit Graph

29129 Commits

Author SHA1 Message Date
Boone Gorges abbbde190c In `WP_User_Query`, `$meta_query` should be a class property rather than a local variable.
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
2015-03-07 16:34:42 +00:00
Boone Gorges a510aafe46 Fix documentation whitespace after [31663].
See #31265.

git-svn-id: https://develop.svn.wordpress.org/trunk@31664 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-07 16:07:26 +00:00
Boone Gorges 945fd67d7b Improve 'orderby' syntax for `WP_User_Query`.
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
2015-03-07 16:05:11 +00:00
Boone Gorges 3262ff0cc8 Tests for some existing 'orderby' functionality in `WP_*_Query` classes.
* 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
2015-03-07 15:44:28 +00:00
Dominik Schilling (ocean90) 305a44617c Customizer: Add audio/video previews for upload controls.
props celloexpressions, Fab1en, wonderboymusic.
fixes #30850.

git-svn-id: https://develop.svn.wordpress.org/trunk@31661 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-07 11:05:57 +00:00
Drew Jaynes 9c1ab4eec0 Add a missing `@since 4.2.0` tag to the DocBlock for `wp_attachment_is()`.
See #25275.


git-svn-id: https://develop.svn.wordpress.org/trunk@31660 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-07 07:11:11 +00:00
Drew Jaynes 37ca5609c8 Better document parameters and the return for the newly-introduced `wp_attachment_is()`.
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
2015-03-07 07:08:52 +00:00
Jeremy Felt a5fcc34a50 Return HTTP status code 403 in network admin when access is forbidden.
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
2015-03-07 05:59:17 +00:00
Jeremy Felt 03b4e1f0aa Return HTTP status code 500 by default in ms_not_installed()
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
2015-03-07 05:34:47 +00:00
Jeremy Felt f0b524dad0 Improve experience when deleting users from a multisite network.
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
2015-03-07 04:39:13 +00:00
Andrew Ozz e651a8bef1 PressThis: make the Preview button "subtle".
See #31458.

git-svn-id: https://develop.svn.wordpress.org/trunk@31655 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-07 01:49:57 +00:00
Andrew Ozz fba4d3e296 PressThis: add preview functionality. Opens the preview in a new window or a tab next to the source tab.
Fixes #31458.

git-svn-id: https://develop.svn.wordpress.org/trunk@31654 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-07 01:16:05 +00:00
Boone Gorges b2332718a1 When passing `$full` to `get_posts_by_author_sql()`, make sure a 'post_type' clause is included in results.
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
2015-03-07 01:14:31 +00:00
Drew Jaynes 86b23615ea Remove a duplicate mention of the default value for the `$number` argument in `get_terms()`.
Props iandunn.
Fixes #31526.


git-svn-id: https://develop.svn.wordpress.org/trunk@31652 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-07 01:04:22 +00:00
Andrew Ozz 900468728a PressThis:
- 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
2015-03-06 22:56:17 +00:00
Scott Taylor 2058dadaf7 Update NPM Grunt packages: `compress`, `concat`, `copy`, `imagemin` and `uglify`
Props netweb.
Fixes #31489.


git-svn-id: https://develop.svn.wordpress.org/trunk@31650 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-06 21:13:21 +00:00
Scott Taylor 3d944cc15e Update `grunt-contrib-jshint` to `0.11.0`
Props netweb.
Fixes #31488.


git-svn-id: https://develop.svn.wordpress.org/trunk@31649 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-06 21:07:35 +00:00
wonderboymusic 689c0982ec Update `grunt-sass` to `0.18.0`.
Props netweb.
Fixes #31343.


git-svn-id: https://develop.svn.wordpress.org/trunk@31648 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-06 21:04:03 +00:00
Scott Taylor 8a28e19808 Add unit tests for `wp_attachment_is()`, checks the whitelist and arbitrary extension.
See #25275.


git-svn-id: https://develop.svn.wordpress.org/trunk@31647 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-06 20:37:08 +00:00
Scott Taylor 6d5385be8d After [31645], for the `default` `case`, return the result of checking the extension against the passed type.
See #25275.


git-svn-id: https://develop.svn.wordpress.org/trunk@31646 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-06 20:27:49 +00:00
Scott Taylor 42bcec5061 Introduce a function, `wp_attachment_is( $type, $post = 0 )`, to collapse the logic for determining whether an attachment is an `image`, `audio`, or `video`.
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
2015-03-06 20:25:09 +00:00
Lance Willett ff67402710 Twenty Fifteen: add ARIA attributes to menu toggle.
See #31527, props davidakennedy, lance.


git-svn-id: https://develop.svn.wordpress.org/trunk@31644 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-06 17:33:38 +00:00
Scott Taylor eb73416790 For our MediaElement 2.16.4 build + monkey patches, also add from the illustrious dd32:
https://github.com/johndyer/mediaelement/pull/1423

Props dd32.
See [31444], #31541.


git-svn-id: https://develop.svn.wordpress.org/trunk@31643 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-06 15:46:26 +00:00
Helen Hou-Sandi df65776f88 Media: UI tweaks for Insert from URL.
"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
2015-03-06 15:02:08 +00:00
Helen Hou-Sandi c9913583e3 Comments: Show more identifying information for moderation and editing.
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
2015-03-06 14:05:05 +00:00
Boone Gorges b9e222fd6a Allow `$autoload` setting to be changed for existing options using `update_option()`.
[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
2015-03-06 13:56:44 +00:00
Boone Gorges 98322a7143 Ensure that an array of object IDs is passed to the 'get_object_terms' filter.
Originally introduced in [31581].

Props doublesharp.
Fixes #18828.

git-svn-id: https://develop.svn.wordpress.org/trunk@31639 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-06 13:17:09 +00:00
Drew Jaynes 653f2ee36e Correct the `$number` argument description in `get_terms()` to reflect that an empty string or 0 will return all possible results, not -1.
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
2015-03-06 08:04:32 +00:00
Andrew Ozz 1080a903fc PressThis: when server-side parsing, filter small images by the width and height attributes if set.
See #31373.

git-svn-id: https://develop.svn.wordpress.org/trunk@31637 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-06 02:02:03 +00:00
Andrew Ozz e6fcf316b3 PressThis: fix toggling of `aria-expanded` attribute.
Props afercia, see #31373.

git-svn-id: https://develop.svn.wordpress.org/trunk@31636 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-06 01:50:56 +00:00
Andrew Ozz 24461024ca PressThis:
- Fix error when checking for empty array keys.
- Add better DailyMotion embed support.
Props stephdau, see #31373.

git-svn-id: https://develop.svn.wordpress.org/trunk@31635 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-06 01:16:53 +00:00
Scott Taylor deb7e5697e Audio previews need top margin on Edit Media screen.
Fixes #31524.


git-svn-id: https://develop.svn.wordpress.org/trunk@31634 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-05 22:44:17 +00:00
Scott Taylor 78bab0c4eb When adding `post_type` to `$sendback` in `wp-admin/post.php`, use `add_query_arg()` instead of string concatenation.
Props podpirate.
Fixes #31492.


git-svn-id: https://develop.svn.wordpress.org/trunk@31633 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-05 22:30:32 +00:00
Scott Taylor b44cf676b1 In the modal state for Embed previews, only show the Title field when the preview fails.
Props johnbillion, wonderboymusic.
See #29476.


git-svn-id: https://develop.svn.wordpress.org/trunk@31632 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-05 21:02:42 +00:00
Scott Taylor 2d120c988e Whitespace after [31630].
git-svn-id: https://develop.svn.wordpress.org/trunk@31631 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-05 20:13:15 +00:00
Scott Taylor 9539c0af8e Add oEmbed support for Tumblr.
Props elliottcarlson.
See #31180.


git-svn-id: https://develop.svn.wordpress.org/trunk@31630 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-05 20:12:31 +00:00
Scott Taylor 06a86d1425 Use `browserify`'s watch mechanism in tandem with `grunt watch`. Makes building media bundles about 10 (million) times faster.
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
2015-03-05 19:48:59 +00:00
Boone Gorges 67324a9234 Introduce `$autoload` parameter to `update_option()`.
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
2015-03-05 19:13:00 +00:00
Scott Taylor 9c292553d9 Ugrade to MediaElement 2.16.4:
https://github.com/johndyer/mediaelement/compare/2.16.2...2.16.4

Includes PRs from WordPress folk:
1a74854abf
f438256f5c
8b9856accd

Monkey-patch MediaElement to restore H264 support to Chromium.

Documented here:
https://core.trac.wordpress.org/ticket/31541#comment:1

See #31541.


git-svn-id: https://develop.svn.wordpress.org/trunk@31627 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-05 16:53:27 +00:00
Scott Taylor 214836a843 After [31620], when checking for HTTP URLs, make sure we are checking the shortcode body instead of an indexed attribute.
See #31139.


git-svn-id: https://develop.svn.wordpress.org/trunk@31626 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-05 16:26:00 +00:00
Scott Taylor ef10d719eb When editing/viewing the details of a `[video]` shortcode that has Vimeo as its source, and `Froogaloop` has not already been lazy-loaded, check the details of the state's model for the video `src`, instead of the HTML element.
See #29267.


git-svn-id: https://develop.svn.wordpress.org/trunk@31625 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-05 16:14:13 +00:00
Scott Taylor 21568b8cc1 `detached` affects the `wp()` call for the media list table, so switch our new `$_GET` key to `detach`.
See #6820.


git-svn-id: https://develop.svn.wordpress.org/trunk@31624 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-05 15:58:02 +00:00
Boone Gorges c4e9c64233 Pinking shears in unit test files.
git-svn-id: https://develop.svn.wordpress.org/trunk@31623 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-05 13:14:28 +00:00
Boone Gorges 067fa3702e In PHPUnit test classes, `parent::tearDown()` should be the last thing done in `tearDown()` methods.
`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
2015-03-05 13:14:15 +00:00
Andrew Ozz 889edda453 TinyMCE wpView: revert decoding of HTML entities. Doesn't work in old IE and needs to be more selective. Keep the change from `.html()` to `.text()` when getting the content of a node. See #31412.
git-svn-id: https://develop.svn.wordpress.org/trunk@31621 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-05 12:35:10 +00:00
Scott Taylor 4726669b3f Allow inline editing of `width` and `height` parameters while previewing an embed in the media modal:
* 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
2015-03-05 05:59:10 +00:00
Scott Taylor 6c8322e8fa Allow attachments to be Detached from their parent in media grid and list modes.
See #6820.


git-svn-id: https://develop.svn.wordpress.org/trunk@31619 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-05 05:34:40 +00:00
Scott Taylor 26875b75a3 Media modules: set `$` to `Backbone.$`, instead of `jQuery`, so fewer globals are imported.
See #28510.


git-svn-id: https://develop.svn.wordpress.org/trunk@31618 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-05 04:11:23 +00:00
Boone Gorges 07abae914e In `get_next_comments_link()`, ensure proper pagination when no 'cpage' query var is found.
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
2015-03-05 03:56:21 +00:00
Scott Taylor 18af27f550 [31468] reverted this in the 4.1 branch, also reverting in trunk.
See #30725.


git-svn-id: https://develop.svn.wordpress.org/trunk@31616 602fd350-edb4-49c9-b593-d223f7449a82
2015-03-05 03:49:11 +00:00