Support » Plugin: NextGEN Gallery - WordPress Gallery Plugin » register_uninstall_hook was called incorrectly

  • Got following message whe activating 1.9.10

    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.) in /var/www/web/wno392687/wordpress/wp-includes/functions.php on line 2944

    Using WP 3.5

    http://wordpress.org/extend/plugins/nextgen-gallery/

Viewing 2 replies - 1 through 2 (of 2 total)
  • This has already been solved in another thread, here:

    [resolved] register_uninstall_hook was called incorrectly

    Just change
    register_uninstall_hook( $this->plugin_name, array(&$this, ‘uninstall’)
    back into
    register_uninstall_hook( $this->plugin_name, array(‘nggLoader’, ‘uninstall’)
    in nggallery.php

    Credit to ZjanPreijde for the answer.

    You need to write class in string instead of passing $this, i.e.

    register_uninstall_hook( __FILE__, array('your_class_name', 'your_class_method') );

    As you see the if condition below, the first parameter of callback must not be an object.

    function register_uninstall_hook( $file, $callback ) {
    	if ( is_array( $callback ) && is_object( $callback[0] ) ) {
    		_doing_it_wrong( __FUNCTION__, __( 'Only a static class method or function can be used in an uninstall hook.' ), '3.1' );
    		return;
    	}
    	...
    }

    For more help Visit here

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘register_uninstall_hook was called incorrectly’ is closed to new replies.