crhallen

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • crhallen
    Participant

    OK. So I needed to create an object as the methods were not declared as static in the class.

    For the first two it is more simple:

    //create new object
    $eventobj = new Event_Tickets_PRO();
    //call the methods within the class
    $eb_id = $eventobj->getEventId( $postId ),
    $eb_is_live = $eventobj->isLive( $postId ),

    For the last one, to count the number of eventbrite ticket types:

    //use api call to get all eventbrite data
    function tribe_eb_all( $postId = null, $eventobj ) {
    $postId = TribeEvents::postIdHelper( $postId );
    if ( $EventBriteId = get_post_meta( $postId, ‘_EventBriteId’, true ) ) {
    $event = $eventobj->sendEventBriteRequest( ‘event_get’, ‘id=’ . $EventBriteId, $postId );
    return $event;
    } else {
    return false;
    }
    }
    //create new object and call the function
    $eventobj = new Event_Tickets_PRO();
    $event = tribe_eb_all( $postId, $eventobj );
    //count the number of ticket types
    $eb_no_of_ticket_types => count( $event[‘event’][‘tickets’] );

Viewing 1 post (of 1 total)