Automattic\WooCommerce\Internal\EmailEditor
Integration::update_preview_post_template_html_data
Filter email preview data used when previewing the email in new tab.
Method of the class: Integration{}
No Hooks.
Returns
String. The updated preview HTML with placeholders replaced.
Usage
$Integration = new Integration(); $Integration->update_preview_post_template_html_data( $data );
- $data(string) (required)
- The preview HTML string.
Integration::update_preview_post_template_html_data() Integration::update preview post template html data code WC 10.3.6
public function update_preview_post_template_html_data( $data ) {
// phpcs:disable WordPress.Security.NonceVerification.Recommended
// Nonce verification is disabled here because the preview action doesn't modify data,
// and the check caused issues with the 'Preview in new tab' feature due to context changes.
$type_param = isset( $_GET['woo_email'] ) ? sanitize_text_field( wp_unslash( $_GET['woo_email'] ) ) : '';
// phpcs:enable
return $this->update_email_preview_data( $data, $type_param );
}