Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

wordpress login programmatically

<?php
 
  clean_user_cache($user_id);
  wp_clear_auth_cookie();
  wp_set_current_user($user_id);
  wp_set_auth_cookie($user_id, true, false);

  $user = get_user_by('id', $user_id);
  update_user_caches($user);

 ?>
Source by kuttler.eu #
 
PREVIOUS NEXT
Tagged: #wordpress #login #programmatically
ADD COMMENT
Topic
Name
2+4 =