Apply pre_get_posts to specific custom post type in the admin area
The function you are looking for is get_current_screen(). To check if you are on a specific custom post type page, do as follows: $screen = get_current_screen(); if ( $screen->post_type == ‘custom_job’ ) { // We are on custom_job post type, good to go } Now, if you visit edit.php?post_type=custom_job, this conditional will return true, which … Read more