Adding new colors to column block settings
-
Hello!
I’ve tried to follow this thread, but without any success. What I’ve done so far is make a js-file called block-filter.js with the following content:
function myColumnBgColorOptions( bgColorOptions ) { return [ {name:'primary', color:'#031251'}, {name:'secondary', color:'#245011'}, {name:'primary-light', color:'#7288d2'}, {name:'secondary-light', color:'#8db351'}, {name:'dark', color:'#1e1e1c'}, {name:'light', color:'#ececec'}, ]; } wp.hooks.addFilter( 'wpBootstrapBlocks.column.bgColorOptions', 'myplugin/wp-bootstrap-blocks/column/bgColorOptions', myColumnBgColorOptions );
And I’ve enqueued it in my functions.php in my current child theme:
wp_enqueue_script( 'block-filter', get_stylesheet_directory_uri() . '/inc/block-filter.js', array( 'wp-hooks' ), '1.0.0', true );
I can see the file is getting loaded, but I can’t see any change in the editor with the new colors – where am I going wrong with this?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Adding new colors to column block settings’ is closed to new replies.