I'm looking for a way to check just check for an option existing when executing a shortcode, but that option doesnt need a value. How do I just check for JUST an option? For example I tried this out, I want the following code to output true, but it is still outputting false.
PHP:
function Test($atts) {
extract(shortcode_atts(array(
'row' => null
), $atts));
$output = 'false';
if($row) {
$output = 'true';
}
return $output;
}
add_shortcode("test", "Test");
In The WYSIWYG:
[test row]
Will just output "false". But if I were to say:
[test row="true"]
It will output "true" onto the page.
Again, I want to just check for that option row
just being there, not to have to feed it a value. Thanks!