This is what's known as a ternary.
However, due to the code style (lack of parens), it's a bit harder to see what is actually happening.
$debug_mode = 'yes' === get_option( 'woocommerce_shipping_debug_mode', 'no' );
My preference is to wrap the condition in parens, to make it a bit more obvious:
$debug_mode = ( 'yes' === get_option( 'woocommerce_shipping_debug_mode', 'no' ) );
Which now looks more clearly like what it is - an assignment to the variable $debug_mode
of whether or not the woocommerce_shipping_debug_mode
option is ===
to yes
(which will return either a TRUE
or FALSE
.
The "long hand" of what this would look like is this:
$debug_mode = ( 'yes' === get_option( 'woocommerce_shipping_debug_mode', 'no' ) ) ? TRUE : FALSE;
But, since the condition returns TRUE
or FALSE
anyway, the ? TRUE : FALSE
portion is redundant.
To explicitly answer your second question, "why would someone use this verbiage", - they are just getting the option value - they wrote it this way because it's brief. This is a perfect example of why we should write code for humans, not just for machines :)