WP_Block_Type::render()publicWP 5.0.0

Renders the block type output for given attributes.

Метод класса: WP_Block_Type{}

Хуков нет.

Возвращает

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

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

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

Список изменений

С версии 5.0.0 Введена.

Код WP_Block_Type::render() WP 6.5.2

public function render( $attributes = array(), $content = '' ) {
	if ( ! $this->is_dynamic() ) {
		return '';
	}

	$attributes = $this->prepare_attributes_for_render( $attributes );

	return (string) call_user_func( $this->render_callback, $attributes, $content );
}