-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuninstall.php
61 lines (50 loc) · 2.15 KB
/
uninstall.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
/**
* @package Turntabl-LearnDash-Plugin
*/
/*
Plugin Name: Turntabl-LearnDash Plugin
Plugin URI: https://github.com/francisbilla/turntabl-learnDash-Plugin
Description: This is a Plugin design by Turntabl Ghana to provide tool to build an affordable Learning Management System to our Clients.
Version: 1.0.0
Author: Francis Billa *PROPHET* & Samuel Owusu *Sam K*
Author URI: https://github.com/francisbilla
License: GPLv2 or later
Text Domain: Turntabl-learndash-plugin
*/
/*
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Copyright 2005-2015 Automatic, Inc.
*/
if (! class_exists('WP_UNINSTALL_Plugin')){
class TurntablLearndashPlugin{
/// CONSTANTS
const VERSION = '1.0.0';
const HELP_URL = 'https://github.com/francisbilla/Turntabl-learndash-plugin/issue';
const CSS_FOLDER = 'TurntablLearndashPlugin-css';
const SETTING_KEY_GENERAL = '_TurntablLearndashPlugin_setting_general';
//CACHE
const CACHE_PERIOD = 86400;
public static $PLUGIN_URI ='';
}
}
//Clear Database stored Data
// $objectives = get_posts( array('post_type' => 'objective', 'numberposts' => -1));
// foreach( $objectives as $objective ) {
// wp_delete_post( $objective -> ID, true );
// }
//Access the Database via SQL
global $wpdb;
$wpdb -> query( "DELETE FROM wp_posts WHERE post_type = 'objective'");
$wpdb -> query( "DELETE FROM wp_postmeta WHERE post_id NOT IN (SELECT id FROM wp_posts)" );
$wpdb -> query( "DELETE FROM wp_term_relationships WHERE object_id NOT IN (SELECT id FROM wp_posts)" );