WPTT / WPThemeReview

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

Add register block functions to forbidden functions sniff #215

Closed dingo-d closed 5 years ago

dingo-d commented 5 years ago

Added

register_block_type();
unregister_block_type();
register_block_core_rss();
register_block_core_search();
register_block_core_archives();
register_block_core_calendar();
register_block_core_shortcode();
register_block_core_tag_cloud();
register_block_core_categories();
register_block_core_latest_posts();

To the list of forbidden functions sniff, as blocks should be registered in plugins, not themes.

The list is generated from: https://developer.wordpress.org/?s=register_block_

timelsass commented 5 years ago

I think this covers it fine, but I was wondering as gutenberg becomes more developed and widely used in core (customizer, widgets, menus etc) if the sniff should check registerblock* instead of listing them out as they come to make it a little more future proof when new blocks are added.

dingo-d commented 5 years ago

Should I also add CRON functionality (#146) in this PR or should I open a new one after this has been merged?

jrfnl commented 5 years ago

Should I also add CRON functionality (#146) in this PR or should I open a new one after this has been merged?

I'd open a new PR after this one.

dingo-d commented 5 years ago

Ok, if everything is ok with this one feel free to merge it 🙂

jrfnl commented 5 years ago

Ok, if everything is ok with this one feel free to merge it

Did you still want to address my two nitpick comments ?

dingo-d commented 5 years ago

Oh, didn't saw new comments. On it :+1:

EDIT:

I've updated it @jrfnl 🙂