Automattic\WooCommerce\Internal\Admin\BlockTemplates
BlockTemplateLogger::template_events_to_json
Get all template events for a given template as a JSON like array.
Method of the class: BlockTemplateLogger{}
No Hooks.
Returns
null. Nothing (null).
Usage
$BlockTemplateLogger = new BlockTemplateLogger(); $BlockTemplateLogger->template_events_to_json( $template_id ): array;
- $template_id(string) (required)
- Template ID.
BlockTemplateLogger::template_events_to_json() BlockTemplateLogger::template events to json code WC 10.6.2
public function template_events_to_json( string $template_id ): array {
if ( ! isset( $this->all_template_events[ $template_id ] ) ) {
return array();
}
$template_events = $this->all_template_events[ $template_id ];
return $this->to_json( $template_events );
}