Commit Graph

256 Commits

Author SHA1 Message Date
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 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 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 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 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