Automattic\WooCommerce\Internal\EmailEditor\WCTransactionalEmails
WCTransactionalEmailPostsGenerator::resolve_block_template_path
Resolve the absolute path of the block template for the given email.
Uses {@see self::resolve_block_template_name()} for name resolution and then delegates to wc_locate_template() theme overrides are honored.
Method of the class: WCTransactionalEmailPostsGenerator{}
No Hooks.
Returns
String. The absolute template path, or an empty string if none can be resolved.
Usage
$result = WCTransactionalEmailPostsGenerator::resolve_block_template_path( $email ): string;
- $email(WC_Email) (required)
- The email object.
Changelog
| Since 10.8.0 | Introduced. |
WCTransactionalEmailPostsGenerator::resolve_block_template_path() WCTransactionalEmailPostsGenerator::resolve block template path code WC 10.8.1
public static function resolve_block_template_path( $email ): string {
$template_name = self::resolve_block_template_name( $email );
if ( '' === $template_name ) {
return '';
}
return (string) wc_locate_template(
$template_name,
'',
(string) $email->template_base
);
}