Hello everyone,
I’m using the Event Organiser 1.6.3 on WordPress 3.4. I’ve inserted a couple of test-events and I’m trying to display them, month by month, by using the eo_get_events(), but the function doesn’t seem to filter anything – it always returns all events, the recurring ones as well. This is a test script for the events in September 2013, which is a month with no events in it (I didn’t insert any, the Calendar View doesn’t show any):
$events = eo_get_events(array(
‘events_start_after’=>’2013-09-01’,
‘events_start_before’=>’2013-09-30’,
‘showpastevents’ => ‘false’));
var_dump($events);
The $events has array has 20 elements (actually, no matter which month I “filter”, I always get 20 elements), and the startdate is definitely outside September:
array(20) {
[0]=>
object(stdClass)#711 (31) {
["event_id"]=>
string(2) "56"
["occurrence_id"]=>
string(2) "56"
["StartDate"]=>
string(10) "2013-01-20"
["StartTime"]=>
string(8) "10:00:00"
["EndDate"]=>
string(10) "2013-01-20"
["FinishTime"]=>
string(8) "12:00:00"
["event_occurrence"]=>
string(1) "3"
...
[5]=>
object(stdClass)#786 (31) {
["event_id"]=>
string(2) "62"
["occurrence_id"]=>
string(2) "62"
["StartDate"]=>
string(10) "2013-01-31"
["StartTime"]=>
string(8) "19:00:00"
["EndDate"]=>
string(10) "2013-02-02"
["FinishTime"]=>
string(8) "16:00:00"
["event_occurrence"]=>
string(1) "0"
["ID"]=>
int(1522)
...
and so on. Any idea what am I doing wrong?
Thanks,
Andre
andrei
Hi Andrei,
The parameters are event_*
(no ‘s’).
(Though maybe I should introduce those as aliases – since with an ‘s’ makes more sense semantically)
Stephen Harris
Was your usage based on an example you found in the documentation? If so I’d better update it!
Stephen Harris
Hey Stephen,
thanks for the fast reply! That was the problem indeed, it works after using event_ instead of events_. Great plugin, by the way!! 🙂
Some examples in the documentation are using events_, e.g. on these sites:
http://wp-event-organiser.com/documentation/function/eo_get_events/
http://wp-event-organiser.com/documentation/function/eo_get_the_end/
https://gist.github.com/4165380
Thanks for the great work,
Andrei
andrei
Thanks Andrei!
I’ll update those and keep an eye out for any other mistakes like that. It looks like the same example which I’ve copied around, so hopefully that’s all of them.
Stephen Harris