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

[Update existing sniff] Allow register_block_style #250

Open
7 tasks
carolinan opened this issue Mar 18, 2020 · 1 comment
Open
7 tasks

[Update existing sniff] Allow register_block_style #250

carolinan opened this issue Mar 18, 2020 · 1 comment

Comments

@carolinan
Copy link

In https://github.com/WPTRT/WPThemeReview/blob/develop/WPThemeReview/Sniffs/PluginTerritory/ForbiddenFunctionsSniff.php
The sniff for regestering blocks is too strict.

The existing sniff is for 'register_block_*', so an error is shown for register_block_style().
register_block_style() is allowed in themes, so it should not cause an error.

To do:

  • Add the rule in the Theme Review handbook to the Requirements page.
  • Add the rule in the Theme Review handbook to the Recommended page.
  • Move the rule in the Theme Review handbook to the Requirements page.
  • Create unit tests
  • Create new sniff
  • Adjust existing WPCS / PHPCS sniff and send in PR upstream.
  • Add existing sniffname sniff to the ruleset.
@dingo-d
Copy link
Member

dingo-d commented Mar 18, 2020

A PR for this is straightforward:

Check https://developer.wordpress.org/?s=register_block_&post_type%5B%5D=wp-parser-function for all the register_block_* type functions, add them manually but exclude the style one.

Thanks for noticing this 👍

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

No branches or pull requests

2 participants