/
admin-customizer-anomalous.php
83 lines (73 loc) · 2.85 KB
/
admin-customizer-anomalous.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
/**
*
* @link https://wpza.co.za
* @since 1.0.0
* @package wordpress-admin-customizer
*
* @wordpress-plugin
* Plugin Name: WordPress Admin Customizer
* Plugin URI: https://github.com/djm56/WordPress-Admin-Customizer
* Description: Some simple changes to Admin, Login Logo, Admin Copyright and other simple changes.
* Version: 1.3.0
* Author: Donovan Maidens
* Author URI: https://wpza.co.za
*/
// If this file is called directly, abort.
if (!defined('WPINC')) {
die;
}
if (!class_exists("AdminCustomizerAnomalousPlugin")) {
/**
* class: AdminCustomizerAnomalousPlugin
* desc: plugin class to allow reports be pulled from multipe GA accounts
*/
class AdminCustomizerAnomalousPlugin {
/**
* Created an instance of the AdminCustomizerAnomalousPlugin class
*/
public function __construct() {
require_once(sprintf("%s/includes/custom-admin.php", dirname(__FILE__)));
require_once(sprintf("%s/includes/cutom-options.php", dirname(__FILE__)));
}
// END public function __construct()
/**
* Hook into the WordPress activate hook
*/
public static function activate() {
// Clear all options on activation, if Restore Defaults Upon Reactivation = Yes
$tmp = get_option('wac_settings');
if (($tmp['wac_text_field_3'] == 'Yes') || (!is_array($tmp))) {
$arr = array(
"wac_text_field_0" => "WPZA",
"wac_text_field_1" => "",
"wac_text_field_2" => "No",
"wac_text_field_3" => "No",
"wac_text_field_4" => "",
"wac_text_field_5" => "",
"wac_text_field_6" => "",
"wac_text_field_7" => "",
"wac_text_field_8" => "",
"wac_text_field_9" => "",
"wac_text_field_10" => "",
"wac_text_field_11" => "",
);
update_option('wac_settings', $arr);
}
}
/**
* Hook into the WordPress deactivate hook
*/
public static function deactivate() {
// Do something
}
}
// END class AdminCustomizerAnomalousPlugin
} // END if(!class_exists("AdminCustomizerAnomalousPlugin"))
if (class_exists('AdminCustomizerAnomalousPlugin')) {
// Installation and uninstallation hooks
register_activation_hook(__FILE__, array('AdminCustomizerAnomalousPlugin', 'activate'));
register_deactivation_hook(__FILE__, array('AdminCustomizerAnomalousPlugin', 'deactivate'));
// instantiate the plugin class
$plugin = new AdminCustomizerAnomalousPlugin();
} // END if(class_exists('AdminCustomizerAnomalousPlugin'))