Support » Plugin: BuddyPress Follow » customize follow button

  • Hi,

    I am using your code to display the follow button:

    if ( function_exists( 'bp_follow_add_follow_button' ) ) :
        if ( bp_loggedin_user_id() && bp_loggedin_user_id() != get_the_author_meta( 'ID' ) ) {
            bp_follow_add_follow_button( array(
                'leader_id'   => get_the_author_meta( 'ID' ),
                'follower_id' => bp_loggedin_user_id()
            ) );

    Is it possible to use the button arguments in this filter too?

    // setup the button arguments
    		$button = array(
    			'id'                => $id,
    			'component'         => 'follow',
    			'must_be_logged_in' => true,
    			'block_self'        => empty( $members_template->member ) ? true : false,
    			'wrapper_class'     => 'follow-button ' . $id,
    			'wrapper_id'        => 'follow-button-' . $leader_id,
    			'link_href'         => wp_nonce_url( $leader_domain . $bp->follow->followers->slug . '/' . $action .'/', $action . '_following' ),
    			'link_text'         => $link_text,
    			'link_title'        => $link_title,
    			'link_id'           => $class . '-' . $leader_id,
    			'link_class'        => $class

    I would like to set the link_text myself and use the Twitter Bootstrap button classes. If it is possible. Could you give an example?


Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author r-a-y


    Good catch. The button template tag needs to be more flexible so you can set those parameters when you manually add the button.

    In the meantime, you could use the existing CSS class and ID to add those styles.


    About the link_text in the follow button. Is there also a temporary solution to remove the name of the user? I am displaying the follow button behind a user profile link (with username as text) and it doesn’t look nice to display the username twice. It also takes to much space 🙂

    I could use the localization file to remove the username, but that is site wide.

    Thank you for the support.

    Plugin Author r-a-y


    You’ll have to use the localizaton file until I get to this.

    Once that is done, you should be able to customize all aspects of the button.

    Keep your eye on:

    Plugin Author r-a-y


    Hi pepperbase,

    Forgot to reply back to you, but I answered a similar question awhile ago:

    You can actually set the link text by using a code snippet similar to the one I provided in that thread:

    Hope that helps.

    Plugin Author r-a-y


    Actually, after re-reading the initial post, I didn’t really address the main issue of setting the other button parameters.

    But, the post above gives you a workaround until I look into this.

    Thanks I already used the localization file to change the text, but I will change it after an update with the above solution.

    Would be nice to set the other parameters.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘customize follow button’ is closed to new replies.