Title: Plugin/Function to check theme author, and display an error message
Last modified: August 20, 2016

---

# Plugin/Function to check theme author, and display an error message

 *  [h4xg33k](https://wordpress.org/support/users/h4xg33k/)
 * (@h4xg33k)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/pluginfunction-to-check-theme-author-and-display-an-error-message/)
 * Hi, everyone!
 * I want to create a plugin or function that checks the current theme’s author 
   name. If it doesn’t match a string of text, it will display an error message 
   on the admin panel saying that it needs to be changed.
 * Here is the code I have so far (not much at all, as I was originally writing 
   this as a function in the theme’s folder, until I realized that folder would 
   get over-written when the theme updated).
 *     ```
       <?php
       add_action( 'admin_notices', 'custom_error_notice' );
       function custom_error_notice(){
            global $current_screen;
   
       if (!empty($_COOKIE["wptheme" . COOKIEHASH]))
       $theme_name = $_COOKIE["wptheme" . COOKIEHASH];
       else
       $theme_name = get_current_theme();
       $theme = get_theme("$theme_name"); 
   
            if ( $current_screen->parent_base == 'themes' )
                 echo "<div class'error'><p>$theme['Author']</p></div>";
       }
       ?>
       ```
   
 * Any help would be greatly appreciated!
 * Thanks,
    Samuel

The topic ‘Plugin/Function to check theme author, and display an error message’ 
is closed to new replies.

## Tags

 * [admin](https://wordpress.org/support/topic-tag/admin/)
 * [author](https://wordpress.org/support/topic-tag/author/)
 * [check](https://wordpress.org/support/topic-tag/check/)
 * [message](https://wordpress.org/support/topic-tag/message/)

 * 0 replies
 * 1 participant
 * Last reply from: [h4xg33k](https://wordpress.org/support/users/h4xg33k/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/pluginfunction-to-check-theme-author-and-display-an-error-message/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
