bootstrap-blocks-wordpress-plugin icon indicating copy to clipboard operation
bootstrap-blocks-wordpress-plugin copied to clipboard

Button Style Options filter

Open adwlabs opened this issue 1 year ago • 2 comments
trafficstars

Adding the function "function myButtonStyleOptions( styleOptions )" I receive this error messagge: Parse error: syntax error, unexpected token ")", expecting variable

adwlabs avatar Jan 15 '24 12:01 adwlabs

Hi @adwlabs. Could you maybe post the whole function you're adding? With just this snippet it's hard to see where the issue could be.

tschortsch avatar Jan 19 '24 19:01 tschortsch

I’m trying to test the function showed in the how to:

function myButtonStyleOptions( styleOptions ) { styleOptions.push( { label: 'My Option', value: 'my-option', bgColor: '#ff0000', textColor: '#ffffff', } ); return styleOptions; } wp.hooks.addFilter( 'wpBootstrapBlocks.button.styleOptions', 'myplugin/wp-bootstrap-blocks/button/styleOptions', myButtonStyleOptions );

thank you for your support

adwlabs avatar Jan 20 '24 12:01 adwlabs