Automattic\WooCommerce\Blocks\BlockTypes
AbstractProductGrid::render() public WC 1.0
Include and render the dynamic block.
{} Это метод класса: AbstractProductGrid{}
Хуков нет.
Возвращает
Строку
. Rendered block type output.
Использование
$AbstractProductGrid = new AbstractProductGrid(); $AbstractProductGrid->render( $attributes, $content );
- $attributes(массив)
- Block attributes.
По умолчанию: empty array - $content(строка)
- Block content.
По умолчанию: empty string
Код AbstractProductGrid::render() AbstractProductGrid::render WC 5.1.0
public function render( $attributes = array(), $content = '' ) {
$this->attributes = $this->parse_attributes( $attributes );
$this->content = $content;
$this->query_args = $this->parse_query_args();
$products = $this->get_products();
if ( ! $products ) {
return '';
}
$classes = $this->get_container_classes();
$output = implode( '', array_map( array( $this, 'render_product' ), $products ) );
return sprintf( '<div class="%s"><ul class="wc-block-grid__products">%s</ul></div>', esc_attr( $classes ), $output );
}