NO BUG: External URL link not working if there's no HTTPS in front of it

Browser: All
OS: All
URL: https://thepmca.org/members/revilomagic/

Easier to just watch the video :slight_smile:

Hey @ianforest, it is not Bricks specific that a link’s href attribute needs a scheme (like http(s), mailto, tel and so on) – see mdn. So you have to make sure that your custom field returns the urls containing the scheme.

What type of meta box field are you using? If you use a URL field you will see that meta box does not even allow saving the value without the scheme.

So I’d definitely recommend using a URL field. If you want to output the link title without the scheme you could create a small helper function:

function get_url_without_scheme( $id ) {
    $value = rwmb_meta( $id );
    if ( ! $value ) return false;
    return preg_replace( '/^https?:\/\//', '', $value );
}

You can then use this function for the link title using the echo tag:

{echo:get_url_without_scheme(a_url)}

(where a_url is the name of the custom field)

Hmm ok I will sort this out… thanks!