I’m trying to remove screen options from a specific page and I’ve got something that removes screen options from all pages so I just need to check for “when page == {x}” How do I check what page I’m on in wordpress though?
function remove_screen_options(){
return false;
}
add_filter('screen_options_show_screen', 'remove_screen_options');
Thought it would be as easy as:
function remove_screen_options(){
global $pagename;
if( $pagename == "admin_faucet_settings") {
return false;
}
}
add_filter('screen_options_show_screen', 'remove_screen_options');
But that is not working – seems to fire all the time too which is strange and off…any ideas?
So, if you need to target any particular page of wordpress admin area, such as plugin page then you can use admin enqueue script hook like this:
Reference: https://wordpress.stackexchange.com/questions/7278/how-can-you-check-if-you-are-in-a-particular-page-in-the-wp-admin-section-for-e