WordPress at Your Fingertips
function is not described

WC_Admin_Meta_Boxes::remove_block_templates() public WC 1.0

Remove block-based templates from the list of available templates for products.

{} It's a method of the class: WC_Admin_Meta_Boxes{}

No Hooks.

Return

String[]. Templates array excluding block-based templates.

Usage

$WC_Admin_Meta_Boxes = new WC_Admin_Meta_Boxes();
$WC_Admin_Meta_Boxes->remove_block_templates( $templates );
$templates(string[]) (required)
Array of template header names keyed by the template file name.

Code of WC_Admin_Meta_Boxes::remove_block_templates() WC 5.8.0

public function remove_block_templates( $templates ) {
	if ( count( $templates ) === 0 || ! function_exists( 'gutenberg_get_block_template' ) ) {
		return $templates;
	}

	$theme              = wp_get_theme()->get_stylesheet();
	$filtered_templates = array();

	foreach ( $templates as $template_key => $template_name ) {
		$gutenberg_template = gutenberg_get_block_template( $theme . '//' . $template_key );

		if ( ! $gutenberg_template ) {
			$filtered_templates[ $template_key ] = $template_name;
		}
	}

	return $filtered_templates;
}