Access to API documentation

Home Forums Calendar Products Events Calendar PRO Access to API documentation

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1214477
    Ron
    Participant

    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!

    #1214617
    Cliff
    Member

    Hi, 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…

    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.

    #1216010
    Ron
    Participant

    Thank 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 advise

    #1216021
    Ron
    Participant

    By 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!

    #1216045
    Ron
    Participant

    Never 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);
    #1216914
    Cliff
    Member

    I 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.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Access to API documentation’ is closed to new replies.