Commit Graph

293 Commits

Author SHA1 Message Date
scribu 2a99093ba9 Better way of settings tax related query flags. See #12891
git-svn-id: http://svn.automattic.com/wordpress/trunk@15733 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-10-06 11:13:37 +00:00
scribu 38888b588d Make hierarchical URLs work for any hierarchical taxonomy. See #12659
git-svn-id: http://svn.automattic.com/wordpress/trunk@15732 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-10-06 11:04:03 +00:00
scribu a8367fa6f2 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: http://svn.automattic.com/wordpress/trunk@15731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-10-06 10:40:30 +00:00
scribu 7630099b45 Revert part of [15713] to prevent notices. See #14645
git-svn-id: http://svn.automattic.com/wordpress/trunk@15729 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-10-05 22:42:47 +00:00
scribu f558d12bf0 Introduce WP_Object_Query. See #15032
git-svn-id: http://svn.automattic.com/wordpress/trunk@15715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-10-04 18:57:13 +00:00
scribu 1190c4094b Strip redundant 'meta_' from 'meta_query' keys. See #14645
git-svn-id: http://svn.automattic.com/wordpress/trunk@15714 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-10-04 18:26:26 +00:00
scribu 6107efe572 Recognize meta_query as a query var. Props aaroncampbell. Fixes #14645
git-svn-id: http://svn.automattic.com/wordpress/trunk@15713 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-10-04 17:51:17 +00:00
scribu 2bfd821b9b Allow search in archive pages. Fixes #14831
git-svn-id: http://svn.automattic.com/wordpress/trunk@15687 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-10-02 22:52:15 +00:00
scribu 688f990cd0 Split wp_filter_object_list() into wp_list_filter() and wp_list_pluck(). Fixes #15016
git-svn-id: http://svn.automattic.com/wordpress/trunk@15686 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-10-02 18:48:51 +00:00
scribu 70728369f9 Set 'cat' query var for backwards compatibility. Fixes #15007
git-svn-id: http://svn.automattic.com/wordpress/trunk@15685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-10-02 18:03:06 +00:00
scribu af5d4ba206 Do thorough resets in init() and init_query_flags(). Props coffee2code. Fixes #14976
git-svn-id: http://svn.automattic.com/wordpress/trunk@15672 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-09-27 23:48:03 +00:00
dd32 6dd01bf248 Do not generate invalid SQL for empty term archives. See #12891
git-svn-id: http://svn.automattic.com/wordpress/trunk@15652 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-09-24 12:09:44 +00:00
scribu 164be642a4 Consistently set $post_type to 'any' when a taxonomy query is involved. See [15649]. See #14589
git-svn-id: http://svn.automattic.com/wordpress/trunk@15650 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-09-23 23:19:47 +00:00
scribu 61cd7dffe0 Set $post_type to 'any' when taxonomies are involved (code resqued from r15613). See #12891
git-svn-id: http://svn.automattic.com/wordpress/trunk@15649 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-09-23 23:11:49 +00:00
ryan 6b351163ef Simplify sanitize_key() and use it in more places. see #14910
git-svn-id: http://svn.automattic.com/wordpress/trunk@15635 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-09-20 15:28:58 +00:00
nacin 75cdf1c0c4 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: http://svn.automattic.com/wordpress/trunk@15627 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-09-17 22:35:05 +00:00
scribu 168659371d Don't require category__in, tag__in etc. to be arrays necessarily. Fixes #14892
git-svn-id: http://svn.automattic.com/wordpress/trunk@15626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-09-17 22:27:22 +00:00
scribu 17c867e74b Remove extraneous sanitization of category_name. Leave it to wp_tax_query(). See #12891
git-svn-id: http://svn.automattic.com/wordpress/trunk@15625 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-09-17 17:07:11 +00:00
scribu 367e4916ee Allow plugins to manipulate the meta query args. See #14645
git-svn-id: http://svn.automattic.com/wordpress/trunk@15624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-09-17 16:08:35 +00:00
scribu 2030231f66 Clean up taxonomy queries in WP_Query. See #12891
git-svn-id: http://svn.automattic.com/wordpress/trunk@15613 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-09-13 16:44:14 +00:00
nacin 5a20c05d27 Phpdoc argument/@param cleanups. props duck_, see #14783.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15590 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-09-07 11:21:11 +00:00
markjaquith 4d44c562e4 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: http://svn.automattic.com/wordpress/trunk@15589 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-09-07 04:46:08 +00:00
scribu 80e2918946 Use _wp_meta_sql() in WP_Query. See #14572. See #14645
git-svn-id: http://svn.automattic.com/wordpress/trunk@15581 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-09-06 11:28:59 +00:00
scribu 349fbcaf30 update WP_Query docs. See #14600
git-svn-id: http://svn.automattic.com/wordpress/trunk@15547 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-08-28 11:09:18 +00:00
ryan 6ff179a805 is_* WP_Query methods. Props mdawaffe. fixes #14494
git-svn-id: http://svn.automattic.com/wordpress/trunk@15531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-08-25 18:05:33 +00:00
scribu f2614ac277 Safer hierarchical display check. Fixes #14600; See #14579
git-svn-id: http://svn.automattic.com/wordpress/trunk@15501 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-08-16 01:36:21 +00:00
nacin 65c1243ce3 More curses on PHP 5.0.5. see #13757, fixes #14160. for trunk.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15471 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-07-25 07:35:59 +00:00
nacin 6310ca6f21 Don't use deprecated functions. props filosofo, fixes #13854.
git-svn-id: http://svn.automattic.com/wordpress/trunk@15229 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-06-11 17:49:35 +00:00
ryan 33886d651b Don't force post_status to publish for custom taxonomy queries. fixes #13755
git-svn-id: http://svn.automattic.com/wordpress/trunk@15173 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-06-08 14:08:33 +00:00
ryan 1a552dd029 Strip trailing whitespace
git-svn-id: http://svn.automattic.com/wordpress/trunk@14924 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-26 02:42:15 +00:00
nacin 542c648ac5 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: http://svn.automattic.com/wordpress/trunk@14887 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-25 15:36:23 +00:00
ryan b5619ffd0c Fix pages setup in setup_postdata(). Props misterbisson. fixes #12651
git-svn-id: http://svn.automattic.com/wordpress/trunk@14750 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-19 18:39:48 +00:00
ryan 5a1f1bd685 Don't update_post_caches if a persistent object cache is installed. fixes #12611
git-svn-id: http://svn.automattic.com/wordpress/trunk@14665 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-15 15:00:53 +00:00
westi 08fc51b214 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: http://svn.automattic.com/wordpress/trunk@14607 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-13 20:39:54 +00:00
westi 175c994615 Add commentary about the posts_search filter. See #10667.
git-svn-id: http://svn.automattic.com/wordpress/trunk@14603 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-13 17:34:43 +00:00
nacin 70f36f6c41 More typos. see #13358.
git-svn-id: http://svn.automattic.com/wordpress/trunk@14588 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-12 21:03:33 +00:00
nacin 7734a07cb2 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: http://svn.automattic.com/wordpress/trunk@14585 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-12 20:45:18 +00:00
nacin b0eb3033ba Remove apparent debug cruft committed in [14401]. fixes #13355
git-svn-id: http://svn.automattic.com/wordpress/trunk@14565 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-11 18:28:12 +00:00
ryan 66502fba1a 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: http://svn.automattic.com/wordpress/trunk@14528 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-10 00:58:39 +00:00
nacin 8d7445c3e8 Fix start of week and SQL WEEK handling. props mdawaffe, fixes #10397.
git-svn-id: http://svn.automattic.com/wordpress/trunk@14499 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-07 05:01:29 +00:00
nacin 6c69044070 Prevent ambiguous table aliases in wp_post_mime_type_where. props stephdau, jfarthing84, fixes #12750.
git-svn-id: http://svn.automattic.com/wordpress/trunk@14478 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-06 18:03:05 +00:00
nacin 40da0a5720 Remove duplicated query var. props lriggle, fixes #13280.
git-svn-id: http://svn.automattic.com/wordpress/trunk@14477 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-06 17:49:54 +00:00
dd32 ce9fce6073 Handle $wp_query->query being a string in r14341. See #12391, #12047. Fixes #13241
git-svn-id: http://svn.automattic.com/wordpress/trunk@14445 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-04 18:08:03 +00:00
ryan 02c300164a White list instead of black list post types when searching. Props sivel. fixes #13183
git-svn-id: http://svn.automattic.com/wordpress/trunk@14419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-03 22:22:34 +00:00
ryan 7b7243d94a Strip trailing whites.
git-svn-id: http://svn.automattic.com/wordpress/trunk@14404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-03 20:26:11 +00:00
dd32 8213b95a67 s/#/ \/\/ / - Remove #comment with // comment in WP_Query
git-svn-id: http://svn.automattic.com/wordpress/trunk@14402 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-03 20:20:46 +00:00
dd32 e840bb1167 WP_Query whitespace cleanup, some loop cleanup as well
git-svn-id: http://svn.automattic.com/wordpress/trunk@14401 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-03 20:19:13 +00:00
dd32 be926482ce Fix custom WP_Queries when using page_on_front. Props aaroncampbell. See #12391 (Which caused it), Fixes #12047
git-svn-id: http://svn.automattic.com/wordpress/trunk@14341 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-05-02 21:28:11 +00:00
nacin 7ef5f08d00 Update object term cache for custom post types. props scribu, fixes #12989.
git-svn-id: http://svn.automattic.com/wordpress/trunk@14310 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-04-29 20:43:59 +00:00
ryan 702e3358ad 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: http://svn.automattic.com/wordpress/trunk@14245 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2010-04-26 22:12:28 +00:00