PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.2.1
ShopBuilder – WooCommerce Builder For Elementor v3.2.1
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
shopbuilder / app / Elementor / Widgets / Single / ShortDescription.php

ShortDescription.php in ShopBuilder – WooCommerce Builder For Elementor 3.2.1, at app/Elementor/Widgets/Single/ShortDescription.php

74 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Main ProductDescription class.
4 *
5 * @package RadiusTheme\SB
6 */
7
8 namespace RadiusTheme\SB\Elementor\Widgets\Single;
9
10 // Do not allow directly accessing this file.
11 if ( ! defined( 'ABSPATH' ) ) {
12 exit( 'This script cannot be accessed directly.' );
13 }
14
15 use RadiusTheme\SB\Abstracts\ElementorWidgetBase;
16 use RadiusTheme\SB\Elementor\Widgets\Controls\TextStyleSettings;
17 use RadiusTheme\SB\Helpers\Fns;
18
19 /**
20 * Product Description class
21 */
22 class ShortDescription extends ElementorWidgetBase {
23 /**
24 * Construct function
25 *
26 * @param array $data default array.
27 * @param mixed $args default arg.
28 */
29 public function __construct( $data = [], $args = null ) {
30 $this->rtsb_name = esc_html__( 'Short Description', 'shopbuilder' );
31 $this->rtsb_base = 'rtsb-short-description';
32 parent::__construct( $data, $args );
33 }
34 /**
35 * Widget Field
36 *
37 * @return array
38 */
39 public function widget_fields() {
40 return TextStyleSettings::widget_fields( $this );
41 }
42 /**
43 * Set Widget Keyword.
44 *
45 * @return array
46 */
47 public function get_keywords() {
48 return [ 'Excerpt' ] + parent::get_keywords();
49 }
50 /**
51 * Render Function
52 *
53 * @return void
54 */
55 protected function render() {
56 global $post;
57 $_post = $post;
58 $controllers = $this->get_settings_for_display();
59 $this->theme_support();
60 if ( $this->is_builder_mode() ) {
61 // Overriding Global.
62 $post = get_post( Fns::get_prepared_product_id() ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
63 }
64 $data = [
65 'template' => 'elementor/single-product/short-description',
66 'controllers' => $controllers,
67 ];
68 Fns::load_template( $data['template'], $data );
69 $this->theme_support( 'render_reset' );
70 $post = $_post; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
71 }
72
73 }
74