I'm still new to wordpress and I'm trying to write a plugin but for some reason this code is producing nothing. Why? I am completely stumped. I have followed the examples here to a tee.
<?php
/*
Plugin Name: Text
*/
add_action("init", "init_stuff");
function x_get_event_posts(){
$all_events = tribe_get_events(
array(
'eventDisplay' => 'all',
'posts_per_page' => -1,
'tax_query'=> array(
array(
'taxonomy' => 'tribe_events_cat',
'field' => 'slug',
'terms' => 'xmlworkshopdonotuse'
)
)
)
);
echo count($all_events); // produces "0";
}
function init_stuff() {
x_get_event_posts();
}
?>
xmlworkshopdonotuse
category?tax_query
returns 0 results. Also, interestingly,get_terms
returns aWPError
.get_terms()
] saying that it will returnfalse
or a row from the DB. How are you callingget_terms()
that it's returning aWP_Error
?