start_controls_section( 'content_section', [ 'label' => __( 'Insert Appointment Booking Calendar', 'appointment-booking-calendar' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); $forms = array(); $rows = $wpdb->get_results("SELECT id,uname FROM ".CPABC_APPOINTMENTS_CONFIG_TABLE_NAME." ORDER BY uname"); foreach ($rows as $item) $forms[$item->id] = $item->uname; $this->add_control( 'formid', [ 'label' => __( 'Select Appointment Calendar', 'appointment-booking-calendar' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => '1', 'options' => $forms, ] ); $this->end_controls_section(); } /** * Render widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { global $cp_cfte_plugin; $settings = $this->get_settings_for_display(); $id = $settings["formid"]; if ( ! \Elementor\Plugin::instance()->editor->is_edit_mode() ) { echo cpabc_appointments_filter_content( array("calendar" => $id) ); return; } else { define('ABC_ELEMENTOR_EDIT_MODE', true); echo '
'; } } } \Elementor\Plugin::instance()->widgets_manager->register_widget_type(new Elementor_CPABC_Widget());