start_controls_section( 'compare_content', [ 'label' => __( 'Compare', 'ai-elementor' ), ] ); $this->add_control( 'title', [ 'label' => __( 'Title', 'ai-elementor' ), 'type' => Controls_Manager::TEXT, 'default' => 'Other AI platforms', ] ); $this->add_control( 'image', [ 'label' => __( 'Image', 'ai-elementor' ), 'type' => Controls_Manager::MEDIA, 'default' => [ 'url' => \Elementor\Utils::get_placeholder_image_src(), ], ] ); $this->add_control( 'hr', [ 'type' => \Elementor\Controls_Manager::DIVIDER, ] ); $repeater = new \Elementor\Repeater(); $repeater->add_control( 'image', [ 'label' => __( 'Icon Image', 'ai-elementor' ), 'type' => Controls_Manager::MEDIA, 'default' => [ 'url' => AIDA_ASSETS_URL . 'images/default/icon.png', ], ] ); $repeater->add_control( 'title', [ 'label' => __( 'Title', 'ai-elementor' ), 'type' => Controls_Manager::TEXT, 'default' => __( 'Insert title here' , 'ai-elementor' ), 'label_block' => true, ] ); $repeater->add_control( 'description', [ 'label' => __( 'Title', 'ai-elementor' ), 'type' => Controls_Manager::TEXTAREA, 'default' => __( 'Insert content here' , 'ai-elementor' ), ] ); $this->add_control( 'compare_items', [ 'label' => __( 'Compare Items', 'ai-elementor' ), 'type' => Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'title_field' => '{{{ title }}}', ] ); $this->end_controls_section(); $this->start_controls_section( 'compare_style', [ 'label' => __( 'Style', 'ai-elementor' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'comp_style', [ 'label' => __( 'Compare Style', 'ai-elementor' ), 'type' => Controls_Manager::SELECT, 'default' => '', 'options' => [ '' => __( 'Style 1', 'plugin-domain' ), 'compare-box-right' => __( 'Style 2', 'plugin-domain' ), ], ] ); $this->end_controls_section(); } /** * Render the widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); ?>