WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the definite hook which identifies links.php page (add, edit, delete, etc. Blogroll Links), and only this page?

Any help would be appreciated.

Thanks, cadeyrn


Sorry, I forgot to mention, I need this hook in the admin area. I have a plugin, that brakes an other one, because both are triggered by the admin_menu add_action. Therefore I need an add_action point that is only valid for the admin menu's link edit/add/delete part.

share|improve this question
up vote 1 down vote accepted

OK, I made an awful, but working solution: the hook is admin_menu, than, in the called function, I added

if( strstr($_SERVER['PHP_SELF'],'link.php')

in the begining.

If there's a better solution, please someone send it.

share|improve this answer

Inside the (public) wp template hierarchy there's no links.php file expected. Links are a built in taxonomy, so I (guess) it's if ( is_archive( 'link_category' ) ) /* do stuff */.

Or are you talking about admin pages?

share|improve this answer
Sorry, I wasn't specific, yes, I did mean the admin pages. – petermolnar Apr 29 '11 at 7:31
The only hook i know is the admin_menu hook itself. From a brief look at /wp-root/wp-admin/link-manager.php i couldn't find any hooks, so i guess you'll have to rely on those mentioned in the action API/reference: codex.wordpress.org/Plugin_API/Action_Reference – kaiser Apr 29 '11 at 13:25
Oh, and you could still use priority with the hook to avoid collisions: add_action( 'admin_menu', 'some_action', 30 ). – kaiser Apr 29 '11 at 13:26

Hook for what exactly?

And in any case it is easy to use any hook and check if you are at the right page. For example by comparing global $hook_suffix variable to link-manager.php (there is no links.php by the way). There is also block of dynamic hooks that rely on this variable in admin-header.php.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.