PATH:
home
/
thebhoeo
/
public_html
/
wp-content
/
themes
/
woodmart
/
inc
/
integrations
/
elementor
/
elements
<?php /** * Menu price map. * * @package woodmart */ namespace XTS\Elementor; use Elementor\Group_Control_Image_Size; use Elementor\Widget_Base; use Elementor\Controls_Manager; use Elementor\Plugin; if ( ! defined( 'ABSPATH' ) ) { exit; // Direct access not allowed. } /** * Elementor widget that inserts an embeddable content into the page, from any given URL. * * @since 1.0.0 */ class Menu_Price extends Widget_Base { /** * Get widget name. * * @since 1.0.0 * @access public * * @return string Widget name. */ public function get_name() { return 'wd_menu_price'; } /** * Get widget title. * * @since 1.0.0 * @access public * * @return string Widget title. */ public function get_title() { return esc_html__( 'Menu price', 'woodmart' ); } /** * Get widget icon. * * @since 1.0.0 * @access public * * @return string Widget icon. */ public function get_icon() { return 'wd-icon-menu-price'; } /** * Get widget categories. * * @since 1.0.0 * @access public * * @return array Widget categories. */ public function get_categories() { return array( 'wd-elements' ); } /** * Register the widget controls. * * @since 1.0.0 * @access protected */ protected function register_controls() { /** * Content tab. */ /** * General settings. */ $this->start_controls_section( 'general_content_section', array( 'label' => esc_html__( 'General', 'woodmart' ), ) ); $this->add_control( 'title', array( 'label' => esc_html__( 'Title', 'woodmart' ), 'type' => Controls_Manager::TEXT, 'default' => 'Weight Watchers General Tso\'s Chicken', ) ); $this->add_control( 'description', array( 'label' => esc_html__( 'Description', 'woodmart' ), 'type' => Controls_Manager::TEXT, 'default' => 'In a medium bowl, whisk together broth, cornstarch, sugar, soy sauce, vinegar and ginger; set aside.', ) ); $this->add_control( 'price', array( 'label' => esc_html__( 'Price', 'woodmart' ), 'type' => Controls_Manager::TEXT, 'default' => '$399.00', ) ); $this->add_control( 'link', array( 'label' => esc_html__( 'Link', 'woodmart' ), 'type' => Controls_Manager::URL, 'default' => array( 'url' => '', 'is_external' => false, 'nofollow' => false, ), ) ); $this->add_control( 'image', array( 'label' => esc_html__( 'Choose image', 'woodmart' ), 'type' => Controls_Manager::MEDIA, ) ); $this->add_group_control( Group_Control_Image_Size::get_type(), array( 'name' => 'image', 'default' => 'thumbnail', 'separator' => 'none', ) ); $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() { $default_settings = array( 'image' => '', 'title' => '', 'description' => '', 'price' => '', 'link' => array( 'url' => '', 'is_external' => '', ), ); $settings = wp_parse_args( $this->get_settings_for_display(), $default_settings ); $image_output = ''; $this->add_render_attribute( array( 'wrapper' => array( 'class' => array( 'wd-menu-price', ), ), 'price' => array( 'class' => array( 'menu-price-price', 'amount', ), ), 'description' => array( 'class' => array( 'menu-price-details', ), ), ) ); $this->add_inline_editing_attributes( 'title' ); $this->add_inline_editing_attributes( 'price' ); $this->add_inline_editing_attributes( 'description' ); // Image settings. $custom_image_size = isset( $settings['image_custom_dimension']['width'] ) && $settings['image_custom_dimension']['width'] ? $settings['image_custom_dimension'] : array( 'width' => 128, 'height' => 128, ); if ( isset( $settings['image']['id'] ) && $settings['image']['id'] ) { $image_output = '<span class="img-wrapper">' . woodmart_otf_get_image_html( $settings['image']['id'], $settings['image_size'], $settings['image_custom_dimension'] ) . '</span>'; if ( woodmart_is_svg( $settings['image']['url'] ) ) { $custom_image_size = 'custom' !== $settings['image_size'] ? $settings['image_size'] : $custom_image_size; $image_output = woodmart_get_svg_html( $settings['image']['id'], $custom_image_size ); } } // Link settings. if ( $settings['link'] && $settings['link']['url'] ) { $this->add_link_attributes( 'link', $settings['link'] ); $this->add_render_attribute( 'link', 'class', 'wd-menu-price-link wd-fill' ); $this->add_render_attribute( 'link', 'aria-label', esc_html__( 'Menu price link', 'woodmart' ) ); $this->add_render_attribute( 'wrapper', 'class', 'wd-with-link' ); } woodmart_enqueue_inline_style( 'menu-price' ); ?> <div <?php echo $this->get_render_attribute_string( 'wrapper' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> <?php if ( $image_output ) : ?> <div class="menu-price-image"> <?php echo $image_output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> </div> <?php endif ?> <div class="menu-price-desc-wrapp"> <div class="menu-price-heading"> <?php if ( $settings['title'] ) : ?> <h3 class="menu-price-title wd-entities-title"> <span <?php echo $this->get_render_attribute_string( 'title' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> <?php echo wp_kses( $settings['title'], woodmart_get_allowed_html() ); ?> </span> </h3> <?php endif ?> <div <?php echo $this->get_render_attribute_string( 'price' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> <?php echo wp_kses( $settings['price'], woodmart_get_allowed_html() ); ?> </div> </div> <?php if ( $settings['description'] ) : ?> <div <?php echo $this->get_render_attribute_string( 'description' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>> <?php echo do_shortcode( $settings['description'] ); ?> </div> <?php endif ?> </div> <?php if ( ! empty( $settings['link']['url'] ) ) : ?> <a <?php echo $this->get_render_attribute_string( 'link' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>></a> <?php endif; ?> </div> <?php } } Plugin::instance()->widgets_manager->register( new Menu_Price() );
[-] class-widget-products.php
[edit]
[-] class-countdown.php
[edit]
[-] class-off-canvas-column-btn.php
[edit]
[-] class-video.php
[edit]
[-] class-author-area.php
[edit]
[+]
banner
[-] class-text-block.php
[edit]
[-] class-product-filters.php
[edit]
[-] class-timeline.php
[edit]
[+]
blog
[-] class-testimonials.php
[edit]
[-] class-size-guide.php
[edit]
[-] class-google-map.php
[edit]
[-] class-title.php
[edit]
[-] class-image-hotspot.php
[edit]
[-] class-mailchimp.php
[edit]
[-] class-page-title.php
[edit]
[-] class-page-heading.php
[edit]
[-] class-product-categories.php
[edit]
[-] class-compare-images.php
[edit]
[-] class-nested-carousel.php
[edit]
[-] class-wd-mega-menu.php
[edit]
[-] class-table.php
[edit]
[-] class-team-member.php
[edit]
[-] class-3d-view.php
[edit]
[-] class-products-brands.php
[edit]
[-] class-slider.php
[edit]
[+]
products
[-] class-image.php
[edit]
[-] class-sidebar.php
[edit]
[-] class-tabs.php
[edit]
[-] class-counter.php
[edit]
[-] class-accordion.php
[edit]
[-] class-open-street-map.php
[edit]
[-] class-wishlist.php
[edit]
[-] class-search.php
[edit]
[+]
..
[-] class-social.php
[edit]
[+]
infobox
[-] class-toggle.php
[edit]
[-] class-contact-form-7.php
[edit]
[-] class-menu-anchor.php
[edit]
[+]
instagram
[-] class-menu-price.php
[edit]
[-] class-breadcrumbs.php
[edit]
[-] class-list.php
[edit]
[+]
products-tabs
[-] class-popup.php
[edit]
[-] class-extra-menu-list.php
[edit]
[+]
portfolio
[-] class-pricing-tables.php
[edit]
[-] class-marquee.php
[edit]
[-] class-twitter.php
[edit]
[-] class-compare.php
[edit]
[-] class-images-gallery.php
[edit]
[+]
button