WPTT / WPThemeReview

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

Restrict defining deprecated define variables #110

Closed ernilambar closed 6 years ago

ernilambar commented 7 years ago

Separated from https://github.com/WPTRT/WordPress-Coding-Standards/pull/30#issuecomment-274225355

define('HEADER_IMAGE_WIDTH',1200);
define('HEADER_IMAGE_HEIGHT',600);

This type of code and similar should be caught by the sniff I believe. This code wont give Constant already defined error, since this was the recommended method used to override Custom Header before 3.4.

grappler commented 7 years ago

I think it makes sense. This code would fail in the current Theme Check too. https://github.com/WordPress/theme-check/blob/master/checks/constants.php