start_controls_section( 'section_content', [ 'label' => esc_html__( 'Content', 'nighty' ), ] ); $this->add_control( 'title', [ 'label' => esc_html__( 'Text', 'nighty' ), 'type' => \Elementor\Controls_Manager::TEXTAREA, 'default' => esc_html__( 'BOOK TODAY!', 'nighty' ), 'placeholder' => esc_html__( 'Type your title here', 'nighty' ), ] ); $this->add_control( 'link', [ 'label' => esc_html__( 'Link', 'nighty' ), 'type' => \Elementor\Controls_Manager::URL, 'placeholder' => esc_html__( 'https://your-link.com', 'nighty' ), 'options' => [ 'url', 'is_external', 'nofollow' ], 'default' => [ 'url' => '#', 'is_external' => true, 'nofollow' => false, ], ] ); $this->add_control( 'alignment', [ 'label' => esc_html__( 'Alignment', 'nighty' ), 'type' => \Elementor\Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => esc_html__( 'Left', 'nighty' ), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => esc_html__( 'Center', 'nighty' ), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => esc_html__( 'Right', 'nighty' ), 'icon' => 'eicon-text-align-right', ], ], 'default' => 'right', 'toggle' => true, 'selectors' => [ '{{WRAPPER}} .ova-button-booking' => 'text-align: {{VALUE}};', ], ] ); $this->end_controls_section(); //SECTION TAB STYLE TITLE $this->start_controls_section( 'section_button_style', [ 'label' => esc_html__( 'Button', 'nighty' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'button_size', [ 'label' => esc_html__( 'Size', 'nighty' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'rem' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 500, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .ova-button-booking .button-booking' => 'width: {{SIZE}}{{UNIT}};min-width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'background_color', [ 'label' => esc_html__( 'Background Color', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-button-booking .button-booking' => 'background-color : {{VALUE}};', ], ] ); $this->add_control( 'background_color_hover', [ 'label' => esc_html__( 'Background Color Hover', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-button-booking .button-booking:hover' => 'background-color : {{VALUE}};' ], ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'button_border', 'selector' => '{{WRAPPER}} .ova-button-booking .button-booking', ] ); $this->add_control( 'border_color_hover', [ 'label' => esc_html__( 'Border Color Hover', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-button-booking .button-booking:hover' => 'border-color : {{VALUE}};' ], ] ); $this->add_control( 'button_text', [ 'label' => esc_html__( 'Text', 'nighty' ), 'type' => \Elementor\Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'button_typography_title', 'label' => esc_html__( 'Typography', 'nighty' ), 'selector' => '{{WRAPPER}} .ova-button-booking .button-booking', ] ); $this->add_control( 'color_title', [ 'label' => esc_html__( 'Color', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-button-booking .button-booking' => 'color : {{VALUE}};', ], ] ); $this->add_control( 'color_title_hover', [ 'label' => esc_html__( 'Color Hover', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-button-booking .button-booking:hover' => 'color : {{VALUE}};' ], ] ); $this->end_controls_section(); //END SECTION TAB STYLE TITLE } // Render Template Here protected function render() { $settings = $this->get_settings(); $title = $settings['title']; $link = $settings['link']['url']; $target = $settings['link']['is_external'] ? '_blank' : '_self'; $nofollow = (( $settings['link']['nofollow'] != '' ) && $settings['link']['nofollow'] ) ? 'rel=nofollow' : ''; ?>
>
register( new Nighty_Elementor_Booking_Button() );