'search', self::CAP_SEARCHREGEX_OPTIONS => 'options', self::CAP_SEARCHREGEX_SUPPORT => 'support', ]; $available = []; foreach ( $pages as $key => $page ) { if ( self::has_access( $key ) ) { $available[] = $page; } } return array_values( apply_filters( self::FILTER_PAGES, $available ) ); } /** * Return all the capabilities the current user has * * @return array Array of capabilities */ public static function get_all_capabilities() { $caps = self::get_every_capability(); $caps = array_filter( $caps, function( $cap ) { return self::has_access( $cap ); } ); return array_values( apply_filters( self::FILTER_ALL, $caps ) ); } /** * Unfiltered list of all the supported capabilities, without influence from the current user * * @return array Array of capabilities */ public static function get_every_capability() { return [ self::CAP_SEARCHREGEX_SEARCH, self::CAP_SEARCHREGEX_OPTIONS, self::CAP_SEARCHREGEX_SUPPORT, ]; } }