Sergey Biryukov
06bf55f809
Avoid a PHP notice in adjacent_image_link() if no images were found.
...
props nabil_kadimi.
see #28361 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28584 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-27 10:54:45 +00:00
Scott Taylor
4dd4a32cde
In wp_get_object_terms()
, before returning terms (and before running them through the 'wp_get_object_terms' filter) - run them through $terms = array_values( array_unique( $terms, SORT_REGULAR ) )
.
...
There will be "dupes" when the function is called with `'fields' => 'all_with_object_id'`, but the objects will actually be unique due to the `object_id` addition, so they shouldn't be filtered out.
Adds unit tests. All other unit tests pass.
Fixes #11003 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28583 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-27 03:28:05 +00:00
Scott Taylor
7f2cad1809
Fix some inline docs churn in wp_insert_post()
after [28579].
...
Props kpdesign.
See #21963 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28582 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-27 00:23:21 +00:00
Scott Taylor
792fe23675
When adding a URL in the Insert from URL
state in the media modal, attempt to show a preview of the content. Drop the unused width and height fields.
...
This will probably be iterated upon.
Props helen, jtsternberg, wonderboymusic.
See #15490 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28581 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-26 23:56:27 +00:00
Scott Taylor
8567bba0bf
Don't pass embeds through the_content()
when trying to render MCE previews, leverage WP_Embed
and do_shortcode()
instead.
...
Props kovshenin.
See #28195 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28580 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-26 23:42:08 +00:00
Scott Taylor
6cd28991e3
Combine wp_insert_attachment()
and wp_insert_post()
. wp_insert_attachment()
becomes a wrapper. Update inline docs.
...
Props wonderboymusic, DrewAPicture.
See #21963 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28579 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-26 23:19:03 +00:00
Scott Taylor
ef81c3fdba
Add oEmbed support for Mixcloud.
...
Props Jayjdk.
Fixes #27169 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28578 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-26 23:09:00 +00:00
Scott Taylor
5413bfc35a
Allow the settings view for galleries to be disabled when instantiating wp.media.controller.GalleryEdit
.
...
Props nd987.
Fixes #23116 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28577 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-26 22:48:56 +00:00
Andrew Ozz
92f79f5bcd
TinyMCE: fix saving the editor content on switching Visual -> Text, fixes #28353
...
git-svn-id: https://develop.svn.wordpress.org/trunk@28576 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-25 22:46:06 +00:00
Sergey Biryukov
aa6d49590b
Fix typo in [28574].
...
see #28360 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28575 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-25 16:11:26 +00:00
Sergey Biryukov
508c1c1ae7
Replace $in_same_cat with $in_same_term in adjacent post functions for consistency.
...
props ixkaito.
fixes #28360 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28574 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-25 16:09:07 +00:00
Sergey Biryukov
95e42909a9
Suggest get_current_site() as an alternative for get_current_site_name().
...
props jesin.
fixes #28346 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28573 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-25 14:31:16 +00:00
Sergey Biryukov
191705a964
Fix inversed logic in Walker_Category::start_el(). see [28359].
...
Correct 'use_desc_for_title' parameter description.
see #26557 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28572 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-24 13:41:11 +00:00
Sergey Biryukov
90a40a07a1
Pass $post to 'protected_title_format' and 'private_title_format' filters.
...
props johnjamesjacoby, DrewAPicture.
fixes #23724 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28571 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-24 06:47:55 +00:00
Drew Jaynes (DrewAPicture)
cff4631f00
Add inline documentation for the option_none_value
argument added to wp_dropdown_users|categories()
in [28564].
...
Fixes #16625 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28570 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-24 05:38:06 +00:00
Drew Jaynes (DrewAPicture)
c4dc6180a5
Use three-digit x.x.x style version for @deprecated
phpDoc tags.
...
See #18298 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28569 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-24 05:22:34 +00:00
Andrew Ozz
8d02021b7c
TinyMCE: update to 4.0.26. Includes fixes for the 'paste' plugin (paste from Word/Excel, paste in WebKit/Blink), show/hide/isHidden in inline mode, drag/drop in tables and in Safari, and others. Fixes #28342 , #28016 , #28250 and #28067
...
git-svn-id: https://develop.svn.wordpress.org/trunk@28568 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-24 01:43:16 +00:00
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