VK All in One Expansion Unit - Version 9.17.0.0

Version Description

[ Specification change ][ sns twitter card ] Print Twitter Card if Twitter ID no setted [ Post Type Manager ] Improved REST API description [ Post Type Manager ] Add term column to admin column

Download this release

Release Info

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

Code changes from version 9.16.2.0 to 9.17.0.0

admin/disable-guide.php CHANGED
@@ -37,13 +37,13 @@ body.vew_hide_edit_guide .veu_adminEdit { display: none; }
37
  (function(w,d,i,c,f){
38
  w.addEventListener('load', function(){
39
  var e=document.getElementById(i);
40
- e.addEventListener('click', function(){
41
  if(e.classList.contains(c)){
42
  e.classList.remove(c);d.body.classList.remove(f);
43
  }else{
44
  e.classList.add(c);d.body.classList.add(f);
45
  }
46
- })})
47
  })(window,document,'wp-admin-bar-veu_disable_admin_edit','active','vew_hide_edit_guide')
48
  </script>
49
  <?php }
37
  (function(w,d,i,c,f){
38
  w.addEventListener('load', function(){
39
  var e=document.getElementById(i);
40
+ if(e){e.addEventListener('click', function(){
41
  if(e.classList.contains(c)){
42
  e.classList.remove(c);d.body.classList.remove(f);
43
  }else{
44
  e.classList.add(c);d.body.classList.add(f);
45
  }
46
+ })}})
47
  })(window,document,'wp-admin-bar-veu_disable_admin_edit','active','vew_hide_edit_guide')
48
  </script>
49
  <?php }
inc/post-type-manager/package/class.post-type-manager.php CHANGED
@@ -10,8 +10,8 @@ if ( ! class_exists( 'Vk_post_type_manager' ) ) {
10
 
11
  class Vk_post_type_manager {
12
 
13
- /*-------------------------------------------*/
14
- /* カスタム投稿タイプ制御用投稿タイプを追加
15
  /*-------------------------------------------*/
16
  function add_post_type_post_type_manage() {
17
  global $vk_post_type_manager_textdomain;
@@ -35,8 +35,8 @@ if ( ! class_exists( 'Vk_post_type_manager' ) ) {
35
  );
36
  }
37
 
38
- /*-------------------------------------------*/
39
- /* post_type_manage の編集権限を追加
40
  /*-------------------------------------------*/
41
  function add_cap_post_type_manage() {
42
  $role = get_role( 'administrator' );
@@ -56,8 +56,8 @@ if ( ! class_exists( 'Vk_post_type_manager' ) ) {
56
  $role->add_cap( 'publish_others_' . $post_type_name . 's' );
57
  }
58
 
59
- /*-------------------------------------------*/
60
- /* meta box を作成
61
  /*-------------------------------------------*/
62
  // add meta_box
63
  function add_meta_box() {
@@ -68,7 +68,7 @@ if ( ! class_exists( 'Vk_post_type_manager' ) ) {
68
  global $vk_post_type_manager_textdomain;
69
  global $post;
70
 
71
- //CSRF対策の設定(フォームにhiddenフィールドとして追加するためのnonceを「'noncename__post_type_manager」として設定)
72
  wp_nonce_field( wp_create_nonce( __FILE__ ), 'noncename__post_type_manager' );
73
 
74
  ?>
@@ -83,7 +83,8 @@ if ( ! class_exists( 'Vk_post_type_manager' ) ) {
83
  </style>
84
  <?php
85
 
86
- /* Post Type ID
 
87
  /*-------------------------------------------*/
88
  echo '<h4>' . __( 'Post Type ID(Required)', $vk_post_type_manager_textdomain ) . '</h4>';
89
  echo '<p>' . __( '20 characters or less in alphanumeric', $vk_post_type_manager_textdomain ) . '</p>';
@@ -100,7 +101,8 @@ if ( ! class_exists( 'Vk_post_type_manager' ) ) {
100
  'revisions' => __( 'revisions', $vk_post_type_manager_textdomain ),
101
  );
102
 
103
- /* Supports(Required)
 
104
  /*-------------------------------------------*/
105
  echo '<h4>' . __( 'Supports(Required)', $vk_post_type_manager_textdomain ) . '</h4>';
106
  $post_type_items_value = get_post_meta( $post->ID, 'veu_post_type_items', true );
@@ -113,7 +115,8 @@ if ( ! class_exists( 'Vk_post_type_manager' ) ) {
113
 
114
  echo '<hr>';
115
 
116
- /* Menu position
 
117
  /*-------------------------------------------*/
118
  echo '<h4>' . __( 'Menu position(optional)', $vk_post_type_manager_textdomain ) . '</h4>';
119
  echo '<p>' . __( 'Please enter a number.', $vk_post_type_manager_textdomain ) . '</p>';
@@ -121,9 +124,10 @@ if ( ! class_exists( 'Vk_post_type_manager' ) ) {
121
 
122
  echo '<hr>';
123
 
124
- /* Export to Rest api
 
125
  /*-------------------------------------------*/
126
- echo '<h4>' . __( 'Export to REST API(optional)', $vk_post_type_manager_textdomain ) . '</h4>';
127
 
128
  // 現在保存されているカスタムフィールドの値を取得
129
  $export_to_api_value = get_post_meta( $post->ID, 'veu_post_type_export_to_api', true );
@@ -135,11 +139,12 @@ if ( ! class_exists( 'Vk_post_type_manager' ) ) {
135
  $checked = '';
136
  }
137
 
138
- echo '<label>' . '<input type="checkbox" id="veu_post_type_export_to_api" name="veu_post_type_export_to_api" value="true"' . $checked . '> ' . __( 'Export to REST API' ) . '</label>';
139
  echo '<p>' . __( 'If you want to use the block editor that, you have to use the REST API.', $vk_post_type_manager_textdomain ) . '</p>';
140
  echo '<hr>';
141
 
142
- /* Custom taxonomies
 
143
  /*-------------------------------------------*/
144
  echo '<h4>' . __( 'Custom taxonomies(optional)', $vk_post_type_manager_textdomain ) . '</h4>';
145
 
@@ -155,7 +160,7 @@ if ( ! class_exists( 'Vk_post_type_manager' ) ) {
155
  $taxonomy = get_post_meta( $post->ID, 'veu_taxonomy', true );
156
 
157
  // if ( ! $taxonomy ){
158
- // $taxonomy = array(array());
159
  // }
160
 
161
  for ( $i = 1; $i <= 3; $i++ ) {
@@ -197,8 +202,8 @@ if ( ! class_exists( 'Vk_post_type_manager' ) ) {
197
  // チェックが元々入ってるかどうか
198
  $checked = ( isset( $taxonomy[ $i ]['rest_api'] ) && $taxonomy[ $i ]['rest_api'] ) ? ' checked' : '';
199
 
200
- echo '<td>' . __( 'REST API(optional)', $vk_post_type_manager_textdomain ) . '</td>';
201
- echo '<td><label><input type="checkbox" id="veu_taxonomy[' . $i . '][rest_api]" name="veu_taxonomy[' . $i . '][rest_api]" value="true"' . $checked . '> ' . __( 'Use for REST API', $vk_post_type_manager_textdomain ) . '</label></td>';
202
  echo '</tr>';
203
 
204
  }
@@ -206,22 +211,22 @@ if ( ! class_exists( 'Vk_post_type_manager' ) ) {
206
 
207
  }
208
 
209
- /*-------------------------------------------*/
210
- /* 入力された値の保存
211
  /*-------------------------------------------*/
212
 
213
  function save_cf_value( $post_id ) {
214
  global $post;
215
 
216
- //設定したnonce を取得(CSRF対策)
217
  $noncename__post_type_manager = isset( $_POST['noncename__post_type_manager'] ) ? $_POST['noncename__post_type_manager'] : null;
218
 
219
- //nonce を確認し、値が書き換えられていれば、何もしない(CSRF対策)
220
  if ( ! wp_verify_nonce( $noncename__post_type_manager, wp_create_nonce( __FILE__ ) ) ) {
221
  return $post_id;
222
  }
223
 
224
- //自動保存ルーチンかどうかチェック。そうだった場合は何もしない(記事の自動保存処理として呼び出された場合の対策)
225
  if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
226
  return $post_id; }
227
 
@@ -270,9 +275,8 @@ if ( ! class_exists( 'Vk_post_type_manager' ) ) {
270
  }
271
  }
272
 
273
-
274
- /*-------------------------------------------*/
275
- /* 登録したカスタム投稿タイプを実際に作成
276
  /*-------------------------------------------*/
277
 
278
  function add_post_type() {
@@ -288,7 +292,8 @@ if ( ! class_exists( 'Vk_post_type_manager' ) ) {
288
  if ( $custom_post_types ) {
289
  foreach ( $custom_post_types as $key => $post ) {
290
 
291
- /* 投稿タイプ追加
 
292
  /*-------------------------------------------*/
293
  $labels = array(
294
  'name' => esc_html( $post->post_title ),
@@ -335,7 +340,8 @@ if ( ! class_exists( 'Vk_post_type_manager' ) ) {
335
  // カスタム投稿タイプを発行
336
  register_post_type( $post_type_id, $args );
337
 
338
- /* カスタム分類を追加
 
339
  /*-------------------------------------------*/
340
 
341
  // カスタムフィールドに連想配列で格納しておいたカスタム分類の情報を取得
@@ -351,13 +357,14 @@ if ( ! class_exists( 'Vk_post_type_manager' ) ) {
351
  $rest_api_true = ( empty( $taxonomy['rest_api'] ) ) ? false : true;
352
 
353
  $args = array(
354
- 'hierarchical' => $hierarchical_true,
355
  'update_count_callback' => '_update_post_term_count',
356
- 'label' => $taxonomy['label'],
357
- 'singular_label' => $taxonomy['label'],
358
- 'public' => true,
359
- 'show_ui' => true,
360
- 'show_in_rest' => $rest_api_true,
 
361
  );
362
 
363
  register_taxonomy(
@@ -377,8 +384,8 @@ if ( ! class_exists( 'Vk_post_type_manager' ) ) {
377
 
378
  }
379
 
380
- /*-------------------------------------------*/
381
- /* 実行
382
  /*-------------------------------------------*/
383
  public function __construct() {
384
  add_action( 'init', array( $this, 'add_post_type_post_type_manage' ) );
@@ -394,4 +401,4 @@ if ( ! class_exists( 'Vk_post_type_manager' ) ) {
394
 
395
  $Vk_post_type_manager = new Vk_post_type_manager();
396
 
397
- }
10
 
11
  class Vk_post_type_manager {
12
 
13
+ /*
14
+ カスタム投稿タイプ制御用投稿タイプを追加
15
  /*-------------------------------------------*/
16
  function add_post_type_post_type_manage() {
17
  global $vk_post_type_manager_textdomain;
35
  );
36
  }
37
 
38
+ /*
39
+ post_type_manage の編集権限を追加
40
  /*-------------------------------------------*/
41
  function add_cap_post_type_manage() {
42
  $role = get_role( 'administrator' );
56
  $role->add_cap( 'publish_others_' . $post_type_name . 's' );
57
  }
58
 
59
+ /*
60
+ meta box を作成
61
  /*-------------------------------------------*/
62
  // add meta_box
63
  function add_meta_box() {
68
  global $vk_post_type_manager_textdomain;
69
  global $post;
70
 
71
+ // CSRF対策の設定(フォームにhiddenフィールドとして追加するためのnonceを「'noncename__post_type_manager」として設定)
72
  wp_nonce_field( wp_create_nonce( __FILE__ ), 'noncename__post_type_manager' );
73
 
74
  ?>
83
  </style>
84
  <?php
85
 
86
+ /*
87
+ Post Type ID
88
  /*-------------------------------------------*/
89
  echo '<h4>' . __( 'Post Type ID(Required)', $vk_post_type_manager_textdomain ) . '</h4>';
90
  echo '<p>' . __( '20 characters or less in alphanumeric', $vk_post_type_manager_textdomain ) . '</p>';
101
  'revisions' => __( 'revisions', $vk_post_type_manager_textdomain ),
102
  );
103
 
104
+ /*
105
+ Supports(Required)
106
  /*-------------------------------------------*/
107
  echo '<h4>' . __( 'Supports(Required)', $vk_post_type_manager_textdomain ) . '</h4>';
108
  $post_type_items_value = get_post_meta( $post->ID, 'veu_post_type_items', true );
115
 
116
  echo '<hr>';
117
 
118
+ /*
119
+ Menu position
120
  /*-------------------------------------------*/
121
  echo '<h4>' . __( 'Menu position(optional)', $vk_post_type_manager_textdomain ) . '</h4>';
122
  echo '<p>' . __( 'Please enter a number.', $vk_post_type_manager_textdomain ) . '</p>';
124
 
125
  echo '<hr>';
126
 
127
+ /*
128
+ Export to Rest api
129
  /*-------------------------------------------*/
130
+ echo '<h4>' . __( 'Corresponds to the block editor ( optional )', $vk_post_type_manager_textdomain ) . '</h4>';
131
 
132
  // 現在保存されているカスタムフィールドの値を取得
133
  $export_to_api_value = get_post_meta( $post->ID, 'veu_post_type_export_to_api', true );
139
  $checked = '';
140
  }
141
 
142
+ echo '<label>' . '<input type="checkbox" id="veu_post_type_export_to_api" name="veu_post_type_export_to_api" value="true"' . $checked . '> ' . __( 'Corresponds to the block editor ( Export to REST API / optional )', $vk_post_type_manager_textdomain ). '</label>';
143
  echo '<p>' . __( 'If you want to use the block editor that, you have to use the REST API.', $vk_post_type_manager_textdomain ) . '</p>';
144
  echo '<hr>';
145
 
146
+ /*
147
+ Custom taxonomies
148
  /*-------------------------------------------*/
149
  echo '<h4>' . __( 'Custom taxonomies(optional)', $vk_post_type_manager_textdomain ) . '</h4>';
150
 
160
  $taxonomy = get_post_meta( $post->ID, 'veu_taxonomy', true );
161
 
162
  // if ( ! $taxonomy ){
163
+ // $taxonomy = array(array());
164
  // }
165
 
166
  for ( $i = 1; $i <= 3; $i++ ) {
202
  // チェックが元々入ってるかどうか
203
  $checked = ( isset( $taxonomy[ $i ]['rest_api'] ) && $taxonomy[ $i ]['rest_api'] ) ? ' checked' : '';
204
 
205
+ echo '<td>' . __( 'Corresponds to the block editor', $vk_post_type_manager_textdomain ) . '</td>';
206
+ echo '<td><label><input type="checkbox" id="veu_taxonomy[' . $i . '][rest_api]" name="veu_taxonomy[' . $i . '][rest_api]" value="true"' . $checked . '> ' . __( 'Corresponds to the block editor ( Export to REST API / optional )', $vk_post_type_manager_textdomain ) . '</label></td>';
207
  echo '</tr>';
208
 
209
  }
211
 
212
  }
213
 
214
+ /*
215
+ 入力された値の保存
216
  /*-------------------------------------------*/
217
 
218
  function save_cf_value( $post_id ) {
219
  global $post;
220
 
221
+ // 設定したnonce を取得(CSRF対策)
222
  $noncename__post_type_manager = isset( $_POST['noncename__post_type_manager'] ) ? $_POST['noncename__post_type_manager'] : null;
223
 
224
+ // nonce を確認し、値が書き換えられていれば、何もしない(CSRF対策)
225
  if ( ! wp_verify_nonce( $noncename__post_type_manager, wp_create_nonce( __FILE__ ) ) ) {
226
  return $post_id;
227
  }
228
 
229
+ // 自動保存ルーチンかどうかチェック。そうだった場合は何もしない(記事の自動保存処理として呼び出された場合の対策)
230
  if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
231
  return $post_id; }
232
 
275
  }
276
  }
277
 
278
+ /*
279
+ 登録したカスタム投稿タイプを実際に作成
 
280
  /*-------------------------------------------*/
281
 
282
  function add_post_type() {
292
  if ( $custom_post_types ) {
293
  foreach ( $custom_post_types as $key => $post ) {
294
 
295
+ /*
296
+ 投稿タイプ追加
297
  /*-------------------------------------------*/
298
  $labels = array(
299
  'name' => esc_html( $post->post_title ),
340
  // カスタム投稿タイプを発行
341
  register_post_type( $post_type_id, $args );
342
 
343
+ /*
344
+ カスタム分類を追加
345
  /*-------------------------------------------*/
346
 
347
  // カスタムフィールドに連想配列で格納しておいたカスタム分類の情報を取得
357
  $rest_api_true = ( empty( $taxonomy['rest_api'] ) ) ? false : true;
358
 
359
  $args = array(
360
+ 'hierarchical' => $hierarchical_true,
361
  'update_count_callback' => '_update_post_term_count',
362
+ 'label' => $taxonomy['label'],
363
+ 'singular_label' => $taxonomy['label'],
364
+ 'public' => true,
365
+ 'show_ui' => true,
366
+ 'show_in_rest' => $rest_api_true,
367
+ 'show_admin_column' => true,
368
  );
369
 
370
  register_taxonomy(
384
 
385
  }
386
 
387
+ /*
388
+ 実行
389
  /*-------------------------------------------*/
390
  public function __construct() {
391
  add_action( 'init', array( $this, 'add_post_type_post_type_manage' ) );
401
 
402
  $Vk_post_type_manager = new Vk_post_type_manager();
403
 
404
+ }
inc/sns/function_twitterCard.php CHANGED
@@ -27,19 +27,19 @@ function vkExUnit_add_twitterCard() {
27
 
28
  // domain
29
  preg_match( '/https?:\/\/(.+?)\//i', admin_url(), $match );
30
- // image size
31
- if ( isset( $vkExUnit_sns_options['twitterId'] ) && $vkExUnit_sns_options['twitterId'] ) :?>
32
  <!-- [ <?php echo veu_get_name(); ?> twitter card ] -->
33
  <meta name="twitter:card" content="summary_large_image">
34
  <meta name="twitter:description" content="<?php echo esc_attr( vk_get_page_description() ); ?>">
35
  <meta name="twitter:title" content="<?php echo esc_attr( veu_get_the_sns_title() ); ?>">
36
  <meta name="twitter:url" content="<?php echo esc_url( $linkUrl ); ?>">
37
- <?php if ( isset( $card_image_url ) && $card_image_url ) { ?>
38
  <meta name="twitter:image" content="<?php echo esc_url( $card_image_url ); ?>">
39
- <?php } ?>
40
  <meta name="twitter:domain" content="<?php echo esc_attr( $match[1] ); ?>">
 
41
  <meta name="twitter:site" content="@<?php echo esc_attr( $vkExUnit_sns_options['twitterId'] ); ?>">
 
42
  <!-- [ / <?php echo veu_get_name(); ?> twitter card ] -->
43
  <?php
44
- endif;
45
  }
27
 
28
  // domain
29
  preg_match( '/https?:\/\/(.+?)\//i', admin_url(), $match );
30
+ ?>
 
31
  <!-- [ <?php echo veu_get_name(); ?> twitter card ] -->
32
  <meta name="twitter:card" content="summary_large_image">
33
  <meta name="twitter:description" content="<?php echo esc_attr( vk_get_page_description() ); ?>">
34
  <meta name="twitter:title" content="<?php echo esc_attr( veu_get_the_sns_title() ); ?>">
35
  <meta name="twitter:url" content="<?php echo esc_url( $linkUrl ); ?>">
36
+ <?php if ( isset( $card_image_url ) && $card_image_url ) { ?>
37
  <meta name="twitter:image" content="<?php echo esc_url( $card_image_url ); ?>">
38
+ <?php } ?>
39
  <meta name="twitter:domain" content="<?php echo esc_attr( $match[1] ); ?>">
40
+ <?php if ( isset( $vkExUnit_sns_options['twitterId'] ) && $vkExUnit_sns_options['twitterId'] ) : ?>
41
  <meta name="twitter:site" content="@<?php echo esc_attr( $vkExUnit_sns_options['twitterId'] ); ?>">
42
+ <?php endif; ?>
43
  <!-- [ / <?php echo veu_get_name(); ?> twitter card ] -->
44
  <?php
 
45
  }
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.0.0
6
  Tested up to: 5.4.0
7
- Stable tag: 9.16.2.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -93,6 +93,11 @@ e.g.
93
 
94
  == Changelog ==
95
 
 
 
 
 
 
96
  = 9.16.2.0 =
97
  [ bug fix ][ Block 0.26.7 ] merely js rebuild
98
 
4
  Tags: Google Analytics, New posts, Related Posts, sitemap, sns, twitter card, Facebook Page Plugin, OG tags,
5
  Requires at least: 5.0.0
6
  Tested up to: 5.4.0
7
+ Stable tag: 9.17.0.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
93
 
94
  == Changelog ==
95
 
96
+ = 9.17.0.0 =
97
+ [ Specification change ][ sns twitter card ] Print Twitter Card if Twitter ID no setted
98
+ [ Post Type Manager ] Improved REST API description
99
+ [ Post Type Manager ] Add term column to admin column
100
+
101
  = 9.16.2.0 =
102
  [ bug fix ][ Block 0.26.7 ] merely js rebuild
103
 
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.16.2.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.17.0.0
7
  * Author: Vektor,Inc.
8
  * Text Domain: vk-all-in-one-expansion-unit
9
  * Domain Path: /languages