芝麻web文件管理V1.00
编辑当前文件:/home/seolotod/critterchoice.com/wp-content/themes/rehub-theme/rehub-elementor/wpsm-deallist.php
add_control( 'aff_link', [ 'type' => \Elementor\Controls_Manager::SWITCHER, 'label' => esc_html__( 'Make link as affiliate?', 'rehub-theme' ), 'description' => esc_html__( 'This will change all inner post links to affiliate link of post offer', 'rehub-theme' ), 'label_on' => esc_html__('Yes', 'rehub-theme'), 'label_off' => esc_html__('No', 'rehub-theme'), 'return_value' => '1', ]); } protected function rehub_filter_values( $haystack ) { foreach ( $haystack as $key => $value ) { if ( is_array( $value ) ) { $haystack[ $key ] = $this->rehub_filter_values( $haystack[ $key ]); } if ( empty( $haystack[ $key ] ) ) { unset( $haystack[ $key ] ); } } return $haystack; } /* Widget output Rendering */ protected function render() { $settings = $this->get_settings_for_display(); if ( is_array( $settings['filterpanel'] ) ) { $settings['filterpanel'] = $this->rehub_filter_values( $settings['filterpanel'] ); $settings['filterpanel'] = rawurlencode( json_encode( $settings['filterpanel'] ) ); } // print_r($settings); $this->normalize_arrays( $settings ); $this->render_custom_js(); echo wpsm_offer_list_loop_shortcode( $settings ); } } Plugin::instance()->widgets_manager->register( new Widget_Wpsm_Deal_Coupon_List );