$relative_path =
substr( $file_path,
strlen( $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( 'templates/' .
$template->slug . '.html',
$template->content
);
} // Load template parts into the zip file.
$template_parts =
get_block_templates( array
(), 'wp_template_part'
);
foreach ( $template_parts as $template_part ) { $zip->
addFromString(