| @@ -50,8 +50,20 @@ | ||
| 50 | 50 | |
| 51 | 51 | add_filter( 'elementor/tracker/send_tracking_data_params', [ $this, 'add_tracking_data' ] ); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | + public static function get_experimental_data() { | |
| 55 | + return [ | |
| 56 | + 'name' => 'favorite-widgets', | |
| 57 | + 'title' => esc_html__( 'Favorite Widgets', 'elementor' ), | |
| 58 | + 'description' => esc_html__( 'Mark widgets as favorites by right clicking them. Favorite widgets will always appear at the top of the editor panel for easy access.', 'elementor' ), | |
| 59 | + 'release_status' => Manager::RELEASE_STATUS_STABLE, | |
| 60 | + 'new_site' => [ | |
| 61 | + 'default_active' => true, | |
| 62 | + ], | |
| 63 | + ]; | |
| 64 | + } | |
| 65 | + | |
| 54 | 66 | /** |
| 55 | 67 | * Add usage data related to favorites. |
| 56 | 68 | * |
| 57 | 69 | * @param $params |
| @@ -93,11 +105,11 @@ | ||
| 93 | 105 | |
| 94 | 106 | /** |
| 95 | 107 | * Merge new user favorites to a type. |
| 96 | 108 | * |
| 97 | - * @param string $type | |
| 98 | - * @param array|string $favorites | |
| 99 | - * @param bool $store | |
| 109 | + * @param string $type | |
| 110 | + * @param array|string $favorites | |
| 111 | + * @param bool $store | |
| 100 | 112 | * |
| 101 | 113 | * @return array|bool |
| 102 | 114 | */ |
| 103 | 115 | public function merge( $type, $favorites, $store = true ) { |
| @@ -106,11 +118,11 @@ | ||
| 106 | 118 | |
| 107 | 119 | /** |
| 108 | 120 | * Delete existing favorites from a type. |
| 109 | 121 | * |
| 110 | - * @param string $type | |
| 111 | - * @param array|string $favorites | |
| 112 | - * @param bool $store | |
| 122 | + * @param string $type | |
| 123 | + * @param array|string $favorites | |
| 124 | + * @param bool $store | |
| 113 | 125 | * |
| 114 | 126 | * @return array|int |
| 115 | 127 | */ |
| 116 | 128 | public function delete( $type, $favorites, $store = true ) { |
| @@ -166,12 +178,12 @@ | ||
| 166 | 178 | |
| 167 | 179 | /** |
| 168 | 180 | * Register a new type class. |
| 169 | 181 | * |
| 170 | - * @param string $class_name | |
| 182 | + * @param string $class | |
| 171 | 183 | */ |
| 172 | - public function register( $class_name ) { | |
| 173 | - $type_instance = new $class_name(); | |
| 184 | + public function register( $class ) { | |
| 185 | + $type_instance = new $class(); | |
| 174 | 186 | |
| 175 | 187 | $this->types[ $type_instance->get_name() ] = $type_instance; |
| 176 | 188 | } |
| 177 | 189 | |
| @@ -237,11 +249,12 @@ | ||
| 237 | 249 | /** |
| 238 | 250 | * Throw action doesn't exist exception. |
| 239 | 251 | * |
| 240 | 252 | * @param string $action |
| 241 | - * | |
| 242 | - * @throws \InvalidArgumentException If favorite action fails or validation errors occur. | |
| 243 | 253 | */ |
| 244 | 254 | public function action_doesnt_exists( $action ) { |
| 245 | - throw new \InvalidArgumentException( sprintf( "Action '%s' to apply on favorites doesn't exists", esc_html( $action ) ) ); | |
| 255 | + throw new \InvalidArgumentException( sprintf( | |
| 256 | + "Action '%s' to apply on favorites doesn't exists", | |
| 257 | + $action | |
| 258 | + ) ); | |
| 246 | 259 | } |
| 247 | 260 | } |