Lightning Advanced Unit - Version 3.3.0

Version Description

Download this release

Release Info

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

Code changes from version 3.2.0 to 3.3.0

inc/widgets/widget-new-posts.php CHANGED
@@ -9,7 +9,7 @@ class WP_Widget_ltg_adv_post_list extends WP_Widget {
9
 
10
  function __construct() {
11
 
12
- $widget_name = LIGHTNING_ADVANCED_SHORT_NAME. ' ' . __( 'Content Area Posts Widget', LIGHTNING_ADVANCED_TEXTDOMAIN );
13
 
14
  parent::__construct(
15
  'ltg_adv_post_list',
@@ -21,11 +21,10 @@ class WP_Widget_ltg_adv_post_list extends WP_Widget {
21
  /*-------------------------------------------*/
22
  /* 一覧へのリンクhtmlを出力する関数
23
  /*-------------------------------------------*/
24
- static public function more_link_html( $instance )
25
- {
26
- if ( ! empty ( $instance['more_text'] ) && ! empty ( $instance['more_url'] )) {
27
- $more_link_html = '<div class="text-right" style="margin-top:1em;">';
28
- $more_link_html .= '<a href="'.esc_url( $instance['more_url'] ).'" class="btn btn-default btn-xs">'.wp_kses_post( $instance['more_text'] ).'</a>';
29
  $more_link_html .= '</div>';
30
  } else {
31
  $more_link_html = '';
@@ -36,44 +35,45 @@ class WP_Widget_ltg_adv_post_list extends WP_Widget {
36
  function widget( $args, $instance ) {
37
  global $is_contentsarea_posts_widget;
38
  $is_contentsarea_posts_widget = true;
39
- if ( ! isset( $instance['format'] ) ) { $instance['format'] = 0; }
 
40
 
41
  echo $args['before_widget'];
42
- echo '<div class="pt_'.$instance['format'].'">';
43
  if ( ! empty( $instance['label'] ) ) {
44
  echo $args['before_title'];
45
  echo $instance['label'];
46
  echo $args['after_title'];
47
- } else if ( ! isset( $instance['label'] ) ){
48
  echo $args['before_title'];
49
  echo __( 'Recent Posts', LIGHTNING_ADVANCED_TEXTDOMAIN );
50
  echo $args['after_title'];
51
  }
52
 
53
- $count = ( isset( $instance['count'] ) && $instance['count'] ) ? $instance['count'] : 10;
54
- $post_type = ( isset( $instance['post_type'] ) && $instance['post_type'] ) ? $instance['post_type'] : 'post';
55
 
56
  if ( $instance['format'] ) {
57
  $this->_taxonomy_init( $post_type );
58
  }
59
 
60
  $p_args = array(
61
- 'post_type' => $post_type,
62
  'posts_per_page' => $count,
63
- 'paged' => 1,
64
  );
65
 
66
  if ( isset( $instance['terms'] ) && $instance['terms'] ) {
67
- $taxonomies = get_taxonomies( array() );
68
  $p_args['tax_query'] = array(
69
  'relation' => 'OR',
70
  );
71
- $terms_array = explode( ',', $instance['terms'] );
72
  foreach ( $taxonomies as $taxonomy ) {
73
  $p_args['tax_query'][] = array(
74
  'taxonomy' => $taxonomy,
75
- 'field' => 'id',
76
- 'terms' => $terms_array,
77
  );
78
  }
79
  }
@@ -82,11 +82,21 @@ class WP_Widget_ltg_adv_post_list extends WP_Widget {
82
 
83
  if ( $post_loop->have_posts() ) :
84
  if ( ! $instance['format'] ) {
85
- while ( $post_loop->have_posts() ) : $post_loop->the_post();
86
- $this->display_pattern_0();
 
 
 
 
 
 
 
 
 
87
  endwhile;
88
- } else if ( $instance['format'] == 1 ) {
89
- while ( $post_loop->have_posts() ) : $post_loop->the_post();
 
90
  $this->display_pattern_1();
91
  endwhile;
92
  }
@@ -101,34 +111,6 @@ class WP_Widget_ltg_adv_post_list extends WP_Widget {
101
 
102
  } // widget($args, $instance)
103
 
104
- /*-------------------------------------------*/
105
- /* display_pattern_0 Lighjnting standard
106
- /*-------------------------------------------*/
107
- function display_pattern_0() { ?>
108
- <article class="media">
109
- <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
110
- <?php if ( has_post_thumbnail()) :?>
111
- <div class="media-left postList_thumbnail">
112
- <a href="<?php the_permalink(); ?>">
113
- <?php
114
- $attr = array('class' => "media-object");
115
- the_post_thumbnail('thumbnail',$attr); ?>
116
- </a>
117
- </div>
118
- <?php endif; ?>
119
- <div class="media-body">
120
- <?php get_template_part('module_loop_post_meta');?>
121
- <h1 class="media-heading entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
122
- <a href="<?php the_permalink(); ?>" class="media-body_excerpt"><?php the_excerpt(); ?></a>
123
- <!--
124
- <div><a href="<?php the_permalink(); ?>" class="btn btn-default btn-sm"><?php _e('Read more', 'lightning'); ?></a></div>
125
- -->
126
- </div>
127
- </div>
128
- </article><?php
129
- }
130
-
131
-
132
  /*-------------------------------------------*/
133
  /* display_pattern_1 Cointent Body
134
  /*-------------------------------------------*/
@@ -138,15 +120,15 @@ class WP_Widget_ltg_adv_post_list extends WP_Widget {
138
 
139
  <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
140
  <header>
141
- <?php get_template_part('module_loop_post_meta');?>
142
  <h1 class="entry-title"><?php the_title(); ?></h1>
143
  </header>
144
 
145
  <div class="entry-body">
146
 
147
  <?php
148
- $lightning_adv_more_btn_txt = '<span class="btn btn-default btn-block">'. __('Read more', LIGHTNING_ADVANCED_TEXTDOMAIN ). '</span>';
149
- $more_btn = apply_filters( 'lightning-adv-more-btn-txt' ,$lightning_adv_more_btn_txt);
150
  global $is_pagewidget;
151
  $is_pagewidget = true;
152
  the_content( $more_btn );
@@ -156,40 +138,44 @@ class WP_Widget_ltg_adv_post_list extends WP_Widget {
156
 
157
  <div class="entry-footer">
158
  <?php
159
- $args = array(
160
- 'before' => '<nav class="page-link"><dl><dt>Pages :</dt><dd>',
161
- 'after' => '</dd></dl></nav>',
162
- 'link_before' => '<span class="page-numbers">',
163
- 'link_after' => '</span>',
164
- 'echo' => 1 );
165
- wp_link_pages( $args ); ?>
 
 
166
 
167
  <?php
168
  /*-------------------------------------------*/
169
  /* Category and tax data
170
  /*-------------------------------------------*/
171
- $args = array(
172
- 'template' => __( '<dl><dt>%s</dt><dd>%l</dd></dl>','lightning' ),
173
- 'term_template' => '<a href="%1$s">%2$s</a>',
174
- );
175
- $taxonomies = get_the_taxonomies($post->ID,$args);
176
- $taxnomiesHtml = '';
177
- if ($taxonomies) {
178
- foreach ($taxonomies as $key => $value) {
179
  if ( $key != 'post_tag' ) {
180
- $taxnomiesHtml .= '<div class="entry-meta-dataList">'.$value.'</div>';
181
  }
182
- } // foreach
183
  } // if ($taxonomies)
184
  $taxnomiesHtml = apply_filters( 'lightning_taxnomiesHtml', $taxnomiesHtml );
185
  echo $taxnomiesHtml;
186
  ?>
187
 
188
- <?php $tags_list = get_the_tag_list();
189
- if ( $tags_list ): ?>
 
 
190
  <div class="entry-meta-dataList entry-tag">
191
  <dl>
192
- <dt><?php _e('Tags','lightning') ;?></dt>
193
  <dd class="tagCloud"><?php echo $tags_list; ?></dd>
194
  </dl>
195
  </div><!-- [ /.entry-tag ] -->
@@ -198,24 +184,29 @@ class WP_Widget_ltg_adv_post_list extends WP_Widget {
198
 
199
  </article>
200
 
201
- <?php }
 
202
 
203
  function _taxonomy_init( $post_type ) {
204
- if ( $post_type == 'post' ) { return; }
 
205
  $this->taxonomies = get_object_taxonomies( $post_type );
206
  }
207
 
208
  function taxonomy_list( $post_id = 0, $before = ' ', $sep = ',', $after = '' ) {
209
- if ( ! $post_id ) { $post_id = get_the_ID(); }
 
210
 
211
  $taxo_catelist = array();
212
 
213
  foreach ( $this->taxonomies as $taxonomy ) {
214
- $terms = get_the_term_list( $post_id, $taxonomy, $before, $sep , $after );
215
- if ( $terms ) { $taxo_catelist[] = $terms; }
 
216
  }
217
 
218
- if ( count( $taxo_catelist ) ) { return join( $taxo_catelist, $sep ); }
 
219
  return '';
220
  }
221
 
@@ -231,58 +222,71 @@ class WP_Widget_ltg_adv_post_list extends WP_Widget {
231
  );
232
 
233
  $instance = wp_parse_args( (array) $instance, $defaults );
234
- //タイトル ?>
235
- <br/>
 
236
  <?php echo _e( 'Display Format', LIGHTNING_ADVANCED_TEXTDOMAIN ); ?>:<br/>
237
  <ul>
238
- <li><label><input type="radio" name="<?php echo $this->get_field_name( 'format' ); ?>" value="0" <?php if ( $instance['format'] == 0 ) { echo 'checked'; } ?>/><?php echo __( 'Thumbnail', LIGHTNING_ADVANCED_TEXTDOMAIN ) .'/'. __( 'Date', LIGHTNING_ADVANCED_TEXTDOMAIN ) .'/'. __( 'Category', LIGHTNING_ADVANCED_TEXTDOMAIN ) .'/'. __( 'Title', LIGHTNING_ADVANCED_TEXTDOMAIN ).'/'. __( 'Excerpt', LIGHTNING_ADVANCED_TEXTDOMAIN ); ?></label>
 
 
 
 
 
239
  </li>
240
- <li><label><input type="radio" name="<?php echo $this->get_field_name( 'format' ); ?>" value="1" <?php if ( $instance['format'] == 1 ) { echo 'checked'; } ?>/><?php echo __( 'Thumbnail', LIGHTNING_ADVANCED_TEXTDOMAIN ) .'/'. __( 'Date', LIGHTNING_ADVANCED_TEXTDOMAIN ) .'/'. __( 'Category', LIGHTNING_ADVANCED_TEXTDOMAIN ) .'/'. __( 'Title', LIGHTNING_ADVANCED_TEXTDOMAIN ).'/'. __( 'Content', LIGHTNING_ADVANCED_TEXTDOMAIN ); ?></label>
 
 
 
 
 
241
  </li>
242
  </ul>
243
- <br/>
244
- <?php //タイトル ?>
245
- <label for="<?php echo $this->get_field_id( 'label' ); ?>"><?php _e( 'Title:' ); ?></label><br/>
246
  <input type="text" id="<?php echo $this->get_field_id( 'label' ); ?>-title" name="<?php echo $this->get_field_name( 'label' ); ?>" value="<?php echo $instance['label']; ?>" />
247
- <br/><br />
248
 
249
  <?php //表示件数 ?>
250
- <label for="<?php echo $this->get_field_id( 'count' ); ?>"><?php _e( 'Display count',LIGHTNING_ADVANCED_TEXTDOMAIN ); ?>:</label><br/>
251
  <input type="text" id="<?php echo $this->get_field_id( 'count' ); ?>" name="<?php echo $this->get_field_name( 'count' ); ?>" value="<?php echo $instance['count']; ?>" />
252
- <br /><br />
253
 
254
  <?php //投稿タイプ ?>
255
- <label for="<?php echo $this->get_field_id( 'post_type' ); ?>"><?php _e( 'Slug for the custom type you want to display', LIGHTNING_ADVANCED_TEXTDOMAIN ) ?>:</label><br />
256
- <input type="text" id="<?php echo $this->get_field_id( 'post_type' ); ?>" name="<?php echo $this->get_field_name( 'post_type' ); ?>" value="<?php echo esc_attr( $instance['post_type'] ) ?>" />
257
- <br/><br/>
258
 
259
  <?php // Terms ?>
260
- <label for="<?php echo $this->get_field_id( 'terms' ); ?>"><?php _e( 'taxonomy ID', LIGHTNING_ADVANCED_TEXTDOMAIN ) ?>:</label><br />
261
- <input type="text" id="<?php echo $this->get_field_id( 'terms' ); ?>" name="<?php echo $this->get_field_name( 'terms' ); ?>" value="<?php echo esc_attr( $instance['terms'] ) ?>" /><br />
262
- <?php _e( 'if you need filtering by term, add the term ID separate by ",".', LIGHTNING_ADVANCED_TEXTDOMAIN );
 
263
  echo '<br/>';
264
  _e( 'if empty this area, I will do not filtering.', LIGHTNING_ADVANCED_TEXTDOMAIN );
265
- echo '<br/><br/>';?>
 
266
 
267
  <?php // Read more ?>
268
- <label for="<?php echo $this->get_field_id( 'more_url' ); ?>"><?php _e( 'Destination URL:', LIGHTNING_ADVANCED_TEXTDOMAIN ); ?></label><br/>
269
  <input type="text" id="<?php echo $this->get_field_id( 'more_url' ); ?>" name="<?php echo $this->get_field_name( 'more_url' ); ?>" value="<?php echo esc_attr( $instance['more_url'] ); ?>" />
270
  <br /><br />
271
- <label for="<?php echo $this->get_field_id( 'more_text' ); ?>"><?php _e( 'Notation text:', LIGHTNING_ADVANCED_TEXTDOMAIN ); ?></label><br/>
272
  <input type="text" placeholder="最新記事一覧 ≫" id="<?php echo $this->get_field_id( 'more_text' ); ?>" name="<?php echo $this->get_field_name( 'more_text' ); ?>" value="<?php echo esc_attr( $instance['more_text'] ); ?>" />
273
  <br /><br />
274
  <?php
275
  }
276
 
277
  function update( $new_instance, $old_instance ) {
278
- $instance = $old_instance;
279
- $instance['format'] = $new_instance['format'];
280
- $instance['count'] = $new_instance['count'];
281
- $instance['label'] = $new_instance['label'];
282
- $instance['post_type'] = ! empty( $new_instance['post_type'] ) ? strip_tags( $new_instance['post_type'] ) : 'post';
283
- $instance['terms'] = preg_replace( '/([^0-9,]+)/', '', $new_instance['terms'] );
284
- $instance['more_url'] = $new_instance['more_url'];
285
- $instance['more_text'] = $new_instance['more_text'];
286
  return $instance;
287
  }
288
  }
9
 
10
  function __construct() {
11
 
12
+ $widget_name = LIGHTNING_ADVANCED_SHORT_NAME . ' ' . __( 'Content Area Posts Widget', LIGHTNING_ADVANCED_TEXTDOMAIN );
13
 
14
  parent::__construct(
15
  'ltg_adv_post_list',
21
  /*-------------------------------------------*/
22
  /* 一覧へのリンクhtmlを出力する関数
23
  /*-------------------------------------------*/
24
+ static public function more_link_html( $instance ) {
25
+ if ( ! empty( $instance['more_text'] ) && ! empty( $instance['more_url'] ) ) {
26
+ $more_link_html = '<div class="text-right" style="margin-top:1em;">';
27
+ $more_link_html .= '<a href="' . esc_url( $instance['more_url'] ) . '" class="btn btn-default btn-xs">' . wp_kses_post( $instance['more_text'] ) . '</a>';
 
28
  $more_link_html .= '</div>';
29
  } else {
30
  $more_link_html = '';
35
  function widget( $args, $instance ) {
36
  global $is_contentsarea_posts_widget;
37
  $is_contentsarea_posts_widget = true;
38
+ if ( ! isset( $instance['format'] ) ) {
39
+ $instance['format'] = 0; }
40
 
41
  echo $args['before_widget'];
42
+ echo '<div class="pt_' . $instance['format'] . '">';
43
  if ( ! empty( $instance['label'] ) ) {
44
  echo $args['before_title'];
45
  echo $instance['label'];
46
  echo $args['after_title'];
47
+ } elseif ( ! isset( $instance['label'] ) ) {
48
  echo $args['before_title'];
49
  echo __( 'Recent Posts', LIGHTNING_ADVANCED_TEXTDOMAIN );
50
  echo $args['after_title'];
51
  }
52
 
53
+ $count = ( isset( $instance['count'] ) && $instance['count'] ) ? $instance['count'] : 10;
54
+ $post_type = ( isset( $instance['post_type'] ) && $instance['post_type'] ) ? $instance['post_type'] : 'post';
55
 
56
  if ( $instance['format'] ) {
57
  $this->_taxonomy_init( $post_type );
58
  }
59
 
60
  $p_args = array(
61
+ 'post_type' => $post_type,
62
  'posts_per_page' => $count,
63
+ 'paged' => 1,
64
  );
65
 
66
  if ( isset( $instance['terms'] ) && $instance['terms'] ) {
67
+ $taxonomies = get_taxonomies( array() );
68
  $p_args['tax_query'] = array(
69
  'relation' => 'OR',
70
  );
71
+ $terms_array = explode( ',', $instance['terms'] );
72
  foreach ( $taxonomies as $taxonomy ) {
73
  $p_args['tax_query'][] = array(
74
  'taxonomy' => $taxonomy,
75
+ 'field' => 'id',
76
+ 'terms' => $terms_array,
77
  );
78
  }
79
  }
82
 
83
  if ( $post_loop->have_posts() ) :
84
  if ( ! $instance['format'] ) {
85
+
86
+ while ( $post_loop->have_posts() ) :
87
+ $post_loop->the_post();
88
+ if (
89
+ file_exists( get_stylesheet_directory() . '/module_loop_' . $post_type . '.php' ) &&
90
+ $post_type != 'post'
91
+ ) {
92
+ get_template_part( 'module_loop_' . $post_type );
93
+ } else {
94
+ get_template_part( 'module_loop_post' );
95
+ }
96
  endwhile;
97
+ } elseif ( $instance['format'] == 1 ) {
98
+ while ( $post_loop->have_posts() ) :
99
+ $post_loop->the_post();
100
  $this->display_pattern_1();
101
  endwhile;
102
  }
111
 
112
  } // widget($args, $instance)
113
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
114
  /*-------------------------------------------*/
115
  /* display_pattern_1 Cointent Body
116
  /*-------------------------------------------*/
120
 
121
  <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
122
  <header>
123
+ <?php get_template_part( 'module_loop_post_meta' ); ?>
124
  <h1 class="entry-title"><?php the_title(); ?></h1>
125
  </header>
126
 
127
  <div class="entry-body">
128
 
129
  <?php
130
+ $lightning_adv_more_btn_txt = '<span class="btn btn-default btn-block">' . __( 'Read more', LIGHTNING_ADVANCED_TEXTDOMAIN ) . '</span>';
131
+ $more_btn = apply_filters( 'lightning-adv-more-btn-txt', $lightning_adv_more_btn_txt );
132
  global $is_pagewidget;
133
  $is_pagewidget = true;
134
  the_content( $more_btn );
138
 
139
  <div class="entry-footer">
140
  <?php
141
+ $args = array(
142
+ 'before' => '<nav class="page-link"><dl><dt>Pages :</dt><dd>',
143
+ 'after' => '</dd></dl></nav>',
144
+ 'link_before' => '<span class="page-numbers">',
145
+ 'link_after' => '</span>',
146
+ 'echo' => 1,
147
+ );
148
+ wp_link_pages( $args );
149
+ ?>
150
 
151
  <?php
152
  /*-------------------------------------------*/
153
  /* Category and tax data
154
  /*-------------------------------------------*/
155
+ $args = array(
156
+ 'template' => __( '<dl><dt>%s</dt><dd>%l</dd></dl>', 'lightning' ),
157
+ 'term_template' => '<a href="%1$s">%2$s</a>',
158
+ );
159
+ $taxonomies = get_the_taxonomies( $post->ID, $args );
160
+ $taxnomiesHtml = '';
161
+ if ( $taxonomies ) {
162
+ foreach ( $taxonomies as $key => $value ) {
163
  if ( $key != 'post_tag' ) {
164
+ $taxnomiesHtml .= '<div class="entry-meta-dataList">' . $value . '</div>';
165
  }
166
+ } // foreach
167
  } // if ($taxonomies)
168
  $taxnomiesHtml = apply_filters( 'lightning_taxnomiesHtml', $taxnomiesHtml );
169
  echo $taxnomiesHtml;
170
  ?>
171
 
172
+ <?php
173
+ $tags_list = get_the_tag_list();
174
+ if ( $tags_list ) :
175
+ ?>
176
  <div class="entry-meta-dataList entry-tag">
177
  <dl>
178
+ <dt><?php _e( 'Tags', 'lightning' ); ?></dt>
179
  <dd class="tagCloud"><?php echo $tags_list; ?></dd>
180
  </dl>
181
  </div><!-- [ /.entry-tag ] -->
184
 
185
  </article>
186
 
187
+ <?php
188
+ }
189
 
190
  function _taxonomy_init( $post_type ) {
191
+ if ( $post_type == 'post' ) {
192
+ return; }
193
  $this->taxonomies = get_object_taxonomies( $post_type );
194
  }
195
 
196
  function taxonomy_list( $post_id = 0, $before = ' ', $sep = ',', $after = '' ) {
197
+ if ( ! $post_id ) {
198
+ $post_id = get_the_ID(); }
199
 
200
  $taxo_catelist = array();
201
 
202
  foreach ( $this->taxonomies as $taxonomy ) {
203
+ $terms = get_the_term_list( $post_id, $taxonomy, $before, $sep, $after );
204
+ if ( $terms ) {
205
+ $taxo_catelist[] = $terms; }
206
  }
207
 
208
+ if ( count( $taxo_catelist ) ) {
209
+ return join( $taxo_catelist, $sep ); }
210
  return '';
211
  }
212
 
222
  );
223
 
224
  $instance = wp_parse_args( (array) $instance, $defaults );
225
+ //タイトル
226
+ ?>
227
+ <br/>
228
  <?php echo _e( 'Display Format', LIGHTNING_ADVANCED_TEXTDOMAIN ); ?>:<br/>
229
  <ul>
230
+ <li><label><input type="radio" name="<?php echo $this->get_field_name( 'format' ); ?>" value="0"
231
+ <?php
232
+ if ( $instance['format'] == 0 ) {
233
+ echo 'checked'; }
234
+ ?>
235
+ /><?php echo __( 'Thumbnail', LIGHTNING_ADVANCED_TEXTDOMAIN ) . '/' . __( 'Date', LIGHTNING_ADVANCED_TEXTDOMAIN ) . '/' . __( 'Category', LIGHTNING_ADVANCED_TEXTDOMAIN ) . '/' . __( 'Title', LIGHTNING_ADVANCED_TEXTDOMAIN ) . '/' . __( 'Excerpt', LIGHTNING_ADVANCED_TEXTDOMAIN ); ?></label>
236
  </li>
237
+ <li><label><input type="radio" name="<?php echo $this->get_field_name( 'format' ); ?>" value="1"
238
+ <?php
239
+ if ( $instance['format'] == 1 ) {
240
+ echo 'checked'; }
241
+ ?>
242
+ /><?php echo __( 'Thumbnail', LIGHTNING_ADVANCED_TEXTDOMAIN ) . '/' . __( 'Date', LIGHTNING_ADVANCED_TEXTDOMAIN ) . '/' . __( 'Category', LIGHTNING_ADVANCED_TEXTDOMAIN ) . '/' . __( 'Title', LIGHTNING_ADVANCED_TEXTDOMAIN ) . '/' . __( 'Content', LIGHTNING_ADVANCED_TEXTDOMAIN ); ?></label>
243
  </li>
244
  </ul>
245
+ <br/>
246
+ <?php //タイトル ?>
247
+ <label for="<?php echo $this->get_field_id( 'label' ); ?>"><?php _e( 'Title:' ); ?></label><br/>
248
  <input type="text" id="<?php echo $this->get_field_id( 'label' ); ?>-title" name="<?php echo $this->get_field_name( 'label' ); ?>" value="<?php echo $instance['label']; ?>" />
249
+ <br/><br />
250
 
251
  <?php //表示件数 ?>
252
+ <label for="<?php echo $this->get_field_id( 'count' ); ?>"><?php _e( 'Display count', LIGHTNING_ADVANCED_TEXTDOMAIN ); ?>:</label><br/>
253
  <input type="text" id="<?php echo $this->get_field_id( 'count' ); ?>" name="<?php echo $this->get_field_name( 'count' ); ?>" value="<?php echo $instance['count']; ?>" />
254
+ <br /><br />
255
 
256
  <?php //投稿タイプ ?>
257
+ <label for="<?php echo $this->get_field_id( 'post_type' ); ?>"><?php _e( 'Slug for the custom type you want to display', LIGHTNING_ADVANCED_TEXTDOMAIN ); ?>:</label><br />
258
+ <input type="text" id="<?php echo $this->get_field_id( 'post_type' ); ?>" name="<?php echo $this->get_field_name( 'post_type' ); ?>" value="<?php echo esc_attr( $instance['post_type'] ); ?>" />
259
+ <br/><br/>
260
 
261
  <?php // Terms ?>
262
+ <label for="<?php echo $this->get_field_id( 'terms' ); ?>"><?php _e( 'taxonomy ID', LIGHTNING_ADVANCED_TEXTDOMAIN ); ?>:</label><br />
263
+ <input type="text" id="<?php echo $this->get_field_id( 'terms' ); ?>" name="<?php echo $this->get_field_name( 'terms' ); ?>" value="<?php echo esc_attr( $instance['terms'] ); ?>" /><br />
264
+ <?php
265
+ _e( 'if you need filtering by term, add the term ID separate by ",".', LIGHTNING_ADVANCED_TEXTDOMAIN );
266
  echo '<br/>';
267
  _e( 'if empty this area, I will do not filtering.', LIGHTNING_ADVANCED_TEXTDOMAIN );
268
+ echo '<br/><br/>';
269
+ ?>
270
 
271
  <?php // Read more ?>
272
+ <label for="<?php echo $this->get_field_id( 'more_url' ); ?>"><?php _e( 'Destination URL:', LIGHTNING_ADVANCED_TEXTDOMAIN ); ?></label><br/>
273
  <input type="text" id="<?php echo $this->get_field_id( 'more_url' ); ?>" name="<?php echo $this->get_field_name( 'more_url' ); ?>" value="<?php echo esc_attr( $instance['more_url'] ); ?>" />
274
  <br /><br />
275
+ <label for="<?php echo $this->get_field_id( 'more_text' ); ?>"><?php _e( 'Notation text:', LIGHTNING_ADVANCED_TEXTDOMAIN ); ?></label><br/>
276
  <input type="text" placeholder="最新記事一覧 ≫" id="<?php echo $this->get_field_id( 'more_text' ); ?>" name="<?php echo $this->get_field_name( 'more_text' ); ?>" value="<?php echo esc_attr( $instance['more_text'] ); ?>" />
277
  <br /><br />
278
  <?php
279
  }
280
 
281
  function update( $new_instance, $old_instance ) {
282
+ $instance = $old_instance;
283
+ $instance['format'] = $new_instance['format'];
284
+ $instance['count'] = $new_instance['count'];
285
+ $instance['label'] = $new_instance['label'];
286
+ $instance['post_type'] = ! empty( $new_instance['post_type'] ) ? strip_tags( $new_instance['post_type'] ) : 'post';
287
+ $instance['terms'] = preg_replace( '/([^0-9,]+)/', '', $new_instance['terms'] );
288
+ $instance['more_url'] = $new_instance['more_url'];
289
+ $instance['more_text'] = $new_instance['more_text'];
290
  return $instance;
291
  }
292
  }
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.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".
2
  /**
3
  * Plugin Name: Lightning Advanced Unit
4
  * Plugin URI: http://lightning.vektor-inc.co.jp/
5
+ * Version: 3.3.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.2.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
4
  Tags: Lightning,
5
  Requires at least: 4.5
6
  Tested up to: 4.9.5
7
+ Stable tag: 3.3.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10