-
Notifications
You must be signed in to change notification settings - Fork 1
/
DeclutterWP.PluginManager.php
42 lines (33 loc) · 1.02 KB
/
DeclutterWP.PluginManager.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
<?php
/*
* PluginManager
*/
class DeclutterWP_PluginManager {
public static function init() {
$options = get_option('declutter_wp_options');
if ($options !== FALSE) {
new DeclutterWP_Declutter($options);
}
}
public static function setDefaultOptions() {
$defaults = array(
'remove-header-junk' => 'on',
'disable-json-rest-api' => 'on',
'disable-oembed' => 'on',
'disable-xml-rpc' => 'on',
'remove-emoji-support' => 'on'
);
if (get_option('declutter_wp_options') === FALSE) {
update_option('declutter_wp_options', $defaults);
}
return;
}
public static function removeRewriteRules() {
add_filter('rewrite_rules_array', array('DeclutterWP_Declutter', 'disableEmbedsRewrites'));
flush_rewrite_rules(false);
}
public static function flushRewriteRules() {
remove_filter('rewrite_rules_array', array('DeclutterWP_Declutter', 'disableEmbedsRewrites'));
flush_rewrite_rules(false);
}
}