PluginProbe
Elementor Website Builder – more than just a page builder / 3.2.0
Elementor Website Builder – more than just a page builder v3.2.0
4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 All 454 releases
← All changes | core/responsive/files/frontend.php +15 -9 3.1.43.2.0 View file →
@@ -1,10 +1,12 @@
1 1 <?php
2 2
3 3 namespace Elementor\Core\Responsive\Files;
4 4
5 +use Elementor\Core\Breakpoints\Breakpoint;
5 6 use Elementor\Core\Files\Base;
6 7 use Elementor\Core\Responsive\Responsive;
8 +use Elementor\Plugin;
7 9
8 10 if ( ! defined( 'ABSPATH' ) ) {
9 11 exit; // Exit if accessed directly
10 12 }
@@ -29,9 +31,9 @@
29 31 * @since 2.1.0
30 32 * @access public
31 33 */
32 34 public function parse_content() {
33 - $breakpoints = Responsive::get_breakpoints();
35 + $breakpoints = Plugin::$instance->breakpoints->get_active_breakpoints();
34 36
35 37 $breakpoints_keys = array_keys( $breakpoints );
36 38
37 39 $file_content = file_get_contents( $this->template_file );
@@ -36,20 +38,24 @@
36 38
37 39 $file_content = file_get_contents( $this->template_file );
38 40
39 41 $file_content = preg_replace_callback( '/ELEMENTOR_SCREEN_([A-Z]+)_([A-Z]+)/', function ( $placeholder_data ) use ( $breakpoints_keys, $breakpoints ) {
40 - $breakpoint_index = array_search( strtolower( $placeholder_data[1] ), $breakpoints_keys );
42 + if ( 'DESKTOP' === $placeholder_data[1] ) {
43 + $value = Plugin::$instance->breakpoints->get_desktop_min_point();
44 + } else {
45 + $breakpoint_index = array_search( strtolower( $placeholder_data[1] ), $breakpoints_keys, true );
41 46
42 - $is_max_point = 'MAX' === $placeholder_data[2];
47 + $is_max_point = 'MAX' === $placeholder_data[2];
43 48
44 - if ( $is_max_point ) {
45 - $breakpoint_index++;
46 - }
49 + if ( ! $is_max_point ) {
50 + $breakpoint_index--;
51 + }
47 52
48 - $value = $breakpoints[ $breakpoints_keys[ $breakpoint_index ] ];
53 + $value = $breakpoints[ $breakpoints_keys[ $breakpoint_index ] ]->get_value();
49 54
50 - if ( $is_max_point ) {
51 - $value--;
55 + if ( ! $is_max_point ) {
56 + $value++;
57 + }
52 58 }
53 59
54 60 return $value . 'px';
55 61 }, $file_content );