Title: Version Safe Category Checking
Last modified: August 19, 2016

---

# Version Safe Category Checking

 *  [srp0uk](https://wordpress.org/support/users/srp0uk/)
 * (@srp0uk)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/version-safe-category-checking/)
 * Hi all, what is the best version safe way of checking that a category exists 
   and then maybe inserting a new category from within a plugin?
 * I have read that using the API to do this is the best way, the function category_exists()–
   there is just one problem with this though.
 * This is in the admin functions, and so when the plugin is triggered by a ‘normal’
   surfer, the admin functions havent been called and relevant permissions arent
   set, so I get the error message Fatal error: Call to undefined function: category_exists()
 * So, do I need to write entirely new functions, one for version 2.3 and one for
   2.2 and lower, or is there another API function that I have overlooked?
 * Thanks…

The topic ‘Version Safe Category Checking’ is closed to new replies.

## Tags

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

 * 0 replies
 * 1 participant
 * Last reply from: [srp0uk](https://wordpress.org/support/users/srp0uk/)
 * Last activity: [18 years, 5 months ago](https://wordpress.org/support/topic/version-safe-category-checking/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
