| 1 |
<?php |
| 2 |
if( ! function_exists( 'boolval' ) ) { |
| 3 |
/** |
| 4 |
* Get the boolean value of a variable |
| 5 |
* |
| 6 |
* @param mixed The scalar value being converted to a boolean. |
| 7 |
* @return boolean The boolean value of var. |
| 8 |
*/ |
| 9 |
function boolval( $var ) { |
| 10 |
return !! $var; |
| 11 |
} |
| 12 |
} |
| 13 |
|
| 14 |
if ( ! function_exists( 'wp_roles' ) ) { |
| 15 |
/** |
| 16 |
* Retrieves the global WP_Roles instance and instantiates it if necessary. |
| 17 |
* |
| 18 |
* @since 4.3.0 |
| 19 |
* |
| 20 |
* @global WP_Roles $wp_roles WP_Roles global instance. |
| 21 |
* |
| 22 |
* @return WP_Roles WP_Roles global instance if not already instantiated. |
| 23 |
*/ |
| 24 |
function wp_roles() { |
| 25 |
global $wp_roles; |
| 26 |
if ( ! isset( $wp_roles ) ) { |
| 27 |
$wp_roles = new WP_Roles(); |
| 28 |
} |
| 29 |
|
| 30 |
return $wp_roles; |
| 31 |
} |
| 32 |
} |