Skip to content

Instantly share code, notes, and snippets.

@agustibr
Last active December 17, 2015 14:49
Show Gist options
  • Save agustibr/5626924 to your computer and use it in GitHub Desktop.
Save agustibr/5626924 to your computer and use it in GitHub Desktop.
CDT Sidebar Login Formulario para el Sidebar de acceso a la Comunidad BP ↳ Versión 0.0.2 | Agusti@bibtic
<?php
/**
* Plugin Name: CDT Sidebar Login
* Plugin URI: https://gist.github.com/AgustiBelloc/5626924
* Description: Formulario para el Sidebar de acceso a la Comunidad BP
* Author: Agusti@bibtic
* Author URI: http://bibtic.cat
* Version: 0.0.2
*/
function widget_SidebarLogin($args) {
extract($args);
echo $before_widget;
$titulo = 'ACCESO A LA COMUNIDAD';
?>
<div class="sidebar-login-form">
<h4><?php echo $titulo;?></h4>
<form name="login-form" id="sidebar-login-form" class="standard-form" action="<?php echo site_url( 'wp-login.php', 'login_post' ); ?>" method="post">
<label><?php _e( 'Username', 'buddypress' ); ?><br />
<input type="text" name="log" id="sidebar-user-login" class="input" value="<?php if ( isset( $user_login) ) echo esc_attr(stripslashes($user_login)); ?>" tabindex="97" /></label>
<label><?php _e( 'Password', 'buddypress' ); ?><br />
<input type="password" name="pwd" id="sidebar-user-pass" class="input" value="" tabindex="98" /></label>
<p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="sidebar-rememberme" value="forever" tabindex="99" /> <?php _e( 'Remember Me', 'buddypress' ); ?></label></p>
<?php do_action( 'bp_sidebar_login_form' ); ?>
<input type="submit" name="wp-submit" id="sidebar-wp-submit" value="<?php _e( 'Log In', 'buddypress' ); ?>" tabindex="100" />
<input type="hidden" name="testcookie" value="1" />
</form>
</div>
<?php
do_action( 'bp_after_sidebar_login_form' );
echo $after_widget;
}
wp_register_sidebar_widget(
'SidebarLogin_1', // your unique widget id
'SidebarLogin', // widget name
'widget_SidebarLogin', // callback function
array( // options
'description' => 'Formulario de acceso a la Comunidad para el Sidebar'
)
);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment