Submit
Path:
~
/
home
/
getwphos
/
www
/
BenjaminMarc2023
/
wp-content
/
plugins
/
xt-woo-quick-view-lite
/
admin
/
elementor
/
File Content:
class-elementor-widget.php
<?php if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Elementor Quick View Widget. * * Elementor widget that inserts a quick view button into the page, from any given product id. * * @since 1.0.0 */ class XT_Woo_Quick_View_Elementor_Widget extends \Elementor\Widget_Base { /** * Get widget name. * * Retrieve widget name. * * @since 1.0.0 * @access public * * @return string Widget name. */ public function get_name() { return 'xt-woo-quick-view'; } /** * Get widget title. * * Retrieve widget title. * * @since 1.0.0 * @access public * * @return string Widget title. */ public function get_title() { return esc_html__( 'XT Quick View', 'xt-woo-quick-view' ); } /** * Get widget icon. * * Retrieve widget icon. * * @since 1.0.0 * @access public * * @return string Widget icon. */ public function get_icon() { return 'eicon-eye'; } /** * Get custom help URL. * * Retrieve a URL where the user can get more information about the widget. * * @since 1.0.0 * @access public * @return string Widget help URL. */ public function get_custom_help_url() { return 'https://xplodedthemes.com/support/'; } /** * Get widget categories. * * Retrieve the list of categories the widget belongs to. * * @since 1.0.0 * @access public * * @return array Widget categories. */ public function get_categories() { return [ 'woocommerce' ]; } /** * Get widget keywords. * * Retrieve the list of keywords the oEmbed widget belongs to. * * @since 1.0.0 * @access public * @return array Widget keywords. */ public function get_keywords() { return [ 'quick', 'view', 'quickview' ]; } /** * Register widget controls. * * Adds different input fields to allow the user to change and customize the widget settings. * * @since 1.0.0 * @access protected */ protected function register_controls() { $this->start_controls_section( 'content_section', [ 'label' => __( 'Content', 'xt-woo-quick-view' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'product_id', [ 'label' => __( 'Product ID', 'xt-woo-quick-view' ), 'description' => __('Enter product ID or keep empty to auto detect product', 'xt-woo-quick-view' ), 'type' => \Elementor\Controls_Manager::TEXT, 'input_type' => 'number', 'placeholder' => __( 'Enter product ID', 'xt-woo-quick-view' ), ] ); $this->end_controls_section(); } /** * Render 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(); $id = $settings['product_id']; echo '<span class="'.$this->get_name().'-elementor-widget">'; echo do_shortcode('[xt_wooqv_trigger id="'.$id.'"]'); echo '</span>'; } }
Submit
FILE
FOLDER
Name
Size
Permission
Action
class-elementor-widget.php
3040 bytes
0644
N4ST4R_ID | Naxtarrr