digisavvy / some-like-it-neat

A WordPress Theme Using _s, Bourbon + Neat and Theme Hook Alliance
GNU General Public License v2.0
276 stars 61 forks source link

Yoda conditions #45

Closed justintadlock closed 9 years ago

justintadlock commented 9 years ago

There are places in the theme that should use Yoda conditions. Reference: https://make.wordpress.org/core/handbook/coding-standards/php/#yoda-conditions

Basically, you need to flip your if statement checks around. For example:

if( get_theme_mod( 'digistarter_mobile_hide_arrow' ) == 0 ) { ?>

Should be:

 if ( 0 == get_theme_mod( 'digistarter_mobile_hide_arrow' ) ) { ?>

I'll link to the ones I catch, but it's worth going through the code to make sure we're not missing any.

digisavvy commented 9 years ago

Thanks for this