Open joshbetz opened 10 years ago
We should also provide a filter to turn this on or off.
Assuming we know vip_get_hidden_posts()
is safe:
add_filter( 'get_previous_post_where', 'newsroom_mod_adjacent' );
add_filter( 'get_next_post_where', 'newsroom_mod_adjacent' );
function newsroom_mod_adjacent( $where ) {
$posts = implode( ',', vip_get_hidden_posts() );
return $where . " AND p.ID NOT IN ($posts)";
}
Hidden posts should not be shown in next/previous links