0

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.

3 Answers 3

1

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.

0

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?

3
  • Sorry, I wasn't specific, yes, I did mean the admin pages. Commented Apr 29, 2011 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
    Commented Apr 29, 2011 at 13:25
  • Oh, and you could still use priority with the hook to avoid collisions: add_action( 'admin_menu', 'some_action', 30 ).
    – kaiser
    Commented Apr 29, 2011 at 13:26
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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