This topic has 4 replies, 2 voices, and was last updated 11 years by SQadmin.

  • Author
  • #4092
     jward2090
    Participant

    Hi,

    This is a fairly complicated question. I have a profile field that I want users to fill out and then on their profile a button is displayed like this:

    COPY CODE
    
    add_action('kleo_bp_after_profile_name', 'my_profile_button');
    function my_profile_button()
    {
    echo '<a href="#" rel="nofollow">Some Text</a>';
    }
    

    I need to make a specific profile field show up in the href=”#” spot. I tried doing this but it “broke” my theme:

    COPY CODE
    
    add_action('kleo_bp_after_profile_name', 'my_profile_button');
    function my_profile_button()
    {
    echo '<a>">Some Text</a>';
    }
    

    Basically I need to change the link to whatever the user inputs in the profile field. Do you know a way to do this? If you want I can reply with the specific profile field I need added into the href=”#” spot, but I need it to be private.

    Thanks!

    #4093
     jward2090
    Participant

    For some reason I can’t edit my post. I used code and it didn’t display right…I had to take out the anchor tags and just replaced theme with “a” and “/a”. Here’s my edited post:

    Hi,

    This is a fairly complicated question. I have a profile field that I want users to fill out and then on their profile a button is displayed like this:

    add_action(‘kleo_bp_after_profile_name’, ‘my_profile_button’);
    function my_profile_button()
    {
    echo ‘a href=”#” class=”success button radius show-for-small” rel=”nofollow” My button’ /a ;
    }

    I need to make a specific profile field show up in the href=”#” spot. I tried doing this but it “broke” my theme:

    add_action(‘kleo_bp_after_profile_name’, ‘my_profile_button’);
    function my_profile_button()
    {
    echo ‘ a id=”link” href=”<?php echo $_POST[‘field’];?>”>My button /a’;
    }
    }

    Basically I need to change the link to whatever the user inputs in the profile field. Do you know a way to do this? If you want I can reply with the specific profile field I need added into the href=”#” spot, but I need it to be private.

    Thanks!

    #4146
     SQadmin
    Keymaster

    To add code here just wrap it in a “pre” tag.
    Inside the href you need to put this php function to get the field value by field name :
    bp_get_member_profile_data( ‘field=the field name’ );

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #4164
     jward2090
    Participant
    This reply has been set as private.
    #4181
     SQadmin
    Keymaster

    It is the field name…. just like it appears. I don’t understand your question

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 5 posts - 1 through 5 (of 5 total)

The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?