| @@ -137,9 +137,9 @@ | ||
| 137 | 137 | * @param array $query Optional. Media query. Default is `null`. |
| 138 | 138 | * |
| 139 | 139 | * @return Stylesheet The current stylesheet class instance. |
| 140 | 140 | */ |
| 141 | - public function add_rules( $selector, $style_rules = null, ?array $query = null ) { | |
| 141 | + public function add_rules( $selector, $style_rules = null, array $query = null ) { | |
| 142 | 142 | $query_hash = 'all'; |
| 143 | 143 | |
| 144 | 144 | if ( $query ) { |
| 145 | 145 | $query_hash = $this->query_to_hash( $query ); |
| @@ -316,13 +316,13 @@ | ||
| 316 | 316 | |
| 317 | 317 | $hash = array_filter( explode( '-', $hash ) ); |
| 318 | 318 | |
| 319 | 319 | foreach ( $hash as $single_query ) { |
| 320 | - preg_match( '/(min|max)_(.*)/', $single_query, $query_parts ); | |
| 320 | + $query_parts = explode( '_', $single_query ); | |
| 321 | 321 | |
| 322 | - $end_point = $query_parts[1]; | |
| 322 | + $end_point = $query_parts[0]; | |
| 323 | 323 | |
| 324 | - $device_name = $query_parts[2]; | |
| 324 | + $device_name = $query_parts[1]; | |
| 325 | 325 | |
| 326 | 326 | $query[ $end_point ] = 'max' === $end_point ? $this->devices[ $device_name ] : Plugin::$instance->breakpoints->get_device_min_breakpoint( $device_name ); |
| 327 | 327 | } |
| 328 | 328 | |
| @@ -387,12 +387,12 @@ | ||
| 387 | 387 | |
| 388 | 388 | /** |
| 389 | 389 | * Get query hash style format. |
| 390 | 390 | * |
| 391 | - * Retrieve formatted media query rule with the endpoint width settings. | |
| 391 | + * Retrieve formated media query rule with the endpoint width settings. | |
| 392 | 392 | * |
| 393 | 393 | * The method returns the CSS `@media` rule and supported viewport width in |
| 394 | - * pixels. It can also handle multiple width endpoints. | |
| 394 | + * pixels. It can also handel multiple width endpoints. | |
| 395 | 395 | * |
| 396 | 396 | * @since 1.2.0 |
| 397 | 397 | * @access private |
| 398 | 398 | * |