WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery
register_uninstall_hook was called incorrectly (3 posts)

  1. era@sf-nett.no
    Member
    Posted 1 year ago #

    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/

  2. geekonthemove
    Member
    Posted 1 year ago #

    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.

  3. sunildhanda
    Member
    Posted 12 months ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags