tribe_get_event_categories

Home Forums Calendar Products Events Calendar PRO tribe_get_event_categories

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1095140
    oniregoc
    Participant

    Hello,

    I am trying to extract categories associated to events with tribe_get_event_categories like this:

    $event_id = get_the_ID();
    print_r (tribe_get_event_categories($event_id)) ;

    doing so I get :
    “Events Category:
    . Myfirsteventscategorie
    . Mysecondevntcategorie”

    but as I would like only the first one
    i was trying with :

    $event_id = get_the_ID();
    $myCat = (tribe_get_event_categories($event_id)) ;
    echo $myCat [0]->name;

    but it doesn’t work. Does it means that tribe_get_event_categories do not return an array ? Please, any help ? Thanks

    #1095159
    oniregoc
    Participant

    with this it’s done:

     echo str_replace(
                            ':',
                            '',
                            tribe_get_event_categories($event->ID, array(
     												'echo'         => false,
     												'label'        => '',
     												'label_before' => '',
     												'label_after'  => '',
     												'wrap_before'  => '',
     												'wrap_after'   => '',
    												)));
    #1095239
    Brook
    Participant

    Howdy oni,

    Nice work there. Thank you for sharing the solution with the rest, very much appreciated.

    Let us know if ever need anything else, hopefully we can beat you to the punch and actually provide assistance before you figure it out. 😀

    • Brook
Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘tribe_get_event_categories’ is closed to new replies.