Hide the View PDF link in the Preview window

Note: This requires the PW WooCommerce Gift Cards Pro version.

If you do not want the View PDF link to appear when viewing the email design Preview, follow these steps:

1. Download the free Code Snippets plugin (https://wordpress.org/plugins/code-snippets/)
2. Create a new Snippet with the following code:

Note: you can add the code to your functions.php instead of using Code Snippets if you are more comfortable with that.

add_filter( 'pwgc_email_template_pdf_link_text', 'custom_pwgc_email_template_pdf_link_text', 10, 2 );
function custom_pwgc_email_template_pdf_link_text( $link_text, $item_data ) {
    if ( $item_data->preview ) {
        $link_text = '';
    }

    return $link_text;
}
Skip to content