Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

EDIT

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
add comment

3 Answers

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
add comment

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
add comment

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
add comment

Your Answer

 
discard

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.