How to add new tab to admin list of posts and handle result list
Admin post queries can be filtered just like frontend queries using pre_get_posts and checking for is_admin. add_action( ‘views_edit-post’, ‘remove_edit_post_views’ ); function remove_edit_post_views( $views ) { $views[‘pre’] = ‘<a href=”‘.admin_url().’edit.php?pre=pre”>My Special Posts</a>’; return $views; } add_action(‘pre_get_posts’, ‘my_special_list’); function my_special_list( $q ) { $scr = get_current_screen(); if ( is_admin() && ( $scr->base === ‘edit’ ) && $q->is_main_query() … Read more