public static function get_category_extensions($categories)
    {
        if (empty($categories)) {
            return array();
        }

        // Fix arguments into a single array
        if (!is_array($categories)) {
            $categories = array($categories);
        } elseif (count($categories) === 1 && is_array(reset($categories))) {
            $categories = reset($categories);
        }

        // Check configured categories
        $appCategories = static::config()->get('app_categories');

        // Merge all categories into list of extensions
        $extensions = array();
        foreach (array_filter($categories) as $category) {
            if (isset($appCategories[$category])) {
                $extensions = array_merge($extensions, $appCategories[$category]);
            } else {
                throw new InvalidArgumentException("Unknown file category: $category");
            }
        }
        $extensions = array_unique($extensions);
        sort($extensions);
        return $extensions;
    }
public static function get_category_extensions($categories)
    {
        if (empty($categories)) {
            return array();
        }

        // Fix arguments into a single array
        if (!is_array($categories)) {
            $categories = array($categories);
        } elseif (count($categories) === 1 && is_array(reset($categories))) {
            $categories = reset($categories);
        }

        // Check configured categories
        $appCategories = static::config()->get('app_categories');

        // Merge all categories into list of extensions
        $extensions = array();
        foreach (array_filter($categories) as $category) {
            if (isset($appCategories[$category])) {
                $extensions = array_merge($extensions, $appCategories[$category]);
            } else {
                throw new InvalidArgumentException("Unknown file category: $category");
            }
        }
        $extensions = array_unique($extensions);
        sort($extensions);
        return $extensions;
    }
public static function get_category_extensions ( $ categories ) { if ( empty ( $ categories ) ) { return array ( ) ; } // Fix arguments into a single array if ( ! is_array ( $ categories ) ) { $ categories = array ( $ categories ) ; } elseif ( count ( $ categories ) === 1 && is_array ( reset ( $ categories ) ) ) { $ categories = reset ( $ categories ) ; } // Check configured categories $ appCategories = static :: config ( ) -> get ( 'app_categories' ) ; // Merge all categories into list of extensions $ extensions = array ( ) ; foreach ( array_filter ( $ categories ) as $ category ) { if ( isset ( $ appCategories [ $ category ] ) ) { $ extensions = array_merge ( $ extensions , $ appCategories [ $ category ] ) ; } else { throw new InvalidArgumentException ( "Unknown file category: $category" ) ; } } $ extensions = array_unique ( $ extensions ) ; sort ( $ extensions ) ; return $ extensions ; }
For a category or list of categories, get the list of file extensions

@param array|string $categories List of categories, or single category
@return array
For a category or list of categories get the list of file extensions