Automattic\WooCommerce\Admin\Features\ProductBlockEditor
BlockTemplateUtils::get_block_template_path
Return the path to a block template file. Otherwise, False.
Метод класса: BlockTemplateUtils{}
Хуков нет.
Возвращает
Строку|true|false. Path to the template file or false.
Использование
$result = BlockTemplateUtils::get_block_template_path( $slug );
- $slug(строка) (обязательный)
- - Template slug.
Код BlockTemplateUtils::get_block_template_path() BlockTemplateUtils::get block template path WC 10.9.4
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;
}