芝麻web文件管理V1.00
编辑当前文件:/home/seolotod/critterchoice.com/wp-content/themes/rehub-theme/rehub-elementor/wpsm-countdown.php
general_controls(); } protected function general_controls() { $this->start_controls_section( 'general_section', [ 'label' => esc_html__( 'General', 'rehub-theme' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ]); $this->add_control( 'date', [ 'type' => \Elementor\Controls_Manager::DATE_TIME, 'label' => esc_html__( 'Choose date of finish', 'rehub-theme' ), 'label_block' => true, ]); $this->add_control( 'enable_light', [ 'type' => \Elementor\Controls_Manager::SWITCHER, 'label' => esc_html__( 'Enable light compact style?', 'rehub-theme' ), 'label_on' => esc_html__('Yes', 'rehub-theme'), 'label_off' => esc_html__('No', 'rehub-theme'), ]); $this->end_controls_section(); } /* Widget output Rendering */ protected function render() { $settings = $this->get_settings_for_display(); $date = date_create_from_format( 'Y-m-d H:i', $this->get_settings( 'date' ) ); $new_date = date_format($date, 'Y-m-d'); $new_time = date_format($date, 'H:i'); $countdown = explode('-', $new_date); $timedown = explode(':', $new_time); $year = $countdown[0]; $month = $countdown[1]; $day = $countdown[2]; $hour = $timedown[0]; $min = $timedown[1]; $light = $this->get_settings( 'enable_light' ); $lightclass = $light ? 'gridcountdown' : ''; echo '
'; echo wpsm_countdown(array('year'=> $year, 'month'=>$month, 'day'=>$day, 'hour'=>$hour, 'minute' => $min)); echo '
'; } } Plugin::instance()->widgets_manager->register( new WPSM_Countdown_Widget );