Move Facebook Register Button in BuddyPress Register page to the bottom

Hi I recently install the Ultimate Facebook plugin and it works like a charm. I was just wondering if there was any way I can move the button from the top of the buddypress registration to the bottom because somehow the button just looks awkward at its current location.

I have a made a screenshot for you guys to take a look.

http://screencast.com/t/XzKic8qeF

  • aristath
    • Recruit

    Hello there @philippesoriano,
    I'm araid this will equire some custom coding...
    BuddyPress uses a template file for its registrations.
    You'll have to manually edit that template file (or if it dosn't exist, create it) and then manually add facebook there.

    I hope that helps!

    Cheers,
    Ari.

  • philippesoriano
    • WPMU DEV Initiate

    Hi,
    Thanks for the respond, I'm quite good in doing custom coding, I also have a fear of the page breaking. Is there any other way I can do this? or can anybody here help me out? Ultimate Facebook is such a good plugin, I just hope there is a solution for the button on top of the registration page.

    Thanks!

  • aristath
    • Recruit

    Hello again @philippesoriano,
    Theoretically you'll have to add something like the below code in your theme's functions.php file:

    remove_action( 'bp_before_register_page', 'something_here' );
    add_action( 'bp_after_register_page', 'something_here' );

    to remove the facebook button from the beginning of the form and add it at the end of the form.
    However I am unable to find what 'something_here' needs to be (perhaps I need more coffee...)
    I have notified the plugin developer about this issue, hopefully he'll be able to shed some light on this and help us figure out the right way to do it.
    Please note though that plugin developers have a lot of responsibilities so this might take a bit longer than a normal ticket.

    Cheers,
    Ari.

  • Vladislav
    • Dead Eye Dev

    Hello,

    Fortunately, this should be possible with just a little code tweak, as @aristath explained. Due to the nature of how the plugin works, the tweak would be just a tad more involved and include creating an action handler that binds to the plugin's post-init hook and then set up the button moving as Ari explained. To cut right to it, this bit of code should move the button after the form:

    function my_move_registration_button ($handler) {
    	remove_filter('bp_before_register_page', array($handler, 'inject_optional_facebook_registration_button'));
    	add_filter('bp_after_register_page', array($handler, 'inject_optional_facebook_registration_button'));
    }
    add_action('wdfb-core-hooks_added-public', 'my_move_registration_button');
  • philippesoriano
    • WPMU DEV Initiate

    Hey guys,

    this is really big help! One last thing though, may I know exactly where to paste the following code?

    function my_move_registration_button ($handler) {
    	remove_filter('bp_before_register_page', array($handler, 'inject_optional_facebook_registration_button'));
    	add_filter('bp_after_register_page', array($handler, 'inject_optional_facebook_registration_button'));
    }
    add_action('wdfb-core-hooks_added-public', 'my_move_registration_button');
  • aristath
    • Recruit

    @Vladilav thanks for the fast response! I ws looking for that for about 20 minutes and couldn't figure it out, that's why I called you in. :wink:

    @philippesoriano You'll have to add that in your theme's functions.php file, preferably at the end of it (please make sure there are no php closing tags ?> right before it. If there are, just add <?php at the beginning of the above code ).

    I am marking this issue as resolved. If however the above solution doesn't work for you or you need any further clarifications/instructions, don't hesitate to reopen this and post an update on your current status. :slight_smile:

    Cheers,
    Ari.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.