Title: post_type_exists in plugin
Last modified: August 30, 2016

---

# post_type_exists in plugin

 *  Resolved [zuk22](https://wordpress.org/support/users/zuk22/)
 * (@zuk22)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/post_type_exists-in-plugin/)
 * Hi guys
    **post_type_exists** return false in my plugin function
 * Code is very simple, myposttype are registered
 *     ```
       function my_function(){
         if( post_type_exists( 'myposttype' ) ) {
           // code here
         }
       }
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [Jose Castaneda](https://wordpress.org/support/users/jcastaneda/)
 * (@jcastaneda)
 * THEME COFFEE MONKEY
 * [10 years, 11 months ago](https://wordpress.org/support/topic/post_type_exists-in-plugin/#post-6342775)
 * Where are you hooking the `my_function` to?
 * Does it work in the global space?
 *  Thread Starter [zuk22](https://wordpress.org/support/users/zuk22/)
 * (@zuk22)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/post_type_exists-in-plugin/#post-6343105)
 * resolved

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘post_type_exists in plugin’ is closed to new replies.

## Tags

 * [function](https://wordpress.org/support/topic-tag/function/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [zuk22](https://wordpress.org/support/users/zuk22/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/post_type_exists-in-plugin/#post-6343105)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
