@@ -36,9 +36,6 @@ function __construct() {
3636 add_action ( 'rest_api_init ' , array ( $ this , 'register_settings ' ) );
3737
3838 if ( is_frontend () ) {
39- // Get the dynamic breakpoints after the theme has loaded.
40- add_action ( 'after_setup_theme ' , array ( $ this , 'get_dynamic_breakpoints ' ) );
41-
4239 // Add a filter for replacing shortcut media queries before the breakpoint adjustment.
4340 add_filter ( 'stackable_frontend_css ' , array ( $ this , 'replace_shortcut_media_queries ' ), 9 );
4441
@@ -139,18 +136,17 @@ public function sanitize_array_setting( $input ) {
139136 return ! is_array ( $ input ) ? array ( array () ) : $ input ;
140137 }
141138
142- // /**
143- // * True if there are any custom breakpoints assigned by the user.
144- // *
145- // * @return boolean
146- // */
147- // public function has_custom_breakpoints( $count = 2 ) {
148- // $breakpoints = $this->dynamic_breakpoints;
149- // if ( $breakpoints === false ) {
150- // $this->get_dynamic_breakpoints( $count );
151- // }
152- // return $this->has_dynamic_breakpoints;
153- // }
139+ /**
140+ * True if there are any custom breakpoints assigned by the user.
141+ *
142+ * @return boolean
143+ */
144+ public function has_custom_breakpoints () {
145+ if ( $ this ->dynamic_breakpoints === false ) {
146+ $ this ->get_dynamic_breakpoints ();
147+ }
148+ return $ this ->has_custom_breakpoints ;
149+ }
154150
155151 /**
156152 * Replace shortcut media queries in the given CSS.
@@ -172,7 +168,7 @@ public function replace_shortcut_media_queries( $css ) {
172168 * @return String adjusted CSS
173169 */
174170 public function adjust_breakpoints ( $ css ) {
175- if ( ! $ this ->has_custom_breakpoints ) {
171+ if ( ! $ this ->has_custom_breakpoints () ) {
176172 return $ css ;
177173 }
178174
@@ -230,7 +226,7 @@ public function adjust_breakpoints( $css ) {
230226 * @return void
231227 */
232228 public function enqueue_adjusted_responsive_css () {
233- if ( ! $ this ->has_custom_breakpoints ) {
229+ if ( ! $ this ->has_custom_breakpoints () ) {
234230 return ;
235231 }
236232
@@ -249,7 +245,7 @@ public function enqueue_adjusted_responsive_css() {
249245 * @return void
250246 */
251247 public function adjust_block_styles ( $ block_content , $ block ) {
252- if ( ! $ this ->has_custom_breakpoints ) {
248+ if ( ! $ this ->has_custom_breakpoints () ) {
253249 return $ block_content ;
254250 }
255251
0 commit comments