Title: Detecting activated plugin with function_exists?
Last modified: August 19, 2016

---

# Detecting activated plugin with function_exists?

 *  [lorieransom](https://wordpress.org/support/users/lorieransom/)
 * (@lorieransom)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/detecting-activated-plugin-with-function_exists/)
 * I’m trying to hide or show a couple of links depending on whether a plugin is
   activated or not. Below is the simple code I am using in the header.php file,
   after the body tag. The code always spits out the else case. (Currently attempting
   to detect wp-cache, which I know is activated). Is the Plugin information not
   available to WordPress when the header file is read? Is there another solution?
   Thanks!
 *     ```
       <?php if (function_exists('wp-cache'))
         {
         	echo <li>this function exists</li>;
         }else	{
         	echo <li>this function does not exist</li>;
       }?>
       ```
   

Viewing 1 replies (of 1 total)

 *  [Qurl](https://wordpress.org/support/users/qurl/)
 * (@qurl)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/detecting-activated-plugin-with-function_exists/#post-1388265)
 * Looking into the source of wp-cache it seems there is no function ‘wp-cache’.
   That’s probably the reason why the else statement is chosen. Try for instance‘
   wp_cache_postload’.

Viewing 1 replies (of 1 total)

The topic ‘Detecting activated plugin with function_exists?’ is closed to new replies.

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [Qurl](https://wordpress.org/support/users/qurl/)
 * Last activity: [16 years, 3 months ago](https://wordpress.org/support/topic/detecting-activated-plugin-with-function_exists/#post-1388265)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
