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 | array | object * @param string $description * * @return string|void */ function _mw_adminimize_debug( $data, $description = '' ) { if ( ! _mw_adminimize_get_option_value( 'mw_adminimize_debug' ) ) { return; } if ( '' === $description ) { $description = 'Debug in Console via Adminimize Plugin:'; } // Buffering to solve problems with WP core, header() etc. ob_start(); $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 ) ) ); } /** * Get intersection of a multiple array. * * @since 2016-06-28 * * @param $array array Array with settings of all roles. * * @return array Data with only the data, there in each role active. */ function _mw_adminimize_get_intersection( $array ) { return (array) call_user_func_array( 'array_intersect', $array ); }