07/31/2014 at 6:18 pm
#299284
Keymaster
@ David
Connections does not have a login feature as of yet. Not sure I’ll be adding one yet because there are some many freely available feature rich plugins that can handle this already. I would suggest finding one that has a configurable frontend login widget.
If you install the Code Snippets plugin, you can add the following code as a new snippet. Once saved and activated, you can use the [connections_login_form] shortcode on a page or in a Text widget to add a login form to widget that can placed in the theme’s sidebar.
function cn_login_form_shortcode( $atts ) {
if ( is_user_logged_in() ) return;
$atts = shortcode_atts( array(
'echo' => FALSE,
'redirect' => get_permalink(),
'form_id' => 'loginform',
'label_username' => __( 'Username', 'connections' ),
'label_password' => __( 'Password', 'connections' ),
'label_remember' => __( 'Remember Me', 'connections' ),
'label_log_in' => __( 'Login', 'connections' ),
'id_username' => 'user_login',
'id_password' => 'user_pass',
'id_remember' => 'rememberme',
'id_submit' => 'wp-submit',
'remember' => TRUE,
'value_username' => NULL,
'value_remember' => FALSE
), $atts, 'connections_login_form' );
return wp_login_form( $atts );
}
add_shortcode( 'connections_login_form', 'cn_login_form_shortcode' );
add_filter( 'widget_text', 'do_shortcode' );
I hope that helps!
