liip / bootstrap-blocks-wordpress-plugin

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

Button Style Options filter #132

Open adwlabs opened 7 months ago

adwlabs commented 7 months ago

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

tschortsch commented 7 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 7 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