| @@ -275,36 +275,8 @@ | ||
| 275 | 275 | return $style_text; |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | /** |
| 279 | - * Get device maximum value. | |
| 280 | - * | |
| 281 | - * Retrieve the maximum size of any given device. | |
| 282 | - * | |
| 283 | - * @since 1.2.0 | |
| 284 | - * @access private | |
| 285 | - * | |
| 286 | - * @throws \RangeException If max value for this device is out of range. | |
| 287 | - * | |
| 288 | - * @param string $device_name Device name. | |
| 289 | - * | |
| 290 | - * @return int | |
| 291 | - */ | |
| 292 | - private function get_device_max_value( $device_name ) { | |
| 293 | - $devices_names = array_keys( $this->devices ); | |
| 294 | - | |
| 295 | - $device_name_index = array_search( $device_name, $devices_names ); | |
| 296 | - | |
| 297 | - $next_index = $device_name_index + 1; | |
| 298 | - | |
| 299 | - if ( $next_index >= count( $devices_names ) ) { | |
| 300 | - throw new \RangeException( 'Max value for this device is out of range.' ); | |
| 301 | - } | |
| 302 | - | |
| 303 | - return $this->devices[ $devices_names[ $next_index ] ] - 1; | |
| 304 | - } | |
| 305 | - | |
| 306 | - /** | |
| 307 | 279 | * Query to hash. |
| 308 | 280 | * |
| 309 | 281 | * Turns the media query into a hashed string that represents the query |
| 310 | 282 | * endpoint in the rules list. |
| @@ -350,9 +322,9 @@ | ||
| 350 | 322 | $end_point = $query_parts[0]; |
| 351 | 323 | |
| 352 | 324 | $device_name = $query_parts[1]; |
| 353 | 325 | |
| 354 | - $query[ $end_point ] = 'max' === $end_point ? $this->get_device_max_value( $device_name ) : $this->devices[ $device_name ]; | |
| 326 | + $query[ $end_point ] = 'max' === $end_point ? $this->devices[ $device_name ] : Plugin::$instance->breakpoints->get_device_min_breakpoint( $device_name ); | |
| 355 | 327 | } |
| 356 | 328 | |
| 357 | 329 | return $query; |
| 358 | 330 | } |