__( 'HTML template', 'woocommerce' ),
'template_plain' => __( 'Plain text template', 'woocommerce' ),
);
foreach ( $templates as $template_type => $title ) :
$template = $this->get_template( $template_type );
if ( empty( $template ) ) {
continue;
}
$local_file = $this->get_theme_template_file( $template );
$core_file = $this->template_base . $template;
$template_file = apply_filters( 'woocommerce_locate_core_template', $core_file, $template, $this->template_base, $this->id );
$template_dir = apply_filters( 'woocommerce_template_directory', 'woocommerce', $template );
?>
' . esc_html( trailingslashit( basename( get_stylesheet_directory() ) ) . $template_dir . '/' . $template ) . '' );
?>
' . esc_html( plugin_basename( $template_file ) ) . '', '' . esc_html( trailingslashit( basename( get_stylesheet_directory() ) ) . $template_dir . '/' . $template ) . '' );
?>
AltBody = ''; // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
}
}
/**
* Get an option or transient for email preview.
*
* @param string $key Option key.
* @param mixed $empty_value Value to use when option is empty.
*/
protected function get_option_or_transient( string $key, $empty_value = null ) {
$option = $this->get_option( $key, $empty_value );
/**
* This filter is documented in templates/emails/email-styles.php
*
* @since 9.6.0
* @param bool $is_email_preview Whether the email is being previewed.
*/
$is_email_preview = apply_filters( 'woocommerce_is_email_preview', false );
if ( $is_email_preview ) {
$email_id = $this->id;
$transient = get_transient( "woocommerce_{$email_id}_{$key}" );
if ( false !== $transient ) {
$option = $transient ? $transient : $empty_value;
}
}
return $option;
}
}