disp_boolean

Return string versions of boolean values.

Description

(string) disp_boolean( (string) $bool_text ); 

Returns (string)

standardized boolean text.

Parameters (1)

0. $bool_text (string)
String boolean value.

Usage

  1. if ( !function_exists( 'disp_boolean' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'custom-post-type-ui/inc/utility.php'; 
  3.  
  4. // String boolean value. 
  5. $bool_text = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = disp_boolean($bool_text); 
  9.  

Defined (1)

The function is defined in the following location(s).

/inc/utility.php  
  1. function disp_boolean( $bool_text ) { 
  2. $bool_text = (string) $bool_text; 
  3. if ( empty( $bool_text ) || '0' === $bool_text || 'false' === $bool_text ) { 
  4. return 'false'; 
  5.  
  6. return 'true';