• Dear Experts,

    How can I get as a variable the “scheduled_time_end” if it exists?

    I’d like to write a query that shows only quizes that are inside the scheduled timeframe.

    Thank you!

Viewing 1 replies (of 1 total)
  • Hello there,

    Check this block of code:

    
    add_filter('qmn_begin_shortcode', 'qsm_scheduled_timeframe_check', 10, 3);
    
    function qsm_scheduled_timeframe_check($display, $options, $variable_data) {
        global $qmn_allowed_visit;
    
        // Checks if the start and end dates have data
        if (!empty($options->scheduled_time_start) && !empty($options->scheduled_time_end)) {
            $start = strtotime($options->scheduled_time_start);
            $end = strtotime($options->scheduled_time_end) + 86399;
    
            // Checks if the current timestamp is outside of scheduled timeframe
            if (current_time('timestamp') < $start || current_time('timestamp') > $end) {
                $qmn_allowed_visit = false;
                $message = wpautop(htmlspecialchars_decode($options->scheduled_timeframe_text, ENT_QUOTES));
                $message = apply_filters('mlw_qmn_template_variable_quiz_page', $message, $variable_data);
                $display .= str_replace("\n", "<br>", $message);
            }
        }
        
        return $display;
    
    }
    

    which presents in php/classes/class-qmn-quiz-manager.php line 1500-1521.

    You would probably be able to find which variable to use within that code.

    Regards,
    Kharis

Viewing 1 replies (of 1 total)

The topic ‘scheduled_time_end’ is closed to new replies.