Automattic\WooCommerce\Blocks\BlockTypes

AbstractProductGrid::get_title_html()protectedWC 1.0

Get the product title.

Method of the class: AbstractProductGrid{}

No Hooks.

Return

String.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_title_html( $product );
$product(\WC_Product) (required)
Product.

AbstractProductGrid::get_title_html() code WC 9.4.2

protected function get_title_html( $product ) {
	if ( empty( $this->attributes['contentVisibility']['title'] ) ) {
		return '';
	}

	return '<div class="wc-block-grid__product-title">' . wp_kses_post( $product->get_title() ) . '</div>';
}