[wp-hackers] Using WP_Query to get posts ids

Ulrich Sossou sorich87 at gmail.com
Tue Sep 13 11:03:37 UTC 2011


You can use the parameter 'fields':

new WP_Query( array( 'fields' => 'ids' ) );

On Tuesday, September 13, 2011, Lox wrote:

> Hello,
>
> I would like to use the power of the WP_Query class to select only posts
> ids
> from the database. I do not want to query for all fields and to have all
> queried posts cached, for performance reasons.
>
> Is that possible?
>
> Regards.
>
> --
> Lox
> lox.dev at knc.nc <javascript:;>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com <javascript:;>
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


-- 
Ulrich Sossou

--------------------------------------------
Q: Did you know I am committed to release and/or provide lifetime
maintenance and support for *at least 100 free WordPress plugins by the end
of this year*?
A: http://pubpoet.com


More information about the wp-hackers mailing list