PluginProbe
Elementor Website Builder – more than just a page builder / 3.0.2
Elementor Website Builder – more than just a page builder v3.0.2
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 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | core/responsive/responsive.php +29 -29 4.0.73.0.2 View file →
@@ -1,10 +1,8 @@
1 1 <?php
2 2 namespace Elementor\Core\Responsive;
3 3
4 -use Elementor\Core\Breakpoints\Manager as Breakpoints_Manager;
5 -use Elementor\Modules\DevTools\Deprecation;
6 -use Elementor\Plugin;
4 +use Elementor\Core\Responsive\Files\Frontend;
7 5
8 6 if ( ! defined( 'ABSPATH' ) ) {
9 7 exit; // Exit if accessed directly.
10 8 }
@@ -15,18 +13,15 @@
15 13 * Elementor responsive handler class is responsible for setting up Elementor
16 14 * responsive breakpoints.
17 15 *
18 16 * @since 1.0.0
19 - * @deprecated 3.2.0
20 17 */
21 18 class Responsive {
22 19
23 20 /**
24 21 * The Elementor breakpoint prefix.
25 - *
26 - * @deprecated 3.2.0
27 22 */
28 - const BREAKPOINT_OPTION_PREFIX = 'viewport_';
23 + const BREAKPOINT_OPTION_PREFIX = 'elementor_viewport_';
29 24
30 25 /**
31 26 * Default breakpoints.
32 27 *
@@ -32,9 +27,8 @@
32 27 *
33 28 * Holds the default responsive breakpoints.
34 29 *
35 30 * @since 1.0.0
36 - * @deprecated 3.2.0
37 31 * @access private
38 32 * @static
39 33 *
40 34 * @var array Default breakpoints.
@@ -53,9 +47,8 @@
53 47 *
54 48 * Holds the editable breakpoint keys.
55 49 *
56 50 * @since 1.0.0
57 - * @deprecated 3.2.0
58 51 * @access private
59 52 * @static
60 53 *
61 54 * @var array Editable breakpoint keys.
@@ -70,9 +63,8 @@
70 63 *
71 64 * Retrieve the default responsive breakpoints.
72 65 *
73 66 * @since 1.0.0
74 - * @deprecated 3.2.0 Use `Elementor\Core\Breakpoints\Manager::get_default_config()` instead.
75 67 * @access public
76 68 * @static
77 69 *
78 70 * @return array Default breakpoints.
@@ -77,10 +69,8 @@
77 69 *
78 70 * @return array Default breakpoints.
79 71 */
80 72 public static function get_default_breakpoints() {
81 - Plugin::$instance->modules_manager->get_modules( 'dev-tools' )->deprecation->deprecated_function( __METHOD__, '3.2.0', 'Elementor\Core\Breakpoints\Manager::get_default_config()' );
82 -
83 73 return self::$default_breakpoints;
84 74 }
85 75
86 76 /**
@@ -88,9 +78,8 @@
88 78 *
89 79 * Retrieve the editable breakpoints.
90 80 *
91 81 * @since 1.0.0
92 - * @deprecated 3.2.0
93 82 * @access public
94 83 * @static
95 84 *
96 85 * @return array Editable breakpoints.
@@ -95,10 +84,8 @@
95 84 *
96 85 * @return array Editable breakpoints.
97 86 */
98 87 public static function get_editable_breakpoints() {
99 - Plugin::$instance->modules_manager->get_modules( 'dev-tools' )->deprecation->deprecated_function( __METHOD__, '3.2.0' );
100 -
101 88 return array_intersect_key( self::get_breakpoints(), array_flip( self::$editable_breakpoints_keys ) );
102 89 }
103 90
104 91 /**
@@ -106,9 +93,8 @@
106 93 *
107 94 * Retrieve the responsive breakpoints.
108 95 *
109 96 * @since 1.0.0
110 - * @deprecated 3.2.0
111 97 * @access public
112 98 * @static
113 99 *
114 100 * @return array Responsive breakpoints.
@@ -115,12 +101,12 @@
115 101 */
116 102 public static function get_breakpoints() {
117 103 return array_reduce(
118 104 array_keys( self::$default_breakpoints ), function( $new_array, $breakpoint_key ) {
119 - if ( ! in_array( $breakpoint_key, self::$editable_breakpoints_keys, true ) ) {
105 + if ( ! in_array( $breakpoint_key, self::$editable_breakpoints_keys ) ) {
120 106 $new_array[ $breakpoint_key ] = self::$default_breakpoints[ $breakpoint_key ];
121 107 } else {
122 - $saved_option = Plugin::$instance->kits_manager->get_current_settings( self::BREAKPOINT_OPTION_PREFIX . $breakpoint_key );
108 + $saved_option = get_option( self::BREAKPOINT_OPTION_PREFIX . $breakpoint_key );
123 109
124 110 $new_array[ $breakpoint_key ] = $saved_option ? (int) $saved_option : self::$default_breakpoints[ $breakpoint_key ];
125 111 }
126 112
@@ -130,38 +116,52 @@
130 116 }
131 117
132 118 /**
133 119 * @since 2.1.0
134 - * @deprecated 3.2.0 Use `Plugin::$instance->breakpoints->has_custom_breakpoints()` instead.
135 120 * @access public
136 121 * @static
137 122 */
138 123 public static function has_custom_breakpoints() {
139 - Plugin::$instance->modules_manager->get_modules( 'dev-tools' )->deprecation->deprecated_function( __METHOD__, '3.2.0', 'Plugin::$instance->breakpoints->has_custom_breakpoints()' );
140 -
141 - return (bool) array_diff( self::$default_breakpoints, self::get_breakpoints() );
124 + return ! ! array_diff( self::$default_breakpoints, self::get_breakpoints() );
142 125 }
143 126
144 127 /**
145 128 * @since 2.1.0
146 - * @deprecated 3.2.0 Use `Elementor\Core\Breakpoints\Manager::get_stylesheet_templates_path()` instead.
147 129 * @access public
148 130 * @static
149 131 */
150 132 public static function get_stylesheet_templates_path() {
151 - Plugin::$instance->modules_manager->get_modules( 'dev-tools' )->deprecation->deprecated_function( __METHOD__, '3.2.0', 'Elementor\Core\Breakpoints\Manager::get_stylesheet_templates_path()' );
152 -
153 - return Breakpoints_Manager::get_stylesheet_templates_path();
133 + return ELEMENTOR_ASSETS_PATH . 'css/templates/';
154 134 }
155 135
156 136 /**
157 137 * @since 2.1.0
158 - * @deprecated 3.2.0 Use `Elementor\Core\Breakpoints\Manager::compile_stylesheet_templates()` instead.
159 138 * @access public
160 139 * @static
161 140 */
162 141 public static function compile_stylesheet_templates() {
163 - Plugin::$instance->modules_manager->get_modules( 'dev-tools' )->deprecation->deprecated_function( __METHOD__, '3.2.0', 'Elementor\Core\Breakpoints\Manager::compile_stylesheet_templates()' );
142 + foreach ( self::get_stylesheet_templates() as $file_name => $template_path ) {
143 + $file = new Frontend( $file_name, $template_path );
164 144
165 - Breakpoints_Manager::compile_stylesheet_templates();
145 + $file->update();
146 + }
147 + }
148 +
149 + /**
150 + * @since 2.1.0
151 + * @access private
152 + * @static
153 + */
154 + private static function get_stylesheet_templates() {
155 + $templates_paths = glob( self::get_stylesheet_templates_path() . '*.css' );
156 +
157 + $templates = [];
158 +
159 + foreach ( $templates_paths as $template_path ) {
160 + $file_name = 'custom-' . basename( $template_path );
161 +
162 + $templates[ $file_name ] = $template_path;
163 + }
164 +
165 + return apply_filters( 'elementor/core/responsive/get_stylesheet_templates', $templates );
166 166 }
167 167 }