0

I installed the plugin https://wordpress.org/plugins/hook-sniffer/.

Action Event Firing Order:

Array
(
  [muplugins_loaded] => 1
  ...
  [the_post] => 3
  ...
)
...

yet

function plugin_the_post() {
  customErrLog('plugin_the_post');
}

function pluginActivate() {
  customErrLog('pluginActivate');
  add_action('the_post', 'plugin_the_post');
}

register_activation_hook(__FILE__, 'pluginActivate');

I get pluginActivate in my debug log but plugin_the_post never happens.

I'm not actually interested in the_post but there have been several action hooks that others seem to use well, and yet I get nothing...

can an action hook callback prevent other callbacks from getting called... What am I doing wrong?

  • Close voted as you rely on a plugin which might be the cause of the problem and therefor you are off-topic. Get rid of the plugin, and just hook on 'the_post' if that is what you want to do. 'the_post' should almost always be called unless you are doing things in the admin side of things at which point it will depend on what exactly are you doing. – Mark Kaplun Sep 4 '15 at 18:00
  • I don't think that the_post action hook is available during plugin activation. – cybmeta Sep 4 '15 at 18:26
  • "deleted" the plugin, and still all I get is activation and init callbacks – user3338098 Sep 4 '15 at 18:35
  • @cybmeta I don't care if the_post is used during plugin activation, my problem is that plugin_the_post is never called, not during general site usage, not during user account registration. even add_action('login_form_login', 'plugin_login_form_login') results in nothing ever happening. – user3338098 Sep 4 '15 at 18:40
  • 1
    yes, just took shortcuts with my english ;) the thing is that plugin activation happens only once when the plugin is being activated and once that execution is done for the next page view you need to register all the hooks again. – Mark Kaplun Sep 5 '15 at 3:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.