WPTT / WPThemeReview

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

Check Theme Text domain #111

Closed grappler closed 7 years ago

grappler commented 7 years ago

fixes #35

With https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/pull/685 multiple text domains are supported and with https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/pull/807 we can easily pass the text domains via the cli.

phpcs -p . --standard=WordPress-Theme --runtime-set text_domain my-slug,default

Or via a custom ruleset.

<rule ref="WordPress.WP.I18n">
   <properties>
     <property name="text_domain" value="my-slug,default"/>
   </properties>
</rule>

We can then add the list of allowed framework text domains to the the Theme Check plugin.

grappler commented 7 years ago

🤦‍♂️