Home › Forums › Calendar Products › Events Calendar PRO › Problem with function "tribe_add_start_end_time_to_month_view "
- This topic has 7 replies, 3 voices, and was last updated 8 years, 7 months ago by
Anna.
-
AuthorPosts
-
August 14, 2017 at 1:23 am #1334803
Anna
ParticipantHi 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.August 14, 2017 at 7:18 pm #1335276Victor
MemberHi 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.August 15, 2017 at 4:39 am #1335363Victor
MemberHello 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,
VictorAugust 18, 2017 at 5:06 am #1337269Anna
ParticipantHi Victor,
thank you very much for your answer and your efforts.
Then I am waiting for your next maintenance release.Best Regards
AnnaAugust 18, 2017 at 12:15 pm #1337528Victor
MemberThanks for the follow up Anna.
We’ll let you know as soon a the fix is released.
Best,
VictorAugust 25, 2017 at 7:33 am #1340246Nico
MemberHey,
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,
NicoSeptember 16, 2017 at 9:35 am #1350152Support Droid
KeymasterHey 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 -
AuthorPosts
- The topic ‘Problem with function "tribe_add_start_end_time_to_month_view "’ is closed to new replies.
