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.

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.

share|improve this question
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

1 Answer 1

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.

share|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

 
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.