Alecaddd / WordPressPlugin101

Official repository of the series of tutorial on How to Create a WordPress Plugin from scratch: https://www.youtube.com/playlist?list=PLriKzYyLb28kR_CPMz8uierDWC2y3znI2
MIT License
408 stars 369 forks source link

cannot use register_deactivation_hook(__FILE__,array('Deactivate','deactivate')) #26

Closed HHubbes closed 1 year ago

HHubbes commented 1 year ago

10

I get an error with register_deactivation_hook( FILE ,array('Deactivate','deactivate')); it seems, the routine is searching in class-wp-hook.php rather than Deactivate.php. With the in class deactivate method (like the activate method) it works.

HHubbes commented 1 year ago

Problem solved: register_deactivation_hook(FILE,array(new Deactivate(),'deactivate')); sorry