Genesis Simple Share - Version 1.0.3

Version Description

  • Fix error resulting in double icon output
Download this release

Release Info

Developer Nick_theGeek
Plugin Icon 128x128 Genesis Simple Share
Version 1.0.3
Comparing to
See all releases

Code changes from version 1.0.2 to 1.0.3

Files changed (3) hide show
  1. lib/front-end.php +8 -7
  2. plugin.php +1 -1
  3. readme.txt +4 -1
lib/front-end.php CHANGED
@@ -28,7 +28,6 @@ class Gensis_Simple_Share_Front_End {
28
  var $appearance;
29
  var $size;
30
  var $archive;
31
- var $location_count;
32
  var $locations = array();
33
 
34
  /**
@@ -153,7 +152,7 @@ class Gensis_Simple_Share_Front_End {
153
  add_filter( 'the_content', array( $this, 'icon_output' ), 15 );
154
  add_filter( 'the_excerpt', array( $this, 'icon_output' ), 15 );
155
 
156
- if( genesis_get_option( 'content_archive_limit' ) && 'full' == genesis_get_option( 'content_archive' ) ){
157
  add_action( 'genesis_post_content' , array( $this, 'before_entry_icons' ), 9 );
158
  add_action( 'genesis_entry_content', array( $this, 'before_entry_icons' ), 9 );
159
  add_action( 'genesis_post_content' , array( $this, 'after_entry_icons' ), 11 );
@@ -319,8 +318,10 @@ class Gensis_Simple_Share_Front_End {
319
  return;
320
  }
321
 
322
- if( in_array( $location . $this->location_count . '-' . get_the_ID(), $this->locations ) ){
323
- $this->location_count = $this->location_count ? $this->location_count++ : 2;
 
 
324
  }
325
 
326
  if( empty( $icons ) ||
@@ -349,7 +350,7 @@ class Gensis_Simple_Share_Front_End {
349
 
350
  $shares[] = $icon .': true';
351
 
352
- $div_id = strtolower( $icon .'-'. $location . $this->location_count .'-'. $id );
353
 
354
  $image = ( $image = genesis_get_image( array( 'format' => 'url', 'size' => 'full' ) ) ) ? $image : $this->get_first_image();
355
 
@@ -437,7 +438,7 @@ class Gensis_Simple_Share_Front_End {
437
 
438
  $divs = implode( '', $buttons );
439
 
440
- $div_id = 'share-'. $location . $this->location_count .'-' . $id;
441
 
442
  $div = sprintf( '<div class="share-%s share-%s share-%s" id="%s">%s</div>',
443
  $location,
@@ -454,7 +455,7 @@ class Gensis_Simple_Share_Front_End {
454
  });
455
  </script>";
456
 
457
- $this->locations[] = $location . $this->location_count . '-' . get_the_ID();
458
 
459
  return $div . $script;
460
 
28
  var $appearance;
29
  var $size;
30
  var $archive;
 
31
  var $locations = array();
32
 
33
  /**
152
  add_filter( 'the_content', array( $this, 'icon_output' ), 15 );
153
  add_filter( 'the_excerpt', array( $this, 'icon_output' ), 15 );
154
 
155
+ if( genesis_get_option( 'content_archive_limit' ) && 'full' == genesis_get_option( 'content_archive' ) && $this->is_archive() ){
156
  add_action( 'genesis_post_content' , array( $this, 'before_entry_icons' ), 9 );
157
  add_action( 'genesis_entry_content', array( $this, 'before_entry_icons' ), 9 );
158
  add_action( 'genesis_post_content' , array( $this, 'after_entry_icons' ), 11 );
318
  return;
319
  }
320
 
321
+ $filter = 'the_excerpt' == current_filter() ? 'excerpt' : '';
322
+
323
+ if( in_array( $location . $filter . '-' . get_the_ID(), $this->locations ) ){
324
+ return '<!-- Genesis Simple Share error: This location has already been used. -->';
325
  }
326
 
327
  if( empty( $icons ) ||
350
 
351
  $shares[] = $icon .': true';
352
 
353
+ $div_id = strtolower( $icon .'-'. $location .'-'. $id );
354
 
355
  $image = ( $image = genesis_get_image( array( 'format' => 'url', 'size' => 'full' ) ) ) ? $image : $this->get_first_image();
356
 
438
 
439
  $divs = implode( '', $buttons );
440
 
441
+ $div_id = 'share-'. $location . '-' . $id;
442
 
443
  $div = sprintf( '<div class="share-%s share-%s share-%s" id="%s">%s</div>',
444
  $location,
455
  });
456
  </script>";
457
 
458
+ $this->locations[] = $location . $filter . '-' . get_the_ID();
459
 
460
  return $div . $script;
461
 
plugin.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Genesis Simple Share
4
  Plugin URI:
5
  Description: A simple sharing plugin using the Share script.
6
- Version: 1.0.2
7
  Author: copyblogger
8
  Author URI: http://www.copyblogger.com
9
  Text Domain: genesis-simple-share
3
  Plugin Name: Genesis Simple Share
4
  Plugin URI:
5
  Description: A simple sharing plugin using the Share script.
6
+ Version: 1.0.3
7
  Author: copyblogger
8
  Author URI: http://www.copyblogger.com
9
  Text Domain: genesis-simple-share
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: nathanrice, studiopress, wpmuguru, nick_thegeek, bgardner
3
  Tags: genesis, share, share buttons, facebook, twitter, pinterest, stumbleupon, linkedin, social
4
  Requires at least: 3.7
5
  Tested up to: 4.1
6
- Stable tag: 1.0.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -31,6 +31,9 @@ https://github.com/copyblogger/genesis-simple-share/wiki/Usage-Tips
31
 
32
  == Changelog ==
33
 
 
 
 
34
  = 1.0.2 =
35
  * Fix error where icons do not show in archives when showing the excerpt
36
 
3
  Tags: genesis, share, share buttons, facebook, twitter, pinterest, stumbleupon, linkedin, social
4
  Requires at least: 3.7
5
  Tested up to: 4.1
6
+ Stable tag: 1.0.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
31
 
32
  == Changelog ==
33
 
34
+ = 1.0.3 =
35
+ * Fix error resulting in double icon output
36
+
37
  = 1.0.2 =
38
  * Fix error where icons do not show in archives when showing the excerpt
39