How to pass boolean value in shortcode in WordPress?

Posted by Pinki | Updated on

If you want to pass boolean value in shortcode in WordPress? Is easy to use 0 and 1 values and then typecasting inside the function:

[shortcode boolean_attribute='1'] or [shortcode boolean_attribute='0']but if you want you can also strictly check for 'false' and assign it to boolean, in this way you can also use:

[shortcode boolean_attribute='false'] or [shortcode boolean_attribute='true']


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers