How to check if user is on the edit page of a custom post type

I would like to determine if the user is on a custom post type. How can I achieve that?

Related posts

Leave a Reply

1 comment

  1. How and where will you be using this?
    To get the post type of a post in a the loop you can use get_post_type()

    To determine if a user is on a custom post type, like if you got multiple post types, you could check if it’s no ‘post’ or ‘page’, if you want to check for a certain post type you just enter the unique custom post type name.

    If this is not the answer you are looking for, please give us more info on the problem.