Title: [Debug] register_uninstall_hook was called incorrectly.
Last modified: October 12, 2019

---

# [Debug] register_uninstall_hook was called incorrectly.

 *  [adamfartassi](https://wordpress.org/support/users/adamfartassi/)
 * (@adamfartassi)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/debug-register_uninstall_hook-was-called-incorrectly/)
 * Hello,
    I’m not asking for support since this plugin is somehow long forgotten
   by its creator.
 * I’ll use this topic to explain how I solved some issues from this plugin.
 * 1) Notice: register_uninstall_hook was called incorrectly. Only a static class
   method or function can be used in an uninstall hook. Please see Debugging in 
   WordPress for more information. (This message was added in version 3.1.0.) in
   XXX/wp-includes/functions.php on line 4773
 * ==> Go to **wp-cta-top-bar/includes/class-wpctatb.php** and replace the line 
   55 to 58 by:
 *     ```
       private function init_hooks() {
       		register_activation_hook( WPCTATB_FILE, 'plugin_activate' ); //activate hook
           	register_deactivation_hook( WPCTATB_FILE, 'plugin_deactivate' ); //deactivation hook
           	register_uninstall_hook( WPCTATB_FILE, 'plugin_uninstall' ); //uninstall hook
       	}
       ```
   
 * What I did was just remove the “array($this,” which was the old way of uninstalling
   things on WordPress.

The topic ‘[Debug] register_uninstall_hook was called incorrectly.’ is closed to
new replies.

 * ![](https://ps.w.org/wp-cta-top-bar/assets/icon-256x256.jpg?rev=1792207)
 * [WP CTA Top Bar](https://wordpress.org/plugins/wp-cta-top-bar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-cta-top-bar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-cta-top-bar/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-cta-top-bar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-cta-top-bar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-cta-top-bar/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [adamfartassi](https://wordpress.org/support/users/adamfartassi/)
 * Last activity: [6 years, 8 months ago](https://wordpress.org/support/topic/debug-register_uninstall_hook-was-called-incorrectly/)
 * Status: not resolved