Question about a statement that uses the ? operator
-
Hi everyone,
I’ve been following this tutorial about creating custom meta boxes:
I was wondering if anyone could explain this line of code that uses the ? operator. The code is:
$text = isset( $values['my_meta_box_text'] ) ? esc_attr( $values['my_meta_box_text'][0] ) : ”;
I understand what happens if the expression evaluates to TRUE (i.e. if the meta text box has a value), but I can’t understand what happens if the expression evaluates to FALSE. The code after the colon that would be triggered in this scenario is merely: ” (i.e. nothing but a closing curly quote). I would really appreciate it if someone could explain what this code does or what it refers to?! Cheers for any help.
- The topic ‘Question about a statement that uses the ? operator’ is closed to new replies.