| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Main ProductDescription class. |
| 5 |
* |
| 6 |
* @package RadiusTheme\SB |
| 7 |
*/ |
| 8 |
|
| 9 |
namespace RadiusTheme\SB\Controllers\ThemesSupport\Helloelementor; |
| 10 |
|
| 11 |
// Do not allow directly accessing this file. |
| 12 |
if ( ! defined( 'ABSPATH' ) ) { |
| 13 |
exit( 'This script cannot be accessed directly.' ); |
| 14 |
} |
| 15 |
|
| 16 |
/** |
| 17 |
* Product Description class |
| 18 |
*/ |
| 19 |
class WidgetsSupport { |
| 20 |
|
| 21 |
/** |
| 22 |
* The single instance of the class. |
| 23 |
* |
| 24 |
* @var object |
| 25 |
*/ |
| 26 |
protected static $instance = null; |
| 27 |
|
| 28 |
/** |
| 29 |
* The single instance of the class. |
| 30 |
* |
| 31 |
* @var object |
| 32 |
*/ |
| 33 |
private $widgets; |
| 34 |
|
| 35 |
/** |
| 36 |
* Construct function |
| 37 |
*/ |
| 38 |
private function __construct() {} |
| 39 |
/** |
| 40 |
* Get class instance. |
| 41 |
* |
| 42 |
* @return object Instance. |
| 43 |
*/ |
| 44 |
public static function instance( $widgets ) { |
| 45 |
if ( ! self::$instance ) { |
| 46 |
self::$instance = new self(); |
| 47 |
} |
| 48 |
self::$instance->widgets = $widgets; |
| 49 |
return self::$instance; |
| 50 |
} |
| 51 |
|
| 52 |
/** |
| 53 |
* The function name comes from the widget base name "rtsb-products-archive". This is for theme support prefix with "widget_controls". |
| 54 |
* |
| 55 |
* @return void |
| 56 |
*/ |
| 57 |
public function widget_controls_rtsb_products_archive() { |
| 58 |
add_filter( 'rtsb/elements/elementor/widgets/controls/rtsb-products-archive', [ $this, 'product_loop_widget_controls_support' ], 11 ); |
| 59 |
} |
| 60 |
/** |
| 61 |
* Widget Field. |
| 62 |
* |
| 63 |
* @return array |
| 64 |
*/ |
| 65 |
public function product_loop_widget_controls_support( $fields ) { |
| 66 |
if ( $this->widgets->has_pagination ) { |
| 67 |
$fields['prev_icon']['default'] = [ |
| 68 |
'value' => 'fas fa-long-arrow-alt-left', |
| 69 |
'library' => 'fa-solid', |
| 70 |
]; |
| 71 |
$fields['next_icon']['default'] = [ |
| 72 |
'value' => 'fas fa-long-arrow-alt-right', |
| 73 |
'library' => 'fa-solid', |
| 74 |
]; |
| 75 |
} |
| 76 |
return $fields; |
| 77 |
} |
| 78 |
|
| 79 |
|
| 80 |
} |
| 81 |
|