Strange work of tribe_get_events()

Home Forums Calendar Products Events Calendar PRO Strange work of tribe_get_events()

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #65240
    Kimiya
    Participant

    I read the following document and develop the PHP code.
    * https://theeventscalendar.com/support/documentation/the-events-calendar-template-tags-general-functions/#functiontribe_get_events
    global $post;
    $current_date = date(‘j M Y’);
    $get_posts = tribe_get_events(array(‘start_date’=>$current_date,’posts_per_page’=>10) );

    There was not problem until recent days (Maybe, plugin version 3.0.4… Sorry, I don’t remember…).
    Today, I took notice that the PHP code needs to be changed as follow.

    global $post;
    $current_date = date(‘Y-m-j’);
    $get_posts = tribe_get_events(array(‘eventDisplay’=>’all’, ‘start_date’=>$current_date,’posts_per_page’=>10) );

    This is two point.
    1. Date format changed?
    2. ‘eventDisplay’ value is required?

    About No.1, I think that this is the reference to the Date format in General settings.
    (My settings is YYYY/MM/DD)

    After the code was changed, there is not problem, so I report the strange behavior.

    #65265
    Barry
    Member

    Hi Kimiya,

    The documentation you referred to is no longer valid (note that the title includes 2.X builds only) – generally speaking though we’d recommend using Y-m-d as the date format at this point.

    eventDisplay is not always required but it’s safer to be explicit and declare exactly what you need.

    I hope that clarifies things – and thanks for contacting us 🙂

    #68060
    Kelly
    Participant

    Hi, Kimiya. Since it’s been a couple of weeks now, I’m going to close this thread. Please feel free to start a new topic if you’d like to revisit this.

    Thanks for being part of the TEC community!

    #981109
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Strange work of tribe_get_events()’ is closed to new replies.