tribe_get_events() exclude parameter not working

Home Forums Calendar Products Events Calendar PRO tribe_get_events() exclude parameter not working

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1578421
    Allen Presher
    Participant

    Following code, exclude parameter does not work:

                  <?php
                    $events = tribe_get_events( array(
                        'posts_per_page' => 6,
                        'start_date' => date( 'Y-m-d H:i:s' ),
                        'exclude' => array(211)
                    ) );
                 ?>

    Also tried removing the array and passing in 211 and ‘211’ to no avail. My understand is tribe_get_events() is a wrapper for get_posts() and thus this should work.

    Any help would be greatly appreciated. Thank you!

    #1579100
    Sky
    Keymaster

    Hi there!

    Thanks for reaching out! I’d be happy to help you with this.

    Instead of “exclude” you might try “post__not_in.”

    For example:

    $events = tribe_get_events( array(
    'posts_per_page' => 6,
    'start_date' => date( 'Y-m-d H:i:s' ),
    'post__not_in' => array(211),
    ) );

    Let me know if that works for you!

    Thanks,
    Sky

    #1579344
    Allen Presher
    Participant

    That did the trick, thank you for the help!

    #1580070
    Sky
    Keymaster

    Hello,

    Awesome! So glad that worked for you.

    Please let us know if you have any questions or issues in the future.

    Thanks,
    Sky

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘tribe_get_events() exclude parameter not working’ is closed to new replies.