Automattic\WooCommerce\Internal\Features\ProductBlockEditor\ProductTemplates

AbstractProductFormTemplate::get_section_by_id()publicWC 1.0

Get a section block by ID.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

$AbstractProductFormTemplate = new AbstractProductFormTemplate();
$AbstractProductFormTemplate->get_section_by_id( $section_id ): ?SectionInterface;
$section_id(строка) (обязательный)
The section block ID.

Код AbstractProductFormTemplate::get_section_by_id() WC 9.7.1

public function get_section_by_id( string $section_id ): ?SectionInterface {
	$section = $this->get_block( $section_id );
	if ( $section && ! $section instanceof SectionInterface ) {
		throw new \UnexpectedValueException( 'Block with specified ID is not a section.' );
	}
	return $section;
}