• Resolved bebizzy

    (@bebizzy)


    I have a field in UM that is an invoice URL (Payment Link). I currently have it shown as a URL field that the client then has to copy/paste in a browser to make a payment.

    Should I have this listed as something else that is clickable, or anyone have some information on how to make a button or link with that link URL?

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • @bebizzy

    You can use a shortcode to create a button for the URL

    [link_button url="https://my.domain.com/payment.html" text="Payment Link"]

    add_shortcode( 'link_button', 'my_link_button_shortcode' );
    function my_link_button_shortcode( $atts, $content ) {
    
        $html = '<button><a href="' . esc_url( $atts['url'] ) . '">' . esc_attr( $atts['text'] ) . '</a></button>';
        return $html;
    }

    You install the code snippet by adding it
    to your active theme’s functions.php file
    or use the “Code Snippets” Plugin

    https://wordpress.org/plugins/code-snippets/

    Thread Starter bebizzy

    (@bebizzy)

    Thank you @missveronicatv

    This should work. But how do I grab the URL that’s already stored in a field and insert that here?

    Your code has : “https://my.domain.com/payment.html&#8221;

    I need that to be a variable from the same field that already has the URL, not a hard-coded URL.

    @bebizzy

    You can try to use the “Shortcode Profile Info” plugin
    and replace key_name with your meta_key name.

    [um_profile_info type="url" meta_key="key_name" user_id="" text_meta_key="" icon=""]Payment Link[/um_profile_info]

    https://github.com/MissVeronica/um-shortcode-profile-info

    Plugin Support andrewshu

    (@andrewshu)

    Hi @bebizzy

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread if any other questions come up and we’d be happy to help. 🙂

    Regards

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Clickable Link or Button’ is closed to new replies.