WordPress filter hook
kirki_default_color_swatches
Defined by Kirki and fired by 7 plugins in total, running on 500K+ sites between them.
How to use kirki_default_color_swatches
It's a filter: your callback receives the value, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'kirki_default_color_swatches', function( $default_swatches ) {
// Change $default_swatches here.
return $default_swatches;
}, 10, 1 );Argument names come from Kirki's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
7 plugins that fire kirki_default_color_swatches
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
Kirki400,000+ installs
apply_filters( 'kirki_default_color_swatches', $default_swatches )customizer/packages/controls/react-colorful/src/Control/ReactColorful.php:159 -
Jupiter X Core70,000+ installs
apply_filters( 'kirki_default_color_swatches', $default_swatches )includes/customizer/vendors/kirki/packages/kirki-framework/control-react-colorful/src/Control/ReactColorful.php:169 -
Envo Extra20,000+ installs
apply_filters( 'kirki_default_color_swatches', $default_swatches )include/packages/kirki-framework/control-react-colorful/src/Control/ReactColorful.php:169 -
Futurio Extra10,000+ installs
apply_filters( 'kirki_default_color_swatches', $default_swatches )inc/framework/kirki-packages/control-react-colorful/src/Control/ReactColorful.php:169 -
Kata Plus300+ installs
apply_filters( 'kirki_default_color_swatches', $default_swatches )includes/vendors/kirki/kirki-packages/control-react-colorful/src/Control/ReactColorful.php:169 -
Home Improvement Companion50+ installs
apply_filters( 'kirki_default_color_swatches', $default_swatches )vendors/kirki/kirki-packages/control-react-colorful/src/Control/ReactColorful.php:169 -
Hill Extension10+ installs
apply_filters( 'kirki_default_color_swatches', $default_swatches )inc/kirki/packages/kirki-framework/control-react-colorful/src/Control/ReactColorful.php:169
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.