activation of a plugin class
-
I have a plugin which is class based,
I have the __constructor call a few functions, one of the functions must make a database table when the plugin is activated, so I have a make_table() method for that, and of course when the plugin is deactivae I would like the tables to be dropped.
Can someone please explain how to useregister_activation_hook(
__FILE__,
‘make_table’
);inside the class.
Obviously if the plugin were not a class I could just call
register_activation_hook(
__FILE__,
‘make_table’
);but I cannot use
register_activation_hook(
__FILE__,
$this->make_table()
);
register_deactivation_hook(
__FILE__,
$this->delete_table()
);or both methods will be called.
It must be something simple. I just cannot see it.
thanks for any help
- The topic ‘activation of a plugin class’ is closed to new replies.