This repository was archived by the owner on Nov 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathuninstall.php
More file actions
75 lines (44 loc) · 1.41 KB
/
Copy pathuninstall.php
File metadata and controls
75 lines (44 loc) · 1.41 KB
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
62
63
64
65
66
67
68
69
70
<?php /*
================================================================================
CommentPress Core Uninstaller Version 1.0
================================================================================
AUTHOR: Christian Wach <needle@haystack.co.uk>
--------------------------------------------------------------------------------
NOTES
=====
--------------------------------------------------------------------------------
*/
// kick out if uninstall not called from WordPress
if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) { exit(); }
/**
* @description: restore Wordpress database schema
* @return boolean $result
* @todo:
*
*/
function commentpress_schema_restore() {
// database object
global $wpdb;
// include Wordpress install helper script
require_once( ABSPATH . 'wp-admin/install-helper.php' );
// drop the column, if already there
$result = maybe_drop_column(
$wpdb->comments,
'comment_signature',
"ALTER TABLE `$wpdb->comments` DROP `comment_signature`;"
);
// --<
return $result;
}
// delete standalone options
delete_option( 'commentpress_version' );
delete_option( 'commentpress_options' );
// restore database schema
$success = commentpress_schema_restore();
// do we care about the result?
// are we deleting in multisite?
if ( is_multisite() ) {
// delete multisite options
//delete_site_option( 'cpmu_options' );
//delete_site_option( 'cpmu_version' );
}