I am building a segmented search (by post type) with the ability to filter to a specific post type and realized pages were not publicly queryable. What I know I can do is the following:
function fix_page_query() {
if ( post_type_exists( 'page' ) ) {
global $wp_post_types;
$wp_post_types['page']->publicly_queryable = true;
}
}
add_action( 'init', 'fix_page_query', 1 );
which does allow them to use post_type as a query var, but are there any shortcomings to doing this? Was there a specific reason they are not by default? I did see this ticket about the subject, but could not decipher a clear answer. Thanks!
post_typein this case becausepublicly_queryableis false), but I'm asking if there is a shortcoming to adding this in (as the action I have above does). Again, I am looking for clarity on the subject, so saying "Sergey answered your question here" doesn't help me as that is the confusing part. – Zach Oct 3 '12 at 16:27