start_controls_section( 'section_feed', ['label' => 'Feed Settings'] ); $this->add_control( 'header', [ 'label' => 'Header Title', 'type' => \Elementor\Controls_Manager::TEXT, 'default' => 'Beep', 'description' => 'Text shown in the feed header. Leave empty to show the wordmark logo.', ] ); $this->add_control( 'show_wordmark', [ 'label' => 'Show Wordmark Logo', 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => 'yes', ] ); $this->add_control( 'sort', [ 'label' => 'Default Sort', 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'latest', 'options' => [ 'latest' => 'Latest First', 'top' => 'Top / Most Liked', ], ] ); $this->add_control( 'limit', [ 'label' => 'Posts Per Page', 'type' => \Elementor\Controls_Manager::NUMBER, 'min' => 1, 'max' => 100, 'default' => 20, ] ); $this->end_controls_section(); $this->start_controls_section( 'section_style', ['label' => 'Appearance'] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'feed_typography', 'label' => 'Feed Typography', 'selector' => '{{WRAPPER}} .beep-feed', ] ); $this->add_control( 'card_radius', [ 'label' => 'Card Border Radius', 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => ['px'], 'range' => ['px' => ['min' => 0, 'max' => 32]], 'default' => ['unit' => 'px', 'size' => 0], 'selectors' => [ '{{WRAPPER}} .beep-post' => 'border-radius: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); } protected function render() { $settings = $this->get_settings_for_display(); $atts = [ 'header' => $settings['header'] ?: 'Beep', 'show_wordmark' => $settings['show_wordmark'] ? '1' : '0', 'sort' => $settings['sort'], 'limit' => (int) $settings['limit'], ]; echo Beep_Shortcode::render_feed($atts); } }