Commit Graph

26256 Commits

Author SHA1 Message Date
Scott Taylor
5c3f7d5392 In media_sideload_image(), check the returned value of download_url() earlier to avoid attempting to unlink() an instance of WP_Error.
Props georgestephanis. 
Fixes #28204.


git-svn-id: https://develop.svn.wordpress.org/trunk@28567 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-23 21:32:12 +00:00
Scott Taylor
b2db40a694 Add unit tests for functions in wp-includes/category.php.
Props mdbitz. 
Fixes #28119.


git-svn-id: https://develop.svn.wordpress.org/trunk@28566 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-23 21:07:18 +00:00
Andrew Ozz
cfb7408e2a wpView: fix selecting a view's text string in Safari, props gcorne, fixes #28088
git-svn-id: https://develop.svn.wordpress.org/trunk@28565 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-23 20:55:53 +00:00
Scott Taylor
cd7d3f2ee8 wp_dropdown_pages() allows option_none_value to be passed. Add that arg to the $defaults for wp_dropdown_users() and wp_dropdown_categories() as well.
Props solarissmoke. 
Fixes #16625.


git-svn-id: https://develop.svn.wordpress.org/trunk@28564 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-23 20:46:18 +00:00
Scott Taylor
70f735669a Replaces all uses of TEMPLATEPATH and STYLESHEETPATH in core with get_template_directory() and get_stylesheet_directory().
Add `@deprecated` annotations to `TEMPLATEPATH` and `STYLESHEETPATH` definitions.

Props obenland, aaroncampbell. 
Fixes #18298.


git-svn-id: https://develop.svn.wordpress.org/trunk@28563 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-23 20:11:08 +00:00
Scott Taylor
e2a124a911 When adding queries to tax_query: if the query's field is term_taxonomy_id, don't require taxonomy to be specified. In WP_Tax_Query::transform_query(), $query['taxonomy'] is never checked for the 'term_taxonomy_id' case because 'term_taxonomy_id' is the primary key being looked up.
Adds unit tests.

Props helen.
Fixes #25284.



git-svn-id: https://develop.svn.wordpress.org/trunk@28562 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-23 19:58:52 +00:00
Scott Taylor
a2b0c8b2e4 In get_terms_to_edit(), call get_object_term_cache() before priming cache with wp_get_object_terms().
In `get_inline_data()`, do the same.

On list table screens with taxonomies in the admin, this dramatically reduces the number of database queries (3x less). Even more so with a persistent object cache (5x less).

Props johnbillion, jeffstieler, wonderboymusic.
Fixes #18968.



git-svn-id: https://develop.svn.wordpress.org/trunk@28561 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-23 19:28:45 +00:00
Scott Taylor
aa34ede226 Truly check for ! empty() instead of falsey '' when determining whether to add LIMIT clause to SQL in wp_get_archives().
Props jjeaton for the initial patch.
Fixes #27834.


git-svn-id: https://develop.svn.wordpress.org/trunk@28560 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-23 18:27:10 +00:00
Scott Taylor
3b060c1931 Read the src attribute for the [embed] shortcode if the shortcode's body is empty.
These work:
`[embed src="https://www.youtube.com/watch?v=ZqD-LPOWIT0"]`
`[embed src="https://www.youtube.com/watch?v=ZqD-LPOWIT0"][/embed]`

If you do:
`[embed src="https://www.youtube.com/watch?v=ZqD-LPOWIT0"]http://any-other-url.com[/embed]`

... "http://any-other-url.com" will be the URL that is parsed.

Props kovshenin, aaroncampbell for making initial patches.
Fixes #24456.



git-svn-id: https://develop.svn.wordpress.org/trunk@28559 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-23 18:05:24 +00:00
Scott Taylor
1061a15eaf Allow get_comments_number() to officially accept $post or $post_id. Adds unit tests.
Props coffee2code, JanHenkG.
Fixes #26240.


git-svn-id: https://develop.svn.wordpress.org/trunk@28558 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-23 17:43:03 +00:00
John Blackbourn
d07954ea60 Add CollegeHumor.com oEmbed support. Fixes #24497. Props johnzanussi.
git-svn-id: https://develop.svn.wordpress.org/trunk@28557 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-22 23:46:22 +00:00
Scott Taylor
e2240cd82f Viddler has had a new oEmbed endpoint for at least 10 months. Let us update to it.
Props garhdez.
Fixes #24296.


git-svn-id: https://develop.svn.wordpress.org/trunk@28556 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-22 23:16:11 +00:00
Scott Taylor
2baa683984 Support Polldaddy's short URL format as a whitelisted oEmbed provider.
Props donncha.
Fixes #28283.



git-svn-id: https://develop.svn.wordpress.org/trunk@28555 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-22 23:12:05 +00:00
Scott Taylor
47be64543c Add Issuu to list of whitelisted oEmbed providers.
Props issuu.
Fixes #28312.



git-svn-id: https://develop.svn.wordpress.org/trunk@28554 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-22 21:49:10 +00:00
Scott Taylor
a4e1ec0b90 Fix parsing in wp_match_mime_types() to allow some mime-types with + in them to appear in the list of filter links shown above the list table on upload.php.
Props _duck.
Fixes #20672.



git-svn-id: https://develop.svn.wordpress.org/trunk@28553 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-22 21:35:36 +00:00
Scott Taylor
1bc5e8329a Support oEmbed matching for YouTube playlist URLs.
Fixes #28125.


git-svn-id: https://develop.svn.wordpress.org/trunk@28552 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-22 21:11:31 +00:00
Scott Taylor
285d74a283 In is_user_option_local(), $user_id is set conditionally, but never used.
See #27882.


git-svn-id: https://develop.svn.wordpress.org/trunk@28551 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-22 19:17:12 +00:00
Scott Taylor
7b3181e4ed $count is set in get_post_galleries() and never used, relic from PFUI RIP.
See #27882.


git-svn-id: https://develop.svn.wordpress.org/trunk@28550 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-22 19:13:01 +00:00
Scott Taylor
1d78b1dcc4 $gallery_div is set twice in gallery_shortcode() before it is used.
See #27882.


git-svn-id: https://develop.svn.wordpress.org/trunk@28549 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-22 19:11:16 +00:00
Scott Taylor
ae9cf4a66d In get_attachment_icon_src(), $class is set in 2 conditions but never used.
See #27882.


git-svn-id: https://develop.svn.wordpress.org/trunk@28548 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-22 19:07:30 +00:00
Scott Taylor
363301f36e break is unreachable in WP_Theme::translate_header().
See #27882.


git-svn-id: https://develop.svn.wordpress.org/trunk@28547 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-22 19:04:16 +00:00
Scott Taylor
8b3d002486 In WP_Customize_Manager::register_controls(), $menu_locations is set and never used.
git-svn-id: https://develop.svn.wordpress.org/trunk@28546 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-22 19:00:30 +00:00
Scott Taylor
e53cdbb8f0 In wp_dashboard_recent_posts(), $i is set and never used.
See #27882.


git-svn-id: https://develop.svn.wordpress.org/trunk@28545 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-22 18:55:07 +00:00
Scott Taylor
70342f4a75 $theme_name is set but no longer used in wp_dashboard_right_now(). The theme name is displayed with the call to update_right_now_message().
See #27882.


git-svn-id: https://develop.svn.wordpress.org/trunk@28544 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-22 18:53:43 +00:00
Sergey Biryukov
5edb7a633f Remove unnecessary array_reverse() from wp_get_post_revisions().
WP_Query properly handles multiple 'orderby' values since [28541].

fixes #26042.

git-svn-id: https://develop.svn.wordpress.org/trunk@28543 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-22 18:50:11 +00:00
Scott Taylor
d6f1c4f904 Because PHP can be configured without --filter, it is not 100% safe to use filter_var(). This is problematic for casting "false" to false, as PHP always casts it to true. FILTER_VALIDATE_BOOLEAN fixes this, but it may not be available.
Add a new function, `wp_validate_boolean()`, to replace `filter_var( $var, FILTER_VALIDATE_BOOLEAN )`.

Fixes #28170.



git-svn-id: https://develop.svn.wordpress.org/trunk@28542 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-22 18:33:34 +00:00
Scott Taylor
0baa73f2e4 Apply order to each passed value for orderby in WP_Query:
* Since `orderby` in `WP_Query` can accept space-delimited sets, yet only one `order` value: when multiple values are passed (and `DESC` is the order), the default sort order `ASC` is being applied to all values before the last in the set.
* There is a unit test that sporadically fails since 3.6 in `tests/post/revision` due to multiple posts having the same `post_date` from being added so rapidly
* When ordering revisions in `wp_get_post_revisions()`, order by `post_date ID`
* Change the `order` value in `wp_get_post_revisions()` to `ASC`. This will produce SQL like: `ORDER BY $wpdb->posts.post_date ASC, $wpdb->posts.ID ASC`. Previously, this would have produced SQL like: `ORDER BY $wpdb->posts.post_date DESC`, and with the addition of ` ID`: `ORDER BY $wpdb->posts.post_date ASC, $wpdb->posts.ID DESC`. Clearly, wrong. The original SQL produced: `ORDER BY $wpdb->posts.post_date DESC`. As such, return the reversions in reverse order using `array_reverse()`. Not doing so would break "Preview Changes."
* Add unit tests to assert that all of this works.
* All existing unit tests pass with the change to ordering multiple `orderby`s in `WP_Query`.
* In the future, we should support independent `order` for each `orderby`, see #17065.

Props SergeyBiryukov, wonderboymusic.
Fixes #26042.


git-svn-id: https://develop.svn.wordpress.org/trunk@28541 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-22 18:18:11 +00:00
Sergey Biryukov
b0b85cc484 Use correct variable. see [28534], [28538].
see #22400.

git-svn-id: https://develop.svn.wordpress.org/trunk@28540 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-22 17:39:22 +00:00
Scott Taylor
312ef7b264 These functions import $wpdb but do not use it.
See #27882.


git-svn-id: https://develop.svn.wordpress.org/trunk@28539 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-22 17:36:42 +00:00
Sergey Biryukov
ce653e1925 Remove redundant assignment. see [28379], [28534].
see #22400.

git-svn-id: https://develop.svn.wordpress.org/trunk@28538 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-22 17:34:34 +00:00
Sergey Biryukov
15588188e8 Fix inconsistent header underlining and spacing in background update emails.
fixes #28306.

git-svn-id: https://develop.svn.wordpress.org/trunk@28537 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-22 09:40:36 +00:00
Sergey Biryukov
3bd4762f9b Twenty Fourteen: Bail early from Featured_Content::hide_featured_term() if term objects are unavailable.
fixes #28072.

git-svn-id: https://develop.svn.wordpress.org/trunk@28536 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-22 09:24:33 +00:00
Sergey Biryukov
9966795165 Use correct function name.
props ericlewis.
fixes #28329.

git-svn-id: https://develop.svn.wordpress.org/trunk@28535 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-22 07:58:26 +00:00
Scott Taylor
a0c78339fc Fix some bad UI recursion in wp_get_archives() caused by [28379]. It appears that $afterafter was appropriately named.
See #22400.



git-svn-id: https://develop.svn.wordpress.org/trunk@28534 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-20 23:08:23 +00:00
Scott Taylor
6f4df85c8f WP_Query was only missing one access modifier.
Add access modifier (`public`) to applicable class methods/members of `WP_Rewrite`. I am not brave enough to set some of the `var`s to `private` without more testing.

See #27881, #22234.


git-svn-id: https://develop.svn.wordpress.org/trunk@28533 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 17:40:08 +00:00
Scott Taylor
707c313333 WP_Date_Query was only missing one access modifier.
Add access modifier (`public`) to all default widgets' class methods.

See #27881, #22234.


git-svn-id: https://develop.svn.wordpress.org/trunk@28532 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 17:29:42 +00:00
Scott Taylor
dc1ada20c7 Upgrade _WP_List_Table_Compat to PHP5-style constructor.
Add `public` to methods/members of `WP_Role`.
Add `public` to methods/members of `WP_User` where appropriate. Don't set `private` where indicated until more study has occurred and tests have been written for compatibiliy with existing magic methods.

See #27881, #22234.


git-svn-id: https://develop.svn.wordpress.org/trunk@28531 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 17:19:09 +00:00
Scott Taylor
be2e5f6fb5 hackificator doesn't like mixed single/double-quoted attributes. These were 2 lingering instances in the admin.
See #27881.


git-svn-id: https://develop.svn.wordpress.org/trunk@28530 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 17:09:42 +00:00
Scott Taylor
d261d0030a In WP_Filesystem_Base, the constructor is a noop, so it shouldn't even be declared. Setting it implies that parent::__construct() should be called by its subclasses.
See #27881, #22234.


git-svn-id: https://develop.svn.wordpress.org/trunk@28529 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 16:45:42 +00:00
Scott Taylor
02eba613a5 Add access modifiers to WP_User_Query.
Add magic methods for BC: __get(), __set(), __isset(), __unset(), and
__call().

See #27881, #22234.


git-svn-id: https://develop.svn.wordpress.org/trunk@28528 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 15:47:33 +00:00
Scott Taylor
3e054a2c7e Add public access modifier to methods/members of WP_Widget and WP_Widget_Factory.
See #27881, #22234.


git-svn-id: https://develop.svn.wordpress.org/trunk@28527 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 15:42:00 +00:00
Scott Taylor
02a28ec4e9 In wpdb, make some things explicitly public. Do not set anything to private. This would instantly blow up hyperdb in the wild.
See #27881, #22234.


git-svn-id: https://develop.svn.wordpress.org/trunk@28526 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 15:35:29 +00:00
Scott Taylor
1cbef26922 Add access modifiers to WP_Text_Diff_Renderer_Table that are compatible with its parent class. Some of the inline docs suggest access that, if implemented, would produce fatal errors.
Add magic methods for BC: __get(), __set(), __isset(), __unset(), and __call().

See #27881, #22234.


git-svn-id: https://develop.svn.wordpress.org/trunk@28525 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 15:22:45 +00:00
Scott Taylor
daecbc9659 Classes that have __set() also need __isset() and __unset().
See #27881, #22234.


git-svn-id: https://develop.svn.wordpress.org/trunk@28524 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 06:51:35 +00:00
Scott Taylor
bf54ad6054 Add missing access modifiers to methods in WP_Query. Add magic methods for __get(), __set(), __isset(), __unset(), and __call().
Add unit test for magic methods.

See #27881, #22234.


git-svn-id: https://develop.svn.wordpress.org/trunk@28523 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 06:48:56 +00:00
Scott Taylor
5771dfbfa5 Add missing access modifiers to methods in WP_Meta_Query.
See #27881, #22234.


git-svn-id: https://develop.svn.wordpress.org/trunk@28522 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 06:34:01 +00:00
Scott Taylor
77c6420969 Some classes with __get() method also need __set().
See #27881, #22234.


git-svn-id: https://develop.svn.wordpress.org/trunk@28521 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 06:31:00 +00:00
Scott Taylor
e76545e011 Fix fatal error in unit test.
See #27881.


git-svn-id: https://develop.svn.wordpress.org/trunk@28520 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 06:24:06 +00:00
Scott Taylor
d398ea806c Add missing access modifiers to methods in WP_Comment_Query. Add a magic __call() method for BC.
See #27881, #22234.


git-svn-id: https://develop.svn.wordpress.org/trunk@28519 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 06:18:51 +00:00
Scott Taylor
ce917f0bc4 Add missing access modifiers to methods in WP_Scripts and WP_Styles.
See #27881, #22234.


git-svn-id: https://develop.svn.wordpress.org/trunk@28518 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 06:16:39 +00:00