Showing posts in calendar view based on start of the day

add_shortcode('ts_day_week_start', function($atts){
    $atts = shortcode_atts( array(
        'day' => 'Monday',
    ), $atts);
    $res = strtotime('last ' . $atts['day']);
    if(date('l') == $atts['day']){
        $res = strtotime('this ' . $atts['day']);
    }
    return $res;
});
 
 
add_shortcode('ts_day_week_end', function($atts){
    $atts = shortcode_atts( array(
        'day' => 'Monday',
    ), $atts);
    $res = strtotime('last ' . $atts['day']);
    if(date('l') == $atts['day']){
        $res = strtotime('this ' . $atts['day']);
    }
    $res = strtotime("tomorrow", $res) - 1;
    return $res;
});
[wpv-view name="schedule-view" cached="off" tsstart="[ts_day_week_start day='Friday']" tsend="[ts_day_week_end day='Friday']"]

Visto en Toolset

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Scroll al inicio

We are using cookies on our website

Please confirm, if you accept our tracking cookies. You can also decline the tracking, so you can continue to visit our website without any data sent to third party services.