Reputation: 19
if ($args->theme_location === 'header' || $args->theme_location === 'uia') {
evaluates to: (bool) false (bool) True
if ($args->theme_location === 'header' || 'uia') {
evaluates to: (bool) false (bool) True
Upvotes: 0
Views: 26
Reputation: 462
This condition will always be true. The reason is the different priorities of the operators. === works first, || works after. Therefore $ args-> theme_location === 'header' || 'uia' is always true This is the same as
($args->theme_location === 'header') || 'uia'
Upvotes: 1