How to add a button with a link inputed from the user

Home Forums Legacy Support Support queries How-to & Troubleshooting How to add a button with a link inputed from the user

Tagged: ,

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #107655
    shubh jangam
    Participant
    Hello Admin , I need a bit of help , In the image attached below , I have circled some space , In that space I want a button to be added named "Book an appointment" , and that button should have a link what the user inputs on the registration form, please help me out! Screenshot
    #107789
    H.K. Latiyan
    Participant
    In the registration form is it a user profile field where the instructor is adding the link. If yes then you can add the bellow code in your wplms-customizer.php file present in your wplms customizer plugin. add_action('bp_after_course_menu_instructors',function(){   $user_id = get_the_author_meta( 'ID' ); if(function_exists('bp_get_profile_field_data')){ $link = bp_get_profile_field_data( array( 'field' => 'appointment', // This is the field name. 'user_id' => $user_id // This is the user id. )); } if(!empty($link)){ echo '<a class="button" href="'.$link.'">Book an appointment</a>'; } });   NOTE: In the code above change the appointment with your profile field name to get the link. PS: This is a customization and the customization is not the part of theme support, please consider hiring a freelancer or a developer for such customizations.
    #107796
    shubh jangam
    Participant
    This reply has been marked as private.
    #107807
    H.K. Latiyan
    Participant
    This reply has been marked as private.
    #107813
    shubh jangam
    Participant
    This reply has been marked as private.
    #107817
    shubh jangam
    Participant
    This reply has been marked as private.
    #108012
    H.K. Latiyan
    Participant
    The code was correct you do not have to change the code. You only need to add the full link like http://vibethemes.com in the profile field and then it will show the correct url. NOTE: If you do not add http:// in your link then the url will be generated incorrectly. I checked this on my test setup and it worked fine. If the issue persists please share the admin credentials with us to check this on your website and make it work for you. PS: Please mark your reply as private while sharing the credentials.
    #108226
    shubh jangam
    Participant
    This reply has been marked as private.
    #108227
    shubh jangam
    Participant
    This reply has been marked as private.
    #108310
    Thanks for the kind words. #Cheers :) Closing the topic.
Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘How to add a button with a link inputed from the user’ is closed to new replies.