| @@ -10,8 +10,10 @@ | ||
| 10 | 10 | function inline_css() { |
| 11 | 11 | $class_id = '#' . $this->class_id; |
| 12 | 12 | |
| 13 | 13 | $isPreview = $this->isPreview; |
| 14 | + | |
| 15 | + $options = get_option( Meow_MGL_Core::get_plugin_option_name(), null ); | |
| 14 | 16 | |
| 15 | 17 | $gutter = []; |
| 16 | 18 | if ( isset( $this->atts['gutter'] ) ) { |
| 17 | 19 | $gutter['desktop'] = $this->atts['gutter']; |
| @@ -18,24 +20,14 @@ | ||
| 18 | 20 | $gutter['tablet'] = $this->atts['gutter']; |
| 19 | 21 | $gutter['mobile'] = $this->atts['gutter']; |
| 20 | 22 | } |
| 21 | 23 | else { |
| 22 | - $gutter['desktop'] = get_option( 'mgl_tiles_gutter', 10 ); | |
| 23 | - $gutter['tablet'] = get_option( 'mgl_tiles_gutter_tablet', 10 ); | |
| 24 | - $gutter['mobile'] = get_option( 'mgl_tiles_gutter_mobile', 10 ); | |
| 24 | + $gutter['desktop'] = $options['tiles_gutter'] ?? 10; | |
| 25 | + $gutter['tablet'] = $options['tiles_gutter_tablet'] ?? 10; | |
| 26 | + $gutter['mobile'] = $options['tiles_gutter_mobile'] ?? 10; | |
| 25 | 27 | } |
| 26 | 28 | |
| 27 | - $density = []; | |
| 28 | - if ( isset( $this->atts['density'] ) ) { | |
| 29 | - $density['desktop'] = $this->atts['density']; | |
| 30 | - $density['tablet'] = $this->atts['density']; | |
| 31 | - $density['mobile'] = $this->atts['density']; | |
| 32 | - } | |
| 33 | - else { | |
| 34 | - $density['desktop'] = get_option( 'mgl_tiles_density', 'high' ); | |
| 35 | - $density['tablet'] = get_option( 'mgl_tiles_density_tablet', 'medium' ); | |
| 36 | - $density['mobile'] = get_option( 'mgl_tiles_density_mobile', 'low' ); | |
| 37 | - } | |
| 29 | + $density = Meow_MGL_Core::get_tiles_density( $this->atts ); | |
| 38 | 30 | |
| 39 | 31 | ob_start(); |
| 40 | 32 | include dirname( __FILE__ ) . '/tiles.css.php'; |
| 41 | 33 | $html = ob_get_clean(); |