Lightning Advanced Unit - Version 3.2.0

Version Description

  • [ Add function ] Add full wide title widget parallax
Download this release

Release Info

Developer kurudrive
Plugin Icon wp plugin Lightning Advanced Unit
Version 3.2.0
Comparing to
See all releases

Code changes from version 3.1.2 to 3.2.0

inc/widgets/widget-full-wide-title.php CHANGED
@@ -10,13 +10,12 @@ add_action(
10
  );
11
 
12
  class LTG_Full_Wide_Title extends WP_Widget {
13
- function __construct()
14
- {
15
- $widget_id = 'ltg_full_wide_title';
16
- $widget_name = LIGHTNING_ADVANCED_SHORT_NAME. ' ' . __( 'Full Wide Title', LIGHTNING_ADVANCED_TEXTDOMAIN );
17
  $widget_description = array( 'description' => __( 'This widget is used for single column only.', LIGHTNING_ADVANCED_TEXTDOMAIN ) );
18
 
19
- parent::__construct (
20
  $widget_id,
21
  $widget_name,
22
  $widget_description
@@ -24,62 +23,89 @@ class LTG_Full_Wide_Title extends WP_Widget {
24
 
25
  }
26
 
27
- public static function default_options( $args=array() )
28
- {
29
  $defaults = array(
30
- 'media_image_id' => Null,
31
- 'title_bg_color' => '',
32
- 'title_font_color' => '',
33
- 'title' => Null,
34
- 'after_widget' => '',
35
- 'title_shadow_use' => false,
36
- 'title_shadow_color' => '#000',
 
 
 
37
  );
38
  return wp_parse_args( (array) $args, $defaults );
39
  }
40
 
41
- public function form ( $instance )
42
- {
43
- $instance = self::default_options( $instance );
 
 
 
 
 
 
 
 
 
 
44
 
45
- // タイトルの入力
46
- if ( isset ( $instance['title']) && $instance['title'] ) {
47
- $title = $instance['title'];
48
  } else {
49
- $title = '';
50
  }
51
 
52
- $id = $this->get_field_id('title');
53
- $name = $this->get_field_name('title');
54
 
55
  echo '<p>';
56
- echo __( 'Title:', LIGHTNING_ADVANCED_TEXTDOMAIN ).'<br>';
57
- printf (
58
- '<input type="text" id="%s" name="%s" value="%s" />',
59
- $id,
60
- $name,
61
- esc_attr( $title )
62
- );
63
  echo '</p>';
64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  $image = null;
66
  // ちゃんと数字が入っているかどうか?
67
- if ( is_numeric( $instance['media_image_id'] ) ) {
68
  // 数字だったら、その数字の画像を full サイズで取得
69
- $image = wp_get_attachment_image_src( $instance['media_image_id'], 'full' );
70
  }
71
  ?>
72
 
73
  <div class="vkExUnit_banner_area" style="padding: 0.7em 0;">
74
  <div class="_display" style="height:auto">
75
- <?php if ( $image ): ?>
76
- <img src="<?php echo esc_url( $image[0] ); ?>" style="width:100%;height:auto;" />
77
- <?php endif; ?>
78
  </div>
79
- <button class="button button-default button-block" style="display:block;width:100%;text-align: center; margin:4px 0;" onclick="javascript:vk_title_bg_image_addiditional(this);return false;"><?php _e('Set image', LIGHTNING_ADVANCED_TEXTDOMAIN ); ?></button>
80
- <button class="button button-default button-block" style="display:block;width:100%;text-align: center; margin:4px 0;" onclick="javascript:vk_title_bg_image_delete(this);return false;"><?php _e('Delete image', LIGHTNING_ADVANCED_TEXTDOMAIN ); ?></button>
81
  <div class="_form" style="line-height: 2em">
82
- <input type="hidden" class="__id" name="<?php echo $this->get_field_name( 'media_image_id' ); ?>" value="<?php echo esc_attr( $instance['media_image_id'] ); ?>" />
83
  </div>
84
  </div>
85
  <script type="text/javascript">
@@ -87,17 +113,17 @@ class LTG_Full_Wide_Title extends WP_Widget {
87
  if ( vk_title_bg_image_addiditional == undefined ){
88
  var vk_title_bg_image_addiditional = function(e){
89
  // プレビュー画像を表示するdiv
90
- var d=jQuery(e).parent().children("._display");
91
  // 画像IDを保存するinputタグ
92
- var w=jQuery(e).parent().children("._form").children('.__id')[0];
93
- var u=wp.media({library:{type:'image'},multiple:false}).on('select', function(e){
94
- u.state().get('selection').each(function(f){
95
  d.children().remove();
96
  d.append(jQuery('<img style="width:100%;mheight:auto">').attr('src',f.toJSON().url));
97
  jQuery(w).val(f.toJSON().id).change();
98
  });
99
- });
100
- u.open();
101
  };
102
  }
103
  // 背景画像削除処理
@@ -115,121 +141,148 @@ var vk_title_bg_image_delete = function(e){
115
  };
116
  }
117
  </script>
 
118
  <?php
119
- // title bg color
120
- echo '<p class="color_picker_wrap">'.
121
- '<label for="'.$this->get_field_id( 'title_bg_color' ).'">'.__( 'Title background color:', LIGHTNING_ADVANCED_TEXTDOMAIN ).'</label><br/>'.
122
- '<input type="text" id="'.$this->get_field_id( 'title_bg_color' ).'" class="color_picker" name="'.$this->get_field_name( 'title_bg_color' ).'" value="'. esc_attr( $instance[ 'title_bg_color' ] ).'" /></p>';
123
 
124
- // title font color
125
- echo '<p class="color_picker_wrap">'.
126
- '<label for="'.$this->get_field_id( 'title_font_color' ).'">'.__( 'Text color of the title:', LIGHTNING_ADVANCED_TEXTDOMAIN ).'</label><br/>'.
127
- '<input type="text" id="'.$this->get_field_id( 'title_font_color' ).'" class="color_picker" name="'.$this->get_field_name( 'title_font_color' ).'" value="'. esc_attr( $instance[ 'title_font_color' ] ).'" /></p>';
128
 
129
- // Shadow Use
130
- $checked = ( $instance['title_shadow_use'] ) ? ' checked': '' ;
131
- echo '<p><input type="checkbox" id="'.$this->get_field_id( 'title_shadow_use' ).'" name="'.$this->get_field_name( 'title_shadow_use' ).'" value="true"'.$checked.' >';
132
- echo '<label for="'.$this->get_field_id( 'title_shadow_use' ).'">'. __( 'Text shadow', LIGHTNING_ADVANCED_TEXTDOMAIN ).'</label><br/></p>';
 
 
 
133
 
134
- // Shadow color
135
- echo '<p class="color_picker_wrap">'.
136
- '<label for="'.$this->get_field_id( 'title_shadow_color' ).'">'.__( 'Text shadow color:', LIGHTNING_ADVANCED_TEXTDOMAIN ).'</label><br/>'.
137
- '<input type="text" id="'.$this->get_field_id( 'title_shadow_color' ).'" class="color_picker" name="'.$this->get_field_name( 'title_shadow_color' ).'" value="'. esc_attr( $instance[ 'title_shadow_color' ] ).'" /></p>';
 
 
 
138
 
139
- // サブタイトルの入力
140
- if ( isset( $instance['text'] ) && $instance['text'] ) {
141
- $text = $instance['text'];
142
- } else {
143
- $text = '';
144
- }
145
-
146
- $id = $this->get_field_id('text');
147
- $name = $this->get_field_name('text');
148
-
149
- echo '<p>';
150
- echo __( 'Sub title:', LIGHTNING_ADVANCED_TEXTDOMAIN ).'<br>';
151
- echo '<textarea id="'.$id.'" name="'.$name.'" style="width:100%;">'.esc_textarea( $text ).'</textarea>';
152
- echo '</p>';
153
  }
154
 
155
  /*-------------------------------------------*/
156
  /* update
157
  /*-------------------------------------------*/
158
 
159
- public function update( $new_instance, $old_instance )
160
- {
161
- $instance[ 'media_image_id' ] = $new_instance[ 'media_image_id' ];
162
- $instance[ 'title_bg_color' ] = sanitize_hex_color( $new_instance[ 'title_bg_color' ] );
163
- $instance[ 'title_font_color' ] = sanitize_hex_color( $new_instance[ 'title_font_color' ] );
164
- $instance[ 'title' ] = wp_kses_post( $new_instance[ 'title' ] );
165
- $instance[ 'text' ] = wp_kses_post( $new_instance[ 'text' ] );
166
- $instance[ 'title_shadow_use' ] = ( $new_instance[ 'title_shadow_use' ] ) ? true : false;
167
- $instance[ 'title_shadow_color' ] = sanitize_hex_color( $new_instance[ 'title_shadow_color' ] );
168
- return $new_instance;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
169
  }
170
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
 
172
- public static function widget_outer_style( $instance ){
173
- $widget_outer_style = 'border:1px solid #f00;';
174
-
175
- // 画像IDから画像のURLを取得
176
- if ( ! empty( $instance['media_image_id'] ) ) {
177
- $image = wp_get_attachment_image_src( $instance['media_image_id'], 'full' );
178
- $image = $image[0];
179
- } else {
180
- $image = null;
181
- }
182
-
183
- // 画像が登録されている場合
184
- if ( ! empty( $image ) && empty( $instance[ 'title_bg_color' ] ) ) {
185
- $widget_outer_style = 'background-image: url(\''.esc_url( $image ).'\');';
186
- // 背景色が登録されている場合(画像は登録されていない)
187
- } else if ( ! empty( $instance[ 'title_bg_color' ] ) && empty( $image ) ) {
188
- $widget_outer_style = 'background: '.sanitize_hex_color( $instance[ 'title_bg_color' ] ).';';
189
- // 画像も背景色もどちらも登録されている場合
190
- } else if ( ! empty( $image ) && ! empty( $instance[ 'title_bg_color' ] ) ) {
191
- $widget_outer_style = 'background-image: url(\''.esc_url( $image ).'\');';
192
- // その他(画像も背景色も登録されていない)
193
- } else if ( empty( $image) && empty( $instance[ 'title_bg_color' ] ) ) {
194
- $widget_outer_style = '';
195
- }
196
- return $widget_outer_style;
197
- }
198
-
199
- public static function widget_font_style( $instance ){
200
- $widget_font_style = '';
201
- // 色が登録されている場合
202
- if ( ! empty( $instance[ 'title_font_color' ] ) ) {
203
- $widget_font_style .= 'color:' .$instance[ 'title_font_color' ].';';
204
- } else {
205
- // その他(色が登録されていない)
206
- $widget_font_style .= '';
207
- }
208
-
209
- // シャドウ
210
- if ( isset( $instance[ 'title_shadow_use' ] ) && $instance[ 'title_shadow_use' ] ) {
211
- if ( ! empty( $instance[ 'title_shadow_color' ] ) ){
212
- $widget_font_style .= 'text-shadow:0 0 0.3em '.$instance[ 'title_shadow_color' ];
213
- } else {
214
- $widget_font_style .= 'text-shadow:0 0 0.3em #000';
215
- }
216
- }
217
-
218
- return $widget_font_style;
219
- }
220
-
221
- public function widget( $args, $instance )
222
- {
223
- $instance = self::default_options( $instance );
224
- echo $args ['before_widget'];
225
- echo '<div class="widget_ltg_adv_full_wide_title_outer" style="'.esc_attr( $this->widget_outer_style($instance) ).'">';
226
- echo '<h2 class="widget_ltg_adv_full_wide_title_title" style="'.esc_attr( $this->widget_font_style($instance) ).'">'.wp_kses_post( $instance['title'] ).'</h2>';
227
- // サブテキストがある場合
228
- if ( ! empty( $instance['text'] ) ){
229
- echo '<p style="'.$this->widget_font_style($instance).'" class="widget_ltg_adv_full_wide_title_caption">'.wp_kses_post( $instance['text'] ).'</p>';
230
  }
231
- echo '</div>';
232
- echo $args ['after_widget'];
233
  }
234
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
235
  }
10
  );
11
 
12
  class LTG_Full_Wide_Title extends WP_Widget {
13
+ function __construct() {
14
+ $widget_id = 'ltg_full_wide_title';
15
+ $widget_name = LIGHTNING_ADVANCED_SHORT_NAME . ' ' . __( 'Full Wide Title', LIGHTNING_ADVANCED_TEXTDOMAIN );
 
16
  $widget_description = array( 'description' => __( 'This widget is used for single column only.', LIGHTNING_ADVANCED_TEXTDOMAIN ) );
17
 
18
+ parent::__construct(
19
  $widget_id,
20
  $widget_name,
21
  $widget_description
23
 
24
  }
25
 
26
+ public static function default_options( $args = array() ) {
 
27
  $defaults = array(
28
+ 'media_image_id' => null,
29
+ 'title_bg_color' => '',
30
+ 'title_font_color' => '',
31
+ 'title' => '',
32
+ 'after_widget' => '',
33
+ 'title_shadow_use' => false,
34
+ 'title_shadow_color' => '#000',
35
+ 'margin_top' => '0',
36
+ 'margin_bottom' => '40px',
37
+ 'bg_parallax' => false,
38
  );
39
  return wp_parse_args( (array) $args, $defaults );
40
  }
41
 
42
+ /*-------------------------------------------*/
43
+ /* form
44
+ /*-------------------------------------------*/
45
+ public function form( $instance ) {
46
+ $options = self::default_options( $instance );
47
+ // ※ wp_parse_args()かけてるのでisset不要
48
+
49
+ echo '<p>';
50
+ echo __( 'Title:', LIGHTNING_ADVANCED_TEXTDOMAIN ) . '<br>';
51
+ $id = $this->get_field_id( 'title' );
52
+ $name = $this->get_field_name( 'title' );
53
+ echo '<input type="text" id="' . $id . '" name="' . $name . '" value="' . esc_attr( $options['title'] ) . '" />';
54
+ echo '</p>';
55
 
56
+ // サブタイトルの入力
57
+ if ( isset( $options['text'] ) && $options['text'] ) {
58
+ $text = $options['text'];
59
  } else {
60
+ $text = '';
61
  }
62
 
63
+ $id = $this->get_field_id( 'text' );
64
+ $name = $this->get_field_name( 'text' );
65
 
66
  echo '<p>';
67
+ echo __( 'Sub title:', LIGHTNING_ADVANCED_TEXTDOMAIN ) . '<br>';
68
+ echo '<textarea id="' . $id . '" name="' . $name . '" style="width:100%;">' . esc_textarea( $text ) . '</textarea>';
 
 
 
 
 
69
  echo '</p>';
70
 
71
+ // title font color
72
+ echo '<p class="color_picker_wrap">' .
73
+ '<label for="' . $this->get_field_id( 'title_font_color' ) . '">' . __( 'Text color of the title:', LIGHTNING_ADVANCED_TEXTDOMAIN ) . '</label><br/>' .
74
+ '<input type="text" id="' . $this->get_field_id( 'title_font_color' ) . '" class="color_picker" name="' . $this->get_field_name( 'title_font_color' ) . '" value="' . esc_attr( $options['title_font_color'] ) . '" /></p>';
75
+
76
+ // Shadow Use
77
+ $checked = ( $options['title_shadow_use'] ) ? ' checked' : '';
78
+ echo '<p><input type="checkbox" id="' . $this->get_field_id( 'title_shadow_use' ) . '" name="' . $this->get_field_name( 'title_shadow_use' ) . '" value="true"' . $checked . ' >';
79
+ echo '<label for="' . $this->get_field_id( 'title_shadow_use' ) . '">' . __( 'Text shadow', LIGHTNING_ADVANCED_TEXTDOMAIN ) . '</label><br/></p>';
80
+
81
+ // Shadow color
82
+ echo '<p class="color_picker_wrap">' .
83
+ '<label for="' . $this->get_field_id( 'title_shadow_color' ) . '">' . __( 'Text shadow color:', LIGHTNING_ADVANCED_TEXTDOMAIN ) . '</label><br/>' .
84
+ '<input type="text" id="' . $this->get_field_id( 'title_shadow_color' ) . '" class="color_picker" name="' . $this->get_field_name( 'title_shadow_color' ) . '" value="' . esc_attr( $options['title_shadow_color'] ) . '" /></p>';
85
+
86
+ // bg color
87
+ echo '<p class="color_picker_wrap">' .
88
+ '<label for="' . $this->get_field_id( 'title_bg_color' ) . '">' . __( 'Title background color:', LIGHTNING_ADVANCED_TEXTDOMAIN ) . '</label><br/>' .
89
+ '<input type="text" id="' . $this->get_field_id( 'title_bg_color' ) . '" class="color_picker" name="' . $this->get_field_name( 'title_bg_color' ) . '" value="' . esc_attr( $options['title_bg_color'] ) . '" /></p>';
90
+
91
  $image = null;
92
  // ちゃんと数字が入っているかどうか?
93
+ if ( is_numeric( $options['media_image_id'] ) ) {
94
  // 数字だったら、その数字の画像を full サイズで取得
95
+ $image = wp_get_attachment_image_src( $options['media_image_id'], 'full' );
96
  }
97
  ?>
98
 
99
  <div class="vkExUnit_banner_area" style="padding: 0.7em 0;">
100
  <div class="_display" style="height:auto">
101
+ <?php if ( $image ) : ?>
102
+ <img src="<?php echo esc_url( $image[0] ); ?>" style="width:100%;height:auto;" />
103
+ <?php endif; ?>
104
  </div>
105
+ <button class="button button-default button-block" style="display:block;width:100%;text-align: center; margin:4px 0;" onclick="javascript:vk_title_bg_image_addiditional(this);return false;"><?php _e( 'Set image', LIGHTNING_ADVANCED_TEXTDOMAIN ); ?></button>
106
+ <button class="button button-default button-block" style="display:block;width:100%;text-align: center; margin:4px 0;" onclick="javascript:vk_title_bg_image_delete(this);return false;"><?php _e( 'Delete image', LIGHTNING_ADVANCED_TEXTDOMAIN ); ?></button>
107
  <div class="_form" style="line-height: 2em">
108
+ <input type="hidden" class="__id" name="<?php echo $this->get_field_name( 'media_image_id' ); ?>" value="<?php echo esc_attr( $options['media_image_id'] ); ?>" />
109
  </div>
110
  </div>
111
  <script type="text/javascript">
113
  if ( vk_title_bg_image_addiditional == undefined ){
114
  var vk_title_bg_image_addiditional = function(e){
115
  // プレビュー画像を表示するdiv
116
+ var d=jQuery(e).parent().children("._display");
117
  // 画像IDを保存するinputタグ
118
+ var w=jQuery(e).parent().children("._form").children('.__id')[0];
119
+ var u=wp.media({library:{type:'image'},multiple:false}).on('select', function(e){
120
+ u.state().get('selection').each(function(f){
121
  d.children().remove();
122
  d.append(jQuery('<img style="width:100%;mheight:auto">').attr('src',f.toJSON().url));
123
  jQuery(w).val(f.toJSON().id).change();
124
  });
125
+ });
126
+ u.open();
127
  };
128
  }
129
  // 背景画像削除処理
141
  };
142
  }
143
  </script>
144
+
145
  <?php
 
 
 
 
146
 
147
+ // Shadow Use
148
+ $checked = ( $options['bg_parallax'] ) ? ' checked' : '';
149
+ echo '<p><input type="checkbox" id="' . $this->get_field_id( 'bg_parallax' ) . '" name="' . $this->get_field_name( 'bg_parallax' ) . '" value="true"' . $checked . ' >';
150
+ echo '<label for="' . $this->get_field_id( 'bg_parallax' ) . '">' . __( 'Set to parallax', LIGHTNING_ADVANCED_TEXTDOMAIN ) . '</label><br/></p>';
151
 
152
+ echo '<p>';
153
+ echo __( 'Margin Top', LIGHTNING_ADVANCED_TEXTDOMAIN ) . ' : ';
154
+ $id = $this->get_field_id( 'margin_top' );
155
+ $name = $this->get_field_name( 'margin_top' );
156
+ echo '<input type="text" id="' . $id . '" name="' . $name . '" value="' . esc_attr( $options['margin_top'] ) . '" /><br />';
157
+ echo __( 'Ex', LIGHTNING_ADVANCED_TEXTDOMAIN ) . ') 0;';
158
+ echo '</p>';
159
 
160
+ echo '<p>';
161
+ echo __( 'Margin Bottom', LIGHTNING_ADVANCED_TEXTDOMAIN ) . ' : ';
162
+ $id = $this->get_field_id( 'margin_bottom' );
163
+ $name = $this->get_field_name( 'margin_bottom' );
164
+ echo '<input type="text" id="' . $id . '" name="' . $name . '" value="' . esc_attr( $options['margin_bottom'] ) . '" /><br />';
165
+ echo __( 'Ex', LIGHTNING_ADVANCED_TEXTDOMAIN ) . ') 40px';
166
+ echo '</p>';
167
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
  }
169
 
170
  /*-------------------------------------------*/
171
  /* update
172
  /*-------------------------------------------*/
173
 
174
+ public function update( $new_instance, $old_instance ) {
175
+ $instance['media_image_id'] = $new_instance['media_image_id'];
176
+ $instance['title_bg_color'] = sanitize_hex_color( $new_instance['title_bg_color'] );
177
+ $instance['title_font_color'] = sanitize_hex_color( $new_instance['title_font_color'] );
178
+ $instance['title'] = wp_kses_post( $new_instance['title'] );
179
+ $instance['text'] = wp_kses_post( $new_instance['text'] );
180
+ $instance['title_shadow_use'] = ( $new_instance['title_shadow_use'] ) ? true : false;
181
+ $instance['title_shadow_color'] = sanitize_hex_color( $new_instance['title_shadow_color'] );
182
+ $instance['margin_top'] = esc_attr( $new_instance['margin_top'] );
183
+ $instance['margin_bottom'] = esc_attr( $new_instance['margin_bottom'] );
184
+ return $new_instance;
185
+ }
186
+
187
+ /*-------------------------------------------*/
188
+ /* functions
189
+ /*-------------------------------------------*/
190
+ public static function widget_outer_style( $instance ) {
191
+
192
+ // 画像IDから画像のURLを取得
193
+ if ( ! empty( $instance['media_image_id'] ) ) {
194
+ $image = wp_get_attachment_image_src( $instance['media_image_id'], 'full' );
195
+ $image = $image[0];
196
+ } else {
197
+ $image = null;
198
  }
199
 
200
+ // 画像が登録されている場合
201
+ if ( ! empty( $image ) && empty( $instance['title_bg_color'] ) ) {
202
+ $widget_outer_style = 'background-image: url(\'' . esc_url( $image ) . '\');';
203
+ // 背景色が登録されている場合(画像は登録されていない)
204
+ } elseif ( ! empty( $instance['title_bg_color'] ) && empty( $image ) ) {
205
+ $widget_outer_style = 'background: ' . sanitize_hex_color( $instance['title_bg_color'] ) . ';';
206
+ // 画像も背景色もどちらも登録されている場合
207
+ } elseif ( ! empty( $image ) && ! empty( $instance['title_bg_color'] ) ) {
208
+ $widget_outer_style = 'background-image: url(\'' . esc_url( $image ) . '\');';
209
+ // その他(画像も背景色も登録されていない)
210
+ } elseif ( empty( $image ) && empty( $instance['title_bg_color'] ) ) {
211
+ $widget_outer_style = '';
212
+ }
213
+
214
+ if ( isset( $instance['margin_top'] ) && $instance['margin_top'] != '' ) {
215
+ $widget_outer_style .= 'margin-top:' . esc_attr( $instance['margin_top'] ) . ';';
216
+ }
217
+ if ( isset( $instance['margin_bottom'] ) && $instance['margin_bottom'] != '' ) {
218
+ $widget_outer_style .= 'margin-bottom:' . esc_attr( $instance['margin_bottom'] ) . ';';
219
+ }
220
+
221
+ return $widget_outer_style;
222
+ }
223
+
224
+ public static function widget_font_style( $instance ) {
225
+ $widget_font_style = '';
226
+ // 色が登録されている場合
227
+ if ( ! empty( $instance['title_font_color'] ) ) {
228
+ $widget_font_style .= 'color:' . $instance['title_font_color'] . ';';
229
+ } else {
230
+ // その他(色が登録されていない)
231
+ $widget_font_style .= '';
232
+ }
233
 
234
+ // シャドウ
235
+ if ( isset( $instance['title_shadow_use'] ) && $instance['title_shadow_use'] ) {
236
+ if ( ! empty( $instance['title_shadow_color'] ) ) {
237
+ $widget_font_style .= 'text-shadow:0 0 0.3em ' . $instance['title_shadow_color'];
238
+ } else {
239
+ $widget_font_style .= 'text-shadow:0 0 0.3em #000';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
  }
 
 
241
  }
242
 
243
+ return $widget_font_style;
244
+ }
245
+
246
+ /*-------------------------------------------*/
247
+ /* widget
248
+ /*-------------------------------------------*/
249
+ public function widget( $args, $instance ) {
250
+ $instance = self::default_options( $instance );
251
+
252
+ // テーマ側から .widget に対してmargin-bottomが付けられてしまっているので、
253
+ // ウィジェット個別で上下余白指定がある場合は .widgetの余白を打ち消す必要がある
254
+ $widget_outer_style = '';
255
+ if ( isset( $instance['margin_top'] ) && $instance['margin_top'] != '' ) {
256
+ $widget_outer_style .= 'margin-top:0;';
257
+ }
258
+ if ( isset( $instance['margin_bottom'] ) && $instance['margin_bottom'] != '' ) {
259
+ $widget_outer_style .= 'margin-bottom:0px;background-repeat:no-repeat;';
260
+ }
261
+
262
+ if ( $widget_outer_style ) {
263
+ $dynamic_css = '#' . $args['widget_id'] . '.widget {' . $widget_outer_style . '}';
264
+ // $dynamic_css = trim( $dynamic_css );
265
+ // // convert tab and br to space
266
+ // $dynamic_css = preg_replace( '/[\n\r\t]/', '', $dynamic_css );
267
+ // // Change multiple spaces to single space
268
+ // $dynamic_css = preg_replace( '/\s(?=\s)/', '', $dynamic_css );
269
+ echo '<style type="text/css">' . $dynamic_css . '</style>';
270
+ // wp_add_inline_style( 'lightning-design-style', $dynamic_css );
271
+ }
272
+ $add_class = '';
273
+ if ( $instance['bg_parallax'] && $instance['media_image_id'] ) {
274
+ $add_class = ' vk-prlx';
275
+ }
276
+
277
+ echo $args ['before_widget'];
278
+ echo '<div class="widget_ltg_adv_full_wide_title_outer' . $add_class . '" style="' . esc_attr( $this->widget_outer_style( $instance ) ) . '">';
279
+ echo '<h2 class="widget_ltg_adv_full_wide_title_title" style="' . esc_attr( $this->widget_font_style( $instance ) ) . '">' . wp_kses_post( $instance['title'] ) . '</h2>';
280
+ // サブテキストがある場合
281
+ if ( ! empty( $instance['text'] ) ) {
282
+ echo '<p style="' . $this->widget_font_style( $instance ) . '" class="widget_ltg_adv_full_wide_title_caption">' . wp_kses_post( $instance['text'] ) . '</p>';
283
+ }
284
+ echo '</div>';
285
+ echo $args ['after_widget'];
286
+ }
287
+
288
  }
languages/lightning-adv-unit-ja.mo CHANGED
Binary file
languages/lightning-adv-unit-ja.po CHANGED
@@ -1,7 +1,7 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: \n"
4
- "POT-Creation-Date: 2018-01-31 12:15+0900\n"
5
  "PO-Revision-Date: \n"
6
  "Last-Translator: Kurudrive <kurudrive@gmail.com>\n"
7
  "Language-Team: Vektor translate Team <info@vektor-inc.co.jp>\n"
@@ -15,35 +15,35 @@ msgstr ""
15
  "X-Poedit-KeywordsList: __;_x;_e;_ex\n"
16
  "X-Poedit-SearchPath-0: ..\n"
17
 
18
- #: ../inc/menu-btn-position.php:14
19
  msgid "Menu button position ( Mobile mode )"
20
  msgstr "メニューボタンの位置(モバイルモード)"
21
 
22
- #: ../inc/menu-btn-position.php:19 ../inc/sidebar-position.php:20
23
  msgid "Left"
24
  msgstr "左"
25
 
26
- #: ../inc/menu-btn-position.php:20 ../inc/sidebar-position.php:19
27
  msgid "Right"
28
  msgstr "右"
29
 
30
- #: ../inc/navi-common.php:77
31
  msgid "VK Mobile Nav(Recommend)"
32
  msgstr "VK Mobile Nav(推奨)"
33
 
34
- #: ../inc/navi-common.php:78
35
  msgid "Vertical Show Hide (Lightning default)"
36
  msgstr "縦展開(Ligthning標準)"
37
 
38
- #: ../inc/navi-common.php:79
39
  msgid "Side Slide(Not recommend)"
40
  msgstr "Side Slide(非推奨)"
41
 
42
- #: ../inc/navi-common.php:84
43
  msgid "Menu Type ( Mobile mode )"
44
  msgstr "メニュータイプ(モバイル端末時)"
45
 
46
- #: ../inc/navi-common.php:88
47
  msgid "It will not take effect unless you save and reload the page."
48
  msgstr "保存してページを再読込しないと反映されません。"
49
 
@@ -69,7 +69,7 @@ msgstr "モバイルナビ上部"
69
  msgid "Mobile Nav Bottom"
70
  msgstr "モバイルナビ下部"
71
 
72
- #: ../inc/vk-mobile-nav/class-vk-mobile-nav.php:85
73
  #, php-format
74
  msgid ""
75
  "This is the widget area.<br>You can set widget item from [ <a href=\"%s"
@@ -80,13 +80,13 @@ msgstr ""
80
  "の “ウィジェット” パネルの “モバイルナビ上部” パネルから設定する事ができま"
81
  "す。"
82
 
83
- #: ../inc/vk-mobile-nav/class-vk-mobile-nav.php:86
84
- #: ../inc/vk-mobile-nav/class-vk-mobile-nav.php:106
85
- #: ../inc/vk-mobile-nav/class-vk-mobile-nav.php:116
86
  msgid "* This message is displayed only to users with editing authority."
87
  msgstr "* このメッセージは編集権限のあるユーザーにのみ表示されています。"
88
 
89
- #: ../inc/vk-mobile-nav/class-vk-mobile-nav.php:105
90
  #, php-format
91
  msgid ""
92
  "Menu is not set.<br>Please set menu from [ <a href=\"%s\">Appearance > "
@@ -97,7 +97,7 @@ msgstr ""
97
  "の “メニュー” パネル から “Mobile Navigation” の位置にメニューを設定してくだ"
98
  "さい。"
99
 
100
- #: ../inc/vk-mobile-nav/class-vk-mobile-nav.php:115
101
  #, php-format
102
  msgid ""
103
  "This is the widget area.<br>You can set widget item from [ <a href=\"%s"
@@ -108,46 +108,63 @@ msgstr ""
108
  "の “ウィジェット” パネルの “モバイルナビ下部” パネルから設定する事ができま"
109
  "す。"
110
 
111
- #: ../inc/widgets/widget-full-wide-title.php:16
112
  msgid "Full Wide Title"
113
  msgstr "全幅見出し"
114
 
115
- #: ../inc/widgets/widget-full-wide-title.php:17
116
  msgid "This widget is used for single column only."
117
  msgstr "このウィジェットは1カラム表示選択時に利用できます。"
118
 
119
- #: ../inc/widgets/widget-full-wide-title.php:56
120
  #: ../inc/widgets/widget-new-posts.php:245
121
  msgid "Title:"
122
  msgstr "タイトル :"
123
 
124
- #: ../inc/widgets/widget-full-wide-title.php:79
125
- msgid "Set image"
126
- msgstr "画像を選択"
127
-
128
- #: ../inc/widgets/widget-full-wide-title.php:80
129
- msgid "Delete image"
130
- msgstr "画像を削除"
131
-
132
- #: ../inc/widgets/widget-full-wide-title.php:121
133
- msgid "Title background color:"
134
- msgstr "背景色:"
135
 
136
- #: ../inc/widgets/widget-full-wide-title.php:126
137
  msgid "Text color of the title:"
138
  msgstr "タイトルの文字色:"
139
 
140
- #: ../inc/widgets/widget-full-wide-title.php:132
141
  msgid "Text shadow"
142
  msgstr "文字の影"
143
 
144
- #: ../inc/widgets/widget-full-wide-title.php:136
145
  msgid "Text shadow color:"
146
  msgstr "文字の影の色 :"
147
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  #: ../inc/widgets/widget-full-wide-title.php:150
149
- msgid "Sub title:"
150
- msgstr "サブタイトル :"
 
 
 
 
 
 
 
 
 
 
 
 
 
151
 
152
  #: ../inc/widgets/widget-new-posts.php:12
153
  msgid "Content Area Posts Widget"
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: \n"
4
+ "POT-Creation-Date: 2018-04-23 02:28+0900\n"
5
  "PO-Revision-Date: \n"
6
  "Last-Translator: Kurudrive <kurudrive@gmail.com>\n"
7
  "Language-Team: Vektor translate Team <info@vektor-inc.co.jp>\n"
15
  "X-Poedit-KeywordsList: __;_x;_e;_ex\n"
16
  "X-Poedit-SearchPath-0: ..\n"
17
 
18
+ #: ../inc/menu-btn-position.php:17
19
  msgid "Menu button position ( Mobile mode )"
20
  msgstr "メニューボタンの位置(モバイルモード)"
21
 
22
+ #: ../inc/menu-btn-position.php:22 ../inc/sidebar-position.php:20
23
  msgid "Left"
24
  msgstr "左"
25
 
26
+ #: ../inc/menu-btn-position.php:23 ../inc/sidebar-position.php:19
27
  msgid "Right"
28
  msgstr "右"
29
 
30
+ #: ../inc/navi-common.php:92
31
  msgid "VK Mobile Nav(Recommend)"
32
  msgstr "VK Mobile Nav(推奨)"
33
 
34
+ #: ../inc/navi-common.php:93
35
  msgid "Vertical Show Hide (Lightning default)"
36
  msgstr "縦展開(Ligthning標準)"
37
 
38
+ #: ../inc/navi-common.php:94
39
  msgid "Side Slide(Not recommend)"
40
  msgstr "Side Slide(非推奨)"
41
 
42
+ #: ../inc/navi-common.php:99
43
  msgid "Menu Type ( Mobile mode )"
44
  msgstr "メニュータイプ(モバイル端末時)"
45
 
46
+ #: ../inc/navi-common.php:103
47
  msgid "It will not take effect unless you save and reload the page."
48
  msgstr "保存してページを再読込しないと反映されません。"
49
 
69
  msgid "Mobile Nav Bottom"
70
  msgstr "モバイルナビ下部"
71
 
72
+ #: ../inc/vk-mobile-nav/class-vk-mobile-nav.php:86
73
  #, php-format
74
  msgid ""
75
  "This is the widget area.<br>You can set widget item from [ <a href=\"%s"
80
  "の “ウィジェット” パネルの “モバイルナビ上部” パネルから設定する事ができま"
81
  "す。"
82
 
83
+ #: ../inc/vk-mobile-nav/class-vk-mobile-nav.php:87
84
+ #: ../inc/vk-mobile-nav/class-vk-mobile-nav.php:108
85
+ #: ../inc/vk-mobile-nav/class-vk-mobile-nav.php:119
86
  msgid "* This message is displayed only to users with editing authority."
87
  msgstr "* このメッセージは編集権限のあるユーザーにのみ表示されています。"
88
 
89
+ #: ../inc/vk-mobile-nav/class-vk-mobile-nav.php:107
90
  #, php-format
91
  msgid ""
92
  "Menu is not set.<br>Please set menu from [ <a href=\"%s\">Appearance > "
97
  "の “メニュー” パネル から “Mobile Navigation” の位置にメニューを設定してくだ"
98
  "さい。"
99
 
100
+ #: ../inc/vk-mobile-nav/class-vk-mobile-nav.php:118
101
  #, php-format
102
  msgid ""
103
  "This is the widget area.<br>You can set widget item from [ <a href=\"%s"
108
  "の “ウィジェット” パネルの “モバイルナビ下部” パネルから設定する事ができま"
109
  "す。"
110
 
111
+ #: ../inc/widgets/widget-full-wide-title.php:15
112
  msgid "Full Wide Title"
113
  msgstr "全幅見出し"
114
 
115
+ #: ../inc/widgets/widget-full-wide-title.php:16
116
  msgid "This widget is used for single column only."
117
  msgstr "このウィジェットは1カラム表示選択時に利用できます。"
118
 
119
+ #: ../inc/widgets/widget-full-wide-title.php:50
120
  #: ../inc/widgets/widget-new-posts.php:245
121
  msgid "Title:"
122
  msgstr "タイトル :"
123
 
124
+ #: ../inc/widgets/widget-full-wide-title.php:67
125
+ msgid "Sub title:"
126
+ msgstr "サブタイトル :"
 
 
 
 
 
 
 
 
127
 
128
+ #: ../inc/widgets/widget-full-wide-title.php:73
129
  msgid "Text color of the title:"
130
  msgstr "タイトルの文字色:"
131
 
132
+ #: ../inc/widgets/widget-full-wide-title.php:79
133
  msgid "Text shadow"
134
  msgstr "文字の影"
135
 
136
+ #: ../inc/widgets/widget-full-wide-title.php:83
137
  msgid "Text shadow color:"
138
  msgstr "文字の影の色 :"
139
 
140
+ #: ../inc/widgets/widget-full-wide-title.php:88
141
+ msgid "Title background color:"
142
+ msgstr "背景色:"
143
+
144
+ #: ../inc/widgets/widget-full-wide-title.php:105
145
+ msgid "Set image"
146
+ msgstr "画像を選択"
147
+
148
+ #: ../inc/widgets/widget-full-wide-title.php:106
149
+ msgid "Delete image"
150
+ msgstr "画像を削除"
151
+
152
  #: ../inc/widgets/widget-full-wide-title.php:150
153
+ msgid "Set to parallax"
154
+ msgstr "パララックスにする"
155
+
156
+ #: ../inc/widgets/widget-full-wide-title.php:153
157
+ msgid "Margin Top"
158
+ msgstr "余白 上"
159
+
160
+ #: ../inc/widgets/widget-full-wide-title.php:157
161
+ #: ../inc/widgets/widget-full-wide-title.php:165
162
+ msgid "Ex"
163
+ msgstr "例"
164
+
165
+ #: ../inc/widgets/widget-full-wide-title.php:161
166
+ msgid "Margin Bottom"
167
+ msgstr "余白 下"
168
 
169
  #: ../inc/widgets/widget-new-posts.php:12
170
  msgid "Content Area Posts Widget"
lightning_advanced_unit.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Lightning Advanced Unit
4
  * Plugin URI: http://lightning.vektor-inc.co.jp/
5
- * Version: 3.1.2
6
  * Author: Vektor,Inc.
7
  * Author URI: https://www.vektor-inc.co.jp
8
  * Description: This is a plug-ins that extend the functionality of the theme "Lightning".
2
  /**
3
  * Plugin Name: Lightning Advanced Unit
4
  * Plugin URI: http://lightning.vektor-inc.co.jp/
5
+ * Version: 3.2.0
6
  * Author: Vektor,Inc.
7
  * Author URI: https://www.vektor-inc.co.jp
8
  * Description: This is a plug-ins that extend the functionality of the theme "Lightning".
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:
4
  Tags: Lightning,
5
  Requires at least: 4.5
6
  Tested up to: 4.9.5
7
- Stable tag: 3.1.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -44,6 +44,9 @@ e.g.
44
 
45
  == Changelog ==
46
 
 
 
 
47
  = 3.0.1 =
48
  * [ Add function ] New Mobile Menu position compatible
49
 
4
  Tags: Lightning,
5
  Requires at least: 4.5
6
  Tested up to: 4.9.5
7
+ Stable tag: 3.2.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
44
 
45
  == Changelog ==
46
 
47
+ = 3.2.0 =
48
+ * [ Add function ] Add full wide title widget parallax
49
+
50
  = 3.0.1 =
51
  * [ Add function ] New Mobile Menu position compatible
52