Want to filter only parent post in admin area
In addition to my previous answer add following code. It should work fine add_filter( ‘views_edit-books’, ‘add_filter_link’ ); function add_filter_link( array $views ) { $url = add_query_arg( array(‘bfilter’=>’parents’,’post_parent’=>0,’post_type’=>’books’), ‘edit.php’ ); $views[ ‘post_parent’ ] = sprintf( ‘<a href=”%1$s”%2$s>%3$s</a>’, esc_url( $url ), ( is_filter_active() ) ? ‘ class=”current” aria-current=”page”‘ : ”, ‘Post Parents’ ); return $views; } function … Read more