0

我正在使用 wordpress 中的一个插件,它有一个数据库表,停用后我也想删除该表,但它不适用于以下代码,停用成功但表没有被删除。这是我的类函数和钩子:

public function deact() {
        global $wpdb;
        delete_option('ACP_settings');
        delete_option('ACP_advance_settings');
        $q = "DROP TABLE tb_name";
        $wpdb->query($q);
    }

register_deactivation_hook( __FILE__, 'deact');
4

1 回答 1

0

After much work, I have got it worked. The main problem is class, When I have declared that as function not as class method its worked.

I updating it for other users

于 2013-11-08T19:08:53.210 回答