query( $wpdb->prepare( "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s", $wpdb->esc_like( 'apgt_lock_' ) . '%' ) ); // 删除语言包数据表。 require_once plugin_dir_path( __FILE__ ) . 'includes/class-apgt-install.php'; APGT_Install::drop_table(); } // 主文件已定义常量,这里卸载场景下需保证 APGT_PLUGIN_DIR 可用。 if ( ! defined( 'APGT_PLUGIN_DIR' ) ) { define( 'APGT_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); } if ( is_multisite() ) { $apgt_site_ids = get_sites( array( 'fields' => 'ids' ) ); foreach ( $apgt_site_ids as $apgt_site_id ) { switch_to_blog( $apgt_site_id ); apgt_uninstall_site(); restore_current_blog(); } } else { apgt_uninstall_site(); }