WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Платформа для конвертации и монетизации трафика
функция не описана

Automattic\WooCommerce\Blocks\BlockTypes

FeaturedProduct::render() public WC 1.0

Render the Featured Product block.

{} Это метод класса: FeaturedProduct{}

Хуки из метода
Возвращает

Строку. Rendered block type output.

Использование

$FeaturedProduct = new FeaturedProduct();
$FeaturedProduct->render( $attributes, $content );
$attributes(массив)
Block attributes.
По умолчанию: empty array
$content(строка)
Block content.
По умолчанию: empty string

Код FeaturedProduct::render() WC 4.7.1

<?php
public function render( $attributes = array(), $content = '' ) {
	$id      = isset( $attributes['productId'] ) ? (int) $attributes['productId'] : 0;
	$product = wc_get_product( $id );
	if ( ! $product ) {
		return '';
	}
	$attributes = wp_parse_args( $attributes, $this->defaults );
	if ( ! $attributes['height'] ) {
		$attributes['height'] = wc_get_theme_support( 'featured_block::default_height', 500 );
	}

	$title = sprintf(
		'<h2 class="wc-block-featured-product__title">%s</h2>',
		wp_kses_post( $product->get_title() )
	);

	if ( $product->is_type( 'variation' ) ) {
		$title .= sprintf(
			'<h3 class="wc-block-featured-product__variation">%s</h3>',
			wc_get_formatted_variation( $product, true, true, false )
		);
	}

	$desc_str = sprintf(
		'<div class="wc-block-featured-product__description">%s</div>',
		apply_filters( 'woocommerce_short_description', $product->get_short_description() ? $product->get_short_description() : wc_trim_string( $product->get_description(), 400 ) )
	);

	$price_str = sprintf(
		'<div class="wc-block-featured-product__price">%s</div>',
		$product->get_price_html()
	);

	$output = sprintf( '<div class="%1$s" style="%2$s">', esc_attr( $this->get_classes( $attributes ) ), esc_attr( $this->get_styles( $attributes, $product ) ) );

	$output .= $title;
	if ( $attributes['showDesc'] ) {
		$output .= $desc_str;
	}
	if ( $attributes['showPrice'] ) {
		$output .= $price_str;
	}
	$output .= '<div class="wc-block-featured-product__link">' . $content . '</div>';
	$output .= '</div>';

	return $output;
}