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
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
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
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
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
d6a3c2a0de
Add access modifiers to methods and members of list table classes:
...
* `WP_List_Table` is the base class that implements `__get()` and `__call()` for BC
* Adds unit tests to confirm that subclasses properly inherit magic methods
* Add modifiers to subclasses: `WP_Links_List_Table`, `WP_Media_List_Table`, `WP_MS_Sites_List_Table`, `WP_MS_Themes_List_Table`, `WP_MS_Users_List_Table`, `WP_Plugin_Install_List_Table`, `WP_Plugins_List_Table`, `WP_Posts_List_Table`, `WP_Terms_List_Table`, `WP_Theme_Install_List_Table`, `WP_Themes_List_Table`
See #27881 , #22234 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28493 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-19 01:16:16 +00:00
Scott Taylor
85ac5c214d
Add a unit test that demonstrates a magic getter.
...
See #27881 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28480 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-18 21:14:13 +00:00
Scott Taylor
17edee17af
Eliminate the use of extract()
in the_taxonomies()
. Adds unit test.
...
See #22400 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28421 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-15 05:24:54 +00:00
Scott Taylor
3e54a1fab5
Eliminate use of extract()
in get_the_taxonomies()
. Adds unit test.
...
See #22400 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28415 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-15 03:50:46 +00:00
Scott Taylor
c47d71feb2
Add unit tests for wp_list_pages()
.
...
Props MikeHansenMe.
See #27326 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28400 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-15 01:17:37 +00:00
Scott Taylor
e4a800238f
Eliminate use of extract()
in wp_dropdown_pages()
.
...
Adds unit tests to: `tests/post/template.php`.
There was previously only one wimpy assertion for `wp_dropdown_pages()`.
See #22400 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28399 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-15 01:11:21 +00:00
Scott Taylor
21e0370e5c
Eliminate use of extract()
in wp_link_pages()
.
...
Adds unit tests to a new file: `tests/post/template.php`.
There were previously no unit tests for `wp_link_pages()`.
See #22400 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28398 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-15 00:43:40 +00:00
Scott Taylor
9e07b1037e
Eliminate use of extract()
in paginate_links()
. Adds unit tests. Moves tests/general/template.php
(which only had one method) to tests/general/paginateLinks.php
.
...
See #22400 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28397 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-14 22:28:08 +00:00
Scott Taylor
77731c03fc
Eliminate use of extract()
in wp_get_archives()
.
...
Adds unit tests: `tests/functions/getArchives.php`.
All other unit tests pass.
Props MikeHansenMe, wonderboymusic.
See #22400 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28379 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-13 04:28:56 +00:00
Scott Taylor
4e0809e3e4
Eliminate use of extract()
in wp_insert_category()
. Adds unit tests. All unit tests pass.
...
Props MikeHansenMe.
See #22400 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28374 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-13 03:26:51 +00:00
Scott Taylor
b70967302b
In get_the_author_posts()
, if there is no current $post
, return 0
and bail.
...
Props krogsgard, aaroncampbell.
Fixes #27998 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28362 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-11 00:25:29 +00:00
Andrew Nacin
cb022f4957
Multisite: Treat 'www' as a special subdomain, reversing 3.9 regression.
...
props jeremyfelt.
fixes #27927 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28280 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-06 05:31:12 +00:00
Scott Taylor
89ecbcc7cb
In WP_Date_Query::get_sql_for_subquery()
, don't parse duplicate parameters - only parse one of w
and week
or month
and monthnum
.
...
Adds unit tests.
Props oso96_2000, ChriCo.
Fixes #25835 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28252 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-04 23:06:07 +00:00
Andrew Nacin
790cb99b27
Shortcode JS: Avoid errors when an escaped shortcode includes a newline between brackets.
...
props gcorne.
props Clorith, jorbin for tests.
see #27907 , for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@28223 602fd350-edb4-49c9-b593-d223f7449a82
2014-05-01 03:36:27 +00:00
Dominik Schilling (ocean90)
a13b695fbd
Customizer: Allow to skip cropping header images if image width is smaller than or equal to theme width.
...
Add tests.
see #27936 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@28219 602fd350-edb4-49c9-b593-d223f7449a82
2014-04-25 20:24:28 +00:00
Dominik Schilling (ocean90)
fd26def119
Revert [28217].
...
Misfired commit for #27936 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28218 602fd350-edb4-49c9-b593-d223f7449a82
2014-04-25 20:17:59 +00:00
Dominik Schilling (ocean90)
5d8f69e0c5
Recent Posts Widget: Use ob_end_flush()
instead of ob_flush()
.
...
`ob_end_flush()` flushes the output buffer *and* turns output buffering off, same as `ob_get_flush()`.
props m_i_n.
see #28009 for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@28217 602fd350-edb4-49c9-b593-d223f7449a82
2014-04-25 14:20:05 +00:00
Scott Taylor
67a0a4fd14
Add a conditional unit test for Tax Query - one query that does an IN
query for categories with relation
for tax_query
set to AND
. Weird queries are being produced.
...
See #27193 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28188 602fd350-edb4-49c9-b593-d223f7449a82
2014-04-23 17:40:25 +00:00
Andrew Ozz
77a65852fa
Update the TinyMCE tests to 4.0.21.1, see #27744
...
git-svn-id: https://develop.svn.wordpress.org/trunk@28138 602fd350-edb4-49c9-b593-d223f7449a82
2014-04-15 22:06:11 +00:00
Andrew Nacin
32721b8347
Avoid stomping of bulk postdata inside the bulk_edit_posts() loop.
...
Reverts [27990] which did not fix it for authors and comment/ping status.
props dd32, DrewAPicture.
fixes #27792 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28113 602fd350-edb4-49c9-b593-d223f7449a82
2014-04-14 07:47:10 +00:00
Andrew Nacin
aa08fb55ce
User Query: Don't blindly re-append new meta queries for capabilities.
...
fixes #21119 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28087 602fd350-edb4-49c9-b593-d223f7449a82
2014-04-12 19:03:56 +00:00
Andrew Nacin
5a7934a362
Fix a multisite test failure by testing an option that can be updated in multisite.
...
fixes #22936 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28067 602fd350-edb4-49c9-b593-d223f7449a82
2014-04-10 21:09:33 +00:00
Andrew Nacin
eef7258ca6
Update license copyright year to 2014.
...
fixes #27728 .
git-svn-id: https://develop.svn.wordpress.org/trunk@28064 602fd350-edb4-49c9-b593-d223f7449a82
2014-04-09 23:49:05 +00:00
Sergey Biryukov
df3eaf73cb
Fix copy/paste error in [27710].
...
props kovshenin.
fixes #21969 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27915 602fd350-edb4-49c9-b593-d223f7449a82
2014-04-02 23:46:34 +00:00
Andrew Nacin
e3171a42a3
Add PHP and JS unit tests for custom headers.
...
props mcsf, ehg.
see #21785 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27847 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-29 10:05:22 +00:00
Andrew Nacin
d8a3ebc173
JavaScript Unit Tests: Add Sinon (sinonjs.org) for test mocks, stubs, etc. see #21785 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27846 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-29 09:58:55 +00:00
Andrew Nacin
f0bd2b8a91
Texturize: Massive performance improvements (~600% faster); better handling of nbsp, double, and weird spaces; 136 new unit tests.
...
big props miqrogroove.
fixes #22692 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27839 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-29 07:15:33 +00:00
Andrew Nacin
05ea231402
Avoid infinite recursion in get_term_children() when a term is incorrectly a parent of itself.
...
props kovshenin.
fixes #27123 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27837 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-29 06:07:17 +00:00
Andrew Nacin
0ad35e169b
Revert the conversion of adjacent post queries to WP_Query. Explanation on the ticket.
...
Reverts [27285], [27286], [27287], [27288], [27291], [27292], [27293], [27296], [27633], [27634], [27635], and [27692].
see #26937 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27836 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-29 06:02:01 +00:00
Andrew Nacin
7a3c12d985
Add a unit test for shortlinks of a page on front.
...
see #26871 , see [27802].
git-svn-id: https://develop.svn.wordpress.org/trunk@27803 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-28 03:01:43 +00:00
Scott Taylor
17e4da2bd8
Remove html5
theme support on tearDown()
so theme settings don't leak into other tests.
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27795 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-27 20:54:08 +00:00
Scott Taylor
7b7e5305c7
In multi_resize()
image editor methods, assert that null
can only be passed for one of the arguments, not both. Add a lot more unit test assertions to ensure this.
...
Props pbearne, DH-Shredder.
Fixes #26823 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27794 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-27 20:39:08 +00:00
Scott Taylor
115f291221
Use wp_parse_id_list()
when parsing exclude_tree
in get_pages()
. Add unit tests to ensure a URL string, array with string as value, and array with array as value for exclude_tree
can be used to specify multiple IDs.
...
Props cgaffga, roothorick, hakre, tbrams for patches across the years.
Fixes #9153 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27767 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-27 01:17:41 +00:00
Andrew Nacin
28663b08e8
Remove select and input from wpautop()'s HTML blocks list.
...
props rachelbaker, DH-Shredder.
fixes #22230 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27761 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-27 00:00:17 +00:00
Scott Taylor
09c4928cf7
In wp_list_pages()
, add the current_page_item
class where applicable when used with a custom post type.
...
Adds a unit test.
Props nacin.
Fixes #17590 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27755 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-26 22:46:16 +00:00
Andrew Nacin
36496a3877
Revert [27166].
...
We should not be accounting for improper assignment of WP_Query properties.
fixes #26321 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27746 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-26 18:42:41 +00:00
Andrew Nacin
79ff680b93
WP_Theme: Return false from the display() method when get() fails.
...
Fixes a potential warning on the themes page when the active theme is deleted.
fixes #26873 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27745 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-26 18:21:45 +00:00
Helen Hou-Sandi
ccc5f363c0
Use Dashicon-style images for mime type icons. Actually moving to Dashicons via the font can be explored later, but has theme/plugin implications and requires too many changes to make it for 3.9. props melchoyce for the icons. fixes #26650 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27726 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-25 21:09:34 +00:00
Scott Taylor
815adc833a
Popular tags' edit links should respect the current post type. Adds unit test.
...
Props mordauk, fahmiadib.
Fixes #25566 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27720 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-25 18:39:26 +00:00
Andrew Nacin
fbb2e1dc89
Transients: Allow a non-expiring transient to be updated with an expiry.
...
props shahpranaf, sandyr.
fixes #22807 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27719 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-25 18:22:49 +00:00
Andrew Nacin
07eb830a9b
Ensure the $path is trailing-slashed in domain_exists().
...
Adds tests for [27717].
props ejdanderson, ericmann.
fixes #20589 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27718 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-25 17:39:08 +00:00
Andrew Nacin
c9531d6d67
Encode spaces in get_template_directory_uri() and get_stylesheet_directory_uri().
...
props SergeyBiryukov.
fixes #21969 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27710 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-25 13:06:21 +00:00
Andrew Nacin
3e28e2fae8
Multisite: Don't set the $super_admins global in grant_super_admin(), revoke_super_admin().
...
Adds tests and docs.
props jdgrimes.
see #27205 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27706 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-25 12:13:40 +00:00
Andrew Nacin
05f0bcabec
Use the current post's post type when determining post adjacency.
...
props ethitter.
fixes #26937 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27692 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-24 21:29:14 +00:00
Scott Taylor
82ba1702df
When using meta_query
in a WP_Query
, passing NOT EXISTS
or ''
to compare
should not require value
to be set. The resulting SQL should then produce the appropriate OR
clause for existence of non-existence after passing the query to the $key_only_queries
stack internally.
...
Adds unit tests.
Props chrisguitarguy, for the original patch.
Fixes #23268 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27689 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-24 19:56:54 +00:00
Scott Taylor
710f11f2df
When using WP_Query's "fields" => "ids"
(or "fields" => "id=>parent"
), the returned values should be an array of integers, not array of integers represented by strings.
...
Adds unit tests. All other unit tests pass.
Props danielbachhuber.
Fixes #27252 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27686 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-24 18:54:38 +00:00
Scott Taylor
651b4a5f5b
Fix the video shortcode unit test after [27519].
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27685 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-24 17:13:48 +00:00
Scott Taylor
88b610dc72
Fix a swath of broken unit tests from Tests_User_ListAuthors
.
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27684 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-24 16:52:38 +00:00
Andrew Ozz
2dc003fb02
Two files weren't deleted in [27679], see #27014
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27680 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-24 06:12:08 +00:00
Andrew Ozz
0898014ebd
Update the TinyMCE tests.
...
In 4.0.20 all tests were reworked. The 'testrunner' was removed and the PhantomJS Runner QUnit plugin was added making it possible to run the tests from cli. However it is still necessary to run the tests in all supported browsers to test the fixes for all browser quirks and normalization. Also all tests are loaded in one html file.
See #27014
git-svn-id: https://develop.svn.wordpress.org/trunk@27679 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-24 05:59:45 +00:00
Andrew Nacin
0963ea19a0
Fix various issues with WP_Adjacent_Post:
...
* Performance / number of queries.
* Incorrect results caused by sticky posts.
* Back compat for filters, which had used "WHERE" while WP_Query does not; and fixing table references.
props ethitter.
fixes #26937 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27635 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-20 02:58:48 +00:00
Andrew Nacin
681ca37c63
Return false from metadata_exists() if the get_$type_metadata filter returns a false value.
...
props xknown.
fixes #22746 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27562 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-17 19:39:31 +00:00
Andrew Nacin
05911cc3d4
Explicitly assign menu term relationship rather than piggybacking on wp_insert_post() with the tax_input argument.
...
That argument currently depends on user context (see #19373 ).
Adds unit test for properly updating orphaned menu items.
props danielbachhuber.
fixes #27113 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27556 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-15 06:06:41 +00:00
Andrew Nacin
f4cc32fac9
XML-RPC: In wp.editPost, Remove all terms in a taxonomy when an empty array is explicitly passed.
...
props jstraitiff, maxcutler.
fixes #26686 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27554 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-15 05:08:40 +00:00
Andrew Nacin
0ed014743d
Allow query strings for servers in IXR_Client and WP_HTTP_IXR_Client.
...
props cfinke.
fixes #26947 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27552 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-15 05:00:27 +00:00
Andrew Nacin
8355232a65
Avoid saving slashed data in XML-RPC's wp.setOptions.
...
props danielbachhuber.
fixes #22936 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27551 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-15 04:46:53 +00:00
Andrew Nacin
5adf89fe26
Pass feed_type arg in wp_list_authors() to get_author_feed_link().
...
Adds a slate of tests for wp_list_authors().
props MikeHansenMe.
fixes #26538 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27550 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-15 04:42:57 +00:00
John Blackbourn
22eb8b34ef
Improve paginate_links()
performance by not calling number_format_i18n()
unnecessarily. Fixes #25735 with tests. Props johnpbloch.
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27523 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-13 17:38:51 +00:00
Scott Taylor
36df368171
In WP_Query::get_queried_object()
, account for pre_get_posts
by checking for tag
when tag_id
isn't present. Tags still need to be rolled up into tax_query
. Add a unit test confirming expected query vars during and after pre_get_posts
.
...
Props mattonomics for a patch.
See #27362 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27511 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-12 04:07:41 +00:00
Andrew Nacin
020ba8e15a
Revert [27492]. see #27112 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27493 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-10 23:29:49 +00:00
Andrew Nacin
f36e40de2c
Add widget customizer tests missing from [27419]. see #27112 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27492 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-10 23:04:53 +00:00
Andrew Nacin
036cb74d46
Add unit tests for searching by relevance.
...
props wonderboymusic.
see #7394 , #20044 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27474 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-08 21:26:26 +00:00
Andrew Nacin
f225973b62
Allow $crop in add_image_size() to receive crop anchors (top, left, right, bottom, center).
...
This also applies to set_post_thumbnail_size() and image_resize_dimensions().
props bradt, wonderboymusic, DH-Shredder.
fixes #19393 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27472 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-08 06:13:27 +00:00
Scott Taylor
613b28cc81
Remove a cache-busting hack from Tests_Term_getTerms::test_get_terms_exclude_tree()
. It is no longer necessary after #14485 and #25711 .
...
See [27300].
Props SergeyBiryukov.
Fixes #27313 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27459 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-07 19:35:55 +00:00
Scott Taylor
3010c5aa20
In get_terms()
, leverage get_term_children()
over _get_term_children()
when making sure to show empty terms that have children in a hierarchical taxonomy while avoiding duplicates.
...
Adds unit test for `child_of` param. Adjusts unit tests for `get_terms()`.
See [27108] and [27125].
Props SergeyBiryukov.
Fixes #27123 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27458 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-07 19:29:01 +00:00
Scott Taylor
dfc11a170b
On second thought, allow posts_per_rss
to be set in pre_get_posts
to override the posts_per_rss
option. There are backwards compatibility concerns otherwise.
...
Props nacin.
Partially reverts [27455]. Updates the unit test. See #25380 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27456 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-07 18:58:33 +00:00
Scott Taylor
65932f71fd
When setting posts_per_page
in WP_Query::get_posts()
, check for is_feed()
in the same place where posts_per_page
is set when it is not already set. Previously, when is_feed()
was true, posts_per_page
would be arbitrarily overwritten. This fix allows posts_per_page
to be set during pre_get_posts
when is_feed()
is true and not be overwritten.
...
Adds unit test.
Props wokamoto.
Fixes #25380 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27455 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-07 18:32:40 +00:00
Andrew Nacin
a14b999605
Always convert auto-drafts to drafts in edit_draft() and _wp_translate_postdata().
...
This regressed due to refactoring in [26995]. This commit fixes Quick Draft.
see #25272 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27405 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-05 06:25:31 +00:00
Andrew Nacin
ed43f002b8
Add has_password and post_password query variables to WP_Query.
...
* has_password true means posts with passwords, false means posts without.
* post_password can query for posts with a particular password.
props wonderboymusic, robmiller.
fixes #20308 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27395 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-04 07:44:28 +00:00
Andrew Nacin
5edec1d792
Don't default to current user for capability checks when dealing with a post without an author (post_author = 0).
...
Undoes [12053]. While it risks breakage, this is a far safer and saner default for these situations.
props danielbachhuber.
fixes #27020 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27390 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-04 03:08:54 +00:00
Andrew Ozz
e5bed6707f
TinyMCE: update to 4.0.18, see #24067
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27387 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-04 01:56:57 +00:00
Andrew Nacin
eef62a9d0d
Update PHPMailer to 5.2.7 from 5.2.4.
...
Includes two trivial modifications for WordPress:
* Doesn't use the autoloader, so the check to enforce the autoloader from the constructor is removed.
* Requires class-smtp.php for backwards compatibility with direct (non-wp_mail()) uses of PHPMailer, as the autoloader isn't used.
props bpetty.
fixes #25560 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27385 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-03 20:24:31 +00:00
Andrew Nacin
260b7f08ca
Let get_the_date() accept a post object.
...
props tanner-m, adamsilverstein, bigdawggi.
fixes #13771 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27380 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-03 17:59:11 +00:00
Mark Jaquith
7937358328
Eliminate some of our last remaining create_function()
instances
...
* Moved some into private function callbacks
* Eliminated some that weren't necessary anymore
props obenland, markjaquith, nacin. fixes #14424
git-svn-id: https://develop.svn.wordpress.org/trunk@27373 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-03 16:20:12 +00:00
Sergey Biryukov
7f3c71eff3
Add missing word. props bassgang. fixes #27259 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27371 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-03 09:46:36 +00:00
Andrew Nacin
6869d203d0
Introduce get_site_by_path() and further rewrite the site detection process for multisite.
...
This is the first big step to supporting arbitrary domains and paths. In this new approach, sites are detected first where possible, then the network is inferred. Allows filtering for arbitrary path segments, smooths out some weirdness, and removes various restrictions. A sunrise plugin could do much of its work by adding filters, if those are even needed.
see #27003 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27359 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-02 22:24:50 +00:00
Sergey Biryukov
3038bdc80f
Restore $content_width global value after changing it in test_constrain_size_for_editor_*().
...
props ericlewis, georgestephanis, salcode, jorbin.
fixes #27256 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27358 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-02 22:22:41 +00:00
Sergey Biryukov
f213decc7e
Skip import tests if WordPress Importer plugin is missing.
...
props mattheu.
fixes #27250 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27349 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-02 10:34:58 +00:00
Andrew Nacin
8a617607a7
Strip backslashes, not just forward slashes, from untrailingslashit().
...
trailingslashit() will now remove any forward or backslashes from the end of a string before appending a forward slash.
props knutsp, willmot.
fixes #22267 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27344 602fd350-edb4-49c9-b593-d223f7449a82
2014-03-01 21:44:43 +00:00
Andrew Nacin
88f1b6e7ec
Add a $default argument to get_query_var() and WP_Query::get(). fixes #16471 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27304 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-26 23:57:10 +00:00
Andrew Nacin
68c8b9cf0f
Introduce doing_filter() and doing_action() to identify hooks in progress.
...
did_action() returns true the moment a hook is initially run, leaving you no way to tell if the hook is still in progress. Hooks can be nested and this checks the entire stack, versus current_filter() which only identifies the final hook in the stack. This commit also introduces current_action() for parity.
To tell if a hook has completed, one can use did_action() and ! doing_action() together.
The functions do not require an argument. In that situation, they indicate whether the stack is empty.
props ericmann for the initial unit tests.
fixes #14994 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27294 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-26 18:43:59 +00:00
Mark Jaquith
1d91296b3b
Return 404 when querying author's posts who is not a member and has no posts on the site
...
fixes #20601 . props yoavf, nacin, SergeyBiryukov, wonderboymusic, markjaquith.
git-svn-id: https://develop.svn.wordpress.org/trunk@27290 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-26 18:11:36 +00:00
Andrew Nacin
1d8d862e97
Make get_adjacent_post() wrap a new WP_Get_Adjacent_Post object that uses WP_Query.
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27285 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-26 17:09:54 +00:00
Andrew Nacin
a407ae2363
Allow user_id to be an array of IDs in WP_Comment_Query.
...
props mordauk.
fixes #27064 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27258 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-25 16:34:25 +00:00
Andrew Nacin
f8af178264
Use ext/mysqli in PHP 5.5 or greater. Expect minor explosions.
...
props aaroncampbell, pento.
see #21663 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27250 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-25 00:39:28 +00:00
Andrew Nacin
b74f222d33
Remove theme support for 'menus' in unregister_nav_menu() when there are no more menus.
...
props kovshenin.
fixes #26900 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27220 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-21 18:13:52 +00:00
Sergey Biryukov
1cda3b44cf
Add @ticket references. see #26903 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27197 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-20 02:20:40 +00:00
Scott Taylor
c2efafbddb
Add some more assertions to Tests_Query_Conditionals
, specifically for is_single()
, is_page()
, and is_attachment()
.
...
See [27016].
Fixes #24257 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27187 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-17 22:10:57 +00:00
Scott Taylor
7bdca44b97
Make WP_User_Query::prepare_query()
public by allowing it to be passed an array of args. Previously, if the WP_User_Query
constructor was not passed args, the object was basically unusable. Adds unit tests, all other tests pass.
...
Props scribu, for the initial patch.
Fixes #21119 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27185 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-17 21:40:04 +00:00
Scott Taylor
a31a167359
Reset $wp_query
and $post
during WP_UnitTestCase::tearDown()
to avoid spillage of globals between tests.
...
See #26321 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27183 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-17 21:03:43 +00:00
Andrew Ozz
920a9799cf
TinyMCE tests: remove 'coverage' for now, has unsatisfied dependencies. Tweak the test runner so it auto-starts. See #27014 .
...
git-svn-id: https://develop.svn.wordpress.org/trunk@27180 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-15 21:25:15 +00:00
Andrew Nacin
31d3af406c
Multisite: Add get_network_by_path() and wp_get_network() to begin cleanup of multisite load.
...
Tries to get network detection under control by simplifying wpmu_current_site(). It now also pops off each subdomain to find a more general match. Adds unit tests for get_network_by_path() and a new network factory for unit tests.
Much of this is likely to change in 3.9 as more of ms-load.php and ms-settings.php gets hacked to bits.
props jeremyfelt.
see #27003 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27178 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-13 23:06:12 +00:00
Andrew Nacin
36fe6c1c27
Don't use HTTPS in unit tests if OpenSSL isn't loaded.
...
props bpetty.
fixes #27114 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27168 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-12 20:39:21 +00:00
Scott Taylor
fd8d6cddcd
Don't iterate over $wp_query->posts
in update_post_thumbnail_cache()
if it is empty. Adds unit tests.
...
Props SergeyBiryukov, for the original patch.
Fixes #26321 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27166 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-12 04:48:14 +00:00
Scott Taylor
2e9d155703
Partially revert [27101], [27102], [27141], and [27142]. Those commits introduced new functions to sync up cache invalidation events. The current commit alters existing internals.
...
"The cache invalidation with static was introduced in r9102 with version 2.7. Multisite wasn't in core back then, so something like switch_to_blog() wasn't a concern, but now it breaks if you switch the blog in between calls to clean_term_cache."
This solution is simpler. All unit tests pass. Removes unnecessary tests linked to removed functions.
Props kovshenin.
Fixes #14485 , #22526 .
git-svn-id: https://develop.svn.wordpress.org/trunk@27163 602fd350-edb4-49c9-b593-d223f7449a82
2014-02-11 16:49:11 +00:00