What to use in place of deprecated function tribe_get_displayed_month

Home Forums Calendar Products Events Calendar PRO What to use in place of deprecated function tribe_get_displayed_month

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1041822
    sunvalleycenter
    Participant

    We are having issues on out calendar where it displays the months using

    $prev_date = new DateTime( str_replace(' ', ' 1, ', tribe_get_displayed_month() ));
    $next_date = new DateTime( str_replace(' ', ' 1, ', tribe_get_displayed_month() ));
    $this_month = new DateTime( str_replace(' ', ' 1, ', tribe_get_displayed_month() ));

    All is still working fine except when we pull the year for the month title

    <span class="year-shown"><?php echo tribe_get_current_month_text(); ?> <?= $this_month->format('Y') ?></span>

    It only returns 2015 now. I see that tribe_get_displayed_month is deprecated but there is no mention of what to replace it with… Is there a place to see what deprecated functions have been replaced with as I can’t find the docs.

    #1042282
    Brian
    Member

    Hi,

    I can try to help out here.

    We have this list of functions to search through:

    https://theeventscalendar.com/functions/

    It does not show what to use instead, but I am not sure if there is a direct replacement for that one.

    I found this might work as a replacement:

    date_i18n( ‘F’, strtotime( tribe_get_month_view_date() ) )

    Does that work for you?

    #1042327
    sunvalleycenter
    Participant

    Thank you – I was able to get that to work. Would be helpful if Tribe gave us a replacement when they deprecate a function.

    #1042501
    Brian
    Member

    Great, glad it helps, I am going to go ahead and close this ticket, but if you need help on this or something else please post a new ticket.

    Thanks!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘What to use in place of deprecated function tribe_get_displayed_month’ is closed to new replies.