wp_is_theme_directory_ignored example

RecursiveIteratorIterator::LEAVES_ONLY
    );

    // Make a copy of the current theme.     foreach ( $theme_files as $file ) {
        // Skip directories as they are added automatically.         if ( ! $file->isDir() ) {
            // Get real and relative path for current file.             $file_path     = wp_normalize_path( $file );
            $relative_path = substr( $file_pathstrlen( $theme_path ) + 1 );

            if ( ! wp_is_theme_directory_ignored( $relative_path ) ) {
                $zip->addFile( $file_path$relative_path );
            }
        }
    }

    // Load templates into the zip file.     $templates = get_block_templates();
    foreach ( $templates as $template ) {
        $template->content = _remove_theme_attribute_in_block_template_content( $template->content );

        $zip->addFromString(
            
Home | Imprint | This part of the site doesn't use cookies.