| @@ -58,29 +58,9 @@ | ||
| 58 | 58 | * |
| 59 | 59 | * @return array Control type. |
| 60 | 60 | */ |
| 61 | 61 | public static function get_animations() { |
| 62 | - $additional_animations = []; | |
| 63 | - | |
| 64 | - /** | |
| 65 | - * Entrance animations. | |
| 66 | - * | |
| 67 | - * Filters the animations list displayed in the animations control. | |
| 68 | - * | |
| 69 | - * This hook can be used to register animations in addition to the | |
| 70 | - * basic Elementor animations. | |
| 71 | - * | |
| 72 | - * @since 2.4.0 | |
| 73 | - * | |
| 74 | - * @param array $additional_animations Additional animations array. | |
| 75 | - */ | |
| 76 | - $additional_animations = apply_filters( 'elementor/controls/animations/additional_animations', $additional_animations ); | |
| 77 | - | |
| 78 | - return array_merge( static::get_default_animations(), $additional_animations ); | |
| 79 | - } | |
| 80 | - | |
| 81 | - public static function get_default_animations() { | |
| 82 | - return [ | |
| 62 | + $animations = [ | |
| 83 | 63 | 'Fading' => [ |
| 84 | 64 | 'fadeIn' => 'Fade In', |
| 85 | 65 | 'fadeInDown' => 'Fade In Down', |
| 86 | 66 | 'fadeInLeft' => 'Fade In Left', |
| @@ -132,8 +112,19 @@ | ||
| 132 | 112 | 'Specials' => [ |
| 133 | 113 | 'rollIn' => 'Roll In', |
| 134 | 114 | ], |
| 135 | 115 | ]; |
| 116 | + | |
| 117 | + /** | |
| 118 | + * Element appearance animations list. | |
| 119 | + * | |
| 120 | + * @since 2.4.0 | |
| 121 | + * | |
| 122 | + * @param array $additional_animations Additional Animations array. | |
| 123 | + */ | |
| 124 | + $additional_animations = apply_filters( 'elementor/controls/animations/additional_animations', [] ); | |
| 125 | + | |
| 126 | + return array_merge( $animations, $additional_animations ); | |
| 136 | 127 | } |
| 137 | 128 | |
| 138 | 129 | /** |
| 139 | 130 | * Render animations control template. |
| @@ -153,9 +144,9 @@ | ||
| 153 | 144 | <select id="<?php $this->print_control_uid(); ?>" data-setting="{{ data.name }}"> |
| 154 | 145 | <option value=""><?php echo esc_html__( 'Default', 'elementor' ); ?></option> |
| 155 | 146 | <option value="none"><?php echo esc_html__( 'None', 'elementor' ); ?></option> |
| 156 | 147 | <?php foreach ( static::get_animations() as $animations_group_name => $animations_group ) : ?> |
| 157 | - <optgroup label="<?php echo esc_attr( $animations_group_name ); ?>"> | |
| 148 | + <optgroup label="<?php $this->print_control_uid(); ?>"> | |
| 158 | 149 | <?php foreach ( $animations_group as $animation_name => $animation_title ) : ?> |
| 159 | 150 | <option value="<?php echo esc_attr( $animation_name ); ?>"><?php echo esc_html( $animation_title ); ?></option> |
| 160 | 151 | <?php endforeach; ?> |
| 161 | 152 | </optgroup> |
| @@ -174,8 +165,8 @@ | ||
| 174 | 165 | return []; |
| 175 | 166 | } |
| 176 | 167 | |
| 177 | 168 | return [ |
| 178 | - 'styles' => [ 'e-animation-' . $setting ], | |
| 169 | + 'styles' => [ 'e-animations' ], | |
| 179 | 170 | ]; |
| 180 | 171 | } |
| 181 | 172 | } |