Guest User

Untitled

a guest
Aug 19th, 2019
67
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <a href="<?php echo wp_logout_url( home_url() ); ?>" class="head-a ">
  2.  
  3.  
  4. function redirect_after_logout() {
  5.  
  6. $current_user = wp_get_current_user();
  7. $role_name = $current_user->roles[0];
  8.  
  9. if($role_name == 'subscriber'){
  10. $redirect_url = site_url();
  11. wp_safe_redirect( $redirect_url );
  12. exit;
  13. }
  14.  
  15. }
  16. add_action( 'wp_logout', 'redirect_after_logout' );
RAW Paste Data