Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter KlausFriese

    (@klausfriese)

    Amazing. Thanks a lot, that’s great. Works perfect, I added an JavaScript countdown and now I have a “next event xxx in 4 days 8 hours 15 minutes 46 seconds” text counting down to zero.

    My code is not yet finished, I will publish it here when it’s final.

    Thread Starter KlausFriese

    (@klausfriese)

    I tried:

    add_action( 'r34ics_display_calendar_before_render_template', 'loadICSdata' );
    
    // The action callback function.
    function loadICSdata( $view, $args, $ics_data ) {
    	// do something
    }
    
    add_filter('r34ics_display_calendar_set_first_date', function($view, $first_date, $startdate, $pastdays) {
    	// do something    
    	return $something;
    } );
    
    add_filter('r34ics_display_calendar_set_limit_date', function($view, $first_ts, $limitdays) {
    	// do something    
    	return $something;
    } );
    
    add_filter('r34ics_display_calendar_set_earliest', function( $view, $first_date) {
    	// do something    
    	return $something;
    } );
    
    add_filter('r34ics_display_calendar_set_latest', function( $view, $limit_date, $first_ts, $limitdays, $limitdayscustom) {
    	// do something    
    	return $something;
    } );
    

    The action r34ics_display_calendar_before_render_template is called, but the $ics_data[‘events’] is empty. Filters are not called – what’s can be wrong here?

    Thanks
    Klaus

    Thread Starter KlausFriese

    (@klausfriese)

    Thanks a lot, I will try that. And moving the parsing to a separate function is a good idea for a future version.

    Another idea I had: I class-r34ics.php there’s a switch for the view and the default call a filter or an action. Filters for setting the date range and an action r34ics_display_calendar_render_template
    Can I use these?

Viewing 3 replies - 1 through 3 (of 3 total)