Improved if statement for wpajax class checking.