[wp-trac] [WordPress Trac] #25552: Functional Docs: WP_Date_Query
WordPress Trac
noreply at wordpress.org
Thu Oct 17 01:00:53 UTC 2013
#25552: Functional Docs: WP_Date_Query
--------------------------+---------------------------
Reporter: DrewAPicture | Owner: DrewAPicture
Type: defect (bug) | Status: reviewing
Priority: normal | Milestone: 3.7
Component: Inline Docs | Version:
Severity: normal | Resolution:
Keywords: needs-patch |
--------------------------+---------------------------
Comment (by Viper007Bond):
Replying to [comment:8 DrewAPicture]:
> * There is bound to be confusion between specifying the column to query
against in the three separate contexts. As this currently reads, you can
specify the column in the first and second-level arrays, as well as the
second parameter passed to the constructor. What's the difference between
them and does specifying one in one place affect the others?
It's inherited if not specified, meaning you can do this:
{{{
// Any posts made over a year ago
// but modified in the past month
$some_posts = new WP_Query( array(
'date_query' => array(
array(
'before' => '1 year ago',
),
array(
'column' => 'post_modified_gmt',
'after' => '1 month ago',
)
),
'posts_per_page' => -1,
) );
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/25552#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list