Automattic\WooCommerce\Internal\Features\ProductBlockEditor\ProductTemplates
AbstractProductFormTemplate::get_group_by_id
Get a group block by ID.
Method of the class: AbstractProductFormTemplate{}
No Hooks.
Returns
null. Nothing (null).
Usage
$AbstractProductFormTemplate = new AbstractProductFormTemplate(); $AbstractProductFormTemplate->get_group_by_id( $group_id ): ?GroupInterface;
- $group_id(string) (required)
- The group block ID.
AbstractProductFormTemplate::get_group_by_id() AbstractProductFormTemplate::get group by id code WC 10.8.1
public function get_group_by_id( string $group_id ): ?GroupInterface {
$group = $this->get_block( $group_id );
if ( $group && ! $group instanceof GroupInterface ) {
throw new \UnexpectedValueException( 'Block with specified ID is not a group.' );
}
return $group;
}