• 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)
  • 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

    (@theape)

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Adding Hooks For Actions’ is closed to new replies.