관리-도구
편집 파일: uninstall.php
<?php /** * Uninstall * * @package SLP * @subpackage Uninstall * @copyright Copyright (c) 2013, Jesse Petersen * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License * @since 3.0.0 */ if (!defined('WP_UNINSTALL_PLUGIN')) { header('Status: 403 Forbidden'); header('HTTP/1.1 403 Forbidden'); exit(); } if ( !is_user_logged_in() ) wp_die( 'You must be logged in to run this script.' ); if ( !current_user_can( 'install_plugins' ) ) wp_die( 'You do not have permission to run this script.' ); function slp_uninstall() { delete_option('slp_settings'); } global $wpdb; if (function_exists('is_multisite') && is_multisite()) { $blogids = $wpdb->get_col($wpdb->prepare("SELECT blog_id FROM $wpdb->blogs")); $old_blog = $wpdb->blogid; foreach ($blogids as $blog_id) { switch_to_blog($blog_id); slp_uninstall(); } // restore old blog switch_to_blog($old_blog); } else slp_uninstall(); ?>