I have a text field (well three of them actually) where users can enter their facebook, twitter, and soundcloud pages. the problem is some people enter the values with http, with https, or without either. How can I clean these values so that I can properly link to the pages?
Better use a URL field type that gets validated upon post publish or update so the users get an error message if the URL is not in the correct format without http:// or https:// . It’s better practice not to hardcode the http:// in your template because users usually copy links from the browsers’ address bar and http:// always gets copied and that will brake the links.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users