I’m working with the Central Color Palette plugin but it doesn’t work on the GP Customizer Alpha pickers.
print_r(array_column( get_option( 'kt_color_grid_palette' ), '0' ));
Prints this but no #
Array ( [0] => C40082 [1] => 0029E2 [2] => A7C900 [3] => 009E90 [4] => 00E5D6 [5] => 00337F [6] => 00DBA8 [7] => 00EA07 [8] => 00BC06 [9] => 007703 )
Apparently Central Color Palette doesn’t prefix the #.
This works but wondering if there might be a better way?
add_filter( 'generate_default_color_palettes', 'gp_ccp_color_palettes', 10 );
function gp_ccp_color_palettes( $palettes ) {
$palettes = array_column( get_option( 'kt_color_grid_palette' ), '0' );
foreach ( $palettes as &$hexclr ) {
$hexclr = '#' . $hexclr;
}
return $palettes;
}
Here’s the contents of ‘kt_color_grid_palette’ option.
a:11:{
i:0;a:2:{i:0;s:6:"c40082";i:1;s:0:"";}
i:1;a:2:{i:0;s:6:"0029e2";i:1;s:0:"";}
i:2;a:2:{i:0;s:6:"a7c900";i:1;s:0:"";}
i:3;a:2:{i:0;s:6:"009e90";i:1;s:0:"";}
i:4;a:2:{i:0;s:6:"00e5d6";i:1;s:0:"";}
i:5;a:2:{i:0;s:6:"00337f";i:1;s:0:"";}
i:6;a:2:{i:0;s:6:"00dba8";i:1;s:0:"";}
i:7;a:2:{i:0;s:6:"00ea07";i:1;s:0:"";}
i:8;a:2:{i:0;s:6:"00bc06";i:1;s:0:"";}
i:9;a:2:{i:0;s:6:"007703";i:1;s:0:"";}
}