Viewing 7 replies - 1 through 7 (of 7 total)
  • Paul

    (@paulplapsa)

    Hello Mark,

    Unfortunately the Profile Builder login form cannot be customized in this manner.

    Regards,
    Paul

    Thread Starter Mark Cutting

    (@mcutting)

    Ok. This is a pity – I thought that the login form would have taken fields from the stock wp-login form, but clearly not the case.

    Thread Starter Mark Cutting

    (@mcutting)

    Easy enough to workaround by making a minor change to profile-builder-pro/front-end/login.php, on line 127

    Change

    $login_form_top = apply_filters( 'login_form_top', '', $args );

    To

    $login_form_top = apply_filters( 'login_form_top', '', $args ) . do_shortcode("[nextend_social_login style=\"icon\"]");

    Less than ideal as this will be overwritten each time the plugin is updated, but does provide what I want.

    I’m an surprised that there is no hook or function to override this though ?

    Thread Starter Mark Cutting

    (@mcutting)

    Ok, this is better, as it’s a function that means that the core doesn’t need to be modified as there’s filter I can use

    add_filter( 'login_form_top', 'add_social_login_buttons');
    function add_social_login_buttons() {
    echo do_shortcode("[nextend_social_login style=\"icon\"]");    
    }

    The problem with this is that the social links sit outside of the form, not inside…

    Thread Starter Mark Cutting

    (@mcutting)

    RESOLVED. This works exactly as intended

    add_filter( 'login_form_top', 'add_social_login_buttons');
    function add_social_login_buttons() {
    $result = do_shortcode("[nextend_social_login style=\"icon\"]");  
    return $result;
    }
    Paul

    (@paulplapsa)

    Hi,

    Yes, you can use the following hooks to write custom code that will modify the login from:

    • login_form_top
    • login_form_middle
    • login_form_bottom

    Regards,
    Paul

    • This reply was modified 7 years, 1 month ago by Paul.
    • This reply was modified 7 years, 1 month ago by Paul.
    • This reply was modified 7 years, 1 month ago by Paul.
    Thread Starter Mark Cutting

    (@mcutting)

    Thanks @paulplapsa. A slightly modified version to allow for error checking (if the plugin is disabled)

    // Add social login buttons from Nextend Social Login to Profile Builder Login Form
    add_filter( 'login_form_top', 'add_social_login_buttons');
    function add_social_login_buttons() {
    // Check to see if the plugin is active first before appending the shortcode
    if( is_plugin_active( 'nextend-facebook-connect/nextend-facebook-connect.php' ) ) {
    $result = do_shortcode("[nextend_social_login style=\"icon\"]");  
    return $result;
    }
    }
Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Add custom fields to login form’ is closed to new replies.