AddToAny Share Buttons - Version 1.7.27

Version Description

  • New "Attach to content" option for the vertical floating bar
  • Add Mix
  • Remove Delicious
  • Remove Polyvore
  • Remove Yahoo Bookmarks
  • Remove Yahoo Messenger
Download this release

Release Info

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

Code changes from version 1.7.26 to 1.7.27

README.txt CHANGED
@@ -1,9 +1,10 @@
1
  === AddToAny Share Buttons ===
2
  Contributors: micropat, addtoany
3
- Tags: AddToAny, share, sharing, social, share buttons, share button, social media, media, marketing, links, email, seo, woocommerce, google, linkedin, reddit, facebook, like, twitter, pinterest, whatsapp, instagram, youtube, share this, sharethis, feed, icons
4
  Requires at least: 3.7
5
  Tested up to: 5.0
6
- Stable tag: 1.7.26
 
7
 
8
  Share buttons for WordPress including the AddToAny sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp, many more, and follow icons too.
9
 
@@ -80,14 +81,14 @@ See also:
80
 
81
  In WordPress:
82
 
83
- 1. Go to `Plugins` > `Add New` > search for `addtoany`
84
- 1. Press `Install Now` for the AddToAny plugin
85
- 1. Press `Activate Plugin`
86
 
87
  Manual installation:
88
 
89
  1. Upload the `add-to-any` directory to the `/wp-content/plugins/` directory
90
- 1. Activate the plugin through the `Plugins` menu in WordPress
91
 
92
  WP-CLI installation:
93
 
@@ -97,11 +98,11 @@ WP-CLI installation:
97
 
98
  = Where are the options, and how can I customize the sharing plugin? =
99
 
100
- In WordPress, go to `Settings` > `AddToAny`.
101
 
102
- Setup Follow buttons (like Instagram, YouTube, etc.) using the AddToAny Follow widget in `Appearance` > `Widgets` (or `Appearance` > `Customize`).
103
 
104
- To further customize AddToAny, see the <a href="https://www.addtoany.com/buttons/customize/wordpress">WordPress sharing documentation</a> for the AddToAny plugin. Many customizations will have you copy & paste one or more lines of code into your "Additional JavaScript" or "Additional CSS" box. Those boxes are in `Settings` > `AddToAny`.
105
 
106
  = Something is wrong. What should I try first? =
107
 
@@ -129,9 +130,9 @@ Display specific share buttons by specifying comma-separated <a href="https://ww
129
 
130
  `[addtoany buttons="facebook,twitter,google_plus"]`
131
 
132
- Share a specific image or video to certain services that accept arbitrary media (Pinterest, Yummly, Houzz, Polyvore):
133
 
134
- `[addtoany buttons="pinterest,yummly,houzz,polyvore" media="https://www.example.com/media/picture.jpg"]`
135
 
136
  = For Facebook sharing, how can I set the thumbnail image and description Facebook uses? =
137
 
@@ -153,7 +154,7 @@ Configure your social media profile links by adding the "AddToAny Follow" widget
153
 
154
  = How can I use custom icons? =
155
 
156
- Upload sharing icons in a single directory to a public location, and make sure the icon filenames match the icon filenames packaged in the AddToAny plugin. In WordPress, go to `Settings` > `AddToAny` > `Advanced Options` > check the "Use custom icons" checkbox and specify the URL to your custom icons directory (including the trailing `/`). For AddToAny's universal button, go to Universal Button, select `Image URL` and specify the exact location of your AddToAny universal share icon (including the filename).
157
 
158
  = How can I place the share buttons in a specific area of my site? =
159
 
@@ -219,7 +220,7 @@ See the [supported follow services](https://www.addtoany.com/buttons/customize/f
219
  } ?>`
220
 
221
  = How can I add a custom share button? =
222
- You can create a plugin or customize the following example PHP code to add to your theme's functions.php file:
223
 
224
  `function addtoany_add_share_services( $services ) {
225
  $services['example_share_service'] = array(
@@ -234,7 +235,7 @@ You can create a plugin or customize the following example PHP code to add to yo
234
  add_filter( 'A2A_SHARE_SAVE_services', 'addtoany_add_share_services', 10, 1 );`
235
 
236
  = How can I add a custom follow button? =
237
- You can create a plugin or customize the following example PHP code to add to your theme's functions.php file:
238
 
239
  `function addtoany_add_follow_services( $services ) {
240
  $services['example_follow_service'] = array(
@@ -273,11 +274,11 @@ An older method was to insert the following tag into the page or post (HTML tab)
273
 
274
  = How can I remove the button(s) from category pages, or tag/author/date/search pages? =
275
 
276
- Go to `Settings` > `AddToAny` > uncheck `Display at the top or bottom of posts on archive pages`. Archive pages include Category, Tag, Author, Date, and also Search pages.
277
 
278
  = How can I programmatically remove the button(s)? =
279
 
280
- In your theme's `functions.php`, you can add a filter to disable AddToAny sharing.
281
 
282
  Disable AddToAny sharing in specific categories, for example:
283
 
@@ -300,14 +301,7 @@ add_filter( 'addtoany_sharing_disabled', 'addtoany_disable_sharing_on_my_custom_
300
 
301
  = How can I position a vertical floating share buttons bar relative to content? =
302
 
303
- In settings, disable the default placement of the Vertical Buttons. In your theme's file(s), find the parent element that you want to position the vertical bar to (the parent element should have a specified width), then add the following example PHP code as a child of that parent element:
304
-
305
- `<?php if ( function_exists( 'ADDTOANY_SHARE_SAVE_FLOATING' ) ) {
306
- ADDTOANY_SHARE_SAVE_FLOATING( array(
307
- 'kit_style' => 'margin-left:-100px; top:150px;',
308
- 'vertical_type' => true,
309
- ) );
310
- } ?>`
311
 
312
  = Why does the Facebook Like Button, Pinterest Pin It Button, Google+ Share Button, or Google +1 Button have so much whitespace to the right of it? =
313
 
@@ -351,6 +345,14 @@ Upload (or move) the `add-to-any` plugin directory into the `/wp-content/mu-plug
351
 
352
  == Changelog ==
353
 
 
 
 
 
 
 
 
 
354
  = 1.7.26 =
355
  * Add Mastodon share button
356
  * Update admin interface
@@ -967,6 +969,9 @@ Upload (or move) the `add-to-any` plugin directory into the `/wp-content/mu-plug
967
 
968
  == Upgrade Notice ==
969
 
 
 
 
970
  = 1.7.23 =
971
  If you have CSS code customizations referencing the universal button (`.addtoany_share_save`) or the standard share buttons container (`.addtoany_share_save_container`), those class names have been deprecated and will be removed in a future plugin update. The new class names are `.addtoany_share` and `.addtoany_content` respectively. Please update your custom CSS if you are referencing the deprecated class names.
972
 
1
  === AddToAny Share Buttons ===
2
  Contributors: micropat, addtoany
3
+ Tags: buttons, share, icons, social media, share buttons, sharing, share button, media, social, marketing, links, email, seo, woocommerce, google, linkedin, reddit, facebook, twitter, pinterest, whatsapp, instagram, youtube, share this, sharethis, feed
4
  Requires at least: 3.7
5
  Tested up to: 5.0
6
+ Requires PHP: 5.2
7
+ Stable tag: 1.7.27
8
 
9
  Share buttons for WordPress including the AddToAny sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp, many more, and follow icons too.
10
 
81
 
82
  In WordPress:
83
 
84
+ 1. Go to Plugins > Add New > search for `addtoany`
85
+ 1. Press "Install Now" for the AddToAny plugin
86
+ 1. Press "Activate Plugin"
87
 
88
  Manual installation:
89
 
90
  1. Upload the `add-to-any` directory to the `/wp-content/plugins/` directory
91
+ 1. Activate the plugin through the "Plugins" menu in WordPress
92
 
93
  WP-CLI installation:
94
 
98
 
99
  = Where are the options, and how can I customize the sharing plugin? =
100
 
101
+ In WordPress, go to Settings > AddToAny.
102
 
103
+ Setup Follow buttons (like Instagram, YouTube, etc.) using the AddToAny Follow widget in Appearance > Widgets (or Appearance > Customize).
104
 
105
+ To further customize AddToAny, see the <a href="https://www.addtoany.com/buttons/customize/wordpress">WordPress sharing documentation</a> for the AddToAny plugin. Many customizations will have you copy & paste one or more lines of code into your "Additional JavaScript" or "Additional CSS" box. Those boxes are in Settings > AddToAny.
106
 
107
  = Something is wrong. What should I try first? =
108
 
130
 
131
  `[addtoany buttons="facebook,twitter,google_plus"]`
132
 
133
+ Share a specific image or video to certain services that accept arbitrary media (Pinterest, Yummly, Houzz):
134
 
135
+ `[addtoany buttons="pinterest,yummly,houzz" media="https://www.example.com/media/picture.jpg"]`
136
 
137
  = For Facebook sharing, how can I set the thumbnail image and description Facebook uses? =
138
 
154
 
155
  = How can I use custom icons? =
156
 
157
+ Upload sharing icons in a single directory to a public location, and make sure the icon filenames match the icon filenames packaged in the AddToAny plugin. In WordPress, go to Settings > AddToAny > Advanced Options > check the "Use custom icons" checkbox and specify the URL to your custom icons directory (including the trailing `/`). For AddToAny's universal button, go to Universal Button, select "Image URL" and specify the exact location of your AddToAny universal share icon (including the filename).
158
 
159
  = How can I place the share buttons in a specific area of my site? =
160
 
220
  } ?>`
221
 
222
  = How can I add a custom share button? =
223
+ You can add the following example PHP code using a "functionality" plugin such as the [Code Snippets](https://wordpress.org/plugins/code-snippets/) plugin:
224
 
225
  `function addtoany_add_share_services( $services ) {
226
  $services['example_share_service'] = array(
235
  add_filter( 'A2A_SHARE_SAVE_services', 'addtoany_add_share_services', 10, 1 );`
236
 
237
  = How can I add a custom follow button? =
238
+ You can customize the following example PHP code and add it to a "functionality" plugin such as the [Code Snippets](https://wordpress.org/plugins/code-snippets/) plugin:
239
 
240
  `function addtoany_add_follow_services( $services ) {
241
  $services['example_follow_service'] = array(
274
 
275
  = How can I remove the button(s) from category pages, or tag/author/date/search pages? =
276
 
277
+ Go to Settings > AddToAny > uncheck "Display at the top or bottom of posts on archive pages". Archive pages include Category, Tag, Author, Date, and also Search pages.
278
 
279
  = How can I programmatically remove the button(s)? =
280
 
281
+ You can disable AddToAny sharing using [filter](https://developer.wordpress.org/plugins/hooks/filters/) (PHP code) that you can add to a "functionality" plugin such as the [Code Snippets](https://wordpress.org/plugins/code-snippets/) plugin.
282
 
283
  Disable AddToAny sharing in specific categories, for example:
284
 
301
 
302
  = How can I position a vertical floating share buttons bar relative to content? =
303
 
304
+ Go to Settings > AddToAny > Floating > select "Attach to content" then input the CSS selector(s) that match the HTML element you want to attach to.
 
 
 
 
 
 
 
305
 
306
  = Why does the Facebook Like Button, Pinterest Pin It Button, Google+ Share Button, or Google +1 Button have so much whitespace to the right of it? =
307
 
345
 
346
  == Changelog ==
347
 
348
+ = 1.7.27 =
349
+ * New "Attach to content" option for the vertical floating bar
350
+ * Add Mix
351
+ * Remove Delicious
352
+ * Remove Polyvore
353
+ * Remove Yahoo Bookmarks
354
+ * Remove Yahoo Messenger
355
+
356
  = 1.7.26 =
357
  * Add Mastodon share button
358
  * Update admin interface
969
 
970
  == Upgrade Notice ==
971
 
972
+ = 1.7.27 =
973
+ * New "Attach to content" option for the floating vertical bar!
974
+
975
  = 1.7.23 =
976
  If you have CSS code customizations referencing the universal button (`.addtoany_share_save`) or the standard share buttons container (`.addtoany_share_save_container`), those class names have been deprecated and will be removed in a future plugin update. The new class names are `.addtoany_share` and `.addtoany_content` respectively. Please update your custom CSS if you are referencing the deprecated class names.
977
 
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.26
7
  Author: AddToAny
8
  Author URI: https://www.addtoany.com/
9
  Text Domain: add-to-any
@@ -209,6 +209,7 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
209
  'icon_size' => isset( $options['icon_size'] ) ? $options['icon_size'] : '32',
210
  'is_follow' => false,
211
  'no_universal_button' => false,
 
212
  'buttons' => array(),
213
  );
214
 
@@ -335,25 +336,30 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
335
  $src = $icon_url ? $icon_url : $icons_dir . $icon . '.' . $icons_type;
336
  $counter = $counter_enabled ? ' a2a_counter' : '';
337
  $class_attr = $custom_service ? '' : ' class="a2a_button_' . $safe_name . $counter . '"';
338
-
 
 
339
  if ( isset( $service['target'] ) ) {
340
  $target_attr = empty( $service['target'] ) ? '' : ' target="' . $service['target'] . '"';
341
- } else {
342
  $target_attr = ' target="_blank"';
 
 
343
  }
344
 
345
  // Use rel="noopener" for links that open in a new tab/window
346
  $rel_noopener = $custom_service || ! $target_attr ? '' : ' noopener';
347
  $rel_noopener_only = $rel_noopener || $target_attr ? ' rel="noopener"' : '';
348
  $rel_attr = $is_follow ? $rel_noopener_only : ' rel="nofollow' . $rel_noopener . '"'; // ($is_follow indicates a Follow Kit. 'nofollow' is for search crawlers. Different things)
349
-
 
350
  // Set dimension attributes if using custom icons and dimension is specified
351
  if ( isset( $custom_icons ) ) {
352
  $width_attr = ! empty( $icons_width ) ? ' width="' . $icons_width . '"' : '';
353
  $height_attr = ! empty( $icons_height ) ? ' height="' . $icons_height . '"' : '';
354
  }
355
 
356
- $link = $html_wrap_open . "<a$class_attr href=\"$url\" title=\"$name\"$rel_attr$target_attr>";
357
  $link .= ( $large_icons && ! isset( $custom_icons ) && ! $custom_service ) ? "" : "<img src=\"$src\"" . $width_attr . $height_attr . " alt=\"$name\"/>";
358
  $link .= "</a>" . $html_wrap_close;
359
  }
@@ -496,7 +502,8 @@ function ADDTOANY_SHARE_SAVE_SPECIAL( $special_service_code, $args = array() ) {
496
  $custom_attributes = '';
497
 
498
  if ( $special_service_code == 'facebook_like' ) {
499
- $custom_attributes .= ( $options['special_facebook_like_options']['verb'] == 'recommend' ) ? ' data-action="recommend"' : '';
 
500
  $custom_attributes .= ' data-href="' . $linkurl . '"';
501
  $special_html = sprintf( $special_anchor_template, $special_service_code, $custom_attributes );
502
  }
@@ -518,7 +525,8 @@ function ADDTOANY_SHARE_SAVE_SPECIAL( $special_service_code, $args = array() ) {
518
  }
519
 
520
  elseif ( $special_service_code == 'pinterest_pin' ) {
521
- $custom_attributes .= ( $options['special_pinterest_pin_options']['show_count'] == '1' ) ? '' : ' data-pin-config="none"';
 
522
  $custom_attributes .= ' data-url="' . $linkurl . '"';
523
  $custom_attributes .= ( ! empty( $linkmedia ) ) ? ' data-media="' . $linkmedia . '"' : '';
524
  $special_html = sprintf( $special_anchor_template, $special_service_code, $custom_attributes );
@@ -748,6 +756,42 @@ function A2A_SHARE_SAVE_head_script() {
748
  // Use "unset" keyword for background if only the foreground is set
749
  $icon_bg_color = empty( $icon_bg_color ) && ! empty( $icon_fg_color ) ? 'unset' : $icon_bg_color;
750
  $icon_color = $icon_bg_color . $icon_fg_color;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
751
 
752
  // Enternal script call + initial JS + set-once variables
753
  $additional_js = ( isset( $options['additional_js_variables'] ) ) ? $options['additional_js_variables'] : '' ;
@@ -762,6 +806,7 @@ function A2A_SHARE_SAVE_head_script() {
762
  . 'a2a_config.callbacks=[];a2a_config.overlays=[];'
763
  . 'a2a_config.templates={};'
764
  . A2A_menu_locale()
 
765
  . $script_configs
766
  . "\n"
767
  . '(function(d,s,a,b){'
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.27
7
  Author: AddToAny
8
  Author URI: https://www.addtoany.com/
9
  Text Domain: add-to-any
209
  'icon_size' => isset( $options['icon_size'] ) ? $options['icon_size'] : '32',
210
  'is_follow' => false,
211
  'no_universal_button' => false,
212
+ 'basic_html' => false,
213
  'buttons' => array(),
214
  );
215
 
336
  $src = $icon_url ? $icon_url : $icons_dir . $icon . '.' . $icons_type;
337
  $counter = $counter_enabled ? ' a2a_counter' : '';
338
  $class_attr = $custom_service ? '' : ' class="a2a_button_' . $safe_name . $counter . '"';
339
+ $href_attr = $basic_html && ! isset( $href ) ? '' : ' href="' . $url . '"';
340
+ $title_attr = $basic_html ? '' : ' title="' . $name . '"';
341
+
342
  if ( isset( $service['target'] ) ) {
343
  $target_attr = empty( $service['target'] ) ? '' : ' target="' . $service['target'] . '"';
344
+ } elseif ( ! $basic_html ) {
345
  $target_attr = ' target="_blank"';
346
+ } else {
347
+ $target_attr = '';
348
  }
349
 
350
  // Use rel="noopener" for links that open in a new tab/window
351
  $rel_noopener = $custom_service || ! $target_attr ? '' : ' noopener';
352
  $rel_noopener_only = $rel_noopener || $target_attr ? ' rel="noopener"' : '';
353
  $rel_attr = $is_follow ? $rel_noopener_only : ' rel="nofollow' . $rel_noopener . '"'; // ($is_follow indicates a Follow Kit. 'nofollow' is for search crawlers. Different things)
354
+ $rel_attr = $basic_html ? '' : $rel_attr;
355
+
356
  // Set dimension attributes if using custom icons and dimension is specified
357
  if ( isset( $custom_icons ) ) {
358
  $width_attr = ! empty( $icons_width ) ? ' width="' . $icons_width . '"' : '';
359
  $height_attr = ! empty( $icons_height ) ? ' height="' . $icons_height . '"' : '';
360
  }
361
 
362
+ $link = $html_wrap_open . "<a$class_attr$href_attr$title_attr$rel_attr$target_attr>";
363
  $link .= ( $large_icons && ! isset( $custom_icons ) && ! $custom_service ) ? "" : "<img src=\"$src\"" . $width_attr . $height_attr . " alt=\"$name\"/>";
364
  $link .= "</a>" . $html_wrap_close;
365
  }
502
  $custom_attributes = '';
503
 
504
  if ( $special_service_code == 'facebook_like' ) {
505
+ $custom_attributes .= ( isset( $options['special_facebook_like_options']['verb'] ) &&
506
+ 'recommend' == $options['special_facebook_like_options']['verb'] ) ? ' data-action="recommend"' : '';
507
  $custom_attributes .= ' data-href="' . $linkurl . '"';
508
  $special_html = sprintf( $special_anchor_template, $special_service_code, $custom_attributes );
509
  }
525
  }
526
 
527
  elseif ( $special_service_code == 'pinterest_pin' ) {
528
+ $custom_attributes .= ( isset( $options['special_pinterest_pin_options']['show_count'] ) &&
529
+ $options['special_pinterest_pin_options']['show_count'] == '1' ) ? '' : ' data-pin-config="none"';
530
  $custom_attributes .= ' data-url="' . $linkurl . '"';
531
  $custom_attributes .= ( ! empty( $linkmedia ) ) ? ' data-media="' . $linkmedia . '"' : '';
532
  $special_html = sprintf( $special_anchor_template, $special_service_code, $custom_attributes );
756
  // Use "unset" keyword for background if only the foreground is set
757
  $icon_bg_color = empty( $icon_bg_color ) && ! empty( $icon_fg_color ) ? 'unset' : $icon_bg_color;
758
  $icon_color = $icon_bg_color . $icon_fg_color;
759
+
760
+ // Floating vertical relative to content
761
+ $floating_js = '';
762
+ if (
763
+ isset( $options['floating_vertical'] ) &&
764
+ in_array( $options['floating_vertical'], array( 'left_attached', 'right_attached' ) ) &&
765
+ ! empty( $options['floating_vertical_attached_to'] )
766
+ ) {
767
+ // Top position
768
+ $floating_js_position = ( isset( $options['floating_vertical_position'] ) ) ? $options['floating_vertical_position'] . 'px' : '100px';
769
+ // Left or right offset
770
+ $floating_js_offset = ( isset( $options['floating_vertical_offset'] ) ) ? $options['floating_vertical_offset'] . 'px' : '0px';
771
+
772
+ // Style attribute (accepts "left" attached only)
773
+ $floating_js_kit_style = 'left_attached' === $options['floating_vertical'] ? 'margin-left:' . $floating_js_offset . ';' : '';
774
+ $floating_js_kit_style .= 'top:' . $floating_js_position . ';';
775
+
776
+ $floating_js = "\n"
777
+ . 'a2a_config.callbacks.push({'
778
+ . 'ready: function(){'
779
+ . 'var d=document;'
780
+ . 'function a(){'
781
+ . 'var e=d.createElement("div");'
782
+ . 'e.innerHTML=' . wp_json_encode( ADDTOANY_SHARE_SAVE_FLOATING( array(
783
+ 'output_later' => true,
784
+ 'basic_html' => true,
785
+ 'kit_style' => $floating_js_kit_style,
786
+ 'vertical_type' => true,
787
+ ) ) ) . ';'
788
+ . 'd.querySelector(' . wp_json_encode( stripslashes( $options['floating_vertical_attached_to'] ) ) . ').appendChild(e.firstChild);'
789
+ . 'a2a.init("page");'
790
+ . '}'
791
+ . 'if("loading"!==d.readyState)a();else d.addEventListener("DOMContentLoaded",a,false);'
792
+ . '}'
793
+ . '});';
794
+ }
795
 
796
  // Enternal script call + initial JS + set-once variables
797
  $additional_js = ( isset( $options['additional_js_variables'] ) ) ? $options['additional_js_variables'] : '' ;
806
  . 'a2a_config.callbacks=[];a2a_config.overlays=[];'
807
  . 'a2a_config.templates={};'
808
  . A2A_menu_locale()
809
+ . $floating_js
810
  . $script_configs
811
  . "\n"
812
  . '(function(d,s,a,b){'
addtoany.admin.php CHANGED
@@ -219,7 +219,7 @@ function A2A_SHARE_SAVE_options_page() {
219
  if ( 'floating' == $current_screen ) {
220
  // Floating options screen
221
 
222
- $possible_floating_values = array( 'left_docked', 'right_docked', 'none' );
223
 
224
  $new_options['floating_vertical'] = ( in_array( $_POST['A2A_SHARE_SAVE_floating_vertical'], $possible_floating_values ) ) ? $_POST['A2A_SHARE_SAVE_floating_vertical'] : 'none';
225
  $new_options['floating_horizontal'] = ( in_array( $_POST['A2A_SHARE_SAVE_floating_horizontal'], $possible_floating_values ) ) ? $_POST['A2A_SHARE_SAVE_floating_horizontal'] : 'none';
@@ -234,7 +234,6 @@ function A2A_SHARE_SAVE_options_page() {
234
  is_numeric( $_POST['A2A_SHARE_SAVE_floating_horizontal_offset'] )
235
  ) ? $_POST['A2A_SHARE_SAVE_floating_horizontal_offset'] : '0';
236
 
237
-
238
  $new_options['floating_horizontal_responsive'] = (
239
  isset( $_POST['A2A_SHARE_SAVE_floating_horizontal_responsive'] ) &&
240
  '1' == $_POST['A2A_SHARE_SAVE_floating_horizontal_responsive']
@@ -257,6 +256,10 @@ function A2A_SHARE_SAVE_options_page() {
257
  isset( $_POST['A2A_SHARE_SAVE_floating_vertical_position'] ) &&
258
  is_numeric( $_POST['A2A_SHARE_SAVE_floating_vertical_position'] )
259
  ) ? $_POST['A2A_SHARE_SAVE_floating_vertical_position'] : '100';
 
 
 
 
260
 
261
  $new_options['floating_vertical_offset'] = (
262
  isset( $_POST['A2A_SHARE_SAVE_floating_vertical_offset'] ) &&
@@ -684,7 +687,6 @@ function A2A_SHARE_SAVE_options_page() {
684
  <?php if ( 'floating' == $current_screen ) : ?>
685
 
686
  <p><?php _e('AddToAny &quot;floating&quot; share buttons stay in a fixed position even when the user scrolls.', 'add-to-any'); ?></p>
687
- <p><?php _e('Large icons from your currently selected buttons are displayed in your floating bar(s). 3rd party buttons (Like, Tweet, etc.) are not displayed.', 'add-to-any'); ?></p>
688
 
689
  <h3><?php _e('Vertical Buttons', 'add-to-any'); ?></h3>
690
  <table class="form-table">
@@ -695,7 +697,16 @@ function A2A_SHARE_SAVE_options_page() {
695
  <br>
696
  <label><input type="radio" name="A2A_SHARE_SAVE_floating_vertical" value="right_docked"<?php if ( isset( $options['floating_vertical'] ) && 'right_docked' == $options['floating_vertical'] ) echo ' checked="checked"'; ?>> <?php _e('Right docked', 'add-to-any'); ?></label>
697
  <br>
 
 
698
  <label><input type="radio" name="A2A_SHARE_SAVE_floating_vertical" value="none"<?php if ( ! isset( $options['floating_vertical'] ) || 'none' == $options['floating_vertical'] ) echo ' checked="checked"'; ?>> <?php _e('None', 'add-to-any'); ?></label>
 
 
 
 
 
 
 
699
  </fieldset></td>
700
  </tr>
701
  <tr valign="top">
@@ -717,7 +728,7 @@ function A2A_SHARE_SAVE_options_page() {
717
  <tr valign="top">
718
  <th scope="row"><?php _e("Offset", 'add-to-any'); ?></th>
719
  <td><fieldset>
720
- <label><input name="A2A_SHARE_SAVE_floating_vertical_offset" type="number" value="<?php if ( isset( $options['floating_vertical_offset'] ) ) esc_attr_e( $options['floating_vertical_offset'] ); else echo '0'; ?>" class="small-text" /> pixels from left or right</label>
721
  </fieldset></td>
722
  </tr>
723
  <tr valign="top">
@@ -854,10 +865,10 @@ function A2A_SHARE_SAVE_admin_head() {
854
  }
855
 
856
  // Show color picker when "Custom" color is selected
857
- jQuery('select.addtoany_icon_color').bind('change click', show_color_picker_for_custom).each(show_color_picker_for_custom);
858
 
859
  // Toggle child options of 'Display in posts'
860
- jQuery('#A2A_SHARE_SAVE_display_in_posts').bind('change click', function(e){
861
  if (jQuery(this).is(':checked'))
862
  jQuery('.A2A_SHARE_SAVE_child_of_display_in_posts').attr('checked', true).attr('disabled', false);
863
  else
@@ -865,7 +876,7 @@ function A2A_SHARE_SAVE_admin_head() {
865
  });
866
 
867
  // Update button position labels/values universally in Placement section
868
- jQuery('select[name="A2A_SHARE_SAVE_position"]').bind('change click', function(e){
869
  var $this = jQuery(this);
870
  jQuery('select[name="A2A_SHARE_SAVE_position"]').not($this).val($this.val());
871
 
@@ -950,8 +961,8 @@ function A2A_SHARE_SAVE_admin_head() {
950
  }
951
 
952
  var new_service = this_service.toggleClass('addtoany_selected')
953
- .unbind('click', moveToSortableList)
954
- .bind('click', moveToSelectableList)
955
  .clone();
956
 
957
  new_service.data('a2a_32_icon_html', this_service.find('img').clone().attr('alt', this_service.attr('title')).wrap('<p>').parent().html() + configurable_html);
@@ -970,8 +981,8 @@ function A2A_SHARE_SAVE_admin_head() {
970
  // Service click again = move back to selectable list
971
  var moveToSelectableList = function(){
972
  jQuery(this).toggleClass('addtoany_selected')
973
- .unbind('click', moveToSelectableList)
974
- .bind('click', moveToSortableList);
975
 
976
  jQuery( '#'+jQuery(this).attr('id').substr(4).replace(/\./, '\\.') )
977
  .hide('fast', function(){
@@ -986,7 +997,7 @@ function A2A_SHARE_SAVE_admin_head() {
986
  };
987
 
988
  // Service click = move to sortable list
989
- jQuery('#addtoany_services_selectable li').bind('click', moveToSortableList);
990
 
991
  // Form submit = get sortable list
992
  jQuery('#addtoany_admin_form').submit(function(){to_input('#addtoany_services_sortable')});
@@ -1088,10 +1099,41 @@ function A2A_SHARE_SAVE_admin_head() {
1088
  });
1089
  // Add margin-top to 'show section' buttons if section is visible
1090
  jQuery('.addtoany_extra_section:visible').next('fieldset').find('.addtoany_show_more_button').css('margin-top', '10px');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1091
  });
1092
  </script>
1093
 
1094
  <style>
 
1095
  .color-field-container,
1096
  .CodeMirror-hints{display:none;}
1097
 
219
  if ( 'floating' == $current_screen ) {
220
  // Floating options screen
221
 
222
+ $possible_floating_values = array( 'left_docked', 'right_docked', 'left_attached', 'right_attached', 'none' );
223
 
224
  $new_options['floating_vertical'] = ( in_array( $_POST['A2A_SHARE_SAVE_floating_vertical'], $possible_floating_values ) ) ? $_POST['A2A_SHARE_SAVE_floating_vertical'] : 'none';
225
  $new_options['floating_horizontal'] = ( in_array( $_POST['A2A_SHARE_SAVE_floating_horizontal'], $possible_floating_values ) ) ? $_POST['A2A_SHARE_SAVE_floating_horizontal'] : 'none';
234
  is_numeric( $_POST['A2A_SHARE_SAVE_floating_horizontal_offset'] )
235
  ) ? $_POST['A2A_SHARE_SAVE_floating_horizontal_offset'] : '0';
236
 
 
237
  $new_options['floating_horizontal_responsive'] = (
238
  isset( $_POST['A2A_SHARE_SAVE_floating_horizontal_responsive'] ) &&
239
  '1' == $_POST['A2A_SHARE_SAVE_floating_horizontal_responsive']
256
  isset( $_POST['A2A_SHARE_SAVE_floating_vertical_position'] ) &&
257
  is_numeric( $_POST['A2A_SHARE_SAVE_floating_vertical_position'] )
258
  ) ? $_POST['A2A_SHARE_SAVE_floating_vertical_position'] : '100';
259
+
260
+ $new_options['floating_vertical_attached_to'] = (
261
+ ! empty( $_POST['A2A_SHARE_SAVE_floating_vertical_attached_to'] )
262
+ ) ? $_POST['A2A_SHARE_SAVE_floating_vertical_attached_to'] : 'main, [role="main"], article, .status-publish';
263
 
264
  $new_options['floating_vertical_offset'] = (
265
  isset( $_POST['A2A_SHARE_SAVE_floating_vertical_offset'] ) &&
687
  <?php if ( 'floating' == $current_screen ) : ?>
688
 
689
  <p><?php _e('AddToAny &quot;floating&quot; share buttons stay in a fixed position even when the user scrolls.', 'add-to-any'); ?></p>
 
690
 
691
  <h3><?php _e('Vertical Buttons', 'add-to-any'); ?></h3>
692
  <table class="form-table">
697
  <br>
698
  <label><input type="radio" name="A2A_SHARE_SAVE_floating_vertical" value="right_docked"<?php if ( isset( $options['floating_vertical'] ) && 'right_docked' == $options['floating_vertical'] ) echo ' checked="checked"'; ?>> <?php _e('Right docked', 'add-to-any'); ?></label>
699
  <br>
700
+ <label><input type="radio" name="A2A_SHARE_SAVE_floating_vertical" value="left_attached"<?php if ( isset( $options['floating_vertical'] ) && 'left_attached' == $options['floating_vertical'] ) echo ' checked="checked"'; ?>> <?php _e('Attach to content', 'add-to-any'); ?></label>
701
+ <br>
702
  <label><input type="radio" name="A2A_SHARE_SAVE_floating_vertical" value="none"<?php if ( ! isset( $options['floating_vertical'] ) || 'none' == $options['floating_vertical'] ) echo ' checked="checked"'; ?>> <?php _e('None', 'add-to-any'); ?></label>
703
+ <div class="addtoany_floating_vertical_attached_to">
704
+ <br>
705
+ <label>
706
+ Attach to <input name="A2A_SHARE_SAVE_floating_vertical_attached_to" type="text" class="regular-text code" placeholder=".content-area" value="<?php if ( isset( $options['floating_vertical_attached_to'] ) ) esc_attr_e( $options['floating_vertical_attached_to'] ); else esc_attr_e( 'main, [role="main"], article, .status-publish' ); ?>" />
707
+ <p class="description">Enter a <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors" class="description" rel="noopener" target="_blank">CSS selector</a>,or group of selectors, that match the HTML element you want to attach to.</p>
708
+ </label>
709
+ </div>
710
  </fieldset></td>
711
  </tr>
712
  <tr valign="top">
728
  <tr valign="top">
729
  <th scope="row"><?php _e("Offset", 'add-to-any'); ?></th>
730
  <td><fieldset>
731
+ <label><input name="A2A_SHARE_SAVE_floating_vertical_offset" type="number" value="<?php if ( isset( $options['floating_vertical_offset'] ) ) esc_attr_e( $options['floating_vertical_offset'] ); else echo '0'; ?>" class="small-text" /> pixels from left <span id="addtoany_vertical_offset_text">or right</span></label>
732
  </fieldset></td>
733
  </tr>
734
  <tr valign="top">
865
  }
866
 
867
  // Show color picker when "Custom" color is selected
868
+ jQuery('select.addtoany_icon_color').on('change', show_color_picker_for_custom).each(show_color_picker_for_custom);
869
 
870
  // Toggle child options of 'Display in posts'
871
+ jQuery('#A2A_SHARE_SAVE_display_in_posts').on('change', function(e){
872
  if (jQuery(this).is(':checked'))
873
  jQuery('.A2A_SHARE_SAVE_child_of_display_in_posts').attr('checked', true).attr('disabled', false);
874
  else
876
  });
877
 
878
  // Update button position labels/values universally in Placement section
879
+ jQuery('select[name="A2A_SHARE_SAVE_position"]').on('change', function(e){
880
  var $this = jQuery(this);
881
  jQuery('select[name="A2A_SHARE_SAVE_position"]').not($this).val($this.val());
882
 
961
  }
962
 
963
  var new_service = this_service.toggleClass('addtoany_selected')
964
+ .off('click', moveToSortableList)
965
+ .on('click', moveToSelectableList)
966
  .clone();
967
 
968
  new_service.data('a2a_32_icon_html', this_service.find('img').clone().attr('alt', this_service.attr('title')).wrap('<p>').parent().html() + configurable_html);
981
  // Service click again = move back to selectable list
982
  var moveToSelectableList = function(){
983
  jQuery(this).toggleClass('addtoany_selected')
984
+ .off('click', moveToSelectableList)
985
+ .on('click', moveToSortableList);
986
 
987
  jQuery( '#'+jQuery(this).attr('id').substr(4).replace(/\./, '\\.') )
988
  .hide('fast', function(){
997
  };
998
 
999
  // Service click = move to sortable list
1000
+ jQuery('#addtoany_services_selectable li').on('click', moveToSortableList);
1001
 
1002
  // Form submit = get sortable list
1003
  jQuery('#addtoany_admin_form').submit(function(){to_input('#addtoany_services_sortable')});
1099
  });
1100
  // Add margin-top to 'show section' buttons if section is visible
1101
  jQuery('.addtoany_extra_section:visible').next('fieldset').find('.addtoany_show_more_button').css('margin-top', '10px');
1102
+
1103
+ // Show/hide selector input for floating vertical "attached" placement
1104
+ var floating_vertical_selector = 'input[name="A2A_SHARE_SAVE_floating_vertical"]';
1105
+ var floating_vertical_offset = jQuery('[name="A2A_SHARE_SAVE_floating_vertical_offset"]');
1106
+ function floating_vertical_attached_selected() {
1107
+ return -1 !== jQuery.inArray( jQuery(floating_vertical_selector+':checked').val(), ['left_attached', 'right_attached'] ) ? true : false;
1108
+ }
1109
+ if ( floating_vertical_attached_selected() ) {
1110
+ jQuery('.addtoany_floating_vertical_attached_to').slideDown('fast');
1111
+ jQuery('#addtoany_vertical_offset_text').text('of content');
1112
+ }
1113
+ jQuery(floating_vertical_selector).on('change', function(e) {
1114
+ if ( floating_vertical_attached_selected() ) {
1115
+ jQuery('.addtoany_floating_vertical_attached_to').slideDown('fast');
1116
+ jQuery('#addtoany_vertical_offset_text').text('of content');
1117
+ var offset = floating_vertical_offset;
1118
+ window.__addtoany_vertical_offset = offset.val();
1119
+ if ( '0' == offset.val() ) {
1120
+ var icon_size = parseInt( jQuery('[name="A2A_SHARE_SAVE_floating_vertical_icon_size"]').val(), 10 );
1121
+ offset.val( '-' + icon_size * 2 );
1122
+ }
1123
+ } else {
1124
+ jQuery('.addtoany_floating_vertical_attached_to').slideUp('fast');
1125
+ jQuery('#addtoany_vertical_offset_text').text('or right');
1126
+ if (window.__addtoany_vertical_offset) {
1127
+ floating_vertical_offset.val( window.__addtoany_vertical_offset );
1128
+ delete window.__addtoany_vertical_offset;
1129
+ }
1130
+ }
1131
+ });
1132
  });
1133
  </script>
1134
 
1135
  <style>
1136
+ .addtoany_floating_vertical_attached_to,
1137
  .color-field-container,
1138
  .CodeMirror-hints{display:none;}
1139
 
addtoany.services.php CHANGED
@@ -117,11 +117,6 @@ $A2A_SHARE_SAVE_services = array(
117
  "icon" => "link",
118
  "color" => "0166FF",
119
  ),
120
- "delicious" => array(
121
- "name" => "Delicious",
122
- "icon" => "delicious",
123
- "color" => "39F",
124
- ),
125
  "design_float" => array(
126
  "name" => "Design Float",
127
  "icon" => "designfloat",
@@ -272,6 +267,11 @@ $A2A_SHARE_SAVE_services = array(
272
  "icon" => "meneame",
273
  "color" => "FF7D12",
274
  ),
 
 
 
 
 
275
  "mixi" => array(
276
  "name" => "Mixi",
277
  "icon" => "mixi",
@@ -317,11 +317,6 @@ $A2A_SHARE_SAVE_services = array(
317
  "icon" => "pocket",
318
  "color" => "EE4056",
319
  ),
320
- "polyvore" => array(
321
- "name" => "Polyvore",
322
- "icon" => "polyvore",
323
- "color" => "2A2A2A",
324
- ),
325
  "print" => array(
326
  "name" => "Print",
327
  "icon" => "print",
@@ -402,8 +397,8 @@ $A2A_SHARE_SAVE_services = array(
402
  "icon" => "svejo",
403
  "color" => "5BD428",
404
  ),
405
- "symbaloo_feeds" => array(
406
- "name" => "Symbaloo Feeds",
407
  "icon" => "symbaloo",
408
  "color" => "6DA8F7",
409
  ),
@@ -477,21 +472,11 @@ $A2A_SHARE_SAVE_services = array(
477
  "icon" => "xing",
478
  "color" => "165B66",
479
  ),
480
- "yahoo_bookmarks" => array(
481
- "name" => "Yahoo Bookmarks",
482
- "icon" => "yahoo",
483
- "color" => "400090",
484
- ),
485
  "yahoo_mail" => array(
486
  "name" => "Yahoo Mail",
487
  "icon" => "yahoo",
488
  "color" => "400090",
489
  ),
490
- "yahoo_messenger" => array(
491
- "name" => "Yahoo Messenger",
492
- "icon" => "yim",
493
- "color" => "400090",
494
- ),
495
  "yoolink" => array(
496
  "name" => "Yoolink",
497
  "icon" => "yoolink",
117
  "icon" => "link",
118
  "color" => "0166FF",
119
  ),
 
 
 
 
 
120
  "design_float" => array(
121
  "name" => "Design Float",
122
  "icon" => "designfloat",
267
  "icon" => "meneame",
268
  "color" => "FF7D12",
269
  ),
270
+ "mix" => array(
271
+ "name" => "Mix",
272
+ "icon" => "mix",
273
+ "color" => "ff8226",
274
+ ),
275
  "mixi" => array(
276
  "name" => "Mixi",
277
  "icon" => "mixi",
317
  "icon" => "pocket",
318
  "color" => "EE4056",
319
  ),
 
 
 
 
 
320
  "print" => array(
321
  "name" => "Print",
322
  "icon" => "print",
397
  "icon" => "svejo",
398
  "color" => "5BD428",
399
  ),
400
+ "symbaloo_bookmarks" => array(
401
+ "name" => "Symbaloo Bookmarks",
402
  "icon" => "symbaloo",
403
  "color" => "6DA8F7",
404
  ),
472
  "icon" => "xing",
473
  "color" => "165B66",
474
  ),
 
 
 
 
 
475
  "yahoo_mail" => array(
476
  "name" => "Yahoo Mail",
477
  "icon" => "yahoo",
478
  "color" => "400090",
479
  ),
 
 
 
 
 
480
  "yoolink" => array(
481
  "name" => "Yoolink",
482
  "icon" => "yoolink",
icons/delicious.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#fff" d="M4 4h12v12H4z"/><path fill="#fff" opacity=".2" d="M4 16h12v12H4z"/><path fill="#fff" opacity=".8" d="M16 16h12v12H16z"/><path fill="#fff" opacity=".4" d="M16 4h12v12H16z"/></svg>
 
icons/mix.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><g fill="#FFF"><path opacity=".8" d="M27.87 4.125c-5.224 0-9.467 4.159-9.467 9.291v2.89c0-1.306 1.074-2.362 2.399-2.362s2.399 1.056 2.399 2.362v1.204c0 1.306 1.074 2.362 2.399 2.362s2.399-1.056 2.399-2.362V4.134c-.036-.009-.082-.009-.129-.009"/><path d="M4 4.125v12.94c2.566 0 4.668-1.973 4.807-4.465v-2.214c0-.065 0-.12.009-.176.093-1.213 1.13-2.177 2.39-2.177 1.325 0 2.399 1.056 2.399 2.362v9.226c0 1.306 1.074 2.353 2.399 2.353s2.399-1.056 2.399-2.353v-6.206c0-5.132 4.233-9.291 9.467-9.291H4z"/><path opacity=".8" d="M4 17.074v8.438c0 1.306 1.074 2.362 2.399 2.362s2.399-1.056 2.399-2.362V12.61C8.659 15.102 6.566 17.074 4 17.074"/></g></svg>
icons/polyvore.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path d="M7.82 5h9.84a6.68 6.68 0 0 1 4.72 1.65 6 6 0 0 1 1.8 4.65 6.76 6.76 0 0 1-1.6 4.5 6 6 0 0 1-4.9 1.9H10.8V27h-3zm11.56 3a6.4 6.4 0 0 0-2.7-.46H10.8v7.62h5.9a5.6 5.6 0 0 0 3.22-.85 3.4 3.4 0 0 0 1.24-3A3.3 3.3 0 0 0 19.38 8z" fill="#fff"/></svg>
 
icons/yim.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#FFF" d="M16 27c6.074 0 11-4.926 11-11 0-6.075-4.926-11-11-11S5 9.925 5 16c0 6.074 4.926 11 11 11zm2.808-17.016a1.432 1.432 0 1 1 .003 2.865 1.432 1.432 0 0 1-.003-2.865zm-5.443 0a1.433 1.433 0 1 1 0 2.865 1.433 1.433 0 0 1 0-2.865zm-5.1 4.583h15.47v2.866h-.032a7.726 7.726 0 1 1-15.402 0h-.03v-2.866zm14.42 2.56H9.13v-1.764h13.554v1.764z"/></svg>