Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #39903, comment 3


Ignore:
Timestamp:
03/05/2017 02:19:47 PM (8 years ago)
Author:
esemlabel
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #39903, comment 3

    initial v1  
    33{{{#!php
    44<?php
    5 if( wp_doing_ajax() && !empty( $_POST['action'] ) ){
     5if ( wp_doing_ajax() && !empty( $_POST['action'] ) ) {
    66    add_action( 'wp_ajax_' . $_POST['action'], 'check_session_token_ajax', 1 );
    77    add_action( 'wp_ajax_nopriv_' . $_POST['action'], 'check_session_token_ajax', 1 );
    88}
    99
    10 function check_session_token_ajax(){
     10function check_session_token_ajax() {
    1111   
    12     if( is_user_logged_in() && ! wp_get_session_token() ){
     12    if ( is_user_logged_in() && ! wp_get_session_token() ) {
    1313        wp_set_current_user( 0 );
     14        wp_clear_auth_cookie();
    1415    }
    1516