Check the constant DOING_AJAX
. It is always defined when someone uses the WordPress AJAX API.
if ( defined( 'DOING_AJAX' ) && DOING_AJAX )
return;
if ( is_admin() )
add_action( 'admin_init', 'xcsn_redirect_from_admin' );
Check the constant DOING_AJAX
. It is always defined when someone uses the WordPress AJAX API.
if ( defined( 'DOING_AJAX' ) && DOING_AJAX )
return;
if ( is_admin() )
add_action( 'admin_init', 'xcsn_redirect_from_admin' );