Automattic\WooCommerce\Blocks\Utils
BlockTemplateUtils::get_block_template_title()
Returns template title.
Метод класса: BlockTemplateUtils{}
Хуков нет.
Возвращает
Строку
. Human friendly title.
Использование
$result = BlockTemplateUtils::get_block_template_title( $template_slug );
- $template_slug(строка) (обязательный)
- The template slug (e.g. single-product).
Код BlockTemplateUtils::get_block_template_title() BlockTemplateUtils::get block template title WC 9.8.4
public static function get_block_template_title( $template_slug ) { $registered_template = self::get_template( $template_slug ); if ( isset( $registered_template ) ) { return $registered_template->get_template_title(); } else { // Human friendly title converted from the slug. return ucwords( preg_replace( '/[\-_]/', ' ', $template_slug ) ); } }