Home › Forums › Calendar Products › Events Calendar PRO › Access to API documentation
- This topic has 6 replies, 3 voices, and was last updated 7 years, 3 months ago by Ron.
-
AuthorPosts
-
January 6, 2017 at 1:00 pm #1214477RonParticipant
Hello,
I am customizing out own theme, and I am looking for the reference to the classes and functions used by your plugin.
Basically, we moved out from a previous plugin where we got all the events by accessing the custom tables in the database. That worked well, but I don’t want to go through the same road again and I am looking on doing it with your functions.
I checked docs.tri.be, but as a java developer, I found it a little bit hard to follow. I saw one of your videos (“Customizing meta content on a single event page”) and, almost at the end –minute 19:09–, you can see the reference to the API in the usual java format.
Over there, you can see class descriptions, functions in a more detailed and ordered fashion.
Is there a way that we can get access to those pages? For example, I want to know the TribeEvents and TriveEventsAPI classes work, but I cannot find them in the current documentation of knowledgebase.
thanks!January 6, 2017 at 10:09 pm #1214617CliffMemberHi, Ron.
Thanks for your detailed question.
I don’t have any Java experience so I’m not exactly sure what you’d consider ideal, but this is what we have…
- https://github.com/moderntribe/the-events-calendar/blob/4.3.5/src/Tribe/API.php
- https://theeventscalendar.com/functions/
- tribe_get_events()
- Themer’s Guide — likely what you’d want to reference to integrate and customize our plugin with a theme
I’m not sure which video you’re referring to, and I don’t know of any additional documentation to point you to. I hope this helps in some way though.
Please let me know if you have any follow-up questions on this topic.
January 10, 2017 at 10:32 am #1216010RonParticipantThank you so much for your links. They were really helpful.
I was able to create a loop with the tribe_get_events function, but it does not return all the recurrent copies of an event. It only gives me one.
Inside the loop, I would like to check if the event is recurrent or not and pull all of its related events.
I have this:$eventsArgs = array( 'posts_per_page' => 100, 'category_name' => $postsCategory, 'start_date' => date( 'Y-m-d H:i:s' ) ); $postEntries = tribe_get_events($eventsArgs); $totalPosts = count($postEntries); if($totalPosts > 0) { $addLink = false; foreach($postEntries as $entry) { /* * I want to put here the code to display my info, but I want to know if the event is * is recurrent or not */ } }
I only get the first occurrence of the event, but I canno get the recurrences.
Please adviseJanuary 10, 2017 at 11:01 am #1216021RonParticipantBy the way, passing the argument ‘category_name’ => ‘my-category’ does not work neither. Please provide a fill example of how to make a call of getting all the events, including recurrences, of certain event-category.
Thanks!January 10, 2017 at 11:48 am #1216045RonParticipantNever mind. I found a way. However, you folks need to clearly document the API of your products because my fix included some arguments not listed anywhere. Also, the way to look for categories is nor really well documented.
Here is my code, I hope it helps some others:
$eventsArgs = array( 'posts_per_page' => 100, 'event_display' => 'custom', 'tribeHideRecurrence' => false, /* Not documented */ 'start_date' => date('Y-m-d H:i:s'), 'eventDisplay' => 'upcoming', /* Not documented */ /* The following method is not documented */ 'tax_query' => array( array('taxonomy' => 'tribe_events_cat', 'field' => 'slug', 'terms' => $postsCategory) ) ); $postEntries = tribe_get_events($eventsArgs);
January 11, 2017 at 1:50 pm #1216914CliffMemberI see that KB article is internally flagged as out of date. Sorry that is the case at the time you’re needing to reference it.
I’ve also shared your feedback internally and there is definitely quite a bit of improvement for us to do in time.
You can see tribe_get_events() at https://github.com/moderntribe/the-events-calendar/blob/4.4.0.1/src/functions/template-tags/general.php#L183-L219
The ajax_change_this_week method of PRO’s This Week widget can be a good reference for arguments too: /wp-content/plugins/events-calendar-pro/src/Tribe/This_Week.php
Overall, I’m glad you’re sorted out, and thanks for helping others by sharing your snippets too.
-
AuthorPosts
- The topic ‘Access to API documentation’ is closed to new replies.