Automattic\WooCommerce\EmailEditor\Engine
Email_Editor::extend_email_theme_styles
Extends the email theme styles with the email specific styles.
Method of the class: Email_Editor{}
No Hooks.
Returns
WP_Theme_JSON.
Usage
$Email_Editor = new Email_Editor(); $Email_Editor->extend_email_theme_styles( $theme, $post ): WP_Theme_JSON;
- $theme(WP_Theme_JSON) (required)
- Email theme styles.
- $post(WP_Post) (required)
- Email post object.
Email_Editor::extend_email_theme_styles() Email Editor::extend email theme styles code WC 10.5.0
public function extend_email_theme_styles( WP_Theme_JSON $theme, WP_Post $post ): WP_Theme_JSON {
$email_theme = get_post_meta( $post->ID, self::WOOCOMMERCE_EMAIL_META_THEME_TYPE, true );
if ( $email_theme && is_array( $email_theme ) ) {
$theme->merge( new WP_Theme_JSON( $email_theme ) );
}
return $theme;
}