| @@ -83,8 +83,28 @@ | ||
| 83 | 83 | |
| 84 | 84 | return self::$_animations; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | + /** | |
| 88 | + * Returns all valid animation slug values used by grid widgets. | |
| 89 | + * | |
| 90 | + * @return array<int, string> Animation slug list. | |
| 91 | + */ | |
| 92 | + public static function get_animation_slugs(): array | |
| 93 | + { | |
| 94 | + $slugs = ['none']; | |
| 95 | + | |
| 96 | + // Do not array_merge the two maps first: they share group keys (Slide, Skew, …), | |
| 97 | + // so the Pro map would replace the free slugs and drop values such as slide-top. | |
| 98 | + foreach ([self::$free_animations, self::$pro_animations] as $animations) { | |
| 99 | + foreach ($animations as $group) { | |
| 100 | + $slugs = array_merge($slugs, array_keys($group)); | |
| 101 | + } | |
| 102 | + } | |
| 103 | + | |
| 104 | + return array_values(array_unique($slugs)); | |
| 105 | + } | |
| 106 | + | |
| 87 | 107 | public function content_template(): void |
| 88 | 108 | { |
| 89 | 109 | $control_uid = $this->get_control_uid(); ?> |
| 90 | 110 | <div class="elementor-control-field"> |