• Is there any way to check whether a hook exists? I want to add a javascript on admin head on certain page of my plugin. I want to use add_action(‘admin_head-(page_hook)’,…) but as I read somewhere in the Docs or this forum, it’s only supported by WP with version above 2.1 while I want my plugin working as well for WP 2.0.x. I know I can easily use ‘admin_head’ for all version but it will be better if I can check if certain hook does exist and use it, otherwise use the workaround.

    Anyone know this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter explor1ng

    (@explor1ng)

    since there’s no answer, I’m thinking for a workaround, I’m going to test what the current admin page is, but again, I’m stuck in not knowing what function to get current admin page, or do I need to just test $_GET[‘page’]?

    Thread Starter explor1ng

    (@explor1ng)

    ah I got this one, based on answer of another question from whoami, thanks.

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

The topic ‘Checking if a hook exists?’ is closed to new replies.