VK All in One Expansion Unit - Version 9.63.0.0

Version Description

  • [ Add function ][ CTA ] Add function of change out put action hook.
Download this release

Release Info

Developer kurudrive
Plugin Icon 128x128 VK All in One Expansion Unit
Version 9.63.0.0
Comparing to
See all releases

Code changes from version 9.62.0.0 to 9.63.0.0

inc/call-to-action/package/class-vk-call-to-action.php CHANGED
@@ -15,11 +15,18 @@ if ( ! class_exists( 'Vk_Call_To_Action' ) ) {
15
  add_action( 'admin_menu', array( __CLASS__, 'add_metabox_cta_register' ) );
16
  add_action( 'save_post', array( __CLASS__, 'save_custom_field' ) );
17
  add_action( 'widgets_init', array( __CLASS__, 'widget_init' ) );
18
- if ( veu_content_filter_state() == 'content' ) {
19
- add_filter( 'the_content', array( __CLASS__, 'content_filter' ), self::CONTENT_NUMBER, 1 );
 
 
20
  } else {
21
- add_action( 'loop_end', array( __CLASS__, 'set_content_loopend' ), self::CONTENT_NUMBER, 1 );
 
 
 
 
22
  }
 
23
  require_once dirname( __FILE__ ) . '/widget-call-to-action.php';
24
 
25
  /*
@@ -28,8 +35,9 @@ if ( ! class_exists( 'Vk_Call_To_Action' ) ) {
28
  admin_menu のタイミングで読み込んでいる
29
  */
30
  add_action(
31
- 'admin_menu', function() {
32
- require_once( dirname( __FILE__ ) . '/class-veu-metabox-cta.php' );
 
33
  }
34
  );
35
  }
@@ -44,7 +52,6 @@ if ( ! class_exists( 'Vk_Call_To_Action' ) ) {
44
  echo self::content_filter( '' );
45
  }
46
 
47
- //////////////////////////////////////////////////////
48
 
49
  public static function option_init() {
50
  vkExUnit_register_setting(
@@ -94,11 +101,11 @@ if ( ! class_exists( 'Vk_Call_To_Action' ) ) {
94
 
95
 
96
  /**
97
- * [save_custom_field description]
98
- *
99
- * @param [type] $post_id [description]
100
- * @return [type] [description]
101
- */
102
  public static function save_custom_field( $post_id ) {
103
  if ( ! isset( $_POST['_vkExUnit_cta_switch'] ) ) {
104
  return $post_id; }
@@ -127,7 +134,7 @@ if ( ! class_exists( 'Vk_Call_To_Action' ) ) {
127
 
128
  // カスタムフィールドの設定
129
  $custom_fields = array(
130
- 'vkExUnit_cta_use_type' => array(
131
  'escape_type' => '',
132
  ),
133
  'vkExUnit_cta_img' => array(
@@ -187,9 +194,10 @@ if ( ! class_exists( 'Vk_Call_To_Action' ) ) {
187
  } // public static function save_custom_field( $post_id ) {
188
 
189
  /**
190
- * [widget_init description]
191
- * @return [type] [description]
192
- */
 
193
  public static function widget_init() {
194
  return register_widget( 'Widget_CTA' );
195
  }
@@ -269,7 +277,7 @@ if ( ! class_exists( 'Vk_Call_To_Action' ) ) {
269
  </script>
270
  <input type="hidden" name="_vkExUnit_cta_switch" value="cta_content" />
271
  <p><?php _e( 'You can create it with a free layout in the content field using, such as Outer block and PR Content block in VK Blocks.', $vk_call_to_action_textdomain ); ?><br>
272
- <?php _e( 'If the contents field is entered, the contents of the body will be displayed with priority, so the following contents will be ignored.', $vk_call_to_action_textdomain ); ?><br>
273
  * <?php _e( 'The entered contents are displayed directly. You can not use Dynamic blocks, reuse blocks, etc.', $vk_call_to_action_textdomain ); ?>
274
  </p>
275
  <table class="form-table">
@@ -279,14 +287,14 @@ if ( ! class_exists( 'Vk_Call_To_Action' ) ) {
279
  <label for="vkExUnit_cta_use_type"><?php _e( 'Use Classic layout', $vk_call_to_action_textdomain ); ?></label>
280
  </th>
281
  <td>
282
- <?php
283
- $target_blank = get_post_meta( get_the_id(), 'vkExUnit_cta_use_type', true );
284
- if ( $target_blank == 'veu_cta_normal' ) {
285
- $checked = ' checked';
286
- } else {
287
- $checked = '';
288
- }
289
- ?>
290
  <input type="checkbox" id="vkExUnit_cta_use_type" name="vkExUnit_cta_use_type" value="veu_cta_normal"<?php echo $checked; ?> />
291
  <label for="vkExUnit_cta_use_type"><?php _e( 'Use following data (Do not use content data)', 'vk-all-in-one-expansion-unit' ); ?></label>
292
  </td>
@@ -333,11 +341,11 @@ if ( ! class_exists( 'Vk_Call_To_Action' ) ) {
333
  </dl>
334
  </div>
335
 
336
- <?php
337
- if ( class_exists( 'Vk_Font_Awesome_Versions' ) ) {
338
- echo Vk_Font_Awesome_Versions::ex_and_link();
339
- }
340
- ?>
341
 
342
  </p>
343
  </td></tr>
@@ -347,14 +355,14 @@ if ( class_exists( 'Vk_Font_Awesome_Versions' ) ) {
347
  </td></tr>
348
  <tr><th>
349
 
350
- <?php
351
- $target_blank = get_post_meta( get_the_id(), 'vkExUnit_cta_url_blank', true );
352
- if ( $target_blank == 'window_self' ) {
353
- $checked = ' checked';
354
- } else {
355
- $checked = '';
356
- }
357
- ?>
358
  <label for="vkExUnit_cta_url_blank"><?php _e( 'Target window', $vk_call_to_action_textdomain ); ?></label></th><td>
359
  <input type="checkbox" id="vkExUnit_cta_url_blank" name="vkExUnit_cta_url_blank" value="window_self"<?php echo $checked; ?> />
360
  <label for="vkExUnit_cta_url_blank"><?php _e( 'Open in a self window', 'vk-all-in-one-expansion-unit' ); ?></label>
@@ -366,7 +374,7 @@ if ( class_exists( 'Vk_Font_Awesome_Versions' ) ) {
366
  </td></tr>
367
  </table>
368
  <a href="<?php echo admin_url( 'admin.php?page=vkExUnit_main_setting#vkExUnit_cta_settings' ); ?>" class="button button-default" target="_blank"><?php _e( 'CTA setting', $vk_call_to_action_textdomain ); ?></a>
369
- <?php
370
  }
371
 
372
 
@@ -423,7 +431,7 @@ if ( class_exists( 'Vk_Font_Awesome_Versions' ) ) {
423
  $content .= '<div class="veu_adminEdit"><a href="' . $url . '" class="btn btn-default" target="_blank">' . __( 'Edit CTA', $vk_call_to_action_textdomain ) . '</a></div>';
424
  }
425
  // wp_kses_post でエスケープすると outerブロックが出力するstyle属性を無効化される
426
- return do_blocks(do_shortcode( $content ));
427
  }
428
 
429
  public static function cta_id_random() {
@@ -505,6 +513,10 @@ if ( class_exists( 'Vk_Font_Awesome_Versions' ) ) {
505
  return $content;
506
  }
507
 
 
 
 
 
508
 
509
  public static function is_pagewidget() {
510
  global $is_pagewidget;
@@ -523,11 +535,13 @@ if ( class_exists( 'Vk_Font_Awesome_Versions' ) ) {
523
  array(
524
  'post' => 'post',
525
  'page' => 'page',
526
- ), get_post_types(
 
527
  array(
528
  'public' => true,
529
  '_builtin' => false,
530
- ), 'names'
 
531
  )
532
  );
533
  $option = get_option( 'vkExUnit_cta_settings' );
@@ -539,7 +553,11 @@ if ( class_exists( 'Vk_Font_Awesome_Versions' ) ) {
539
  if ( $value == 'random' ) {
540
  $option[ $key ] = 'random';
541
  } else {
542
- $option[ $key ] = ( is_numeric( $value ) ) ? $value : 0;
 
 
 
 
543
  }
544
  }
545
  }
@@ -554,11 +572,13 @@ if ( class_exists( 'Vk_Font_Awesome_Versions' ) ) {
554
  array(
555
  'post' => 'post',
556
  'page' => 'page',
557
- ), get_post_types(
 
558
  array(
559
  'public' => true,
560
  '_builtin' => false,
561
- ), 'names'
 
562
  )
563
  );
564
  foreach ( $posttypes as $key => $posttype ) {
@@ -581,11 +601,13 @@ if ( class_exists( 'Vk_Font_Awesome_Versions' ) ) {
581
  array(
582
  'post' => 'post',
583
  'page' => 'page',
584
- ), get_post_types(
 
585
  array(
586
  'public' => true,
587
  '_builtin' => false,
588
- ), 'names'
 
589
  )
590
  );
591
 
@@ -627,14 +649,16 @@ if ( class_exists( 'Vk_Font_Awesome_Versions' ) ) {
627
 
628
  // ランダムを先頭に追加
629
  array_unshift(
630
- $ctas, array(
 
631
  'key' => 'random',
632
  'label' => __( 'Random', $vk_call_to_action_textdomain ),
633
  )
634
  );
635
  // 表示しないを先頭に追加
636
  array_unshift(
637
- $ctas, array(
 
638
  'key' => 0,
639
  'label' => __( 'Disable display', $vk_call_to_action_textdomain ),
640
  )
15
  add_action( 'admin_menu', array( __CLASS__, 'add_metabox_cta_register' ) );
16
  add_action( 'save_post', array( __CLASS__, 'save_custom_field' ) );
17
  add_action( 'widgets_init', array( __CLASS__, 'widget_init' ) );
18
+
19
+ $options = get_option( 'vkExUnit_cta_settings' );
20
+ if ( ! empty( $options['hook_point'] ) ){
21
+ add_action( $options['hook_point'], array( __CLASS__, 'display_cta_to_hook' ), self::CONTENT_NUMBER, 1 );
22
  } else {
23
+ if ( veu_content_filter_state() == 'content' ) {
24
+ add_filter( 'the_content', array( __CLASS__, 'content_filter' ), self::CONTENT_NUMBER, 1 );
25
+ } else {
26
+ add_action( 'loop_end', array( __CLASS__, 'set_content_loopend' ), self::CONTENT_NUMBER, 1 );
27
+ }
28
  }
29
+
30
  require_once dirname( __FILE__ ) . '/widget-call-to-action.php';
31
 
32
  /*
35
  admin_menu のタイミングで読み込んでいる
36
  */
37
  add_action(
38
+ 'admin_menu',
39
+ function() {
40
+ require_once dirname( __FILE__ ) . '/class-veu-metabox-cta.php';
41
  }
42
  );
43
  }
52
  echo self::content_filter( '' );
53
  }
54
 
 
55
 
56
  public static function option_init() {
57
  vkExUnit_register_setting(
101
 
102
 
103
  /**
104
+ * [save_custom_field description]
105
+ *
106
+ * @param [type] $post_id [description]
107
+ * @return [type] [description]
108
+ */
109
  public static function save_custom_field( $post_id ) {
110
  if ( ! isset( $_POST['_vkExUnit_cta_switch'] ) ) {
111
  return $post_id; }
134
 
135
  // カスタムフィールドの設定
136
  $custom_fields = array(
137
+ 'vkExUnit_cta_use_type' => array(
138
  'escape_type' => '',
139
  ),
140
  'vkExUnit_cta_img' => array(
194
  } // public static function save_custom_field( $post_id ) {
195
 
196
  /**
197
+ * [widget_init description]
198
+ *
199
+ * @return [type] [description]
200
+ */
201
  public static function widget_init() {
202
  return register_widget( 'Widget_CTA' );
203
  }
277
  </script>
278
  <input type="hidden" name="_vkExUnit_cta_switch" value="cta_content" />
279
  <p><?php _e( 'You can create it with a free layout in the content field using, such as Outer block and PR Content block in VK Blocks.', $vk_call_to_action_textdomain ); ?><br>
280
+ <?php _e( 'If the contents field is entered, the contents of the body will be displayed with priority, so the following contents will be ignored.', $vk_call_to_action_textdomain ); ?><br>
281
  * <?php _e( 'The entered contents are displayed directly. You can not use Dynamic blocks, reuse blocks, etc.', $vk_call_to_action_textdomain ); ?>
282
  </p>
283
  <table class="form-table">
287
  <label for="vkExUnit_cta_use_type"><?php _e( 'Use Classic layout', $vk_call_to_action_textdomain ); ?></label>
288
  </th>
289
  <td>
290
+ <?php
291
+ $target_blank = get_post_meta( get_the_id(), 'vkExUnit_cta_use_type', true );
292
+ if ( $target_blank == 'veu_cta_normal' ) {
293
+ $checked = ' checked';
294
+ } else {
295
+ $checked = '';
296
+ }
297
+ ?>
298
  <input type="checkbox" id="vkExUnit_cta_use_type" name="vkExUnit_cta_use_type" value="veu_cta_normal"<?php echo $checked; ?> />
299
  <label for="vkExUnit_cta_use_type"><?php _e( 'Use following data (Do not use content data)', 'vk-all-in-one-expansion-unit' ); ?></label>
300
  </td>
341
  </dl>
342
  </div>
343
 
344
+ <?php
345
+ if ( class_exists( 'Vk_Font_Awesome_Versions' ) ) {
346
+ echo Vk_Font_Awesome_Versions::ex_and_link();
347
+ }
348
+ ?>
349
 
350
  </p>
351
  </td></tr>
355
  </td></tr>
356
  <tr><th>
357
 
358
+ <?php
359
+ $target_blank = get_post_meta( get_the_id(), 'vkExUnit_cta_url_blank', true );
360
+ if ( $target_blank == 'window_self' ) {
361
+ $checked = ' checked';
362
+ } else {
363
+ $checked = '';
364
+ }
365
+ ?>
366
  <label for="vkExUnit_cta_url_blank"><?php _e( 'Target window', $vk_call_to_action_textdomain ); ?></label></th><td>
367
  <input type="checkbox" id="vkExUnit_cta_url_blank" name="vkExUnit_cta_url_blank" value="window_self"<?php echo $checked; ?> />
368
  <label for="vkExUnit_cta_url_blank"><?php _e( 'Open in a self window', 'vk-all-in-one-expansion-unit' ); ?></label>
374
  </td></tr>
375
  </table>
376
  <a href="<?php echo admin_url( 'admin.php?page=vkExUnit_main_setting#vkExUnit_cta_settings' ); ?>" class="button button-default" target="_blank"><?php _e( 'CTA setting', $vk_call_to_action_textdomain ); ?></a>
377
+ <?php
378
  }
379
 
380
 
431
  $content .= '<div class="veu_adminEdit"><a href="' . $url . '" class="btn btn-default" target="_blank">' . __( 'Edit CTA', $vk_call_to_action_textdomain ) . '</a></div>';
432
  }
433
  // wp_kses_post でエスケープすると outerブロックが出力するstyle属性を無効化される
434
+ return do_blocks( do_shortcode( $content ) );
435
  }
436
 
437
  public static function cta_id_random() {
513
  return $content;
514
  }
515
 
516
+ public static function display_cta_to_hook(){
517
+ echo self::render_cta_content( self::is_cta_id() );
518
+ }
519
+
520
 
521
  public static function is_pagewidget() {
522
  global $is_pagewidget;
535
  array(
536
  'post' => 'post',
537
  'page' => 'page',
538
+ ),
539
+ get_post_types(
540
  array(
541
  'public' => true,
542
  '_builtin' => false,
543
+ ),
544
+ 'names'
545
  )
546
  );
547
  $option = get_option( 'vkExUnit_cta_settings' );
553
  if ( $value == 'random' ) {
554
  $option[ $key ] = 'random';
555
  } else {
556
+ if ( 'hook_point' === $key ){
557
+ $option[ $key ] = sanitize_text_field( $value );
558
+ } else {
559
+ $option[ $key ] = ( is_numeric( $value ) ) ? $value : 0;
560
+ }
561
  }
562
  }
563
  }
572
  array(
573
  'post' => 'post',
574
  'page' => 'page',
575
+ ),
576
+ get_post_types(
577
  array(
578
  'public' => true,
579
  '_builtin' => false,
580
+ ),
581
+ 'names'
582
  )
583
  );
584
  foreach ( $posttypes as $key => $posttype ) {
601
  array(
602
  'post' => 'post',
603
  'page' => 'page',
604
+ ),
605
+ get_post_types(
606
  array(
607
  'public' => true,
608
  '_builtin' => false,
609
+ ),
610
+ 'names'
611
  )
612
  );
613
 
649
 
650
  // ランダムを先頭に追加
651
  array_unshift(
652
+ $ctas,
653
+ array(
654
  'key' => 'random',
655
  'label' => __( 'Random', $vk_call_to_action_textdomain ),
656
  )
657
  );
658
  // 表示しないを先頭に追加
659
  array_unshift(
660
+ $ctas,
661
+ array(
662
  'key' => 0,
663
  'label' => __( 'Disable display', $vk_call_to_action_textdomain ),
664
  )
inc/call-to-action/package/view-adminsetting.php CHANGED
@@ -34,7 +34,7 @@ global $vk_call_to_action_textdomain;
34
  <?php foreach ( $options as $type => $value ) : ?>
35
  <tr><th><label ><?php echo get_post_type_object( $type )->label; ?></label></th>
36
  <td><select name="vkExUnit_cta_settings[<?php echo $type; ?>]" id="vkExUnit_cta_settings">
37
- <?php foreach ( $ctas as $cta ) : ?>
38
  <option value="<?php echo $cta['key']; ?>" <?php echo( $value == $cta['key'] ) ? 'selected' : ''; ?> ><?php echo $cta['label']; ?></option>
39
  <?php endforeach; ?>
40
  </select>
@@ -42,5 +42,26 @@ global $vk_call_to_action_textdomain;
42
  </td></tr>
43
  <?php endforeach; ?>
44
  </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  <?php submit_button(); ?>
46
  </div>
34
  <?php foreach ( $options as $type => $value ) : ?>
35
  <tr><th><label ><?php echo get_post_type_object( $type )->label; ?></label></th>
36
  <td><select name="vkExUnit_cta_settings[<?php echo $type; ?>]" id="vkExUnit_cta_settings">
37
+ <?php foreach ( $ctas as $cta ) : ?>
38
  <option value="<?php echo $cta['key']; ?>" <?php echo( $value == $cta['key'] ) ? 'selected' : ''; ?> ><?php echo $cta['label']; ?></option>
39
  <?php endforeach; ?>
40
  </select>
42
  </td></tr>
43
  <?php endforeach; ?>
44
  </table>
45
+
46
+ <hr>
47
+ <?php
48
+ $options = get_option( 'vkExUnit_cta_settings' );
49
+ $options_value = '';
50
+ if ( isset( $options['hook_point'] ) ) {
51
+ $options_value = $options['hook_point'];
52
+ }
53
+ ?>
54
+ <table class="form-table">
55
+ <tr><th><label ><?php _e( 'Output action hook (optional)', $vk_call_to_action_textdomain ); ?></label></th>
56
+ <td>
57
+ <p>
58
+ <?php _e( 'By default, it is output at the bottom of the content.', $vk_call_to_action_textdomain ); ?><br>
59
+ <?php _e( 'If you want to change the location of any action hook, enter the action hook name.', $vk_call_to_action_textdomain ); ?><br>
60
+ <?php _e( 'ex) lightning_site_footer_bofore', $vk_call_to_action_textdomain ); ?>
61
+ </p>
62
+ <input type="text" name="vkExUnit_cta_settings[hook_point]" id="hook_point" value="<?php echo esc_attr( $options_value ); ?>" style="width:100%;" />
63
+ </td></tr>
64
+ </table>
65
+
66
  <?php submit_button(); ?>
67
  </div>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:
4
  Tags: Google Analytics, New posts, Related Posts, sitemap, sns, twitter card, Facebook Page Plugin, OG tags,
5
  Requires at least: 5.3.0
6
  Tested up to: 5.8.0
7
- Stable tag: 9.62.0.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -81,6 +81,9 @@ e.g.
81
 
82
  == Changelog ==
83
 
 
 
 
84
  = 9.62.0.0 =
85
  * [ Specification Change ][ Child page list ] readmore btn class btn-xs -> btn-sm
86
  * [ Specification Change ][ HTML Sitemap ] tuning of taxonomy css
4
  Tags: Google Analytics, New posts, Related Posts, sitemap, sns, twitter card, Facebook Page Plugin, OG tags,
5
  Requires at least: 5.3.0
6
  Tested up to: 5.8.0
7
+ Stable tag: 9.63.0.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
81
 
82
  == Changelog ==
83
 
84
+ = 9.63.0.0 =
85
+ * [ Add function ][ CTA ] Add function of change out put action hook.
86
+
87
  = 9.62.0.0 =
88
  * [ Specification Change ][ Child page list ] readmore btn class btn-xs -> btn-sm
89
  * [ Specification Change ][ HTML Sitemap ] tuning of taxonomy css
vkExUnit.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: VK All in One Expansion Unit
4
  * Plugin URI: https://ex-unit.nagoya
5
  * Description: This plug-in is an integrated plug-in with a variety of features that make it powerful your web site. Many features can be stopped individually. Example Facebook Page Plugin,Social Bookmarks,Print OG Tags,Print Twitter Card Tags,Print Google Analytics tag,New post widget,Insert Related Posts and more!
6
- * Version: 9.62.0.0
7
  * Author: Vektor,Inc.
8
  * Text Domain: vk-all-in-one-expansion-unit
9
  * Domain Path: /languages
3
  * Plugin Name: VK All in One Expansion Unit
4
  * Plugin URI: https://ex-unit.nagoya
5
  * Description: This plug-in is an integrated plug-in with a variety of features that make it powerful your web site. Many features can be stopped individually. Example Facebook Page Plugin,Social Bookmarks,Print OG Tags,Print Twitter Card Tags,Print Google Analytics tag,New post widget,Insert Related Posts and more!
6
+ * Version: 9.63.0.0
7
  * Author: Vektor,Inc.
8
  * Text Domain: vk-all-in-one-expansion-unit
9
  * Domain Path: /languages