• Resolved jirkavy

    (@jirkavy)


    Hello,
    Iam using your plugin Calendar for wordpress. I have a question about hidding the old events. Iam already use this little code in file main.php on line 880:

    if ($event['end_date'] >= date("Y-m-d")) {
    //code } else {
    $event_html = "?";
    }

    Is it possible implement some function into your callendar like this?

    Have a good day,
    Jiri.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author ishitaka

    (@ishitaka)

    Hi,

    It is better to use ‘xo_event_calendar_event_title’ filter hook.

    Example:

    In the theme’s functions.php,

    add_filter( 'xo_event_calendar_event_title', function( $html, $event ) {
    
    	$current_time = strtotime( current_time( 'Y-m-d' ) );
    	$event_time   = strtotime( $event['end_date'] );
    
    	if ( $event_time < $current_time ) {
    		$html = '';
    	}
    
    	return $html;
    }, 10, 2 );
    
    Thread Starter jirkavy

    (@jirkavy)

    Thank you, this is tottaly better solution. Have a nice day and happy new year!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hidde old events’ is closed to new replies.