Email field does not take any html email parameters, is there a way to do that?

Support General Email field does not take any html email parameters, is there a way to do that?Resolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #21223
    hartsook@gmail.com[email protected]
    Participant

    For example I want to add a subject in a mailto: link using MB custom fields. I'm using the Email field, but it won't accept the ?subject=AboutMyWebsite after the actual email address.

    I tried adding the attribute sanitize_callback = none on the Email field, but that didn't work.

    Maybe I need to add another field for the email paramaters and then combine them somehow to form a clickable link or a button link.

    Any suggestions?

    #21224
    Long NguyenLong Nguyen
    Moderator

    Hi,

    You can use the custom sanitize callback to add some text after the field email. See my screenshot https://share.getcloudapp.com/X6uNOn7K.

    function custom_sanitize_email( $value ) {    
        $value = $value . '?subject=AboutMyWebsite';
        return $value;
    }

    For more information, please follow this documentation https://docs.metabox.io/sanitization/#custom-sanitize-callback.

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