Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1340878

    Hi,

    how can I stop the setting of links (html-code) in the contact form?

    Thanks and best regards

    #1341211

    Hey,

    Thanks for contacting us!

    I am not sure I understood the changes you would like to make clearly. Could you please elaborate? If you have screenshots, please upload them on imgur.com and post the links here :)

    Best regards,
    Yigit

    #1341599

    Hey Yigit,

    Thanks for the answer.
    I would like to prevent clickable links from being sent in the message text via the contact form.
    Is there a way to turn these links off?

    Best regards,
    Andreas

    #1341747

    Hi,

    Thank you for the inquiry.

    We might be able to use the pointer-events property to make the links within the message unclickable. Please add this filter in the functions.php file to add the style attribute to the links and set the pointer-events css property to none.

    add_filter("avf_contact_form_incoming_mail", function($mail_array, $new_post, $form_params, $cs, $from, $from_filtered) {
        $mail_array["Message"] = preg_replace('/<a/', '<a style="pointer-events: none; color: inherit;"', $mail_array["Message"]);
        return $mail_array;
    }, 10, 6);
    

    Best regards,
    Ismael

    #1341773
    This reply has been marked as private.
    #1341899

    Hi,

    Thank you for the screenshots.

    Looks like you have copied the code from your email based on your screenshots. Please make sure to copy the code directly from the forum and check if the code is actually the same as what we posted above.

    Best regards,
    Ismael

    #1342356

    Hey Ismael,

    thank you very much.
    Now the code does not give an error message, but clickable links can still be sent.
    Is there perhaps another possibility?

    Best regards,
    Andreas

    #1342513

    Hi,

    Did you actually send a new message using the contact form? Please note that older messages will not be affected by this filter.

    Best regards,
    Ismael

    #1349170

    Hi,
    wie ist denn: “und setzen Sie die CSS- Eigenschaft pointer-events auf none” zu verstehen?

    #1349171

    Hi Tobi,

    They are already set to none in the code Ismael shared here – https://kriesi.at/support/topic/html-code-in-contact-form/#post-1341747.
    You can simply copy & paste the code into functions.php file of your child theme in Appearance > Editor

    Best regards,
    Yigit

    #1349173

    Hi Yigit, vielen Dank für die Info. Leider funktioniert es nicht … ich habe:

    “add_filter(“avf_contact_form_incoming_mail”, function($mail_array, $new_post, $form_params, $cs, $from, $from_filtered) {
    $mail_array[“Message”] = preg_replace(‘/<a/’, ‘<a style=”pointer-events: none; color: inherit;”‘, $mail_array[“Message”]);
    return $mail_array;
    }, 10, 6);”

    in die function.php eingefügt und mir über meine Website eine Nachricht mit eingefügtem Link geschickt … der Link ist in der Mail dann leider immer noch anklickbar. Muss ich sonst noch was machen?

    VG

    #1349760

    Hi,

    Thank you for the update.

    We may need to test this modification further. Please post the WP and FTP details in the private field, and make sure that the theme is updated to version 4.9.2.1.

    Best regards,
    Ismael

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.