Url Validation "Must Contain"

Support Meta Box AIO Url Validation "Must Contain"Resolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #45787
    Mathew BlackMathew Black
    Participant

    Hello,

    Hoping you can help me out. ive looked over the docs and cant see how to get the following

    im looking to set up social links and want each url to validate.
    ie facebook url must contain 'facebook'

    and also would like to know how to exclude text
    ie facebook url must not contain 'gtm'

    #45795
    PeterPeter
    Moderator

    Hello Matthew,

    You can use the custom attribute HTML5 pattern and set a regex to validate the URL:
    - url must contain 'facebook'
    - url must not contain 'gtm'

    here is an example: ^(?=.*facebook)(?!.*gtm).*$
    https://imgur.com/UuHDmzr

    Following the documentation https://docs.metabox.io/custom-attributes/

    #45807
    Mathew BlackMathew Black
    Participant

    Peter,

    Worked a treat
    Thank you and Appreciated for the fast reply 🙂

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