tokkilee

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: Show list of organizers who have events only #1557693
    tokkilee
    Participant

    Right I understand, but this is a standard function that’s already in the plugin that has the bug.

    in reply to: Show list of organizers who have events only #1557608
    tokkilee
    Participant

    SO I’ve narrowed it down to the fact there’s a bug with the actual Events Calendar plugin. The default posts_per_page in tribe_get_events is affecting the calculation of the organizer list in find_with_upcoming_events() – the call to $events = tribe_get_events( $args ); returns only max 10 events, which isn’t enough to calculate the full number of organizers. Adding posts_per_page => -1 into the $args array on line 277 of Base.php seems to be a suitable fix for this.

    Is it possible this will be fixed in the future? I hate editing core plugin files since it’ll get overwritten when upgrading.

    in reply to: Show list of organizers who have events only #1557362
    tokkilee
    Participant

    So I’ve found the function tribe_get_organizers(), but using it with ‘only_with_upcoming’ => true only returns *2* organizers (posts_per_page is set to -1) but I have more organizers than that. setting it to ‘has_events’ => true brings back 26 organizers, but shows organizers with events that have passed. Here’s an example of the function:

    $args = array(
    	'only_with_upcoming' => true
    	
    );
    	
    $organizers = tribe_get_organizers( '', $posts_per_page = -1, $suppress_filters = false, $args);
    
    foreach ($organizers as $org) {
    	echo $org->post_title;
    }

    What am I doing wrong here?

Viewing 3 posts - 1 through 3 (of 3 total)