WPThemeReview
WPThemeReview copied to clipboard
[Update existing sniff] Allow register_block_style
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
sniffnamesniff to the ruleset.
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 👍