start_controls_section( 'section_poll_maker', array( 'label' => esc_html__( 'Poll Maker', 'poll-maker' ), ) ); $this->add_control( 'poll_title', array( 'label' =>esc_html__( 'Poll Title', 'poll-maker' ), 'type' => Controls_Manager::TEXT, 'default' => '', 'title' =>esc_html__( 'Enter the poll title', 'poll-maker' ), 'placeholder' =>esc_html__( 'Enter the poll title', 'poll-maker' ), ) ); $this->add_control( 'poll_title_alignment', array( 'label' =>esc_html__( 'Title Alignment', 'poll-maker' ), 'type' => Controls_Manager::SELECT, 'default' => 'left', 'options' => array( 'left' => 'Left', 'right' => 'Right', 'center' => 'Center' ) ) ); $this->add_control( 'poll_selector', array( 'label' =>esc_html__( 'Select Poll', 'poll-maker' ), 'type' => Controls_Manager::SELECT, 'default' => $this->get_default_poll(), 'options' => $this->get_active_polls() ) ); $this->end_controls_section(); } protected function render( $instance = array() ) { $settings = $this->get_settings_for_display(); echo ( isset( $settings['poll_title'] ) && ! empty( $settings['poll_title'] ) ) ? "