Open justintadlock opened 8 years ago
When doing logical comparisons, use Yoda conditions. For example in the ih_social_share_sanitize_checkbox() method, you have this line of code:
ih_social_share_sanitize_checkbox()
if ( $input == 1 ) {
Ideally, that would be:
if ( 1 == $input ) {
See: https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/#yoda-conditions
Also, you could simplify that entire function's code:
if ( $input == 1 ) { return 1; } else { return ''; }
...down to this:
return 1 == $input ? 1 : '';
When doing logical comparisons, use Yoda conditions. For example in the
ih_social_share_sanitize_checkbox()
method, you have this line of code:Ideally, that would be:
See: https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/#yoda-conditions
Also, you could simplify that entire function's code:
...down to this: