Use an expression to select an array value in PHP. It's handy for quick output logic. Update: it's a bit too clever, perhaps, versus using the tenary operator.
$classes .= [ ' sort-default', ' sort-custom' ][ has_custom_sort( $post ) ];
Use an expression to select an array value in PHP. It's handy for quick output logic. Update: it's a bit too clever, perhaps, versus using the tenary operator.
$classes .= [ ' sort-default', ' sort-custom' ][ has_custom_sort( $post ) ];