How to check if a user is on the page edit screen but not the post edit screen
-
Hi there,
I’m looking for a way to enqueue a small CSS file in the WP admin but only when the user is on the page new or edit screens but NOT the post new or edit screens. I’ll use it to hide a few elements that need to still show on a post edit screen so, just using $pagenow == ‘post.php’ will not work as it’s not specific enough. I’ve also tried get_post_type but as my hook is on admin_init I don’t think the post id is available yet unless I’m doing it wrong . I tried get_post_type (get_the_id()) but it returned false (also tried with global $post).
Is there any way to do this?
Thanks in advance for any pointers anyone can provide!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to check if a user is on the page edit screen but not the post edit screen’ is closed to new replies.