I have a very rudimentary plugin in development, but at the point of needing to enable the register_activation_hook() and register_deactivation_hook() I have stalled. I am getting zero output from error_log('it ran') debugging statements.

This plugin is going to be run on a multisite install (so I am developing it on a multisite install). I need to create a custom table for the business logic of the work, but until I can get this hook happy I am getting nowhere.

Interestingly, if I Network Activate this same plugin, the site locks me out with a "You do not have permission to access this page." message. I have to clear the wp_sitemeta option: active_network_plugins to get back on the site again.

I'm praying someone hears a bell ringing with this description and ca straighten me out quickly.

  • 1
    If you would post the code it would be possible for us to evaluate this better, and to test it. – s_ha_dum May 5 '13 at 3:58

I discovered that I was attempting to use register_activation_hook too late in the loading cycle.Moving it outside my class init function to the global scope made it behave as expected.

| improve this answer | |
  • Please use Syntax highlighting and show your complete solution instead of an explanation of it. Thanks. – kaiser Jul 14 '13 at 16:49

Your Answer

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

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