Site icon Hip-Hop Website Design and Development

tips on how to refresh web page after person logout with ‘wp_logout_url’?

I’ve written a plugin for my very own web site the place I’ve a difficulty like “after person login to the location if he logout then once more if he clicks on browser again button then the earlier web page exhibiting once more as an alternative of login web page”. Iam making an attempt the beneath code however it does not work.

<script>
   window.onhashchange = operate() {
     <?php if( ! is_user_logged_in()) { $this->tewa_login(); } ?>
   }
<script>

My logout code is beneath:

if ( is_user_logged_in() ) {
  $knowledge .= '<li><a category="add-new" href="'. wp_logout_url() .'" class="btn btn-primary" >'.$this->icon_sign_out.' Logout</a></li>';
}

Can the beneath code works or not?

operate my_redirect(){
  <script>
     location.reload();
  </script>
 exit();
}
add_filter('wp_logout','my_redirect');

I believe this situation completely browser situation not belongs to server. I believe only a web page refresh that does the trick. I used to be utilizing ‘wp_logout_url’ for person logout. tips on how to do it might probably anybody plz inform me? Thanks prematurely.