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

Using * in registerBlockExtension throws namespace validation error #345

Closed
1 task done
palicko opened this issue Nov 18, 2024 · 1 comment · Fixed by #346
Closed
1 task done

Using * in registerBlockExtension throws namespace validation error #345

palicko opened this issue Nov 18, 2024 · 1 comment · Fixed by #346

Comments

@palicko
Copy link
Contributor

palicko commented Nov 18, 2024

Describe the bug

Hey,
when * is used in registerBlockExtension() to target all blocks, WP throws validation error:

hooks.js The namespace can only contain numbers, letters, dashes, periods, underscores and slashes.

Steps to Reproduce

Register new block extension with *, e.g.:

registerBlockExtension('*', {
  extensionName: 'demo/addExtension',
  attributes: {},
  inlineStyleGenerator: () => {},
  classNameGenerator: () => {},
  order: 'before',
  Edit: () => <></>,
});

Screenshots, screen recording, code snippet

Image

Environment information

  • Device: Macbook
  • OS: 14.6.1
  • Browser: Arc 1.69.0

WordPress information

  • WP 6.6
  • PHP 8.2

Code of Conduct

  • I agree to follow this project's Code of Conduct
@fabiankaegy
Copy link
Member

@palicko Thanks again for your contribution 🎉

Version 1.19.4 was just released and contains your fix: https://github.com/10up/block-components/releases/tag/v1.19.4

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

Successfully merging a pull request may close this issue.

2 participants