register_activation_hook / register_deactivation_hook
-
So … I just don’t understand what’s happening here.
I’m written a class for my plugin, and register_deactivation_hook works, but register_activation_hook doesn’t.
class Foo{ function Foo(){ register_activation_hook( __FILE__, array( &this, "initializeFoo" ); register_deactivation_hook( __FILE__, array( &this, "killFoo" ); } function initializeFoo(){ add_option( "foo_start", 1 ); } function killFoo(){ add_option( "foo_die", 1 ); } } add_action( 'plugins_loaded', 'loadThePlugin' ); function loadThePlugin(){ global $Foo; $Foo = new Foo(); }
When I activate the plugin, register_activation_hook appears not to fire, but when I deactivate it, register_deactivation_hook does. (The option appears in the database for foo_die, but not foo_start.)
Help?
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘register_activation_hook / register_deactivation_hook’ is closed to new replies.