| @@ -5,12 +5,11 @@ | ||
| 5 | 5 | use Elementor\Core\Breakpoints\Breakpoint; |
| 6 | 6 | use Elementor\Core\Files\Base; |
| 7 | 7 | use Elementor\Core\Responsive\Responsive; |
| 8 | 8 | use Elementor\Plugin; |
| 9 | -use Elementor\Utils; | |
| 10 | 9 | |
| 11 | 10 | if ( ! defined( 'ABSPATH' ) ) { |
| 12 | - exit; // Exit if accessed directly. | |
| 11 | + exit; // Exit if accessed directly | |
| 13 | 12 | } |
| 14 | 13 | |
| 15 | 14 | class Frontend extends Base { |
| 16 | 15 | |
| @@ -36,9 +35,9 @@ | ||
| 36 | 35 | $breakpoints = Plugin::$instance->breakpoints->get_active_breakpoints(); |
| 37 | 36 | |
| 38 | 37 | $breakpoints_keys = array_keys( $breakpoints ); |
| 39 | 38 | |
| 40 | - $file_content = Utils::file_get_contents( $this->template_file ); | |
| 39 | + $file_content = file_get_contents( $this->template_file ); | |
| 41 | 40 | |
| 42 | 41 | // The regex pattern parses placeholders located in the frontend _templates.scss file. |
| 43 | 42 | $file_content = preg_replace_callback( '/ELEMENTOR_SCREEN_([A-Z_]+)(?:_(MIN|MAX|NEXT))/', function ( $placeholder_data ) use ( $breakpoints_keys, $breakpoints ) { |
| 44 | 43 | // Handle BC for legacy template files and Elementor Pro builds. |
| @@ -58,9 +57,9 @@ | ||
| 58 | 57 | } |
| 59 | 58 | } elseif ( false === $breakpoint_index ) { |
| 60 | 59 | // If the breakpoint in the placeholder is not active - use a -1 value for the media query, to make |
| 61 | 60 | // sure the setting is printed (to avoid a PHP error) but doesn't apply. |
| 62 | - return -1; | |
| 61 | + $value = -1; | |
| 63 | 62 | } elseif ( 'WIDESCREEN' === $placeholder_data[1] ) { |
| 64 | 63 | $value = $breakpoints['widescreen']->get_value(); |
| 65 | 64 | } else { |
| 66 | 65 | $breakpoint_index = array_search( strtolower( $placeholder_data[1] ), $breakpoints_keys, true ); |
| @@ -175,8 +174,11 @@ | ||
| 175 | 174 | * Converts responsive placeholders in Elementor CSS template files from the legacy format into the new format. |
| 176 | 175 | * Used for backwards compatibility for old Pro versions that were built with an Elementor Core version <3.2.0. |
| 177 | 176 | * |
| 178 | 177 | * @since 3.2.3 |
| 178 | + * | |
| 179 | + * @param $placeholder_data | |
| 180 | + * @return mixed | |
| 179 | 181 | */ |
| 180 | 182 | private function maybe_convert_placeholder_data( $placeholder_data ) { |
| 181 | 183 | switch ( $placeholder_data[1] ) { |
| 182 | 184 | case 'SM': |