VK All in One Expansion Unit - Version 2.1.2

Version Description

Download this release

Release Info

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

Code changes from version 2.1.1 to 2.1.2

plugins/call_to_action/class.call_to_action.php CHANGED
@@ -320,11 +320,18 @@ jQuery(document).ready(function($){
320
 
321
 
322
  public function content_filter( $content ){
 
323
  $content .= self::render_cta_content( $this->is_cta_id() );
324
  return $content;
325
  }
326
 
327
 
 
 
 
 
 
 
328
  public function sanitize_config( $input ){
329
  $posttypes = array_merge( array( 'post'=>'post', 'page'=>'page' ), get_post_types( array( 'public'=>true, '_builtin'=>false ), 'names' ) );
330
  $option = get_option( 'vkExUnit_cta_settings' );
320
 
321
 
322
  public function content_filter( $content ){
323
+ if( self::is_pagewidget() ) return $content;
324
  $content .= self::render_cta_content( $this->is_cta_id() );
325
  return $content;
326
  }
327
 
328
 
329
+ public static function is_pagewidget(){
330
+ global $is_pagewidget;
331
+ return ($is_pagewidget)? true : false;
332
+ }
333
+
334
+
335
  public function sanitize_config( $input ){
336
  $posttypes = array_merge( array( 'post'=>'post', 'page'=>'page' ), get_post_types( array( 'public'=>true, '_builtin'=>false ), 'names' ) );
337
  $option = get_option( 'vkExUnit_cta_settings' );
plugins/call_to_action/view.actionbox.php CHANGED
@@ -3,12 +3,9 @@
3
  $btn_text = get_post_meta( $id, 'vkExUnit_cta_button_text', true );
4
  $url = get_post_meta( $id, 'vkExUnit_cta_url', true );
5
  $text = get_post_meta( $id, 'vkExUnit_cta_text', true);
6
- $text = preg_replace('/\n/', '<br/>', $text);
7
  $imgid = get_post_meta( $id, 'vkExUnit_cta_img', true);
8
 
9
- if (isset($imgid) && $imgid){
10
- $cta_image = wp_get_attachment_image_src($imgid,full);
11
- }
12
 
13
  $image_position = get_post_meta( $id, 'vkExUnit_cta_img_position', true);
14
  if(!$image_position){ $image_position = 'right'; }
@@ -18,6 +15,7 @@ $content .= '<section class="vkExUnit_cta">';
18
  $content .= '<h1 class="vkExUnit_cta_title">' . $post->post_title . '</h1>';
19
  $content .= '<div class="vkExUnit_cta_body">';
20
  if( $imgid ){
 
21
  $content .= '<div class="vkExUnit_cta_body_image vkExUnit_cta_body_image_'.$image_position.'">';
22
  $content .= '<img src="'. $cta_image[0] .'" />';
23
  $content .= '</div>';
3
  $btn_text = get_post_meta( $id, 'vkExUnit_cta_button_text', true );
4
  $url = get_post_meta( $id, 'vkExUnit_cta_url', true );
5
  $text = get_post_meta( $id, 'vkExUnit_cta_text', true);
6
+ $text = preg_replace('/\n/', '<br/>', $text);
7
  $imgid = get_post_meta( $id, 'vkExUnit_cta_img', true);
8
 
 
 
 
9
 
10
  $image_position = get_post_meta( $id, 'vkExUnit_cta_img_position', true);
11
  if(!$image_position){ $image_position = 'right'; }
15
  $content .= '<h1 class="vkExUnit_cta_title">' . $post->post_title . '</h1>';
16
  $content .= '<div class="vkExUnit_cta_body">';
17
  if( $imgid ){
18
+ $cta_image = wp_get_attachment_image_src( $imgid, 'full' );
19
  $content .= '<div class="vkExUnit_cta_body_image vkExUnit_cta_body_image_'.$image_position.'">';
20
  $content .= '<img src="'. $cta_image[0] .'" />';
21
  $content .= '</div>';
plugins/insert_ads.php CHANGED
@@ -43,6 +43,8 @@ class vExUnit_Ads {
43
 
44
 
45
  public function set_content($content){
 
 
46
  $option = $this->get_option();
47
 
48
  $content = preg_replace('/(<span id="more-[0-9]+"><\/span>)/', '$1'.'[vkExUnit_ad area=more]' , $content);
@@ -65,25 +67,21 @@ class vExUnit_Ads {
65
 
66
 
67
  private function render_ad( $ads ,$area='more'){
68
- // Display only post
69
- if( get_post_type() == 'post'){
70
-
71
- if( !$ads[0] ) return '';
72
- $class = "col-md-12";
73
- if( isset($ads[1]) && $ads[1] ) $class="col-md-6";
74
-
75
- $content = '';
76
- $content .= '<aside class="row vkExUnit_insertAds '.$area.'">';
77
- foreach($ads as $ad){
78
- if(!$ad) break;
79
-
80
- $content .= '<div class="'.$class.'">';
81
- $content .= $ad;
82
- $content .= '</div>';
83
- }
84
- $content .= '</aside>';
85
- return $content;
86
- } // if( get_post_type() == 'post'){
87
  }
88
 
89
 
43
 
44
 
45
  public function set_content($content){
46
+ if( get_post_type() != 'post' ){ return $content; }
47
+
48
  $option = $this->get_option();
49
 
50
  $content = preg_replace('/(<span id="more-[0-9]+"><\/span>)/', '$1'.'[vkExUnit_ad area=more]' , $content);
67
 
68
 
69
  private function render_ad( $ads ,$area='more'){
70
+ if( !$ads[0] ) return '';
71
+ $class = "col-md-12";
72
+ if( isset($ads[1]) && $ads[1] ) $class="col-md-6";
73
+
74
+ $content = '';
75
+ $content .= '<aside class="row vkExUnit_insertAds '.$area.'">';
76
+ foreach($ads as $ad){
77
+ if(!$ad) break;
78
+
79
+ $content .= '<div class="'.$class.'">';
80
+ $content .= $ad;
81
+ $content .= '</div>';
82
+ }
83
+ $content .= '</aside>';
84
+ return $content;
 
 
 
 
85
  }
86
 
87
 
plugins/other_widget/widget-page.php CHANGED
@@ -15,7 +15,10 @@ class WP_Widget_vkExUnit_widget_page extends WP_Widget {
15
  }
16
 
17
  function widget($args, $instance){
 
 
18
  $this->display_page($instance['page_id'],$instance['set_title']);
 
19
  }
20
 
21
  function form($instance){
@@ -52,9 +55,9 @@ class WP_Widget_vkExUnit_widget_page extends WP_Widget {
52
  $page = get_page($pageid);
53
  echo PHP_EOL.'<div id="widget-page-'.$pageid.'" class="widget widget_pageContent">'.PHP_EOL;
54
  if($titleflag){ echo '<h1 class="widget-title">'.$page->post_title.'</h1>'.PHP_EOL; }
55
- remove_filter( 'the_content', 'vkExUnit_add_snsBtns' );
56
  echo apply_filters('the_content', $page->post_content );
57
- add_filter( 'the_content', 'vkExUnit_add_snsBtns');
58
 
59
  if ( is_user_logged_in() == TRUE ) {
60
  global $user_level;
15
  }
16
 
17
  function widget($args, $instance){
18
+ global $is_pagewidget;
19
+ $is_pagewidget = true;
20
  $this->display_page($instance['page_id'],$instance['set_title']);
21
+ $is_pagewidget = false;
22
  }
23
 
24
  function form($instance){
55
  $page = get_page($pageid);
56
  echo PHP_EOL.'<div id="widget-page-'.$pageid.'" class="widget widget_pageContent">'.PHP_EOL;
57
  if($titleflag){ echo '<h1 class="widget-title">'.$page->post_title.'</h1>'.PHP_EOL; }
58
+ remove_filter( 'the_content', 'vkExUnit_add_snsBtns', 200, 1 );
59
  echo apply_filters('the_content', $page->post_content );
60
+ add_filter( 'the_content', 'vkExUnit_add_snsBtns', 200, 1);
61
 
62
  if ( is_user_logged_in() == TRUE ) {
63
  global $user_level;
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.2
6
  Tested up to: 4.2
7
- Stable tag: 2.1.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
4
  Tags: Google Analytics, New posts, Related Posts, sitemap, sns, twitter card, Facebook Page Plugin, OG tags,
5
  Requires at least: 4.2
6
  Tested up to: 4.2
7
+ Stable tag: 2.1.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
vkExUnit.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: VK All in One Expansion Unit
4
  Plugin URI: https://github.com/kurudrive/VK-All-in-one-Expansion-Unit
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: 2.1.1
7
  Author: Vektor,Inc.
8
  Author URI: http://vektor-inc.co.jp
9
  License: GPL2
3
  Plugin Name: VK All in One Expansion Unit
4
  Plugin URI: https://github.com/kurudrive/VK-All-in-one-Expansion-Unit
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: 2.1.2
7
  Author: Vektor,Inc.
8
  Author URI: http://vektor-inc.co.jp
9
  License: GPL2