Home › Forums › Calendar Products › Events Calendar PRO › PHP Warning: Missing argument 4 for ecp_filter_single_title()
- This topic has 4 replies, 2 voices, and was last updated 8 years, 11 months ago by George.
-
AuthorPosts
-
April 24, 2015 at 10:43 pm #958262GlennParticipant
Hello,
I stumbled across by error log and discovered the following error listed a lot…
[25-Apr-2015 03:43:12 UTC] PHP Warning: Missing argument 4 for ecp_filter_single_title() in /home/o/public_html/h/wp-content/themes/twentythirteen-child/functions.php on line 41
I have the following in this file at that point:
/** * Filter Single Event Title in the Events Calendar 3.8 to Remove Upcoming Events * */ add_filter('tribe_events_title_tag', 'ecp_filter_single_title', 10, 4); function ecp_filter_single_title( $title_filter, $new_title, $title, $sep ) { if( tribe_is_event() && is_single() ) { $title_filter = str_replace('Upcoming Events |', '', $title_filter); } return $title_filter; } ?>
Seems it was advised to insert this filter to remove the “Upcoming Events” in the title and is found here:
Thoughts on how to clean it up? The whole filter thing does my head in… 🙂
Thanks
Glenn.
April 24, 2015 at 10:47 pm #958263GlennParticipantApril 25, 2015 at 11:13 am #958318GeorgeParticipantHey Glenn,
I have two ideas here that might help.
First, try making this function declaration:
ecp_filter_single_title( $title_filter, $new_title, $title, $sep ) {
Instead look like this:
ecp_filter_single_title( $title_filter, $new_title, $title, $sep = '|' ) {
If that does not help, then instead try removing that $sep argument altogether, like this:
ecp_filter_single_title( $title_filter, $new_title, $title ) {
And then go to the actual add_filter() bit of code and make the 4 a 3, so that it looks like this:
add_filter('tribe_events_title_tag', 'ecp_filter_single_title', 10, 3);
Let us know if either solution helps suppress that error!
Thanks,
GeorgeApril 25, 2015 at 5:32 pm #958336GlennParticipantGeorge,
Thanks for the reply. My log file had grown to 43,000 lines and 90% were this.
It seems the first option has fixed this issue.
Regards,
Glenn.
April 27, 2015 at 9:53 am #958605GeorgeParticipantGlad to hear it Glenn! Best of luck with your site 🙂
-
AuthorPosts
- The topic ‘PHP Warning: Missing argument 4 for ecp_filter_single_title()’ is closed to new replies.