[wp-hackers] bug in is_home in query filters for custom post landing pages?
Simon Blackbourn
piemanek at gmail.com
Mon Jun 14 19:19:40 UTC 2010
i've just installed RC3 and it seems that all the post query filters
(posts_join, posts_where, posts_orderby & posts_fields) are seeing is_home()
as true for custom post type landing pages, even when they're not the home
page.
in my case, i have a custom post type called "member", the main landing page
is mydomain.com/members (which is not the home page of my site), but the
following filter runs on that page:
add_filter( 'posts_orderby', 'my_members_orderby' );
function my_members_orderby( $sql ) {
global $wpdb, $wp_query;
if ( is_home() ) {
return $wpdb->prefix . "posts.post_title ASC";
}
return $sql;
}
is this a bug or is it correct behaviour - are the landing pages for custom
post types considered a 'home' page? if so, seems a bit odd to me.
More information about the wp-hackers
mailing list