PluginProbe
Elementor Website Builder – more than just a page builder / 3.35.0-dev2
Elementor Website Builder – more than just a page builder v3.35.0-dev2
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/managers/elements.php +6 -61 4.0.73.35.0-dev2 View file →
@@ -16,13 +16,8 @@
16 16 * @since 1.0.0
17 17 */
18 18 class Elements_Manager {
19 19
20 - const CATEGORY_ATOMIC_ELEMENTS = 'v4-elements';
21 - const CATEGORY_ATOMIC_FORM = 'atomic-form';
22 - const CATEGORY_FAVORITES = 'favorites';
23 - const CATEGORY_ANGIE_WIDGETS = 'angie-widgets';
24 -
25 20 /**
26 21 * Element types.
27 22 *
28 23 * Holds the list of all the element types.
@@ -288,12 +283,16 @@
288 283 * @access private
289 284 */
290 285 private function init_categories() {
291 286 $this->categories = [
292 - self::CATEGORY_ATOMIC_ELEMENTS => [
287 + 'v4-elements' => [
293 288 'title' => esc_html__( 'Atomic Elements', 'elementor' ),
294 289 'hideIfEmpty' => true,
295 290 ],
291 + 'atomic-form' => [
292 + 'title' => esc_html__( 'Atomic Form', 'elementor' ),
293 + 'hideIfEmpty' => true,
294 + ],
296 295 'layout' => [
297 296 'title' => esc_html__( 'Layout', 'elementor' ),
298 297 'hideIfEmpty' => true,
299 298 ],
@@ -334,34 +333,11 @@
334 333 ],
335 334 ],
336 335 ];
337 336
338 - if ( Plugin::$instance->experiments->is_feature_active( 'e_atomic_elements' ) ) {
339 - $atomic_form_category = [
340 - 'title' => esc_html__( 'Atomic Form', 'elementor' ),
341 - ];
342 -
343 - if ( Utils::has_pro() && Plugin::$instance->experiments->is_feature_active( 'e_pro_atomic_form' ) ) {
344 - $atomic_form_category['hideIfEmpty'] = true;
345 - } elseif ( ! Utils::has_pro() ) {
346 - $atomic_form_category['hideIfEmpty'] = false;
347 - $atomic_form_category['promotion'] = [
348 - 'url' => esc_url( 'https://go.elementor.com/go-pro-atomic-form-section/' ),
349 - ];
350 - } else {
351 - $atomic_form_category['hideIfEmpty'] = true;
352 - }
353 -
354 - $this->categories = array_merge(
355 - [ self::CATEGORY_ATOMIC_ELEMENTS => $this->categories[ self::CATEGORY_ATOMIC_ELEMENTS ] ],
356 - [ self::CATEGORY_ATOMIC_FORM => $atomic_form_category ],
357 - array_diff_key( $this->categories, [ self::CATEGORY_ATOMIC_ELEMENTS => true ] )
358 - );
359 - }
360 -
361 337 // Not using the `add_category` because it doesn't allow 3rd party to inject a category on top the others.
362 338 $this->categories = array_merge_recursive( [
363 - self::CATEGORY_FAVORITES => [
339 + 'favorites' => [
364 340 'title' => esc_html__( 'Favorites', 'elementor' ),
365 341 'icon' => 'eicon-heart',
366 342 'sort' => 'a-z',
367 343 'hideIfEmpty' => false,
@@ -382,10 +358,8 @@
382 358 * @param Elements_Manager $this Elements manager instance.
383 359 */
384 360 do_action( 'elementor/elements/categories_registered', $this );
385 361
386 - $this->promote_category_after( self::CATEGORY_ANGIE_WIDGETS, [ self::CATEGORY_ATOMIC_FORM, self::CATEGORY_ATOMIC_ELEMENTS ] );
387 -
388 362 $this->categories['wordpress'] = [
389 363 'title' => esc_html__( 'WordPress', 'elementor' ),
390 364 'icon' => 'eicon-wordpress',
391 365 'active' => false,
@@ -407,37 +381,8 @@
407 381 public function register_frontend_handlers() {
408 382 foreach ( $this->get_element_types() as $element ) {
409 383 $element->register_frontend_handlers();
410 384 }
411 - }
412 -
413 - private function promote_category_after( string $category_name, array $after_candidates ): void {
414 - if ( ! isset( $this->categories[ $category_name ] ) ) {
415 - return;
416 - }
417 -
418 - $after = null;
419 -
420 - foreach ( $after_candidates as $candidate ) {
421 - if ( isset( $this->categories[ $candidate ] ) ) {
422 - $after = $candidate;
423 - break;
424 - }
425 - }
426 -
427 - if ( ! $after ) {
428 - return;
429 - }
430 -
431 - $category = $this->categories[ $category_name ];
432 - unset( $this->categories[ $category_name ] );
433 -
434 - $position = array_search( $after, array_keys( $this->categories ), true ) + 1;
435 - $this->categories = array_merge(
436 - array_slice( $this->categories, 0, $position, true ),
437 - [ $category_name => $category ],
438 - array_slice( $this->categories, $position, null, true )
439 - );
440 385 }
441 386
442 387 /**
443 388 * Require files.