Title: Adding Hooks For Actions
Last modified: August 18, 2016

---

# Adding Hooks For Actions

 *  [theApe](https://wordpress.org/support/users/theape/)
 * (@theape)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/adding-hooks-for-actions/)
 * I want add an action for only a specific admin page
 * `add_action('admin_head', 'name-of-action');`
 * So it doesn’t show on all admin pages (headers). Just ones specified, can anyone
   offer any pointers?

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

 *  [ajd777](https://wordpress.org/support/users/ajd777/)
 * (@ajd777)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/adding-hooks-for-actions/#post-508440)
 * The easiest way is to wrap that in an if statement that use strpos (or the like)
   that looks for the page name you want in the current url.
 * So you could do:
    ` if ((!strstr($_SERVER['PHP_SELF'], 'edit.php')){ add_action('
   admin_head', 'name-of-action'); }
 *  Thread Starter [theApe](https://wordpress.org/support/users/theape/)
 * (@theape)
 * [19 years, 3 months ago](https://wordpress.org/support/topic/adding-hooks-for-actions/#post-508467)
 * Thanks!

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

The topic ‘Adding Hooks For Actions’ is closed to new replies.

 * 2 replies
 * 2 participants
 * Last reply from: [theApe](https://wordpress.org/support/users/theape/)
 * Last activity: [19 years, 3 months ago](https://wordpress.org/support/topic/adding-hooks-for-actions/#post-508467)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
