Hi all,

I'm working on a plugin which needs to store some data in the table "wp_options", and to create some new tables as well. I have two questions:

1) Why calling add_option('myoption', array(), 'no') creates a new entry that has the 'autoload' field set to YES in the database? Am I doing something wrong?

2) Since I want to be a 'good developer', I added the uninstall function to be executed whenever the user decides to remove this plugin from his WP box. So I have this method inside my class:

public function uninstall() {
        global $wpdb;

        // Goodbye data...
        $wpdb->query("DROP TABLE IF EXISTS `tablename`");

        // Goodbye options...
        delete_option('myoption');
    }

And then it's hooked like this

register_uninstall_hook( __FILE__, array( &$myclass, 'uninstall' ) );

I've tried both with 2.9 and 3.0alpha, and the table is still there after I uninstall the plugin via the admin interface.

Thanks for your time,
dino.
_______________________________________________
wp-testers mailing list
[email protected]
http://lists.automattic.com/mailman/listinfo/wp-testers

Reply via email to