Created
March 2, 2015 14:50
-
-
Save imvaskii/d93306c6cd319e997e63 to your computer and use it in GitHub Desktop.
WP Login Form
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php function wp_login_form_frontend($args = array()) { | |
$defaults = array('echo' => true, | |
'redirect' => ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], // Default redirect is back to the current page | |
'form_id' => 'loginformfrontend', | |
'label_username' => __('Username'), | |
'label_password' => __('Password'), | |
'label_remember' => __('Remember Me'), | |
'label_log_in' => __('SIGN IN'), | |
'id_username' => 'user_login', | |
'id_password' => 'user_pass', | |
'id_remember' => 'rememberme', | |
'id_submit' => 'wp-submit', | |
'remember' => false, | |
'value_username' => '', | |
// 'value_remember' => false, // Set this to true to default the "Remember me" checkbox to checked | |
); | |
$args = wp_parse_args($args, apply_filters('login_form_defaults', $defaults)); | |
ob_start(); | |
?> | |
<form name="<?php echo $args['form_id'] ?>" id="<?php echo $args['form_id'] ?>" action="<?php echo esc_url(site_url('wp-login.php', 'login_post')) ?>" method="post" class="form-signin"> | |
<?php apply_filters('login_form_top', '', $args) ?> | |
<h3>SIGN IN</h3> | |
<div class="form-group"> | |
<input type="text" name="log" id="<?php echo esc_attr($args['id_username']) ?>" class="form-control input-field" value="<?php echo esc_attr($args['value_username']) ?>" size="20" placeholder="Email Address" /> | |
</div> | |
<div class="form-group"> | |
<input placeholder="Password" type="password" name="pwd" id="<?php echo esc_attr($args['id_password']) ?>" class="form-control input-field" value="" size="20" /> | |
<div class="form-group"> | |
<label><a href="#forgot-password-popup" class="fancybox">Forgot your password ?</a></label> | |
<input type="submit" name="wp-submit" id="<?php echo esc_attr($args['id_submit']) ?>" class="btn-no-bg" value="<?php echo esc_attr($args['label_log_in']) ?>" /> | |
<input type="hidden" name="redirect_to" value="<?php esc_url($args['redirect']) ?>" /> | |
<?php apply_filters('login_form_middle', '', $args) ?> | |
<?php apply_filters('login_form_bottom', '', $args) ?> | |
</form> | |
<?php | |
return ob_get_clean(); | |
} ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment