Home › Forums › Calendar Products › Events Calendar PRO › tribe_get_events throwing PHP Warning
- This topic has 6 replies, 2 voices, and was last updated 11 years, 6 months ago by
Casey.
-
AuthorPosts
-
October 13, 2014 at 2:20 am #806851
Roger
ParticipantWe updated to latest version of Events Calendar and are now getting the following warning thrown by tribe_get_events().
Warning: Illegal string offset ‘eventDisplay’ in /home/narecdec/public_html/wp-content/plugins/the-events-calendar/public/template-tags/general.php on line 20
Our code:
if( function_exists( ‘tribe_get_events’ ) ) {
$posts = tribe_get_events( ‘eventDisplay=upcoming&posts_per_page=3’ );
}October 13, 2014 at 7:16 am #807393Casey
ParticipantRoger,
Thanks for getting in touch! Please try passing in the params as an array to see if that fixes the issue. tribe_get_events() expects the arguments to passed in as an array, so passing them as a string might be causing issues here.Give that a shot and see if it does the trick. Thanks! π
-Casey-
October 21, 2014 at 6:09 pm #825756Casey
ParticipantI just wanted to follow up and see if youβre all set here or if you still have further questions. Just let me know if you have further questions or if I should go ahead and close out this thread. Thanks! π
-Casey-
October 22, 2014 at 1:23 am #826483Roger
ParticipantHi Casey, didn’t see your original response. I’m out of the office today, but will recode as an array tomorrow and test. Seems an odd solution though, as I was pretty sure the underlying Events code was written to work with both arrays and strings (as per the WP ‘usual practice’ for queries etc.). I think Modern Tribe’s own widget also made the call using a string for the parameters.
Cheers, Roger
October 22, 2014 at 11:18 am #827332Casey
ParticipantOk great. I’ll keep this thread open, and await your response. Thanks! π
-Casey-
October 23, 2014 at 5:26 am #829353Roger
ParticipantPassing the parameters as an args array solves the issue.
Did you guys modify the function specification in the latest version of the calendar? The string version didn’t generate warnings previously, and was also the approach used in an Event Calendar widget.October 29, 2014 at 12:34 pm #847347Casey
ParticipantRoger,
I’m not aware of any changes that were made to this function that would be causing this issue, but I’ll pass along your feedback to our developers to investigate further.Since it looks like you’re all set here, I’ll go ahead and close out this thread. Feel free to start a new thread if you need further help. Thanks! π
-Casey-
-
AuthorPosts
- The topic ‘tribe_get_events throwing PHP Warning’ is closed to new replies.
