-
Notifications
You must be signed in to change notification settings - Fork 2
/
disable-custom-css.php
41 lines (36 loc) · 1.1 KB
/
disable-custom-css.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
<?php
/**
* The Disable Custom CSS Plugin
*
* Disable frontend database query and Customizer section for Custom CSS.
*
* @package Disable_Custom_CSS
* @subpackage Main
*/
/**
* Plugin Name: Disable Custom CSS
* Plugin URI: https://milandinic.com/wordpress/plugins/disable-custom-css/
* Description: Disable frontend database query and Customizer section for Custom CSS.
* Author: Milan Dinić
* Author URI: https://milandinic.com/
* Version: 1.1
* Text Domain: disable-custom-css
* Domain Path: /languages/
* License: GPL
*/
// Exit if accessed directly
if ( ! defined( 'ABSPATH' ) ) exit;
// Disable Custom CSS in the frontend head
remove_action( 'wp_head', 'wp_custom_css_cb', 11 );
remove_action( 'wp_head', 'wp_custom_css_cb', 101 );
/**
* Remove Custom CSS section from the Customizer.
*
* @since 1.0
*
* @param WP_Customize_Manager $wp_customize WP_Customize_Manager instance.
*/
function disable_custom_css_customize_section( $wp_customize ) {
$wp_customize->remove_section( 'custom_css' );
}
add_action( 'customize_register', 'disable_custom_css_customize_section', 20 );