Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button Style Options filter #132

Open
adwlabs opened this issue Jan 15, 2024 · 2 comments
Open

Button Style Options filter #132

adwlabs opened this issue Jan 15, 2024 · 2 comments

Comments

@adwlabs
Copy link

adwlabs commented Jan 15, 2024

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

@tschortsch
Copy link
Member

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
Copy link
Author

adwlabs commented Jan 20, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants