How to hook into an action in the Wordpress menu

RE: Wordpress menu and performing an action hook when a link is clicked.

In this WP install I’m looking to hook into a WP action if the menu link clicked has a path containing …/somepath/…

I don’t want to hook into something that runs every time aWP page is loaded such as in the init or wp_loaded hooks. Rather, I would like to hook into it right after the user clicks the menu item, but before being directed to the url. I need to kick off some server processing on menu clicks that contain part of a path in the url.

It would be neat if there is a WP hook for this, but I haven’t found one and as I’m thinking about it, it may not be possible with hooks. But maybe somebody has an idea of how this could be done.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.