start_controls_section( '_section_reddit', [ 'label' => __( 'Reddit Content Settings', 'allembed' ), ] ); $this->add_control( 'reddit_link', [ 'label' => esc_html__( 'Reddit Link', 'allembed' ), 'label_block' => true, 'type' => Controls_Manager::TEXT, 'placeholder' => esc_html__( 'https://your-link.com', 'allembed' ), 'default' =>'https://www.reddit.com/r/HISHAMtalksANIME/comments/1o05c7n/ringoko/', ] ); $this->end_controls_section(); $this->start_controls_section( 'reddit_ttabb', [ 'label' =>esc_html__( 'Reddit Other Settings', 'allembed' ), ] ); $this->add_control( 'width', [ 'label' => esc_html__( 'Width', 'allembed' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ '%', 'px' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1500, 'step' => 5, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 600, ], 'selectors' => [ '{{WRAPPER}} .reddit-app-wrapper' => 'width: {{SIZE}}{{UNIT}}', ], ] ); $this->add_control( 'height', [ 'label' => esc_html__( 'Height', 'allembed' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ '%', 'px' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1500, 'step' => 5, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'default' => [ 'unit' => 'px', 'size' => 460, ], 'selectors' => [ '{{WRAPPER}} .reddit-app-wrapper' => 'height: {{SIZE}}{{UNIT}}', ], ] ); $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(); $reddit_link = $settings['reddit_link']; if (strpos($reddit_link, 'redditmedia.com') !== false) { echo ''; } else { ?>