• Hi! the calendar have ajax events? I need reload a script/s after/before click next or previous month in calendar.

    exactly i need reload wp leafletmap but question is… have ajax events?

    you know?

    thank u

    p.d: or deactivate ajax in a calendar? or add a url location on change month (ex: https://www.web.com/calendar/?month=january+2021) ,i think can reaload page with js if i have location

    • This topic was modified 3 years, 3 months ago by sermalefico.
    • This topic was modified 3 years, 3 months ago by sermalefico.
    • This topic was modified 3 years, 3 months ago by sermalefico.
Viewing 1 replies (of 1 total)
  • Plugin Author ishitaka

    (@ishitaka)

    Hi,

    Unfortunately, I don’t have ajax events. Sorry for not living up to your expectations.

    To display the month specified by the URL parameter, the code would look like the following.

    add_action( "xo_event_calendar_args", function( $args ) {
    	if ( isset( $_GET['month'] ) ) {
    		$months = array( 'january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december' );
    		$reg = implode( '|', $months );
    		$month = sanitize_text_field( $_GET['month'] );
    		if ( preg_match( '/(' . implode( '|', $months ) . ')\s([0-9]{4})/', $month, $matchs ) ) {
    			$args['month'] = array_search( $matchs[1], $months ) + 1;
    			$args['year'] = $matchs[2];
    		}
    	}
    	return $args;
    } );
Viewing 1 replies (of 1 total)
  • The topic ‘Ajax events’ is closed to new replies.