PHP Warning: Missing argument 4 for ecp_filter_single_title()

Home Forums Calendar Products Events Calendar PRO PHP Warning: Missing argument 4 for ecp_filter_single_title()

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #958262
    Glenn
    Participant

    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.

    #958263
    Glenn
    Participant

    The adding of a URL is a bit hit and miss with the forum. Here is the link to the code snippet.

    (If there is nothing here, it didn’t work again…)

    Glenn.

    #958318
    George
    Participant

    Hey 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,
    George

    #958336
    Glenn
    Participant

    George,

    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.

    #958605
    George
    Participant

    Glad to hear it Glenn! Best of luck with your site 🙂

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘PHP Warning: Missing argument 4 for ecp_filter_single_title()’ is closed to new replies.