WordPress-Coding-Standards
WordPress-Coding-Standards copied to clipboard
Handbook: Check that ternaries test for `true`
Ternary operators are fine, but always have them test if the statement is true, not false. Otherwise, it just gets confusing. (An exception would be using ! empty(), as testing for false here is generally more intuitive.)
ref: https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/#ternary-operator