roles, FALSE ) ) { return TRUE; } return FALSE; } /** * Simple helper to debug to the console of the browser. * Set WP_DEBUG_DISPLAY in your wp-config.php to true for view debug messages inside the console. * * @param string $description * @param string | array | object */ function _mw_adminimize_debug( $description = '' , $data ) { if ( ! defined( 'WP_DEBUG_DISPLAY' ) || ( defined( 'WP_DEBUG_DISPLAY' ) && ! WP_DEBUG_DISPLAY ) ) { return; } if ( '' === $description ) { $description = 'Debug in Console via Adminimize Plugin:'; } $output = 'console.info(' . json_encode( $description ) . ');'; $output .= 'console.log(' . json_encode( $data ) . ');'; $output = sprintf( '', $output ); echo $output; } /** * Return duplicate items from array. * * @param $array * * @return array */ function _mw_adminimize_get_duplicate( $array ) { return array_unique( array_diff_assoc( $array, array_unique( $array ) ) ); }