Beispiel #1
0
function uninstall()
{
    global $wpdb;
    $meta_query = "DELETE FROM {$wpdb->postmeta} WHERE meta_key LIKE '" . LONGTAIL_KEY . "%';";
    $option_query = "DELETE FROM {$wpdb->options} WHERE option_name LIKE '" . LONGTAIL_KEY . "%';";
    $post_query = "DELETE FROM {$wpdb->posts} WHERE post_type = 'jw_playlist';";
    $wpdb->query($meta_query);
    $wpdb->query($option_query);
    $wpdb->query($post_query);
    @unlink(LongTailFramework::getPlayerPath());
    @unlink(LongTailFramework::getEmbedderPath());
    @rmdir(JWPLAYER_FILES_DIR . "/player/");
    $handler = @opendir(JWPLAYER_FILES_DIR . "/configs");
    if ($handler) {
        while ($file = readdir($handler)) {
            if ($file != "." && $file != ".." && strstr($file, ".xml")) {
                @unlink(JWPLAYER_FILES_DIR . "/configs/{$file}");
            }
        }
        closedir($handler);
    }
    @rmdir(JWPLAYER_FILES_DIR . "/configs/");
    @rmdir(JWPLAYER_FILES_DIR);
    update_option(LONGTAIL_KEY . "uninstalled", true);
    feedback_message(__('Files and settings deleted.  The plugin can now be deactivated.', 'jw-player-plugin-for-wordpress'));
}
function uninstall()
{
    global $wpdb;
    $meta_query = "DELETE FROM {$wpdb->postmeta} WHERE meta_key LIKE '" . LONGTAIL_KEY . "%';";
    $option_query = "DELETE FROM {$wpdb->options} WHERE option_name LIKE '" . LONGTAIL_KEY . "%';";
    $post_query = "DELETE FROM {$wpdb->posts} WHERE post_type = 'jw_playlist';";
    $wpdb->query($meta_query);
    $wpdb->query($option_query);
    $wpdb->query($post_query);
    update_option(LONGTAIL_KEY . "uninstalled", true);
    feedback_message(__('Tables and settings deleted, deactivate the plugin now'));
}