[wp-hackers] Custom search, how ?

Michael D Adams mda at blogwaffe.com
Wed Aug 18 03:44:00 UTC 2010


On Tue, Aug 17, 2010 at 8:34 PM, Lox <lox.dev at knc.nc> wrote:
> I am currently trying to do like so:
>
> $args = array ('post_type' => 'formation', 'fs'=>'1',
> 'custom_field_in_custom_table" = 'value');
> $posts = get_posts($args);
>
> Then to add a join I use the posts_join filter witch doesn't seems to being
> called at all.

get_posts() doesn't use the posts_join filter by default (for backward
compatibility).

You can make it use posts_join by setting suppress_filters => false in
your $args.

Or you could use the WP_Query class directly.

Mike
--mdawaffe


More information about the wp-hackers mailing list