• Resolved David Levine

    (@justlevine)


    Having trouble with the tribe_get_events() function (exact same issue as reported here without solution).

    Basically, whenever I pass a search term to tribe_get_events(), I get no results. The exact same function without ‘s’ works, and using WP_Query() works as well.
    (And yes, I’m searching for terms that exist in Event Titles.

    E.g.:

    
    $args_for_event_query = array(
        's' => $search,
        'posts_per_page' => 5
    );
    $args_for_wp_query = array(
        's' => $search,
        'posts_per_page' => 5,
        'post_type' => 'tribe-events'
    );
    $args_no_search = array(
        'posts_per_page' => 5
    );
    
    $eventsArray = tribe_get_events($args_no_search); //returns fine
    $eventsArray = new WP_Query($args_for_wp_query); //returns fine
    
    $eventsArray = tribe_get_events($args_for_events_query); // RETURNS EMPTY!!
  • The topic ‘tribe_get_events() not working with search parameter’ is closed to new replies.