PluginProbe
Elementor Website Builder – more than just a page builder / 3.5.2
Elementor Website Builder – more than just a page builder v3.5.2
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | includes/widgets/wordpress.php +33 -45 4.2.03.5.2 View file →
@@ -31,16 +31,24 @@
31 31 * @var \WP_Widget
32 32 */
33 33 private $_widget_instance = null;
34 34
35 - public function hide_on_search() {
36 - return true;
35 + /**
36 + * Whether the widget is a Pojo widget or not.
37 + *
38 + * @since 2.0.0
39 + * @access private
40 + *
41 + * @return bool
42 + */
43 + private function is_pojo_widget() {
44 + return $this->get_widget_instance() instanceof \Pojo_Widget_Base;
37 45 }
38 46
39 47 /**
40 48 * Get widget name.
41 49 *
42 - * Retrieve WordPress widget name.
50 + * Retrieve WordPress/Pojo widget name.
43 51 *
44 52 * @since 1.0.0
45 53 * @access public
46 54 *
@@ -52,9 +60,9 @@
52 60
53 61 /**
54 62 * Get widget title.
55 63 *
56 - * Retrieve WordPress widget title.
64 + * Retrieve WordPress/Pojo widget title.
57 65 *
58 66 * @since 1.0.0
59 67 * @access public
60 68 *
@@ -66,9 +74,9 @@
66 74
67 75 /**
68 76 * Get widget categories.
69 77 *
70 - * Retrieve the list of categories the WordPress widget belongs to.
78 + * Retrieve the list of categories the WordPress/Pojo widget belongs to.
71 79 *
72 80 * Used to determine where to display the widget in the editor.
73 81 *
74 82 * @since 1.0.0
@@ -73,25 +81,33 @@
73 81 *
74 82 * @since 1.0.0
75 83 * @access public
76 84 *
77 - * @return array Widget categories. Returns either a WordPress category.
85 + * @return array Widget categories. Returns either a WordPress category or Pojo category.
78 86 */
79 87 public function get_categories() {
80 - return [ 'wordpress' ];
88 + if ( $this->is_pojo_widget() ) {
89 + $category = 'pojo';
90 + } else {
91 + $category = 'wordpress';
92 + }
93 + return [ $category ];
81 94 }
82 95
83 96 /**
84 97 * Get widget icon.
85 98 *
86 - * Retrieve WordPress widget icon.
99 + * Retrieve WordPress/Pojo widget icon.
87 100 *
88 101 * @since 1.0.0
89 102 * @access public
90 103 *
91 - * @return string Widget icon. Returns either a WordPress icon.
104 + * @return string Widget icon. Returns either a WordPress icon or Pojo icon.
92 105 */
93 106 public function get_icon() {
107 + if ( $this->is_pojo_widget() ) {
108 + return 'eicon-pojome';
109 + }
94 110 return 'eicon-wordpress';
95 111 }
96 112
97 113 /**
@@ -107,36 +123,8 @@
107 123 public function get_keywords() {
108 124 return [ 'wordpress', 'widget' ];
109 125 }
110 126
111 - /**
112 - * Get style dependencies.
113 - *
114 - * Retrieve the list of style dependencies the widget requires.
115 - *
116 - * @since 3.26.0
117 - * @access public
118 - *
119 - * @return array Widget style dependencies.
120 - */
121 - public function get_style_depends(): array {
122 - return [ 'e-swiper' ];
123 - }
124 -
125 - /**
126 - * Get script dependencies.
127 - *
128 - * Retrieve the list of script dependencies the widget requires.
129 - *
130 - * @since 3.27.0
131 - * @access public
132 - *
133 - * @return array Widget script dependencies.
134 - */
135 - public function get_script_depends(): array {
136 - return [ 'swiper' ];
137 - }
138 -
139 127 public function get_help_url() {
140 128 return '';
141 129 }
142 130
@@ -154,9 +142,9 @@
154 142 return true;
155 143 }
156 144
157 145 /**
158 - * Retrieve WordPress widget form.
146 + * Retrieve WordPress/Pojo widget form.
159 147 *
160 148 * Returns the WordPress widget form, to be used in Elementor.
161 149 *
162 150 * @since 1.0.0
@@ -179,9 +167,9 @@
179 167 return ob_get_clean();
180 168 }
181 169
182 170 /**
183 - * Retrieve WordPress widget instance.
171 + * Retrieve WordPress/Pojo widget instance.
184 172 *
185 173 * Returns an instance of WordPress widget, to be used in Elementor.
186 174 *
187 175 * @since 1.0.0
@@ -204,9 +192,9 @@
204 192 return $this->_widget_instance;
205 193 }
206 194
207 195 /**
208 - * Retrieve WordPress widget parsed settings.
196 + * Retrieve WordPress/Pojo widget parsed settings.
209 197 *
210 198 * Returns the WordPress widget settings, to be used in Elementor.
211 199 *
212 200 * @access protected
@@ -227,9 +215,9 @@
227 215 return $settings;
228 216 }
229 217
230 218 /**
231 - * Register WordPress widget controls.
219 + * Register WordPress/Pojo widget controls.
232 220 *
233 221 * Adds different input fields to allow the user to change and customize the widget settings.
234 222 *
235 223 * @since 3.1.0
@@ -247,9 +235,9 @@
247 235 );
248 236 }
249 237
250 238 /**
251 - * Render WordPress widget output on the frontend.
239 + * Render WordPress/Pojo widget output on the frontend.
252 240 *
253 241 * Written in PHP and used to generate the final HTML.
254 242 *
255 243 * @since 1.0.0
@@ -288,9 +276,9 @@
288 276 }
289 277 }
290 278
291 279 /**
292 - * Render WordPress widget output in the editor.
280 + * Render WordPress/Pojo widget output in the editor.
293 281 *
294 282 * Written as a Backbone JavaScript template and used to generate the live preview.
295 283 *
296 284 * @since 2.9.0
@@ -298,9 +286,9 @@
298 286 */
299 287 protected function content_template() {}
300 288
301 289 /**
302 - * WordPress widget constructor.
290 + * WordPress/Pojo widget constructor.
303 291 *
304 292 * Used to run WordPress widget constructor.
305 293 *
306 294 * @since 1.0.0
@@ -315,9 +303,9 @@
315 303 parent::__construct( $data, $args );
316 304 }
317 305
318 306 /**
319 - * Render WordPress widget as plain content.
307 + * Render WordPress/Pojo widget as plain content.
320 308 *
321 309 * Override the default render behavior, don't render widget content.
322 310 *
323 311 * @since 1.0.0