AddToAny Share Buttons - Version 1.7.1

Version Description

  • Fix floating share buttons fallback so that the current page is shared by default
  • Show meta box ("Show sharing buttons") below the WordPress editor when a floating share bar is enabled
  • Remove deprecated option that displayed the title in the mini menu
  • Add Douban share button
  • Add Draugiem share button
Download this release

Release Info

Developer micropat
Plugin Icon 128x128 AddToAny Share Buttons
Version 1.7.1
Comparing to
See all releases

Code changes from version 1.7 to 1.7.1

README.txt CHANGED
@@ -1,9 +1,9 @@
1
  === AddToAny Share Buttons ===
2
  Contributors: micropat, addtoany
3
- Tags: AddToAny, sharing, share, social, share button, share buttons, share links, social icons, social media, media, marketing, bookmark, bookmarks, save, post, posts, page, pages, images, image, admin, analytics, statistics, stats, links, plugin, shortcode, sidebar, widget, responsive, email, e-mail, print, seo, button, amp, woocommerce, ecommerce, e-commerce, amazon, delicious, google, tumblr, linkedin, digg, reddit, facebook, facebook share, facebook like, like, twitter, twitter button, twitter share, tweet, tweet button, google plus, pinterest, pin, pin it, pinit, wanelo, buffer, stumbleupon, bitly, whatsapp, instagram, behance, flickr, foursquare, vimeo, youtube, feed, rss, addthis, sociable, share this, sharethis, shareaholic, icon, icons, vector, SVG, floating, floating buttons, wpml, wpmu, Add to Any
4
  Requires at least: 3.7
5
  Tested up to: 4.6
6
- Stable tag: 1.7
7
 
8
  Share buttons for WordPress including the AddToAny sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp, many more, and follow icons too.
9
 
@@ -24,7 +24,7 @@ AddToAny is the universal sharing platform, and AddToAny's plugin is the most po
24
  * 3rd party buttons include the Facebook Like Button, Twitter Tweet Button, Pinterest Pin It Button, Google+ Share Button and Google +1 Button
25
  * Universal email sharing makes it easy to share via Gmail, Yahoo! Mail, Outlook.com (Hotmail), AOL Mail, and any other web and native apps
26
 
27
- <a href="https://www.addtoany.com/" title="Sharing buttons">Share Buttons</a> demo
28
 
29
  = Custom Placement =
30
  * Before content, after content, or before & after content
@@ -35,7 +35,7 @@ AddToAny is the universal sharing platform, and AddToAny's plugin is the most po
35
  = Analytics Integration =
36
 
37
  * Automatic Google Analytics integration (<a href="https://www.addtoany.com/ext/google_analytics/">access guide</a>) for sharing analytics
38
- * Track shared links with bit.ly, goo.gl, and custom URL shorteners
39
  * Display share counts on posts and pages
40
 
41
  = WordPress Optimized =
@@ -62,7 +62,7 @@ AddToAny is the universal sharing platform, and AddToAny's plugin is the most po
62
 
63
  = Wide Support =
64
 
65
- * Over 9 years of active development
66
  * Over 5 million downloads
67
  * Translated into dozens of languages
68
  * Ongoing support from the community
@@ -174,8 +174,8 @@ To share the current URL and title (detected on the client-side):
174
  To hardcode the shared current URL and modify the title (server-side):
175
  `<?php if ( function_exists( 'ADDTOANY_SHARE_SAVE_KIT' ) ) {
176
  ADDTOANY_SHARE_SAVE_KIT( array(
177
- 'linkname' => ( is_home() ? get_bloginfo( 'description' ) : wp_title( '', false ) ),
178
- 'linkurl' => ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER["HTTP_HOST"] . $_SERVER['REQUEST_URI'],
179
  ) );
180
  } ?>`
181
 
@@ -334,6 +334,13 @@ Upload (or move) the `add-to-any` plugin directory into the `/wp-content/mu-plug
334
 
335
  == Changelog ==
336
 
 
 
 
 
 
 
 
337
  = 1.7 =
338
  * Simplify AddToAny asynchronous loading method
339
  * Use HTML5 data attributes for AddToAny instances
1
  === AddToAny Share Buttons ===
2
  Contributors: micropat, addtoany
3
+ Tags: AddToAny, share, sharing, social, share button, share buttons, share links, social media, media, marketing, post, posts, page, pages, images, image, admin, analytics, stats, links, plugin, shortcode, sidebar, widget, responsive, email, seo, button, woocommerce, ecommerce, e-commerce, amazon, google, linkedin, reddit, facebook, like, twitter, tweet, google plus, pinterest, whatsapp, instagram, flickr, vimeo, youtube, feed, rss, addthis, share this, sharethis, icons, floating, wpml
4
  Requires at least: 3.7
5
  Tested up to: 4.6
6
+ Stable tag: 1.7.1
7
 
8
  Share buttons for WordPress including the AddToAny sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp, many more, and follow icons too.
9
 
24
  * 3rd party buttons include the Facebook Like Button, Twitter Tweet Button, Pinterest Pin It Button, Google+ Share Button and Google +1 Button
25
  * Universal email sharing makes it easy to share via Gmail, Yahoo! Mail, Outlook.com (Hotmail), AOL Mail, and any other web and native apps
26
 
27
+ <a href="https://www.addtoany.com/">Share Buttons</a> demo
28
 
29
  = Custom Placement =
30
  * Before content, after content, or before & after content
35
  = Analytics Integration =
36
 
37
  * Automatic Google Analytics integration (<a href="https://www.addtoany.com/ext/google_analytics/">access guide</a>) for sharing analytics
38
+ * Track shared links with Bitly, Google URL Shortener, and custom URL shorteners
39
  * Display share counts on posts and pages
40
 
41
  = WordPress Optimized =
62
 
63
  = Wide Support =
64
 
65
+ * Over 10 years of development
66
  * Over 5 million downloads
67
  * Translated into dozens of languages
68
  * Ongoing support from the community
174
  To hardcode the shared current URL and modify the title (server-side):
175
  `<?php if ( function_exists( 'ADDTOANY_SHARE_SAVE_KIT' ) ) {
176
  ADDTOANY_SHARE_SAVE_KIT( array(
177
+ 'linkname' => is_home() ? get_bloginfo( 'description' ) : wp_title( '', false ),
178
+ 'linkurl' => esc_url_raw( ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ),
179
  ) );
180
  } ?>`
181
 
334
 
335
  == Changelog ==
336
 
337
+ = 1.7.1 =
338
+ * Fix floating share buttons fallback so that the current page is shared by default
339
+ * Show meta box ("Show sharing buttons") below the WordPress editor when a floating share bar is enabled
340
+ * Remove deprecated option that displayed the title in the mini menu
341
+ * Add Douban share button
342
+ * Add Draugiem share button
343
+
344
  = 1.7 =
345
  * Simplify AddToAny asynchronous loading method
346
  * Use HTML5 data attributes for AddToAny instances
add-to-any.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: AddToAny Share Buttons
4
  Plugin URI: https://www.addtoany.com/
5
  Description: Share buttons for your pages including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp and many more.
6
- Version: 1.7
7
  Author: AddToAny
8
  Author URI: https://www.addtoany.com/
9
  Text Domain: add-to-any
@@ -42,12 +42,14 @@ function A2A_SHARE_SAVE_init() {
42
  }
43
  add_filter( 'init', 'A2A_SHARE_SAVE_init' );
44
 
45
- function A2A_SHARE_SAVE_link_vars( $linkname = false, $linkurl = false, $linkmedia = false ) {
46
  global $post;
47
 
48
  // Set linkname
49
  if ( ! $linkname ) {
50
- if ( isset( $post ) ) {
 
 
51
  $linkname = html_entity_decode( strip_tags( get_the_title( $post->ID ) ), ENT_QUOTES, 'UTF-8' );
52
  } else {
53
  $linkname = '';
@@ -58,7 +60,9 @@ function A2A_SHARE_SAVE_link_vars( $linkname = false, $linkurl = false, $linkmed
58
 
59
  // Set linkurl
60
  if ( ! $linkurl ) {
61
- if ( isset( $post ) ) {
 
 
62
  $linkurl = get_permalink( $post->ID );
63
  } else {
64
  $linkurl = '';
@@ -80,13 +84,13 @@ function ADDTOANY_SHARE_SAVE_KIT( $args = array() ) {
80
  $linkname = isset( $args['linkname'] ) ? $args['linkname'] : false;
81
  $linkurl = isset( $args['linkurl'] ) ? $args['linkurl'] : false;
82
  $linkmedia = isset( $args['linkmedia'] ) ? $args['linkmedia'] : false;
 
83
 
84
- $args = array_merge( $args, A2A_SHARE_SAVE_link_vars( $linkname, $linkurl, $linkmedia ) ); // linkname_enc, etc.
85
 
86
  $defaults = array(
87
  'output_later' => false,
88
  'icon_size' => isset( $options['icon_size'] ) ? $options['icon_size'] : '32',
89
- 'use_current_page' => false,
90
  );
91
 
92
 
@@ -719,7 +723,6 @@ function A2A_SHARE_SAVE_head_script() {
719
  $additional_js = ( isset( $options['additional_js_variables'] ) ) ? $options['additional_js_variables'] : '' ;
720
  $script_configs = ( ( $cache ) ? "\n" . 'a2a_config.static_server="' . $static_server . '";' : '' )
721
  . ( ( isset( $options['onclick'] ) && '1' == $options['onclick'] ) ? "\n" . 'a2a_config.onclick=1;' : '' )
722
- . ( ( isset( $options['show_title'] ) && '1' == $options['show_title'] ) ? "\n" . 'a2a_config.show_title=1;' : '' )
723
  . ( ( $additional_js ) ? "\n" . stripslashes( $additional_js ) : '' );
724
  $A2A_SHARE_SAVE_external_script_called = true;
725
 
3
  Plugin Name: AddToAny Share Buttons
4
  Plugin URI: https://www.addtoany.com/
5
  Description: Share buttons for your pages including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp and many more.
6
+ Version: 1.7.1
7
  Author: AddToAny
8
  Author URI: https://www.addtoany.com/
9
  Text Domain: add-to-any
42
  }
43
  add_filter( 'init', 'A2A_SHARE_SAVE_init' );
44
 
45
+ function A2A_SHARE_SAVE_link_vars( $linkname = false, $linkurl = false, $linkmedia = false, $use_current_page = false ) {
46
  global $post;
47
 
48
  // Set linkname
49
  if ( ! $linkname ) {
50
+ if ( $use_current_page ) {
51
+ $linkname = is_home() || is_front_page() ? get_bloginfo( 'name' ) : rtrim( wp_title( '', false, 'right' ) );
52
+ } elseif ( isset( $post ) ) {
53
  $linkname = html_entity_decode( strip_tags( get_the_title( $post->ID ) ), ENT_QUOTES, 'UTF-8' );
54
  } else {
55
  $linkname = '';
60
 
61
  // Set linkurl
62
  if ( ! $linkurl ) {
63
+ if ( $use_current_page ) {
64
+ $linkurl = esc_url_raw ( ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
65
+ } elseif ( isset( $post ) ) {
66
  $linkurl = get_permalink( $post->ID );
67
  } else {
68
  $linkurl = '';
84
  $linkname = isset( $args['linkname'] ) ? $args['linkname'] : false;
85
  $linkurl = isset( $args['linkurl'] ) ? $args['linkurl'] : false;
86
  $linkmedia = isset( $args['linkmedia'] ) ? $args['linkmedia'] : false;
87
+ $use_current_page = isset( $args['use_current_page'] ) ? $args['use_current_page'] : false;
88
 
89
+ $args = array_merge( $args, A2A_SHARE_SAVE_link_vars( $linkname, $linkurl, $linkmedia, $use_current_page ) ); // linkname_enc, etc.
90
 
91
  $defaults = array(
92
  'output_later' => false,
93
  'icon_size' => isset( $options['icon_size'] ) ? $options['icon_size'] : '32',
 
94
  );
95
 
96
 
723
  $additional_js = ( isset( $options['additional_js_variables'] ) ) ? $options['additional_js_variables'] : '' ;
724
  $script_configs = ( ( $cache ) ? "\n" . 'a2a_config.static_server="' . $static_server . '";' : '' )
725
  . ( ( isset( $options['onclick'] ) && '1' == $options['onclick'] ) ? "\n" . 'a2a_config.onclick=1;' : '' )
 
726
  . ( ( $additional_js ) ? "\n" . stripslashes( $additional_js ) : '' );
727
  $A2A_SHARE_SAVE_external_script_called = true;
728
 
addtoany.admin.php CHANGED
@@ -11,19 +11,21 @@ function A2A_SHARE_SAVE_add_meta_box() {
11
 
12
  $title = apply_filters( 'A2A_SHARE_SAVE_meta_box_title', __( 'AddToAny', 'add-to-any' ) );
13
  foreach( $post_types as $post_type ) {
14
- // If automatic placement is disabled for the post type
15
  if (
16
- 'post' == $post_type && isset( $options['display_in_posts'] ) && $options['display_in_posts'] == '-1' ||
17
- 'page' == $post_type && isset( $options['display_in_pages'] ) && $options['display_in_pages'] == '-1' ||
18
- // Custom post type
19
- isset( $options['display_in_cpt_' . $post_type] ) && $options['display_in_cpt_' . $post_type] == '-1'
 
 
 
 
 
 
20
  ) {
21
- // Skip current post type
22
- continue;
23
  }
24
-
25
- // Add meta box (unless we skipped this post type above)
26
- add_meta_box( 'A2A_SHARE_SAVE_meta', $title, 'A2A_SHARE_SAVE_meta_box_content', $post_type, 'advanced', 'high' );
27
  }
28
  }
29
 
@@ -82,7 +84,6 @@ function A2A_SHARE_SAVE_migrate_options() {
82
  'display_in_posts' => '1',
83
  'display_in_pages' => '1',
84
  'display_in_feed' => '1',
85
- 'show_title' => '-1',
86
  'onclick' => '-1',
87
  'button' => 'A2A_SVG_32',
88
  'button_custom' => '',
@@ -114,6 +115,7 @@ function A2A_SHARE_SAVE_migrate_options() {
114
  $deprecated_options = array(
115
  'button_opens_new_window',
116
  'hide_embeds',
 
117
  );
118
 
119
  foreach ( $deprecated_options as $option_name ) {
@@ -273,7 +275,6 @@ function A2A_SHARE_SAVE_options_page() {
273
  $new_options['display_in_pages'] = ( isset( $_POST['A2A_SHARE_SAVE_display_in_pages'] ) && $_POST['A2A_SHARE_SAVE_display_in_pages'] == '1' ) ? '1' : '-1';
274
  $new_options['display_in_attachments'] = ( isset( $_POST['A2A_SHARE_SAVE_display_in_attachments'] ) && $_POST['A2A_SHARE_SAVE_display_in_attachments'] == '1' ) ? '1' : '-1';
275
  $new_options['display_in_feed'] = ( isset( $_POST['A2A_SHARE_SAVE_display_in_feed'] ) && $_POST['A2A_SHARE_SAVE_display_in_feed'] == '1' ) ? '1' : '-1';
276
- $new_options['show_title'] = ( isset( $_POST['A2A_SHARE_SAVE_show_title'] ) && $_POST['A2A_SHARE_SAVE_show_title'] == '1' ) ? '1' : '-1';
277
  $new_options['onclick'] = ( isset( $_POST['A2A_SHARE_SAVE_onclick'] ) && $_POST['A2A_SHARE_SAVE_onclick'] == '1' ) ? '1' : '-1';
278
  $new_options['icon_size'] = ( isset( $_POST['A2A_SHARE_SAVE_icon_size'] ) ) ? $_POST['A2A_SHARE_SAVE_icon_size'] : '';
279
  $new_options['button'] = ( isset( $_POST['A2A_SHARE_SAVE_button'] ) ) ? $_POST['A2A_SHARE_SAVE_button'] : '';
@@ -644,11 +645,6 @@ function A2A_SHARE_SAVE_options_page() {
644
  <input name="A2A_SHARE_SAVE_onclick" type="checkbox"<?php if ( isset( $options['onclick'] ) && $options['onclick'] == '1' ) echo ' checked="checked"'; ?> value="1"/>
645
  <?php _e('Only show the universal share menu when the user <em>clicks</em> the universal share button', 'add-to-any'); ?>
646
  </label>
647
- <br />
648
- <label>
649
- <input name="A2A_SHARE_SAVE_show_title" type="checkbox"<?php if ( isset( $options['show_title'] ) && $options['show_title'] == '1' ) echo ' checked="checked"'; ?> value="1"/>
650
- <?php _e('Show the title of the page within the universal share menu', 'add-to-any'); ?>
651
- </label>
652
  <label>
653
  <p><?php _e("You can use AddToAny's Menu Styler to customize the colors of your universal share menu. When you're done, be sure to paste the generated code in the <a href=\"#\" onclick=\"document.getElementById('A2A_SHARE_SAVE_additional_js_variables').focus();return false\">Additional JavaScript</a> box below.", 'add-to-any'); ?></p>
654
  </label>
11
 
12
  $title = apply_filters( 'A2A_SHARE_SAVE_meta_box_title', __( 'AddToAny', 'add-to-any' ) );
13
  foreach( $post_types as $post_type ) {
 
14
  if (
15
+ // If automatic placement is enabled
16
+ // for either floating bar
17
+ isset( $options['floating_vertical'] ) && 'none' != $options['floating_vertical'] ||
18
+ isset( $options['floating_horizontal'] ) && 'none' != $options['floating_horizontal'] ||
19
+ // for standard buttons in posts
20
+ 'post' == $post_type && isset( $options['display_in_posts'] ) && $options['display_in_posts'] != '-1' ||
21
+ // for standard buttons in pages
22
+ 'page' == $post_type && isset( $options['display_in_pages'] ) && $options['display_in_pages'] != '-1' ||
23
+ // for standard buttons in a custom post type
24
+ isset( $options['display_in_cpt_' . $post_type] ) && $options['display_in_cpt_' . $post_type] != '-1'
25
  ) {
26
+ // Add meta box
27
+ add_meta_box( 'A2A_SHARE_SAVE_meta', $title, 'A2A_SHARE_SAVE_meta_box_content', $post_type, 'advanced', 'high' );
28
  }
 
 
 
29
  }
30
  }
31
 
84
  'display_in_posts' => '1',
85
  'display_in_pages' => '1',
86
  'display_in_feed' => '1',
 
87
  'onclick' => '-1',
88
  'button' => 'A2A_SVG_32',
89
  'button_custom' => '',
115
  $deprecated_options = array(
116
  'button_opens_new_window',
117
  'hide_embeds',
118
+ 'show_title',
119
  );
120
 
121
  foreach ( $deprecated_options as $option_name ) {
275
  $new_options['display_in_pages'] = ( isset( $_POST['A2A_SHARE_SAVE_display_in_pages'] ) && $_POST['A2A_SHARE_SAVE_display_in_pages'] == '1' ) ? '1' : '-1';
276
  $new_options['display_in_attachments'] = ( isset( $_POST['A2A_SHARE_SAVE_display_in_attachments'] ) && $_POST['A2A_SHARE_SAVE_display_in_attachments'] == '1' ) ? '1' : '-1';
277
  $new_options['display_in_feed'] = ( isset( $_POST['A2A_SHARE_SAVE_display_in_feed'] ) && $_POST['A2A_SHARE_SAVE_display_in_feed'] == '1' ) ? '1' : '-1';
 
278
  $new_options['onclick'] = ( isset( $_POST['A2A_SHARE_SAVE_onclick'] ) && $_POST['A2A_SHARE_SAVE_onclick'] == '1' ) ? '1' : '-1';
279
  $new_options['icon_size'] = ( isset( $_POST['A2A_SHARE_SAVE_icon_size'] ) ) ? $_POST['A2A_SHARE_SAVE_icon_size'] : '';
280
  $new_options['button'] = ( isset( $_POST['A2A_SHARE_SAVE_button'] ) ) ? $_POST['A2A_SHARE_SAVE_button'] : '';
645
  <input name="A2A_SHARE_SAVE_onclick" type="checkbox"<?php if ( isset( $options['onclick'] ) && $options['onclick'] == '1' ) echo ' checked="checked"'; ?> value="1"/>
646
  <?php _e('Only show the universal share menu when the user <em>clicks</em> the universal share button', 'add-to-any'); ?>
647
  </label>
 
 
 
 
 
648
  <label>
649
  <p><?php _e("You can use AddToAny's Menu Styler to customize the colors of your universal share menu. When you're done, be sure to paste the generated code in the <a href=\"#\" onclick=\"document.getElementById('A2A_SHARE_SAVE_additional_js_variables').focus();return false\">Additional JavaScript</a> box below.", 'add-to-any'); ?></p>
650
  </label>
addtoany.services.php CHANGED
@@ -138,6 +138,14 @@ $A2A_SHARE_SAVE_services = array(
138
  "name" => "Diigo",
139
  "icon" => "diigo",
140
  ),
 
 
 
 
 
 
 
 
141
  "dzone" => array(
142
  "name" => "DZone",
143
  "icon" => "dzone",
138
  "name" => "Diigo",
139
  "icon" => "diigo",
140
  ),
141
+ "douban" => array(
142
+ "name" => "Douban",
143
+ "icon" => "douban",
144
+ ),
145
+ "draugiem" => array(
146
+ "name" => "Draugiem",
147
+ "icon" => "draugiem",
148
+ ),
149
  "dzone" => array(
150
  "name" => "DZone",
151
  "icon" => "dzone",
icons/douban.png ADDED
Binary file
icons/draugiem.png ADDED
Binary file