Skip to main content

Here are 3 ways to do it:

  1. Use the wp_signon hook

The first way is to use the wp_signon hook

$creds = array();    
$creds['user_login'] = 'example';   
$creds['user_password'] = 'plaintextpw';   
$creds['remember'] = true;   
$user = wp_signon( $creds, false );  
if ( is_wp_error($user) ) {  
   echo $user->get_error_message();
}

The second way, is to use jQuery $creds = array(); $creds['user_login'] = 'example'; $creds['user_password'] = 'plaintextpw'; $creds['remember'] = true; $user = wp_signon( $creds, false ); if ( is_wp_error($user) ) echo $user->get_error_message.val(); and add it to your login page

  1. Use jQuery Val and add it to your login page
$("#user_login").val('username');    
$("#user_pass").val('password');

The last way is to edit your $("#user_login").val('username'); $("#user_pass")wp-login.val('password');php file (Note, this is not recommended although it would work).

  1. Modify wp-login.php (Note, this is not recommended although it would work)

Here are 3 ways to do it

  1. Use the wp_signon hook

$creds = array(); $creds['user_login'] = 'example'; $creds['user_password'] = 'plaintextpw'; $creds['remember'] = true; $user = wp_signon( $creds, false ); if ( is_wp_error($user) ) echo $user->get_error_message();

  1. Use jQuery Val and add it to your login page

$("#user_login").val('username'); $("#user_pass").val('password');

  1. Modify wp-login.php (Note, this is not recommended although it would work)

Here are 3 ways to do it:

The first way is to use the wp_signon hook

$creds = array();    
$creds['user_login'] = 'example';   
$creds['user_password'] = 'plaintextpw';   
$creds['remember'] = true;   
$user = wp_signon( $creds, false );  
if ( is_wp_error($user) ) {  
   echo $user->get_error_message();
}

The second way, is to use jQuery .val() and add it to your login page

$("#user_login").val('username');    
$("#user_pass").val('password');

The last way is to edit your wp-login.php file (Note, this is not recommended although it would work).

deleted 3 characters in body
Source Link
kaiser
  • 50.8k
  • 27
  • 150
  • 244

Here are 3 ways to do it

  1. Use the wp_signon hook

$creds = array(); $creds['user_login'] = 'example'; $creds['user_password'] = 'plaintextpw'; $creds['remember'] = true; $user = wp_signon( $creds, false ); if ( is_wp_error($user) ) echo $user->get_error_message();

  1. Use jQuery Val and add it to your login page

    $("#user_login").val('username'); $("#user_pass").val('password');

  2. Modify wp-login.php (Note, this is not recommended although it would work)

    Use jQuery Val and add it to your login page

$("#user_login").val('username'); $("#user_pass").val('password');

  1. Modify wp-login.php (Note, this is not recommended although it would work)

Here are 3 ways to do it

  1. Use the wp_signon hook

$creds = array(); $creds['user_login'] = 'example'; $creds['user_password'] = 'plaintextpw'; $creds['remember'] = true; $user = wp_signon( $creds, false ); if ( is_wp_error($user) ) echo $user->get_error_message();

  1. Use jQuery Val and add it to your login page

    $("#user_login").val('username'); $("#user_pass").val('password');

  2. Modify wp-login.php (Note, this is not recommended although it would work)

Here are 3 ways to do it

  1. Use the wp_signon hook

$creds = array(); $creds['user_login'] = 'example'; $creds['user_password'] = 'plaintextpw'; $creds['remember'] = true; $user = wp_signon( $creds, false ); if ( is_wp_error($user) ) echo $user->get_error_message();

  1. Use jQuery Val and add it to your login page

$("#user_login").val('username'); $("#user_pass").val('password');

  1. Modify wp-login.php (Note, this is not recommended although it would work)
added 6 characters in body
Source Link
Brooke.
  • 3.9k
  • 1
  • 26
  • 34

Here are 3 ways to do it

  1. Use the wp_signon hook

    $creds = array();
    $creds['user_login'] = 'example';
    $creds['user_password'] = 'plaintextpw';
    $creds['remember'] = true;
    $user = wp_signon( $creds, false );
    if ( is_wp_error($user) )
    echo $user->get_error_message();

  2. Use jQuery Val and add it to your login page

    $("#user_login").val('username');
    $("#user_pass").val('password');

  3. Modify wp-login.php (Note, this is not recommended although it would work)

    Use the wp_signon hook

$creds = array(); $creds['user_login'] = 'example'; $creds['user_password'] = 'plaintextpw'; $creds['remember'] = true; $user = wp_signon( $creds, false ); if ( is_wp_error($user) ) echo $user->get_error_message();

  1. Use jQuery Val and add it to your login page

    $("#user_login").val('username'); $("#user_pass").val('password');

  2. Modify wp-login.php (Note, this is not recommended although it would work)

Here are 3 ways to do it

  1. Use the wp_signon hook

    $creds = array();
    $creds['user_login'] = 'example';
    $creds['user_password'] = 'plaintextpw';
    $creds['remember'] = true;
    $user = wp_signon( $creds, false );
    if ( is_wp_error($user) )
    echo $user->get_error_message();

  2. Use jQuery Val and add it to your login page

    $("#user_login").val('username');
    $("#user_pass").val('password');

  3. Modify wp-login.php (Note, this is not recommended although it would work)

Here are 3 ways to do it

  1. Use the wp_signon hook

$creds = array(); $creds['user_login'] = 'example'; $creds['user_password'] = 'plaintextpw'; $creds['remember'] = true; $user = wp_signon( $creds, false ); if ( is_wp_error($user) ) echo $user->get_error_message();

  1. Use jQuery Val and add it to your login page

    $("#user_login").val('username'); $("#user_pass").val('password');

  2. Modify wp-login.php (Note, this is not recommended although it would work)

Source Link
Brooke.
  • 3.9k
  • 1
  • 26
  • 34
Loading