Problem with function "tribe_add_start_end_time_to_month_view "

Home Forums Calendar Products Events Calendar PRO Problem with function "tribe_add_start_end_time_to_month_view "

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1334803
    Anna
    Participant

    Hi there,

    the following function to add event start and end time works perfect in the past:

    function tribe_add_start_end_time_to_month_view ( $post_title, $post_id ) {

    if ( ! tribe_is_event($post_id) ) return $post_title;
    // Checks if it is the month view, modify this line to apply to more views
    if ( ! tribe_is_month() ) return $post_title;

    $event_start_time = tribe_get_start_time( $post_id );
    $event_end_time = tribe_get_end_time( $post_id );

    if ( !empty( $event_start_time ) ) {
    $post_title = '<span style="font-weight:400!important;">' . $event_start_time . ' - ' . $event_end_time . ' </span><br /> ' . $post_title;
    }
    return $post_title;
    }

    add_filter( 'the_title', 'tribe_add_start_end_time_to_month_view', 100, 2 );

    But for some time I get the following error message if I want to edit an organizer:

    ArgumentCountError thrown

    Too few arguments to function tribe_add_start_end_time_to_month_view(), 1 passed in /mnt/web108/e2/85/51476285/htdocs/FreiRaum/html/wp-includes/class-wp-hook.php on line 298 and exactly 2 expected

    Would you help me, please
    A.

    #1335276
    Victor
    Member

    Hi Anna!

    Thanks for reaching out to us!

    I could reproduce the issue with the code you provided. I can’t find anything wrong with your code, so I will reach out to the team to have a second pair of eyes on it.

    I will get back to you as soon as we find something, so please hang in there.

    Thanks,
    Victor.

    #1335363
    Victor
    Member

    Hello Anna!

    Thanks for your patience and for flagging this.

    We have identified a minor bug in our code that caused the error to trigger while editing a venue or organizer when making use of the the_title filter.

    A fix for this issue is already in place and will be available in our next maintenance release scheduled for next week.

    I apologise for this inconvenience and we’d appreciate your patience in the meantime.

    Best,
    Victor

    #1337269
    Anna
    Participant

    Hi Victor,
    thank you very much for your answer and your efforts.
    Then I am waiting for your next maintenance release.

    Best Regards
    Anna

    #1337528
    Victor
    Member

    Thanks for the follow up Anna.

    We’ll let you know as soon a the fix is released.

    Best,
    Victor

    #1340246
    Nico
    Member

    Hey,

    Just wanted to share with you that a new maintenance release is out, containing a fix for this issue ?

    Find out more about this release → https://theeventscalendar.com/maintenance-release-week-21-august-2017/

    Please update the plugins and let us know if the fix works for you,
    Cheers,
    Nico

    #1350152
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Problem with function "tribe_add_start_end_time_to_month_view "’ is closed to new replies.