get_body_class() in ajax envrionment
You are probably trying to do something wrong. Templating functions require context with global query and post variables properly set, and even then you might miss all kinds of filters because ajax requests are not being run in the context of template evaluation which means that template_redirect, wp_head and others are not being “run” which … Read more