liip / bootstrap-blocks-wordpress-plugin

Bootstrap Gutenberg Blocks for WordPress
https://wordpress.org/plugins/wp-bootstrap-blocks/
280 stars 60 forks source link

Button Style Options filter #132

Open adwlabs opened 10 months ago

adwlabs commented 10 months ago

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

tschortsch commented 10 months ago

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.

adwlabs commented 10 months ago

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