Automattic\WooCommerce\Admin\Features\ProductBlockEditor
BlockTemplateUtils::get_block_template_path()
Return the path to a block template file. Otherwise, False.
Method of the class: BlockTemplateUtils{}
No Hooks.
Return
String|true|false
. Path to the template file or false.
Usage
$result = BlockTemplateUtils::get_block_template_path( $slug );
- $slug(string) (required)
- - Template slug.
BlockTemplateUtils::get_block_template_path() BlockTemplateUtils::get block template path code WC 9.7.1
public static function get_block_template_path( $slug ) { $directory = self::get_templates_directory(); $path = trailingslashit( $directory ) . $slug . '.php'; if ( ! file_exists( $path ) ) { return false; } return $path; }