• Resolved telemarker

    (@telemarker)


    hi there,

    i just noticed that the br-tags of the message are all gone and the words get glued together which is quite ugly appereance for a gift card template.
    how can i fix this?

    all my best
    telemarker

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello @telemarker

    According to WordPress standard we have used wp_kses in all input in that all the tags, script and spaces will get removed.
    If you want to remove wp_kses you can make the changes in below line. Gift message will display fine.

    
    public function mwb_wgm_preview_thickbox_rqst()
    //replace this line $_POST['message'] = isset( $_POST['message'] ) ? stripcslashes( sanitize_text_field( wp_unslash( $_POST['message'] ) ) ) : '';
    with
    $_POST['message'] = isset( $_POST['message'] ) ? $_POST['message'] : '';
    
    public function mwb_wgm_preview_email_on_single_page()
    //replace this line
    //$args['message'] = isset( $_GET['message'] ) ? sanitize_text_field( wp_unslash( $_GET['message'] ) ) : '';
    with
    $args['message'] = isset( $_GET['message'] ) ? $_GET['message'] : '';
    replace thsi line
    //echo wp_kses( $message, $allowed_tags );
    with
    echo $message;
    

    With Regards,
    MakeWebBetter

    • This reply was modified 4 years, 7 months ago by Yui.
    • This reply was modified 4 years, 7 months ago by Yui. Reason: please use CODE button for proper formatting
    Thread Starter telemarker

    (@telemarker)

    i put this in the functions.php of the theme?

    You have to go in our plugin woo-gift-cards-lite/public/class-woocommerce_gift_cards_lite-public.php
    then find the above function and change the code accordingly.

    Thread Starter telemarker

    (@telemarker)

    ok, i did that but it still does not work.

    After making these changes in the code break line should be display properly.
    Now from the template edit page please replace this <td> where you have used the [MESSAGE] shortcode. Here is code for <td>

    <td class="center-on-narrow" dir="ltr" style="font-family: sans-serif; font-size: 15px; mso-height-rule: exactly; line-height: 20px; padding: 0px 30px 0 20px; min-height: 170px; height: auto;" valign="top">
    <p class="mwb_message" style="text-align: center; line-height: 25px; white-space: pre-line; font-size: 16px; padding: 20px;">[MESSAGE]</p>
    </td>
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘keep line breaks in message’ is closed to new replies.