VK All in One Expansion Unit - Version 8.0.6

Version Description

[ Specification change ][ Auto Eye Catch ] AAdd post type filter hook

Download this release

Release Info

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

Code changes from version 8.0.5 to 8.0.6

Files changed (3) hide show
  1. plugins/auto_eyecatch.php +23 -14
  2. readme.txt +4 -1
  3. vkExUnit.php +1 -1
plugins/auto_eyecatch.php CHANGED
@@ -11,8 +11,6 @@
11
  class vExUnit_eyecatch {
12
  private static $instance;
13
 
14
- public static $allowed_post_types = array( 'post', 'page' );
15
-
16
  public static function instance() {
17
  if ( isset( self::$instance ) ) {
18
  return self::$instance; }
@@ -22,21 +20,27 @@ class vExUnit_eyecatch {
22
  return self::$instance;
23
  }
24
 
25
-
26
  private function __construct() {
27
- /*** do noting ***/
28
  }
29
 
30
 
31
  protected function run_init() {
32
  add_action( 'admin_menu', array( $this, 'add_custom_field' ) );
33
- add_action( 'save_post' , array( $this, 'save_custom_field' ) );
34
- add_filter( 'the_content', array( $this, 'set_eyecatch' ), 1 );
35
  }
36
 
 
 
 
 
37
 
38
  public function add_custom_field() {
39
- foreach ( self::$allowed_post_types as $post_type ) {
 
 
 
40
  add_meta_box( 'vkExUnit_EyeCatch', __( 'Automatic EyeCatch', 'vkExUnit' ), array( $this, 'render_meta_box' ), $post_type, 'normal', 'high' );
41
  }
42
  }
@@ -46,8 +50,8 @@ class vExUnit_eyecatch {
46
  global $post;
47
  $disable_autoeyecatch = get_post_meta( get_the_id(), 'vkExUnit_EyeCatch_disable', true );
48
 
49
- echo '<input type="hidden" name="_nonce_vkExUnit__custom_auto_eyecatch" id="_nonce_vkExUnit__custom_auto_eyecatch_noonce" value="'.wp_create_nonce( "vkEx_AYC_" . get_the_id() ).'" />';
50
- echo '<label ><input type="checkbox" name="vkExUnit_auto_eyecatch" value="true" ' . ( ($disable_autoeyecatch)? 'checked' : '' ) . ' />'.__( 'Do not set eyecatch image automatic.', 'vkExUnit' ).'</label>';
51
 
52
  }
53
 
@@ -62,7 +66,7 @@ class vExUnit_eyecatch {
62
  if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
63
  return $post_id; }
64
 
65
- if ( ! wp_verify_nonce( $metaKeyword, "vkEx_AYC_" . $post_id ) ) {
66
  return $post_id;
67
  }
68
 
@@ -75,14 +79,18 @@ class vExUnit_eyecatch {
75
 
76
  public static function is_my_turn() {
77
 
78
- if ( vkExUnit_is_excerpt() ) { return false; }
 
79
 
80
  global $is_pagewidget;
81
- if( $is_pagewidget ){ return false; }
 
82
 
83
  if ( get_the_id() ) {
84
 
85
- if ( in_array( get_post_type( get_the_id() ), self::$allowed_post_types ) ) {
 
 
86
 
87
  if ( has_post_thumbnail( get_the_id() ) ) {
88
 
@@ -100,7 +108,8 @@ class vExUnit_eyecatch {
100
 
101
  public function set_eyecatch( $content ) {
102
 
103
- if ( ! self::is_my_turn() ) { return $content; }
 
104
 
105
  $imageHtml = self::render_eyecatch( get_the_id() );
106
 
11
  class vExUnit_eyecatch {
12
  private static $instance;
13
 
 
 
14
  public static function instance() {
15
  if ( isset( self::$instance ) ) {
16
  return self::$instance; }
20
  return self::$instance;
21
  }
22
 
 
23
  private function __construct() {
24
+ /*** do noting */
25
  }
26
 
27
 
28
  protected function run_init() {
29
  add_action( 'admin_menu', array( $this, 'add_custom_field' ) );
30
+ add_action( 'save_post', array( $this, 'save_custom_field' ) );
31
+ add_filter( 'the_content', array( $this, 'set_eyecatch' ), 1 );
32
  }
33
 
34
+ public static function post_types() {
35
+ $allowed_post_types = array( 'post', 'page' );
36
+ return apply_filters( 'veu_auto_eye_chatch_post_types', $allowed_post_types );
37
+ }
38
 
39
  public function add_custom_field() {
40
+
41
+ $post_types = self::post_types();
42
+
43
+ foreach ( $post_types as $post_type ) {
44
  add_meta_box( 'vkExUnit_EyeCatch', __( 'Automatic EyeCatch', 'vkExUnit' ), array( $this, 'render_meta_box' ), $post_type, 'normal', 'high' );
45
  }
46
  }
50
  global $post;
51
  $disable_autoeyecatch = get_post_meta( get_the_id(), 'vkExUnit_EyeCatch_disable', true );
52
 
53
+ echo '<input type="hidden" name="_nonce_vkExUnit__custom_auto_eyecatch" id="_nonce_vkExUnit__custom_auto_eyecatch_noonce" value="' . wp_create_nonce( 'vkEx_AYC_' . get_the_id() ) . '" />';
54
+ echo '<label ><input type="checkbox" name="vkExUnit_auto_eyecatch" value="true" ' . ( ( $disable_autoeyecatch ) ? 'checked' : '' ) . ' />' . __( 'Do not set eyecatch image automatic.', 'vkExUnit' ) . '</label>';
55
 
56
  }
57
 
66
  if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
67
  return $post_id; }
68
 
69
+ if ( ! wp_verify_nonce( $metaKeyword, 'vkEx_AYC_' . $post_id ) ) {
70
  return $post_id;
71
  }
72
 
79
 
80
  public static function is_my_turn() {
81
 
82
+ if ( vkExUnit_is_excerpt() ) {
83
+ return false; }
84
 
85
  global $is_pagewidget;
86
+ if ( $is_pagewidget ) {
87
+ return false; }
88
 
89
  if ( get_the_id() ) {
90
 
91
+ $post_types = self::post_types();
92
+
93
+ if ( in_array( get_post_type( get_the_id() ), $post_types ) ) {
94
 
95
  if ( has_post_thumbnail( get_the_id() ) ) {
96
 
108
 
109
  public function set_eyecatch( $content ) {
110
 
111
+ if ( ! self::is_my_turn() ) {
112
+ return $content; }
113
 
114
  $imageHtml = self::render_eyecatch( get_the_id() );
115
 
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: 4.4
6
  Tested up to: 5.1.1
7
- Stable tag: 8.0.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -86,6 +86,9 @@ e.g.
86
 
87
  == Changelog ==
88
 
 
 
 
89
  = 8.0.5 =
90
  [ Bug fix ][ main setting page ] Admin page image uploader select button not transrated
91
 
4
  Tags: Google Analytics, New posts, Related Posts, sitemap, sns, twitter card, Facebook Page Plugin, OG tags,
5
  Requires at least: 4.4
6
  Tested up to: 5.1.1
7
+ Stable tag: 8.0.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
86
 
87
  == Changelog ==
88
 
89
+ = 8.0.6 =
90
+ [ Specification change ][ Auto Eye Catch ] AAdd post type filter hook
91
+
92
  = 8.0.5 =
93
  [ Bug fix ][ main setting page ] Admin page image uploader select button not transrated
94
 
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: 8.0.5
7
  * Author: Vektor,Inc.
8
  * Text Domain: vkExUnit
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: 8.0.6
7
  * Author: Vektor,Inc.
8
  * Text Domain: vkExUnit
9
  * Domain Path: /languages