So the post_class
hook will fire anywhere that uses the get_post_class
function.
You should be able to do this and check the post type first:
function db_current_post_class( $classes, $class, $post_id ) {
if ( 'your-post-type' == get_post_type() ) {
global $wp_query;
$current_id = $wp_query->get_queried_object_id();
if( $current_id == $post_id ) {
$classes[] = 'current-page-item';
}
}
return $classes;
}
add_filter( 'post_class', 'db_current_post_class', 10, 3 );
Adding it to the Query Loop, could be something we could add. I’ll raise an issue on it