Commit Graph

468 Commits

Author SHA1 Message Date
Mark Jaquith 956b191c60 Use is_page_type_hierarchical(). props nacin. see #15140
git-svn-id: https://develop.svn.wordpress.org/trunk@16819 602fd350-edb4-49c9-b593-d223f7449a82
2010-12-08 21:17:01 +00:00
Mark Jaquith 08671532d3 Do not do slug logging/redirects for hierarchical post types. see #15140
git-svn-id: https://develop.svn.wordpress.org/trunk@16818 602fd350-edb4-49c9-b593-d223f7449a82
2010-12-08 21:10:38 +00:00
scribu cae6e8d4ef Set queried object on CPT archives. Fixes #15730
git-svn-id: https://develop.svn.wordpress.org/trunk@16792 602fd350-edb4-49c9-b593-d223f7449a82
2010-12-08 08:57:38 +00:00
Mark Jaquith 0c15540407 Cast to array, to avoid notices. props hakre. fixes #14997
git-svn-id: https://develop.svn.wordpress.org/trunk@16576 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-24 20:34:22 +00:00
scribu 156dc90ffe Remove debug cruft from [16543]. See #14590
git-svn-id: https://develop.svn.wordpress.org/trunk@16544 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-23 00:49:23 +00:00
scribu 86da62e436 Minor cleanup in queried object setting logic. See #14590
git-svn-id: https://develop.svn.wordpress.org/trunk@16543 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-23 00:47:45 +00:00
Andrew Nacin cf21cf2a89 Cast term_id to int for queried_object_id. props wojtek.szkutnik, fixes #14590.
git-svn-id: https://develop.svn.wordpress.org/trunk@16542 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-23 00:32:19 +00:00
scribu 0053f9b5e1 Prevent notice when checking for hierarchical tax rewrite. Props demetris. See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@16538 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-22 21:56:20 +00:00
scribu 6df13c0a90 Consider only IN tax queries when returning the queried object. See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@16531 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-22 05:14:47 +00:00
scribu eb6a65e501 Move s/ /+ out of WP_Query, so that 'category_name=Some Category' works again. See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@16526 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-21 16:33:05 +00:00
scribu 6401205f36 Don't do any taxonomy stuff if is_singular. See #15487
git-svn-id: https://develop.svn.wordpress.org/trunk@16515 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-20 21:51:21 +00:00
Ryan Boren f3e3c03abe array_unique() category__in and category__not_in to eliminate dupes from multiple runs of parse_tax_query(). Fixes canonical redirects for cat, category__in, and category__not_in requests. see #12891 #15487
git-svn-id: https://develop.svn.wordpress.org/trunk@16513 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-20 21:43:19 +00:00
scribu a825250771 Fix logic for when excluding a non-existant term. See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@16512 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-20 21:28:50 +00:00
Ryan Boren 75453e5e2d If the queried term does not exist make sure no posts are returned in the query rather than falling through to querying all posts. Fixes 404s when querying cats that do not exist. see #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@16511 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-20 21:10:20 +00:00
scribu 3e8a8c96cf Remove debug cruft from [16505]. See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@16506 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-20 13:48:24 +00:00
scribu 6020138317 Don't set post_type to 'any' for category and tag queries. See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@16505 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-20 13:39:07 +00:00
Mark Jaquith 103bde3e19 Do not set is_category/is_tax/is_tax for is_singular requests. props mtekk. fixes #15487
git-svn-id: https://develop.svn.wordpress.org/trunk@16495 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-19 19:25:53 +00:00
scribu 90de63b3ad Force GROUP BY when there's a tax query. See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@16482 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-19 09:17:59 +00:00
Andrew Nacin ba37b82b10 Allow is_feed() to drill down the feed being checked. props johnbillion for initial patch, fixes #15460.
git-svn-id: https://develop.svn.wordpress.org/trunk@16447 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-18 03:19:08 +00:00
Ryan Boren 4b33a0e9c4 Pinking shears
git-svn-id: https://develop.svn.wordpress.org/trunk@16438 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-17 18:47:34 +00:00
scribu 1298668d9a Re-introduce ->tax_query as a read-only var. See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@16414 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-17 02:04:08 +00:00
scribu 92fae02550 Optimize get_tax_sql(). See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@16413 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-17 01:56:01 +00:00
scribu 9242c290b3 Revert [16402] outright. Causes issues with themes. See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@16404 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-16 16:36:20 +00:00
scribu 93b63b771c Don't pollute the 'tax_query' query var. See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@16402 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-16 16:22:09 +00:00
scribu ecad0a9016 Revert [16384]. See #15433
git-svn-id: https://develop.svn.wordpress.org/trunk@16385 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-15 15:23:04 +00:00
scribu 4c4e5ed0df Ignore 'name' qv if 'p' qv is set. Fixes #15433
git-svn-id: https://develop.svn.wordpress.org/trunk@16384 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-15 13:33:16 +00:00
scribu e72a75d2d6 Set 'taxonomy' and 'term' query vars for back-compat. Fixes #12659
git-svn-id: https://develop.svn.wordpress.org/trunk@16381 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-15 10:51:39 +00:00
scribu ed4788b696 Re-parse tax query just before calling get_tax_sql(). Fixes #15161
git-svn-id: https://develop.svn.wordpress.org/trunk@16380 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-15 10:11:25 +00:00
scribu c38380fd8f Update doc for WP_Query::post. Fixes #15105
git-svn-id: https://develop.svn.wordpress.org/trunk@16360 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-13 23:32:18 +00:00
scribu a8160ed916 Kill WP_Object_Query. See #15032
git-svn-id: https://develop.svn.wordpress.org/trunk@16353 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-13 18:32:43 +00:00
scribu 6daedd550c Revert most of [16018]. See #15032
git-svn-id: https://develop.svn.wordpress.org/trunk@16352 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-13 18:26:15 +00:00
Ryan Boren 8ad934c85d Prevent stomping of global. Props prettyboymp. fixes #13945
git-svn-id: https://develop.svn.wordpress.org/trunk@16303 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-11 16:22:18 +00:00
scribu f337bb1b86 Add context to get_meta_sql(). See #15018
git-svn-id: https://develop.svn.wordpress.org/trunk@16286 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-11 10:06:05 +00:00
Andrew Nacin d50013b957 Ensure we have a valid post type object when checking for has_archive. props filosofo, fixes #15364.
git-svn-id: https://develop.svn.wordpress.org/trunk@16276 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-10 16:42:59 +00:00
scribu 83738d47f4 Make get_tax_sql() a standalone function. See #15032
git-svn-id: https://develop.svn.wordpress.org/trunk@16267 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-09 23:30:35 +00:00
scribu c0be4fafcf Make get_meta_sql() a standalone function. See #15032
git-svn-id: https://develop.svn.wordpress.org/trunk@16266 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-09 23:22:13 +00:00
scribu 5a2a86f84a Allow mix of 'taxonomy' => 'foo', 'term' => 'bar' and 'foo2' => 'bar2'. Props filosofo. Fixes #15363
git-svn-id: https://develop.svn.wordpress.org/trunk@16259 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-09 16:45:51 +00:00
scribu 4754dbd2c6 Set 'operator' field. Fixes #15350. See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@16258 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-09 12:27:03 +00:00
scribu e07b7bbdc5 Use wp_basename() in WP_Query too. See #11887
git-svn-id: https://develop.svn.wordpress.org/trunk@16155 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-02 17:28:28 +00:00
scribu 033dc3afa2 Just pass meta type to get_meta_sql(). See #15032
git-svn-id: https://develop.svn.wordpress.org/trunk@16143 602fd350-edb4-49c9-b593-d223f7449a82
2010-11-01 20:34:54 +00:00
scribu 33e3ef1367 Remove check on unexistant $ids var in WP_Query::get_posts. Props Utkarsh. See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@16116 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-31 11:28:49 +00:00
Ryan Boren af17458ed9 get_queried_obecjt() and get_queried_object_id(). Props filosofo. fixes #14015
git-svn-id: https://develop.svn.wordpress.org/trunk@16091 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-29 20:48:54 +00:00
scribu 0ba17a703a Make get_meta_sql() return associative array. See #15032
git-svn-id: https://develop.svn.wordpress.org/trunk@16053 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-28 17:02:37 +00:00
scribu 174c0acfb4 Move get() and set() methods from WP_Query to WP_Object_Query. See #15032
git-svn-id: https://develop.svn.wordpress.org/trunk@16018 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-27 18:16:52 +00:00
scribu 1c9a241148 Introduce 'fields' query var to WP_Query. See #14777
git-svn-id: https://develop.svn.wordpress.org/trunk@15982 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-26 19:01:55 +00:00
Andrew Nacin 4738e732ae Remove dead arguments. see [15937], see #13818, props dd32.
git-svn-id: https://develop.svn.wordpress.org/trunk@15942 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-24 03:27:01 +00:00
Andrew Nacin 6eb9fbbd39 Remove post_type params from is_archive(). use is_post_type_archive() for full context. see #13818.
git-svn-id: https://develop.svn.wordpress.org/trunk@15937 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-23 19:20:47 +00:00
Andrew Nacin 6d7366d5fc Move the CPT archive flag outside of the rewrite argument, into its own has_archive. has_archive controls more than just URL rewriting, it also handles whether ?post_type= is treated as a CPT archive. feeds remain in rewrite as ?feed= would work regardless. see #13818.
git-svn-id: https://develop.svn.wordpress.org/trunk@15936 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-23 18:29:22 +00:00
Andrew Nacin 4d0164db91 Remove some capability_type code in WP_Query. Only build faux caps if we're querying for multiple post types or if the post type object can't be found. see #14122.
git-svn-id: https://develop.svn.wordpress.org/trunk@15935 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-23 18:16:41 +00:00
scribu ed9a39abab Introduce sanitize_title_for_query(). See #9591
git-svn-id: https://develop.svn.wordpress.org/trunk@15929 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-23 12:55:55 +00:00
scribu 3081a12de2 Introduce _qv_basename() and apply it to hierarchical taxonomies. See #9591.
git-svn-id: https://develop.svn.wordpress.org/trunk@15923 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-22 22:54:05 +00:00
scribu 890c0ead1c Remove misplaced code in WP_Query::parse_tax_query(). See #12659
git-svn-id: https://develop.svn.wordpress.org/trunk@15921 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-22 21:17:09 +00:00
scribu 8315655230 Revert accidental changes to WP_Query made in [15887]. See #14163
git-svn-id: https://develop.svn.wordpress.org/trunk@15888 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-21 14:06:52 +00:00
scribu a3ef15ffc0 Allow filtering comments by user_id via URL. Props neoxx. Fixes #14163
git-svn-id: https://develop.svn.wordpress.org/trunk@15887 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-21 14:03:25 +00:00
scribu 188f3458f9 Fix tax=term1+term2 queries. See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@15874 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-20 19:00:57 +00:00
scribu 2b08f69b50 Fix 'taxonomy' and 'term' query var logic. See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@15860 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-20 12:07:23 +00:00
scribu 6b80426cfa Re-add the ability to filter by 'taxonomy' and 'term' query vars. Fixes #13582. See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@15850 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-19 14:41:30 +00:00
Dion Hulse 1027248cee Limit wp_old_slug_redirect() to redirecting to only posts of the same post_type kind. See #15140
git-svn-id: https://develop.svn.wordpress.org/trunk@15848 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-19 10:27:34 +00:00
Andrew Nacin fb4e38b0e7 Pinking shears.
git-svn-id: https://develop.svn.wordpress.org/trunk@15843 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-19 07:48:22 +00:00
Dion Hulse 5a1373ddd6 Use $wpdb->prepare in wp_old_slug_redirect(). See #15140
git-svn-id: https://develop.svn.wordpress.org/trunk@15832 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-18 11:44:19 +00:00
Dion Hulse a5da762a4e Prevent notices on non-existent Term locations (such as /tag/404-non-existant-term/)
git-svn-id: https://develop.svn.wordpress.org/trunk@15827 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-17 06:14:58 +00:00
Dion Hulse d7b230ca26 Merge Category/Tag URL creation/rewriting into general Taxonomy system. Removes the legacy handling for these url's. See #12659
git-svn-id: https://develop.svn.wordpress.org/trunk@15825 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-17 05:41:22 +00:00
Dion Hulse a47b78e95b Move hierarchical_url to $args['rewrite']['hierarchical']
git-svn-id: https://develop.svn.wordpress.org/trunk@15824 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-17 04:36:26 +00:00
Andrew Nacin 38092bb128 Custom post type archives, second pass. see #13818.
git-svn-id: https://develop.svn.wordpress.org/trunk@15819 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-15 19:44:57 +00:00
Andrew Nacin 86ab32a196 Custom post type archives. see #13818.
git-svn-id: https://develop.svn.wordpress.org/trunk@15803 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-14 10:39:47 +00:00
scribu ea756a6b40 Sacrifice DRY for readability in WP_Query. Props nacin for initial patch. See #14997
git-svn-id: https://develop.svn.wordpress.org/trunk@15795 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-13 16:37:01 +00:00
scribu d5e50c918b Add posts_clauses_request filter too. Props hakre. See #14997
git-svn-id: https://develop.svn.wordpress.org/trunk@15794 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-13 15:49:26 +00:00
scribu 6d33bb68e9 Restore previous filter order in WP_Query. See #14997
git-svn-id: https://develop.svn.wordpress.org/trunk@15791 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-13 13:45:53 +00:00
scribu 53d8aaf3fc Introduce wp_query_clauses filter. Fixes #14997
git-svn-id: https://develop.svn.wordpress.org/trunk@15775 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-11 15:04:44 +00:00
scribu 253cc18443 don't re-urlencode taxonomy query vars. See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@15773 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-11 12:18:42 +00:00
scribu a080a0a289 Fix warning caused by empty meta query. See #14645
git-svn-id: https://develop.svn.wordpress.org/trunk@15768 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-09 12:18:52 +00:00
scribu a3ee8cac1a Get rid of redundant $this->meta_query. See #14645
git-svn-id: https://develop.svn.wordpress.org/trunk@15766 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-09 10:48:13 +00:00
scribu c4a14ee8d9 Get rid of redundant ->tax_query. See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@15765 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-09 10:19:15 +00:00
scribu ccbf85c82d Remove debug cruft introduced by [15751]. See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@15752 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-07 21:50:32 +00:00
scribu f4ed3e239c Add 'tax_query' as public query var. See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@15751 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-07 21:47:52 +00:00
scribu 7cd352d4b8 Better way of settings tax related query flags. See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@15733 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-06 11:13:37 +00:00
scribu d6e6296b89 Make hierarchical URLs work for any hierarchical taxonomy. See #12659
git-svn-id: https://develop.svn.wordpress.org/trunk@15732 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-06 11:04:03 +00:00
scribu 448f74675a Generalize taxonomy queries:
* transform wp_tax_query() into WP_Object_Query::get_tax_sql()
	* create parse_tax_query() method in WP_Query
	* add doc-block for $tax_query and $meta_query
See #15032. See #12891.


git-svn-id: https://develop.svn.wordpress.org/trunk@15731 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-06 10:40:30 +00:00
scribu 39d1200d5c Revert part of [15713] to prevent notices. See #14645
git-svn-id: https://develop.svn.wordpress.org/trunk@15729 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-05 22:42:47 +00:00
scribu a811171a0c Introduce WP_Object_Query. See #15032
git-svn-id: https://develop.svn.wordpress.org/trunk@15715 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-04 18:57:13 +00:00
scribu ec8503802e Strip redundant 'meta_' from 'meta_query' keys. See #14645
git-svn-id: https://develop.svn.wordpress.org/trunk@15714 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-04 18:26:26 +00:00
scribu 68f22e028e Recognize meta_query as a query var. Props aaroncampbell. Fixes #14645
git-svn-id: https://develop.svn.wordpress.org/trunk@15713 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-04 17:51:17 +00:00
scribu 3791a39615 Allow search in archive pages. Fixes #14831
git-svn-id: https://develop.svn.wordpress.org/trunk@15687 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-02 22:52:15 +00:00
scribu c063cc13bb Split wp_filter_object_list() into wp_list_filter() and wp_list_pluck(). Fixes #15016
git-svn-id: https://develop.svn.wordpress.org/trunk@15686 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-02 18:48:51 +00:00
scribu 455d7463c1 Set 'cat' query var for backwards compatibility. Fixes #15007
git-svn-id: https://develop.svn.wordpress.org/trunk@15685 602fd350-edb4-49c9-b593-d223f7449a82
2010-10-02 18:03:06 +00:00
scribu 898ba9b2b2 Do thorough resets in init() and init_query_flags(). Props coffee2code. Fixes #14976
git-svn-id: https://develop.svn.wordpress.org/trunk@15672 602fd350-edb4-49c9-b593-d223f7449a82
2010-09-27 23:48:03 +00:00
Dion Hulse b5f0bf47ac Do not generate invalid SQL for empty term archives. See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@15652 602fd350-edb4-49c9-b593-d223f7449a82
2010-09-24 12:09:44 +00:00
scribu d004c99ea6 Consistently set $post_type to 'any' when a taxonomy query is involved. See [15649]. See #14589
git-svn-id: https://develop.svn.wordpress.org/trunk@15650 602fd350-edb4-49c9-b593-d223f7449a82
2010-09-23 23:19:47 +00:00
scribu 9e37c78da3 Set $post_type to 'any' when taxonomies are involved (code resqued from r15613). See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@15649 602fd350-edb4-49c9-b593-d223f7449a82
2010-09-23 23:11:49 +00:00
Ryan Boren df6d5550db Simplify sanitize_key() and use it in more places. see #14910
git-svn-id: https://develop.svn.wordpress.org/trunk@15635 602fd350-edb4-49c9-b593-d223f7449a82
2010-09-20 15:28:58 +00:00
Andrew Nacin 17e249f359 Fix logic inversion in r15626. see #14892. Also note that r15626 fixed a s/is_category/is_tag/ typo introduced in r6011, on line 1340.
git-svn-id: https://develop.svn.wordpress.org/trunk@15627 602fd350-edb4-49c9-b593-d223f7449a82
2010-09-17 22:35:05 +00:00
scribu 03a3e5c1d9 Don't require category__in, tag__in etc. to be arrays necessarily. Fixes #14892
git-svn-id: https://develop.svn.wordpress.org/trunk@15626 602fd350-edb4-49c9-b593-d223f7449a82
2010-09-17 22:27:22 +00:00
scribu c1ce7ddc38 Remove extraneous sanitization of category_name. Leave it to wp_tax_query(). See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@15625 602fd350-edb4-49c9-b593-d223f7449a82
2010-09-17 17:07:11 +00:00
scribu 89382ae313 Allow plugins to manipulate the meta query args. See #14645
git-svn-id: https://develop.svn.wordpress.org/trunk@15624 602fd350-edb4-49c9-b593-d223f7449a82
2010-09-17 16:08:35 +00:00
scribu 5c95616ce8 Clean up taxonomy queries in WP_Query. See #12891
git-svn-id: https://develop.svn.wordpress.org/trunk@15613 602fd350-edb4-49c9-b593-d223f7449a82
2010-09-13 16:44:14 +00:00
Andrew Nacin 9494e4ce7e Phpdoc argument/@param cleanups. props duck_, see #14783.
git-svn-id: https://develop.svn.wordpress.org/trunk@15590 602fd350-edb4-49c9-b593-d223f7449a82
2010-09-07 11:21:11 +00:00
Mark Jaquith 93680ad646 Rename caller_get_posts WP_Query flag to ignore_sticky_posts, because that is the only thing it does. fixes #14624. props scribu
git-svn-id: https://develop.svn.wordpress.org/trunk@15589 602fd350-edb4-49c9-b593-d223f7449a82
2010-09-07 04:46:08 +00:00
scribu 7ddd031d75 Use _wp_meta_sql() in WP_Query. See #14572. See #14645
git-svn-id: https://develop.svn.wordpress.org/trunk@15581 602fd350-edb4-49c9-b593-d223f7449a82
2010-09-06 11:28:59 +00:00
scribu ad904f3307 update WP_Query docs. See #14600
git-svn-id: https://develop.svn.wordpress.org/trunk@15547 602fd350-edb4-49c9-b593-d223f7449a82
2010-08-28 11:09:18 +00:00
Ryan Boren a4ce5b114b is_* WP_Query methods. Props mdawaffe. fixes #14494
git-svn-id: https://develop.svn.wordpress.org/trunk@15531 602fd350-edb4-49c9-b593-d223f7449a82
2010-08-25 18:05:33 +00:00
scribu 6d510588aa Safer hierarchical display check. Fixes #14600; See #14579
git-svn-id: https://develop.svn.wordpress.org/trunk@15501 602fd350-edb4-49c9-b593-d223f7449a82
2010-08-16 01:36:21 +00:00
Andrew Nacin 85394e795e More curses on PHP 5.0.5. see #13757, fixes #14160. for trunk.
git-svn-id: https://develop.svn.wordpress.org/trunk@15471 602fd350-edb4-49c9-b593-d223f7449a82
2010-07-25 07:35:59 +00:00
Andrew Nacin ec9f6d34cb Don't use deprecated functions. props filosofo, fixes #13854.
git-svn-id: https://develop.svn.wordpress.org/trunk@15229 602fd350-edb4-49c9-b593-d223f7449a82
2010-06-11 17:49:35 +00:00
Ryan Boren 1006d5b101 Don't force post_status to publish for custom taxonomy queries. fixes #13755
git-svn-id: https://develop.svn.wordpress.org/trunk@15173 602fd350-edb4-49c9-b593-d223f7449a82
2010-06-08 14:08:33 +00:00
Ryan Boren aec821c651 Strip trailing whitespace
git-svn-id: https://develop.svn.wordpress.org/trunk@14924 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-26 02:42:15 +00:00
Andrew Nacin 5bc3a62137 Give is_singular the ability to provide awareness/context for custom post types. props ryan, scribu. Usage: is_singular('book') or is_singular( array( 'newspapers', 'books' ) ). fixes #12588.
git-svn-id: https://develop.svn.wordpress.org/trunk@14887 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-25 15:36:23 +00:00
Ryan Boren 8203d22175 Fix pages setup in setup_postdata(). Props misterbisson. fixes #12651
git-svn-id: https://develop.svn.wordpress.org/trunk@14750 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-19 18:39:48 +00:00
Ryan Boren 14d8731a49 Don't update_post_caches if a persistent object cache is installed. fixes #12611
git-svn-id: https://develop.svn.wordpress.org/trunk@14665 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-15 15:00:53 +00:00
Peter Westwood 728b90a13b Introduce wp_reset_postdata(). Use it to reset the post global for the current query_posts() call after using a loop with a new WP_Query object. Fixes #12320 props scribu.
git-svn-id: https://develop.svn.wordpress.org/trunk@14607 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-13 20:39:54 +00:00
Peter Westwood f782838830 Add commentary about the posts_search filter. See #10667.
git-svn-id: https://develop.svn.wordpress.org/trunk@14603 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-13 17:34:43 +00:00
Andrew Nacin 490a0a99cd More typos. see #13358.
git-svn-id: https://develop.svn.wordpress.org/trunk@14588 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-12 21:03:33 +00:00
Andrew Nacin 323342deec Move post type object capabilities to a 'cap' object. Allow them to be initialized via the 'capabilities' key (an array) when registering support for the post type. Caps are now referred to by the name of the cap as if it was a post, i.e. ->cap->edit_post. see #13358.
git-svn-id: https://develop.svn.wordpress.org/trunk@14585 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-12 20:45:18 +00:00
Andrew Nacin d620c50f96 Remove apparent debug cruft committed in [14401]. fixes #13355
git-svn-id: https://develop.svn.wordpress.org/trunk@14565 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-11 18:28:12 +00:00
Ryan Boren ee0b76261b Allow turning off object_term and postmeta cache updates. Turn off object_term updates in the wp_get_nav_menu_items() get_posts() query to avoid useless taxonomy query.
git-svn-id: https://develop.svn.wordpress.org/trunk@14528 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-10 00:58:39 +00:00
Andrew Nacin c100b80c20 Fix start of week and SQL WEEK handling. props mdawaffe, fixes #10397.
git-svn-id: https://develop.svn.wordpress.org/trunk@14499 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-07 05:01:29 +00:00
Andrew Nacin cba25aba7e Prevent ambiguous table aliases in wp_post_mime_type_where. props stephdau, jfarthing84, fixes #12750.
git-svn-id: https://develop.svn.wordpress.org/trunk@14478 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-06 18:03:05 +00:00
Andrew Nacin 0b3e082d6e Remove duplicated query var. props lriggle, fixes #13280.
git-svn-id: https://develop.svn.wordpress.org/trunk@14477 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-06 17:49:54 +00:00
Dion Hulse 12196261a4 Handle $wp_query->query being a string in r14341. See #12391, #12047. Fixes #13241
git-svn-id: https://develop.svn.wordpress.org/trunk@14445 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-04 18:08:03 +00:00
Ryan Boren d2b4e092aa White list instead of black list post types when searching. Props sivel. fixes #13183
git-svn-id: https://develop.svn.wordpress.org/trunk@14419 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-03 22:22:34 +00:00
Ryan Boren d783952469 Strip trailing whites.
git-svn-id: https://develop.svn.wordpress.org/trunk@14404 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-03 20:26:11 +00:00
Dion Hulse d28dcf1ef6 s/#/ \/\/ / - Remove #comment with // comment in WP_Query
git-svn-id: https://develop.svn.wordpress.org/trunk@14402 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-03 20:20:46 +00:00
Dion Hulse aa7c1d8a41 WP_Query whitespace cleanup, some loop cleanup as well
git-svn-id: https://develop.svn.wordpress.org/trunk@14401 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-03 20:19:13 +00:00
Dion Hulse 65aac68cd6 Fix custom WP_Queries when using page_on_front. Props aaroncampbell. See #12391 (Which caused it), Fixes #12047
git-svn-id: https://develop.svn.wordpress.org/trunk@14341 602fd350-edb4-49c9-b593-d223f7449a82
2010-05-02 21:28:11 +00:00
Andrew Nacin fbac23f1eb Update object term cache for custom post types. props scribu, fixes #12989.
git-svn-id: https://develop.svn.wordpress.org/trunk@14310 602fd350-edb4-49c9-b593-d223f7449a82
2010-04-29 20:43:59 +00:00
Ryan Boren 3e9cc3ebd9 The read_post cap cannot be checked for sticky posts because not logged in users don't have any caps. see #11197
git-svn-id: https://develop.svn.wordpress.org/trunk@14245 602fd350-edb4-49c9-b593-d223f7449a82
2010-04-26 22:12:28 +00:00
Dion Hulse 4c6df3a2e4 Ignore sticky posts which the current user cannot read, Ignore sticky posts which have been explicitly excluded with 'post__not_in'. Fixes #11197
git-svn-id: https://develop.svn.wordpress.org/trunk@14217 602fd350-edb4-49c9-b593-d223f7449a82
2010-04-24 06:04:05 +00:00
Dion Hulse 6f89c1a63a Remove double-query for Author ID. Props simonwheatley. Fixes #12048
git-svn-id: https://develop.svn.wordpress.org/trunk@14160 602fd350-edb4-49c9-b593-d223f7449a82
2010-04-19 10:50:03 +00:00
Andrew Nacin a8d984183f Fix sticky post handling. Use unset instead of array_splice to remove an item by key retrieved by array_search. props jeffstieler, fixes #11966.
git-svn-id: https://develop.svn.wordpress.org/trunk@14135 602fd350-edb4-49c9-b593-d223f7449a82
2010-04-18 05:11:05 +00:00
Dion Hulse 66e73d0f64 Respect the post_type param for Taxonomy Queries, Props Otto & Dougal Campbell. Restrict Attachment post_status joins to queries involving attachment results ("any" or "attachment"). See #13020
git-svn-id: https://develop.svn.wordpress.org/trunk@14121 602fd350-edb4-49c9-b593-d223f7449a82
2010-04-17 09:03:33 +00:00
Andrew Nacin 028f262ccf Introduce the wp_filter_object_list() helper, with an $operator arg. Fixes an intersection bug in get_post_types() and get_taxonomies(). Also switches $operator default from 'or' to 'and' for get_post_stati(). props scribu, fixes #12966.
git-svn-id: https://develop.svn.wordpress.org/trunk@14108 602fd350-edb4-49c9-b593-d223f7449a82
2010-04-16 14:08:58 +00:00
Dion Hulse d648c8b9dd Alternative implementation of custom post_type query_var handling. fills name & pagename for custom post_types to reduce amount of code duplication. See #12704
git-svn-id: https://develop.svn.wordpress.org/trunk@14072 602fd350-edb4-49c9-b593-d223f7449a82
2010-04-11 13:51:24 +00:00
Dion Hulse e28019c1ec Fix a case where $post_type = 'any' causes a large query to run without any specifications (post_name/limits/id/etc). See #12704
git-svn-id: https://develop.svn.wordpress.org/trunk@14027 602fd350-edb4-49c9-b593-d223f7449a82
2010-04-07 08:29:46 +00:00
Dion Hulse 99359a2b48 Remove Debug cruft.. See #12704
git-svn-id: https://develop.svn.wordpress.org/trunk@13839 602fd350-edb4-49c9-b593-d223f7449a82
2010-03-27 06:03:58 +00:00
Dion Hulse 9cd846b401 Support multiple post_type query params/post_type's to be specified in a query. See #12704
git-svn-id: https://develop.svn.wordpress.org/trunk@13838 602fd350-edb4-49c9-b593-d223f7449a82
2010-03-27 05:56:27 +00:00
Andrew Nacin 4f5a2095a8 Remove trailing whites and double semicolons.
git-svn-id: https://develop.svn.wordpress.org/trunk@13830 602fd350-edb4-49c9-b593-d223f7449a82
2010-03-26 19:36:49 +00:00
Dion Hulse af3144f092 When viewing a Parent term in a hierarchical taxonomy, display objects contained within children too. Props scribu. Fixes #12533
git-svn-id: https://develop.svn.wordpress.org/trunk@13787 602fd350-edb4-49c9-b593-d223f7449a82
2010-03-21 02:52:00 +00:00
Dion Hulse 6be1550e75 Add hierarchical support for custom post_types in Rewrite Rules & Querying. See #12643
git-svn-id: https://develop.svn.wordpress.org/trunk@13774 602fd350-edb4-49c9-b593-d223f7449a82
2010-03-20 02:23:52 +00:00
Andrew Nacin dd306def81 Remove redundant isset() and empty() checks.
git-svn-id: https://develop.svn.wordpress.org/trunk@13770 602fd350-edb4-49c9-b593-d223f7449a82
2010-03-19 21:29:21 +00:00
Peter Westwood f93010c7ff Make use of apply_filters_ref_array() when running the query. Fixes #9886 props scribu.
git-svn-id: https://develop.svn.wordpress.org/trunk@13758 602fd350-edb4-49c9-b593-d223f7449a82
2010-03-18 21:55:25 +00:00
Ryan Boren e61755c853 Trim trailing whitespace
git-svn-id: https://develop.svn.wordpress.org/trunk@13733 602fd350-edb4-49c9-b593-d223f7449a82
2010-03-17 16:27:25 +00:00
Mark Jaquith 8bca8131a6 More pedantry. "Setup" is not a verb. http://notaverb.com/setup
git-svn-id: https://develop.svn.wordpress.org/trunk@13725 602fd350-edb4-49c9-b593-d223f7449a82
2010-03-17 04:39:50 +00:00
Dion Hulse e7b6cd83c7 Prevent PHP Notices on 404 pages
git-svn-id: https://develop.svn.wordpress.org/trunk@13691 602fd350-edb4-49c9-b593-d223f7449a82
2010-03-13 07:47:20 +00:00
Ryan Boren 78ef621011 Add no_found_rows argument to WP_Query::get_posts() to allow forcibly defeating SQL_CALC_FOUND_ROWS. Use no_found_rows for the query in get_boundary_post(). fixes #12557
git-svn-id: https://develop.svn.wordpress.org/trunk@13647 602fd350-edb4-49c9-b593-d223f7449a82
2010-03-10 18:37:03 +00:00
Dion Hulse d2232722ea Don't 404 for empty custom taxonomy terms. See #12533
git-svn-id: https://develop.svn.wordpress.org/trunk@13615 602fd350-edb4-49c9-b593-d223f7449a82
2010-03-07 00:42:50 +00:00
Dion Hulse 5f43ce3a7b Add meta_value_num meta_key ordering for WP_Query. Allows Natural numeric ordering of results. Props stencil & scribu for cleanups. Fixes #10649
git-svn-id: https://develop.svn.wordpress.org/trunk@13501 602fd350-edb4-49c9-b593-d223f7449a82
2010-02-28 12:49:10 +00:00
Dion Hulse 0f8493b92b Revert part of r13486, is_tax() is false for tags||categories. See #11904
git-svn-id: https://develop.svn.wordpress.org/trunk@13495 602fd350-edb4-49c9-b593-d223f7449a82
2010-02-28 09:45:52 +00:00
Dion Hulse bfe10ba981 Re-use /page/xx/ for Post Paging on Page_on_front. Few fixes related to paging on front page. Fixes #12391
git-svn-id: https://develop.svn.wordpress.org/trunk@13494 602fd350-edb4-49c9-b593-d223f7449a82
2010-02-28 09:40:42 +00:00
Dion Hulse e7721041df When using Page on front, Do not jump back to Blog listing when per-page query vars are set. Fixes #12047
git-svn-id: https://develop.svn.wordpress.org/trunk@13493 602fd350-edb4-49c9-b593-d223f7449a82
2010-02-28 09:19:34 +00:00
Dion Hulse 4070e39a15 Initialise Search related query vars. Props scribu. Fixes #11480
git-svn-id: https://develop.svn.wordpress.org/trunk@13492 602fd350-edb4-49c9-b593-d223f7449a82
2010-02-28 07:47:11 +00:00
Dion Hulse 10355ed13c More powerful version is is_tax(). Props filosofo, scribu. Adds $term parameter. Fixes #11904
git-svn-id: https://develop.svn.wordpress.org/trunk@13486 602fd350-edb4-49c9-b593-d223f7449a82
2010-02-28 05:59:39 +00:00