| @@ -7,11 +7,12 @@ | ||
| 7 | 7 | $this->layout = 'square'; |
| 8 | 8 | } |
| 9 | 9 | |
| 10 | 10 | function inline_css() { |
| 11 | + $options = get_option( Meow_MGL_Core::get_plugin_option_name(), null ); | |
| 11 | 12 | $class_id = '#' . $this->class_id; |
| 12 | - $gutter = isset( $this->atts['gutter'] ) ? $this->atts['gutter'] : get_option( 'mgl_square_gutter', 10 ); | |
| 13 | - $columns = isset( $this->atts['columns'] ) ? $this->atts['columns'] : get_option( 'mgl_square_columns', 5 ); | |
| 13 | + $gutter = isset( $this->atts['gutter'] ) ? $this->atts['gutter'] : ( $options['square_gutter'] ?? 10 ); | |
| 14 | + $columns = isset( $this->atts['columns'] ) ? $this->atts['columns'] : ( $options['square_columns'] ?? 5 ); | |
| 14 | 15 | $isPreview = $this->isPreview; |
| 15 | 16 | ob_start(); |
| 16 | 17 | include dirname( __FILE__ ) . '/square.css.php'; |
| 17 | 18 | $html = ob_get_clean(); |
| @@ -19,9 +20,9 @@ | ||
| 19 | 20 | } |
| 20 | 21 | |
| 21 | 22 | function build_next_cell( $id, $data ) { |
| 22 | 23 | $html = parent::build_next_cell( $id, $data ); |
| 23 | - $columns = ( isset( $this->atts['columns'] ) ? $this->atts['columns'] : get_option( 'mgl_square_columns', 5 ) ) + 1; | |
| 24 | + $columns = ( isset( $this->atts['columns'] ) ? $this->atts['columns'] : Meow_MGL_Core::get_plugin_option( 'square_columns', 5 ) ) + 1; | |
| 24 | 25 | $html = str_replace( '100vw', 100 / $columns . 'vw', $html ); |
| 25 | 26 | return $html; |
| 26 | 27 | } |
| 27 | 28 | |