-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathcustomizer.php
More file actions
49 lines (44 loc) · 743 Bytes
/
customizer.php
File metadata and controls
49 lines (44 loc) · 743 Bytes
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
<?php
/**
* Disable Customizer
*
* @link https://github.com/joppuyo/customizer-disabler
*/
add_action(
'admin_init',
function () {
remove_action( 'plugins_loaded', '_wp_customize_include', 10 );
remove_action( 'admin_enqueue_scripts', '_wp_customize_loader_settings', 11 );
add_action(
'load-customize.php',
function () {
wp_die(
__( 'The Customizer is currently disabled.', 'customizer-disabler' )
);
}
);
},
10
);
add_action(
'init',
function () {
add_filter(
'map_meta_cap',
function (
$caps = array(),
$cap = '',
$user_id = 0,
$args = array()
) {
if ( $cap == 'customize' ) {
return array( 'nope' );
}
return $caps;
},
10,
4
);
},
10
);