MailPoet\EmailEditor\Engine\Templates
Templates::get_block_template()
Get a block template by ID.
Method of the class: Templates{}
No Hooks.
Return
WP_Block_Template|null
.
Usage
$Templates = new Templates(); $Templates->get_block_template( $template_slug );
- $template_slug(string) (required)
- The template slug.
Templates::get_block_template() Templates::get block template code WC 9.8.1
public function get_block_template( $template_slug ) { // Template id is always prefixed by active theme and get_stylesheet returns the active theme slug. $template_id = get_stylesheet() . '//' . $template_slug; return get_block_template( $template_id ); }