r-a-y / buddypress-followers

Follow users on your BuddyPress site. Similar to Twitter!
http://wordpress.org/plugins/buddypress-followers/
74 stars 39 forks source link

Change Position #79

Closed ooclaar closed 8 years ago

ooclaar commented 8 years ago

Hello, how do I change the location that appears the buttons?

r-a-y commented 8 years ago

It depends what position you are referring to.

If you are talking about the profile header, the code that adds the button is:

add_action( 'bp_member_header_actions', 'bp_follow_add_profile_follow_button' );

If you want to change where in the profile header the button is added, you will need to remove the default position and re-add the button.

Add the following in wp-content/plugins/bp-custom.php:

function my_bp_follow_mods() {
    if ( false === function_exists( 'bp_follow_init' ) ) {
        return;
    }

    // Remove the default placement of the 'Follow' button in the profile header.
    remove_action( 'bp_member_header_actions', 'bp_follow_add_profile_follow_button' );

    // Re-add the 'Follow' button in the profile header, but add it earlier in the profile header.
    // Change 5 to wherever you need to position the button.
    add_action( 'bp_member_header_actions', 'bp_follow_add_profile_follow_button', 5 );
}
add_action( 'bp_init', 'my_bp_follow_mods' );

I'm closing this, because this isn't a plugin issue, but more of a support issue.