芝麻web文件管理V1.00
编辑当前文件:/home/seolotod/critterchoice.com/wp-content/themes/rehub-theme/rehub-elementor/wpsm-proscons.php
start_controls_section( 'select_layout_block', [ 'label' => esc_html__( 'Blocks', 'rehub-theme' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ]); $this->add_control( 'select_block', [ 'type' => \Elementor\Controls_Manager::SELECT, 'label' => esc_html__( 'Select Block', 'rehub-theme' ), 'default' => 'wpsm_pros_shortcode', 'options' => [ 'wpsm_pros_shortcode' => esc_html__('Pros Block', 'rehub-theme'), 'wpsm_cons_shortcode' => esc_html__('Cons Block', 'rehub-theme'), ], 'label_block' => true, ]); $this->add_control( 'title', [ 'type' => \Elementor\Controls_Manager::TEXT, 'label' => esc_html__( 'Positives', 'rehub-theme' ), 'default' => 'Positives:', 'label_block' => true, 'condition' => [ 'select_block' => 'wpsm_pros_shortcode' ] ]); $this->add_control( 'content', [ 'type' => \Elementor\Controls_Manager::WYSIWYG, 'label' => esc_html__( 'Content', 'rehub-theme' ), 'label_block' => true, 'default' => '
Positive one
Positive two
Positive three
', 'condition' => [ 'select_block' => 'wpsm_pros_shortcode' ] ]); $this->add_control( 'cons_title', [ 'type' => \Elementor\Controls_Manager::TEXT, 'label' => esc_html__( 'Negatives', 'rehub-theme' ), 'label_block' => true, 'default' => 'Negatives:', 'condition' => [ 'select_block' => 'wpsm_cons_shortcode' ], ]); $this->add_control( 'cons_content', [ 'type' => \Elementor\Controls_Manager::WYSIWYG, 'label' => esc_html__( 'Content', 'rehub-theme' ), 'label_block' => true, 'default' => '
Negative one
Negative two
Negative three
', 'condition' => [ 'select_block' => 'wpsm_cons_shortcode' ] ]); $this->end_controls_section(); } /* Widget output Rendering */ protected function render() { $settings = $this->get_settings_for_display(); if( $settings['select_block'] == 'wpsm_cons_shortcode' ) { $cons_title = rh_check_empty_index($settings, 'cons_title'); if($cons_title){ $settings['title'] = $settings['cons_title']; } $cons_content = rh_check_empty_index($settings, 'cons_content'); if($cons_content){ $settings['content'] = $settings['cons_content']; } echo wpsm_cons_shortcode($settings, $settings['content']); }else{ echo wpsm_pros_shortcode($settings, $settings['content']); } } } Plugin::instance()->widgets_manager->register( new WPSM_Pros_Cons_Block_Widget );