PluginProbe ʕ •ᴥ•ʔ
Strong Testimonials / 3.3.6
Strong Testimonials v3.3.6
3.3.6 3.3.5 3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.0.1 2.30.9 2.31.10 2.32 2.32.1 2.32.2 2.32.3 2.32.4 2.33 2.34 2.35 2.36 2.37 2.38 2.38.1 2.39 2.39.1 2.39.2 2.39.3 2.40.0 2.40.1 2.40.2 2.40.3 2.40.4 2.40.5 2.40.6 2.40.7 2.41.0 2.41.1 2.50.0 2.50.1 2.50.2 2.50.3 2.50.4 2.51.0 2.51.1 2.51.2 2.51.3 2.51.4 2.51.5 2.51.6 2.51.7 2.51.8 2.51.9 3.0.0 3.0.1 3.0.2 3.0.3 3.1.0 3.1.1 3.1.10 3.1.11 3.1.12 3.1.13 3.1.14 3.1.15 3.1.16 3.1.17 3.1.18 3.1.19 3.1.2 3.1.20 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.10 3.2.11 3.2.12 3.2.13 3.2.14 3.2.15 3.2.16 3.2.17 3.2.18 3.2.19 3.2.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0
strong-testimonials / includes / elementor / class-strong-testimonials-elementor-widget-activation.php
strong-testimonials / includes / elementor Last commit date
class-strong-testimonials-elementor-check.php 1 year ago class-strong-testimonials-elementor-widget-activation.php 1 year ago class-strong-testimonials-elementor-widget.php 1 year ago
class-strong-testimonials-elementor-widget-activation.php
95 lines
1 <?php
2
3 namespace ElementorStrongTestimonials;
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit;
6 } // Exit if accessed directly
7
8 class Strong_Testimonials_Elementor_Widget_Activation {
9
10 private static $_instance = null;
11
12 public static function instance() {
13 if ( is_null( self::$_instance ) ) {
14 self::$_instance = new self();
15 }
16
17 return self::$_instance;
18 }
19
20 private function include_widgets_files() {
21 require_once WPMTST_INC . 'elementor/class-strong-testimonials-elementor-widget.php';
22 }
23
24 /**
25 * Register Widgets
26 *
27 * Register new Elementor widgets.
28 *
29 * @since 1.2.0
30 * @access public
31 */
32 public function register_widgets() {
33 $this->include_widgets_files();
34 // Register Widgets
35 if ( method_exists( \Elementor\Plugin::instance()->widgets_manager, 'register' ) ) {
36 \Elementor\Plugin::instance()->widgets_manager->register( new Widgets\Strong_Testimonials_Elementor_Widget() );
37 } else {
38 \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\Strong_Testimonials_Elementor_Widget() );
39 }
40 }
41
42 public function __construct() {
43
44 // Register widgets
45 if ( has_action( 'elementor/widgets/register' ) ) {
46 add_action( 'elementor/widgets/register', array( $this, 'register_widgets' ) );
47 } else {
48 add_action( 'elementor/widgets/widgets_registered', array( $this, 'register_widgets' ) );
49 }
50
51 // Enqueue needed scripts for elementor Editor
52 add_action( 'elementor/editor/before_enqueue_scripts', array( $this, 'strong_testimonials_elementor_enqueue_editor_scripts' ) );
53
54 // Enqueue needed scripts and styles in Elementor preview
55 add_action( 'elementor/preview/enqueue_scripts', array( $this, 'strong_testimonials_elementor_enqueue_scripts' ) );
56 add_action( 'wp_ajax_strong_testimonials_elementor_ajax_search', array( $this, 'strong_testimonials_elementor_ajax_search' ) );
57 }
58
59 public function strong_testimonials_elementor_enqueue_editor_scripts() {
60
61 wp_enqueue_script( 'strong-testimonials-elementor-editor', WPMTST_URL . 'admin/js/strong-testimonials-elementor-editor.js', null, WPMTST_VERSION, true );
62 wp_localize_script(
63 'strong-testimonials-elementor-editor',
64 'strongAjax',
65 array(
66 'ajax_url' => admin_url( 'admin-ajax.php' ),
67 )
68 );
69
70 wp_enqueue_script( 'st-selectize', WPMTST_URL . 'admin/js/selectize.js', null, WPMTST_VERSION, true );
71 wp_enqueue_style( 'st-selectize-css', WPMTST_URL . 'admin/css/selectize.default.css' );
72 }
73
74 /**
75 * Enqueue scripts in Elementor preview
76 */
77 public function strong_testimonials_elementor_enqueue_scripts() {
78 }
79
80 public function strong_testimonials_elementor_ajax_search() {
81
82 if ( isset( $_POST['action'] ) && 'strong_testimonials_elementor_ajax_search' === $_POST['action'] ) {
83 $galleries = wpmtst_unserialize_views( wpmtst_get_views() );
84
85 wp_send_json_success( $galleries );
86 } else {
87 wp_send_json_error();
88 }
89 die();
90 }
91 }
92
93 // Instantiate Plugin Class
94 Strong_Testimonials_Elementor_Widget_Activation::instance();
95