How to isolate code to the post edit screen
Use the WP_Screen object to tell where you are at in the admin instead. Much more convenient. $screen = get_current_screen(); if ( $screen->id == ‘edit-post’ ) { // you’re on the posts screen } Note that you have to wait until at least the admin_head hook to run for the current screen to have been … Read more