I am developing a WordPress plugin which requires certain rules to be added to the .htaccess file of the WordPress installation upon activation of the plugin.
Initially, before I switched my code to OOP (with classes and functions) the hooks and this functionality was working. But after I switched it, it doesn't work.
register_activation_hook( __FILE__, array( 'Optimizo', 'activation' ) );
The above code is how I am trying to call the function 'activation' from the class 'Optimizo' which resides in the same file as where I am writing the above activation hook. The 'activation' function has the necessary classes in it which should be called upon activation. Below is the content of the function.
protected function activation() {
$this->activate();
}
I am just wondering if I wrote the code wrong of is it because that the function is having the protected access specifier or if I am doing something entirely wrong.
PS the function 'activate' resides in another class which is being extended to the 'Optimizo' class.