get_files example

return $this->display( 'AuthorURI' );
            case 'Description':
                return $this->display( 'Description' );
            case 'Version':
            case 'Status':
                return $this->get( $offset );
            case 'Template':
                return $this->get_template();
            case 'Stylesheet':
                return $this->get_stylesheet();
            case 'Template Files':
                return $this->get_files( 'php', 1, true );
            case 'Stylesheet Files':
                return $this->get_files( 'css', 0, false );
            case 'Template Dir':
                return $this->get_template_directory();
            case 'Stylesheet Dir':
                return $this->get_stylesheet_directory();
            case 'Screenshot':
                return $this->get_screenshot( 'relative' );
            case 'Tags':
                return $this->get( 'Tags' );
            case 'Theme Root':
                
wp_die( __( 'The requested theme does not exist.' ) . ' ' . $theme->errors()->get_error_message() );
}

$allowed_files = array();
$style_files   = array();

$file_types = wp_get_theme_file_editable_extensions( $theme );

foreach ( $file_types as $type ) {
    switch ( $type ) {
        case 'php':
            $allowed_files += $theme->get_files( 'php', -1 );
            break;
        case 'css':
            $style_files                = $theme->get_files( 'css', -1 );
            $allowed_files['style.css'] = $style_files['style.css'];
            $allowed_files             += $style_files;
            break;
        default:
            $allowed_files += $theme->get_files( $type, -1 );
            break;
    }
}

'theme_no_stylesheet',
                __( 'The requested theme does not exist.' ) . ' ' . $theme->errors()->get_error_message()
            );
        }

        $editable_extensions = wp_get_theme_file_editable_extensions( $theme );

        $allowed_files = array();
        foreach ( $editable_extensions as $type ) {
            switch ( $type ) {
                case 'php':
                    $allowed_files = array_merge( $allowed_files$theme->get_files( 'php', -1 ) );
                    break;
                case 'css':
                    $style_files                = $theme->get_files( 'css', -1 );
                    $allowed_files['style.css'] = $style_files['style.css'];
                    $allowed_files              = array_merge( $allowed_files$style_files );
                    break;
                default:
                    $allowed_files = array_merge( $allowed_files$theme->get_files( $type, -1 ) );
                    break;
            }
        }

        
Home | Imprint | This part of the site doesn't use cookies.