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