WordPress Share Buttons Plugin – AddThis - Version 5.1.2

Version Description

  • Resolves a bug where above excerpt sharing buttons would be added whenever below excerpt sharing buttons were enabled
  • Adding back in the addthis_post_exclude filter
Download this release

Release Info

Developer jgrodel
Plugin Icon 128x128 WordPress Share Buttons Plugin – AddThis
Version 5.1.2
Comparing to
See all releases

Code changes from version 5.1.1 to 5.1.2

AddThisWordPressSharingButtonsPlugin.php CHANGED
@@ -25,7 +25,7 @@ if (!class_exists('AddThisWordPressSharingButtonsPlugin')) {
25
  Class AddThisWordPressSharingButtonsPlugin {
26
  // implements AddThisWordPressPluginInterface {
27
 
28
- static $version = '5.1.1';
29
  static $settingsPageId = 'addthis_social_widget';
30
  static $name = "AddThis Sharing Buttons";
31
  static $productPrefix = 'wpp';
25
  Class AddThisWordPressSharingButtonsPlugin {
26
  // implements AddThisWordPressPluginInterface {
27
 
28
+ static $version = '5.1.2';
29
  static $settingsPageId = 'addthis_social_widget';
30
  static $name = "AddThis Sharing Buttons";
31
  static $productPrefix = 'wpp';
addthis_social_widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: AddThis Sharing Buttons
4
  * Plugin URI: http://www.addthis.com
5
  * Description: Use the AddThis suite of website tools which includes sharing, following, recommended content, and conversion tools to help you make your website smarter. With AddThis, you can see how your users are engaging with your content, provide a personalized experience for each user and encourage them to share, subscribe or follow.
6
- * Version: 5.1.1
7
  * Author: The AddThis Team
8
  * Author URI: http://www.addthis.com/
9
  * License: GPL2
@@ -1081,11 +1081,10 @@ if ($addthis_options['addthis_plugin_controls'] == "AddThis") {
1081
  $checkForToolbox = "addthis_toolbox";
1082
  $checkForButton = "addthis_button";
1083
 
1084
- if ( _addthis_excerpt_buttons_enabled()
1085
- && strpos($content, $checkForToolbox) === false
1086
  && strpos($content, $checkForButton) === false
1087
  ) {
1088
- $content = addthis_display_social_widget($content, false, false);
1089
  }
1090
 
1091
  return $content;
@@ -1222,7 +1221,7 @@ if ($addthis_options['addthis_plugin_controls'] == "AddThis") {
1222
  return $below;
1223
  }
1224
 
1225
- function addthis_display_social_widget($content, $filtered = true, $below_excerpt = false)
1226
  {
1227
  global $addthis_styles, $addthis_new_styles, $post;
1228
  global $addThisConfigs;
@@ -1242,8 +1241,8 @@ if ($addthis_options['addthis_plugin_controls'] == "AddThis") {
1242
 
1243
  $aboveFieldName = $fieldList['above']['fieldName'];
1244
  $belowFieldName = $fieldList['below']['fieldName'];
1245
- $displayAbove = (isset($options[$aboveFieldName]) && $options[$aboveFieldName] == true ) ? true : false;
1246
- $displayBelow = (isset($options[$belowFieldName]) && $options[$belowFieldName] == true ) ? true : false;
1247
  } else {
1248
  $displayAbove = false;
1249
  $displayBelow = false;
@@ -1270,6 +1269,9 @@ if ($addthis_options['addthis_plugin_controls'] == "AddThis") {
1270
  $displayBelow = false;
1271
  }
1272
 
 
 
 
1273
  remove_filter('wp_trim_excerpt', 'addthis_remove_tag', 9, 1);
1274
  remove_filter('get_the_excerpt', 'addthis_late_widget');
1275
  $identifier = addthis_get_identifier();
@@ -1279,6 +1281,7 @@ if ($addthis_options['addthis_plugin_controls'] == "AddThis") {
1279
  && $options['above'] != 'none'
1280
  && $options['above'] != 'disable'
1281
  && $displayAbove
 
1282
  ) {
1283
  $above = addthis_display_widget_above($styles, $options);
1284
  } elseif ($displayAbove) {
@@ -1291,7 +1294,7 @@ if ($addthis_options['addthis_plugin_controls'] == "AddThis") {
1291
  && $options['below'] != 'none'
1292
  && $options['below'] != 'disable'
1293
  && $displayBelow
1294
- && ! $below_excerpt
1295
  ) {
1296
  $below = addthis_display_widget_below($styles, $options);
1297
  } elseif ( $below_excerpt
3
  * Plugin Name: AddThis Sharing Buttons
4
  * Plugin URI: http://www.addthis.com
5
  * Description: Use the AddThis suite of website tools which includes sharing, following, recommended content, and conversion tools to help you make your website smarter. With AddThis, you can see how your users are engaging with your content, provide a personalized experience for each user and encourage them to share, subscribe or follow.
6
+ * Version: 5.1.2
7
  * Author: The AddThis Team
8
  * Author URI: http://www.addthis.com/
9
  * License: GPL2
1081
  $checkForToolbox = "addthis_toolbox";
1082
  $checkForButton = "addthis_button";
1083
 
1084
+ if (strpos($content, $checkForToolbox) === false
 
1085
  && strpos($content, $checkForButton) === false
1086
  ) {
1087
+ $content = addthis_display_social_widget($content, false, true);
1088
  }
1089
 
1090
  return $content;
1221
  return $below;
1222
  }
1223
 
1224
+ function addthis_display_social_widget($content, $filtered = true, $excerpt = false)
1225
  {
1226
  global $addthis_styles, $addthis_new_styles, $post;
1227
  global $addThisConfigs;
1241
 
1242
  $aboveFieldName = $fieldList['above']['fieldName'];
1243
  $belowFieldName = $fieldList['below']['fieldName'];
1244
+ $displayAbove = !empty($options[$aboveFieldName]);
1245
+ $displayBelow = !empty($options[$belowFieldName]);
1246
  } else {
1247
  $displayAbove = false;
1248
  $displayBelow = false;
1269
  $displayBelow = false;
1270
  }
1271
 
1272
+ $displayAbove = apply_filters('addthis_post_exclude', $displayAbove);
1273
+ $displayBelow = apply_filters('addthis_post_exclude', $displayBelow);
1274
+
1275
  remove_filter('wp_trim_excerpt', 'addthis_remove_tag', 9, 1);
1276
  remove_filter('get_the_excerpt', 'addthis_late_widget');
1277
  $identifier = addthis_get_identifier();
1281
  && $options['above'] != 'none'
1282
  && $options['above'] != 'disable'
1283
  && $displayAbove
1284
+ && (!$excerpt || _addthis_excerpt_buttons_enabled_above())
1285
  ) {
1286
  $above = addthis_display_widget_above($styles, $options);
1287
  } elseif ($displayAbove) {
1294
  && $options['below'] != 'none'
1295
  && $options['below'] != 'disable'
1296
  && $displayBelow
1297
+ && (!$excerpt || _addthis_excerpt_buttons_enabled_below())
1298
  ) {
1299
  $below = addthis_display_widget_below($styles, $options);
1300
  } elseif ( $below_excerpt
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: abramsm, srijith.v, vipinss, dnrahamim, jgrodel, bradaddthiscom, m
3
  Tags: AddThis, addtoany, bookmark, bookmarking, email, e-mail, sharing buttons, share, share this, facebook, google+, pinterest, instagram, linkedin, whatsapp, social tools, website tools, twitter, content marketing, recommended content, conversion tool, subscription button, conversion tools, email tools, ecommerce tools, social marketing, personalization tools
4
  Requires at least: 3.0
5
  Tested up to: 4.3
6
- Stable tag: 5.1.1
7
 
8
  AddThis provides the best sharing tools to help you make your website smarter.
9
 
@@ -76,13 +76,17 @@ In the screen options you can enable the AddThis meta box. Check the box and sav
76
 
77
  == Changelog ==
78
 
 
 
 
 
79
  = 5.1.1 =
80
  * PHP notice at addthis_social_widget.php:1337
81
  * PHP error for older versions of PHP (< 5.3.0) at addthis_settings_functions.php:476
82
  * Adding select configs and page info into addthis_plugin_info to aide <a href="http://support.addthis.com/">the AddThis Support Team</a> with troubleshooting
83
 
84
  = 5.1.0 =
85
- * New feature: set your own addthis.layers() paramaters to customize further using our API (in WordPress mode only)
86
  * Fixing a bug with the AddThis Sharing Buttons meta box not showing up for users in AddThis mode when editing posts
87
  * Fixing a bug with addthis_config where the JSON wasn't always checked before submitting the settings form
88
  * Fixing a bug with the sharing sidebar, where the theme for the sidebar was used for all AddThis layers tools (in WordPress mode)
@@ -381,13 +385,17 @@ Fixed nondeterministic bug with the_title(), causing the title to occasionally a
381
 
382
  == Upgrade Notice ==
383
 
 
 
 
 
384
  = 5.1.1 =
385
  * PHP notice at addthis_social_widget.php:1337
386
  * PHP error for older versions of PHP (< 5.3.0) at addthis_settings_functions.php:476
387
  * Adding select configs and page info into addthis_plugin_info to aide <a href="http://support.addthis.com/">the AddThis Support Team</a> with troubleshooting
388
 
389
  = 5.1.0 =
390
- * New feature: set your own addthis.layers() paramaters to customize further using our API (in WordPress mode only)
391
  * Fixing a bug with the AddThis Sharing Buttons meta box not showing up for users in AddThis mode when editing posts
392
  * Fixing a bug with addthis_config where the JSON wasn't always checked before submitting the settings form
393
  * Fixing a bug with the sharing sidebar, where the theme for the sidebar was used for all AddThis layers tools (in WordPress mode)
3
  Tags: AddThis, addtoany, bookmark, bookmarking, email, e-mail, sharing buttons, share, share this, facebook, google+, pinterest, instagram, linkedin, whatsapp, social tools, website tools, twitter, content marketing, recommended content, conversion tool, subscription button, conversion tools, email tools, ecommerce tools, social marketing, personalization tools
4
  Requires at least: 3.0
5
  Tested up to: 4.3
6
+ Stable tag: 5.1.2
7
 
8
  AddThis provides the best sharing tools to help you make your website smarter.
9
 
76
 
77
  == Changelog ==
78
 
79
+ = 5.1.2 =
80
+ * Resolves a bug where above excerpt sharing buttons would be added whenever below excerpt sharing buttons were enabled
81
+ * Adding back in the addthis_post_exclude filter
82
+
83
  = 5.1.1 =
84
  * PHP notice at addthis_social_widget.php:1337
85
  * PHP error for older versions of PHP (< 5.3.0) at addthis_settings_functions.php:476
86
  * Adding select configs and page info into addthis_plugin_info to aide <a href="http://support.addthis.com/">the AddThis Support Team</a> with troubleshooting
87
 
88
  = 5.1.0 =
89
+ * New feature: set your own addthis.layers() paramaters to customize further using our <a href="http://support.addthis.com/customer/portal/articles/1200473-smart-layers-api">Smart Layers API</a> (in WordPress mode only)
90
  * Fixing a bug with the AddThis Sharing Buttons meta box not showing up for users in AddThis mode when editing posts
91
  * Fixing a bug with addthis_config where the JSON wasn't always checked before submitting the settings form
92
  * Fixing a bug with the sharing sidebar, where the theme for the sidebar was used for all AddThis layers tools (in WordPress mode)
385
 
386
  == Upgrade Notice ==
387
 
388
+ = 5.1.2=
389
+ * Resolves a bug where above excerpt sharing buttons would be added whenever below excerpt sharing buttons were enabled
390
+ * Adding back in the addthis_post_exclude filter
391
+
392
  = 5.1.1 =
393
  * PHP notice at addthis_social_widget.php:1337
394
  * PHP error for older versions of PHP (< 5.3.0) at addthis_settings_functions.php:476
395
  * Adding select configs and page info into addthis_plugin_info to aide <a href="http://support.addthis.com/">the AddThis Support Team</a> with troubleshooting
396
 
397
  = 5.1.0 =
398
+ * New feature: set your own addthis.layers() paramaters to customize further using our <a href="http://support.addthis.com/customer/portal/articles/1200473-smart-layers-api">Smart Layers API</a> (in WordPress mode only)
399
  * Fixing a bug with the AddThis Sharing Buttons meta box not showing up for users in AddThis mode when editing posts
400
  * Fixing a bug with addthis_config where the JSON wasn't always checked before submitting the settings form
401
  * Fixing a bug with the sharing sidebar, where the theme for the sidebar was used for all AddThis layers tools (in WordPress mode)