layers_remove_config_element()
Filters config elements to allow you to unregister or remove a control from the Customizer.
Please use caution when removing default/core controls in commercial products. The user may refer to Layers documentation which states a control is in a specific place, so if you remove or move it, it can cause confusion.
Location: core/helpers/controls.php
Usage:
In the following example we filter the default Layers color controls using the layers_customizer_controls hook on our “my_customizer_controls” callback. The callback can be whatever you want as long as it is unique, ie “yourthemename_remove_heading_color”.
1 2 3 4 5 |
add_filter( 'layers_customizer_controls', 'my_customizer_controls' ); function my_customizer_controls( $controls ){ $controls = layers_remove_config_element( 'site-color-heading', $controls ); return $controls; }; |
Line 3: The first argument, shown here as site-color-heading , must be a valid control name. See Layers Customizer Defaults for reference.