WPTT / WPThemeReview

PHP_CodeSniffer rules (sniffs) to enforce WordPress theme review coding conventions
MIT License
207 stars 38 forks source link

[Update existing sniff] Allow register_block_style #250

Open carolinan opened 4 years ago

carolinan commented 4 years ago

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:

dingo-d commented 4 years ago

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 👍