I have a ajax call to a php file which uses get_categories(). But it always says "Call to undefined function get_categories()" How can I make it to work? What should be included?
<?php
if(isset($_GET['slug'])) {
echo get_categories(array('taxonomy' => 'product_cat'))[0]['slur'];
}
?>