| @@ -7,12 +7,13 @@ | ||
| 7 | 7 | $this->layout = 'horizontal'; |
| 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_horizontal_gutter', 10 ); | |
| 13 | - $image_height = isset( $this->atts['image_height'] ) ? $this->atts['image_height'] : get_option( 'mgl_horizontal_image_height', 500 ); | |
| 14 | - $hide_scrollbar = isset( $this->atts['hide_scrollbar'] ) ? $this->atts['hide_scrollbar'] : get_option( 'mgl_horizontal_hide_scrollbar', false ); | |
| 13 | + $gutter = isset( $this->atts['gutter'] ) ? $this->atts['gutter'] : ( $options['horizontal_gutter'] ?? 10 ); | |
| 14 | + $image_height = isset( $this->atts['image_height'] ) ? $this->atts['image_height'] : ( $options['horizontal_image_height'] ?? 500 ); | |
| 15 | + $hide_scrollbar = isset( $this->atts['hide_scrollbar'] ) ? $this->atts['hide_scrollbar'] : ( $options['horizontal_hide_scrollbar'] ?? false ); | |
| 15 | 16 | $isPreview = $this->isPreview; |
| 16 | 17 | ob_start(); |
| 17 | 18 | include dirname( __FILE__ ) . '/horizontal.css.php'; |
| 18 | 19 | $html = ob_get_clean(); |
| @@ -20,19 +21,23 @@ | ||
| 20 | 21 | } |
| 21 | 22 | |
| 22 | 23 | function build( $idsStr ) { |
| 23 | 24 | |
| 25 | + $options = get_option( Meow_MGL_Core::get_plugin_option_name(), null ); | |
| 26 | + | |
| 24 | 27 | // Generate gallery |
| 25 | 28 | $classes = $this->build_classes(); |
| 26 | 29 | $styles = $this->build_styles(); |
| 27 | 30 | $out = "<div id='{$this->class_id}' class='{$classes}' style='{$styles}'>"; |
| 28 | - $gutter = isset( $this->atts['mgl_horizontal_gutter'] ) ? | |
| 29 | - $this->atts['mgl_horizontal_gutter'] : get_option( 'mgl_horizontal_gutter', 5 ); | |
| 30 | - $hide_scrollbar = isset( $this->atts['hide_scrollbar'] ) ? $this->atts['hide_scrollbar'] : | |
| 31 | - get_option( 'mgl_horizontal_hide_scrollbar', false ); | |
| 31 | + $gutter = isset( $this->atts['mgl_horizontal_gutter'] ) | |
| 32 | + ? $this->atts['mgl_horizontal_gutter'] | |
| 33 | + : ( $options['horizontal_gutter'] ?? 5 ); | |
| 34 | + $hide_scrollbar = isset( $this->atts['hide_scrollbar'] ) | |
| 35 | + ? $this->atts['hide_scrollbar'] | |
| 36 | + : ( $options['horizontal_hide_scrollbar'] ?? false ); | |
| 32 | 37 | $classes = $hide_scrollbar ? "$classes hide-scrollbar" : $classes; |
| 33 | 38 | $attributes = "data-mgl-gutter=\"${gutter}\""; |
| 34 | - | |
| 39 | + | |
| 35 | 40 | $out = "<div id='{$this->class_id}' class='{$classes}' style='{$styles}' {$attributes}>"; |
| 36 | 41 | $out .= '<div class="meow-horizontal-track">'; |
| 37 | 42 | $this->prepare_data( $idsStr ); |
| 38 | 43 | while ( count( $this->ids ) > 0 ) { |