AddToAny Share Buttons - Version 1.3.1

Version Description

  • Floating share buttons are now responsive by default
  • Responsive breakpoints configurable in Floating options
  • "Use default CSS" must be enabled in Advanced Options for responsiveness
Download this release

Release Info

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

Code changes from version 1.3.0.1 to 1.3.1

Files changed (3) hide show
  1. README.txt +14 -5
  2. add-to-any.php +69 -2
  3. addtoany.admin.php +41 -0
README.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Share Buttons by AddToAny ===
2
  Contributors: micropat, addtoany
3
- Tags: sharing, share, share this, bookmarking, social, share button, share buttons, share links, social share, social sharing, social bookmarking, social bookmarks, bookmark, bookmarks, save, Post, posts, page, pages, images, image, admin, statistics, stats, links, plugin, shortcode, sidebar, widget, email, e-mail, print, seo, button, delicious, google, tumblr, linkedin, digg, reddit, facebook, facebook share, facebook like, like, twitter, twitter button, twitter share, tweet, +1, plus 1, google plus, google plus one, plus one, pinterest, pin, pin it, pinit, wanelo, buffer, stumbleupon, bitly, technorati, lockerz, addthis, sociable, sharedaddy, sharethis, shareaholic, icon, icons, vector, SVG, floating, floating buttons, wpmu, Add to Any, AddToAny
4
  Requires at least: 2.8
5
  Tested up to: 3.9.1
6
- Stable tag: 1.3.0.1
7
 
8
  Share buttons for WordPress including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, StumbleUpon and many more.
9
 
@@ -15,7 +15,7 @@ AddToAny's customizable platform and social share icons let you optimize your si
15
 
16
  = Share Buttons =
17
 
18
- * **New**: Floating share buttons — optional & customizable, vertical & horizontal
19
  * Vector sharing buttons (SVG sharing icons)
20
  * Universal Share Button and Smart Menu
21
  * Sharing Kit for individual share links
@@ -40,11 +40,12 @@ AddToAny's customizable platform and social share icons let you optimize your si
40
 
41
  * Loads asynchronously so your content always loads before or in parallel with AddToAny
42
  * Supports theme features such as HTML5 & XHTML, widgets, infinite scroll, post formats
 
43
 
44
  = Mobile Optimized & Retina Ready =
45
 
46
- * AddToAny gives users the choice in sharing from a service's native app or from a web app
47
- * For example, choose between Twitter's native app or Twitter's mobile web app
48
  * AddToAny's SVG icons are super-lightweight and pixel-perfect at any size
49
 
50
  = Customizable & Extensible =
@@ -277,6 +278,11 @@ Upload the plugin directory (including all files and directories within) to the
277
 
278
  == Changelog ==
279
 
 
 
 
 
 
280
  = 1.3.0.1 =
281
  * Apply universal sharing button toggle to floating buttons
282
 
@@ -1150,6 +1156,9 @@ Upload the plugin directory (including all files and directories within) to the
1150
 
1151
  == Upgrade Notice ==
1152
 
 
 
 
1153
  = 1.3 =
1154
  Floating Share Buttons are now available! Click the "Floating" tab in Settings > AddToAny.
1155
 
1
  === Share Buttons by AddToAny ===
2
  Contributors: micropat, addtoany
3
+ Tags: sharing, share, share this, bookmarking, social, share button, share buttons, share links, social share, social sharing, social bookmarking, social bookmarks, bookmark, bookmarks, save, Post, posts, page, pages, images, image, admin, statistics, stats, links, plugin, shortcode, sidebar, widget, responsive, email, e-mail, print, seo, button, delicious, google, tumblr, linkedin, digg, reddit, facebook, facebook share, facebook like, like, twitter, twitter button, twitter share, tweet, +1, plus 1, google plus, google plus one, plus one, pinterest, pin, pin it, pinit, wanelo, buffer, stumbleupon, bitly, technorati, lockerz, addthis, sociable, sharedaddy, sharethis, shareaholic, icon, icons, vector, SVG, floating, floating buttons, wpmu, Add to Any, AddToAny
4
  Requires at least: 2.8
5
  Tested up to: 3.9.1
6
+ Stable tag: 1.3.1
7
 
8
  Share buttons for WordPress including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, StumbleUpon and many more.
9
 
15
 
16
  = Share Buttons =
17
 
18
+ * **New**: Floating share buttons — responsive & customizable, vertical & horizontal
19
  * Vector sharing buttons (SVG sharing icons)
20
  * Universal Share Button and Smart Menu
21
  * Sharing Kit for individual share links
40
 
41
  * Loads asynchronously so your content always loads before or in parallel with AddToAny
42
  * Supports theme features such as HTML5 & XHTML, widgets, infinite scroll, post formats
43
+ * No signup, no login, no account necessary
44
 
45
  = Mobile Optimized & Retina Ready =
46
 
47
+ * AddToAny gives users the choice in sharing from a service's native app or from a web app. For example, choose between Twitter's native app or Twitter's mobile web app
48
+ * Responsive Floating Share Buttons are mobile ready by default, and configurable breakpoints make floating buttons work with any theme
49
  * AddToAny's SVG icons are super-lightweight and pixel-perfect at any size
50
 
51
  = Customizable & Extensible =
278
 
279
  == Changelog ==
280
 
281
+ = 1.3.1 =
282
+ * Floating share buttons are now responsive by default
283
+ * Responsive breakpoints configurable in Floating options
284
+ * "Use default CSS" must be enabled in Advanced Options for responsiveness
285
+
286
  = 1.3.0.1 =
287
  * Apply universal sharing button toggle to floating buttons
288
 
1156
 
1157
  == Upgrade Notice ==
1158
 
1159
+ = 1.3.1 =
1160
+ Floating share buttons are now responsive by default, ready for mobile & tablets. You can toggle responsiveness and set responsive breakpoints in the "Floating" tab of Settings > AddToAny.
1161
+
1162
  = 1.3 =
1163
  Floating Share Buttons are now available! Click the "Floating" tab in Settings > AddToAny.
1164
 
add-to-any.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Share Buttons by AddToAny
4
  Plugin URI: http://www.addtoany.com/
5
  Description: Share buttons for your pages including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, StumbleUpon and many more. [<a href="options-general.php?page=add-to-any.php">Settings</a>]
6
- Version: 1.3.0.1
7
  Author: AddToAny
8
  Author URI: http://www.addtoany.com/
9
  */
@@ -867,10 +867,77 @@ add_shortcode( 'addtoany', 'A2A_SHARE_SAVE_shortcode' );
867
  function A2A_SHARE_SAVE_stylesheet() {
868
  global $A2A_SHARE_SAVE_options, $A2A_SHARE_SAVE_plugin_url_path;
869
 
 
 
870
  // Use stylesheet?
871
- if ( ! isset( $A2A_SHARE_SAVE_options['inline_css'] ) || $A2A_SHARE_SAVE_options['inline_css'] != '-1' && ! is_admin() ) {
 
872
  wp_enqueue_style( 'A2A_SHARE_SAVE', $A2A_SHARE_SAVE_plugin_url_path . '/addtoany.min.css', false, '1.6' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
873
  }
 
874
  }
875
 
876
  add_action( 'wp_print_styles', 'A2A_SHARE_SAVE_stylesheet' );
3
  Plugin Name: Share Buttons by AddToAny
4
  Plugin URI: http://www.addtoany.com/
5
  Description: Share buttons for your pages including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, StumbleUpon and many more. [<a href="options-general.php?page=add-to-any.php">Settings</a>]
6
+ Version: 1.3.1
7
  Author: AddToAny
8
  Author URI: http://www.addtoany.com/
9
  */
867
  function A2A_SHARE_SAVE_stylesheet() {
868
  global $A2A_SHARE_SAVE_options, $A2A_SHARE_SAVE_plugin_url_path;
869
 
870
+ $options = $A2A_SHARE_SAVE_options;
871
+
872
  // Use stylesheet?
873
+ if ( ! isset( $options['inline_css'] ) || $options['inline_css'] != '-1' && ! is_admin() ) {
874
+
875
  wp_enqueue_style( 'A2A_SHARE_SAVE', $A2A_SHARE_SAVE_plugin_url_path . '/addtoany.min.css', false, '1.6' );
876
+
877
+ // wp_add_inline_style requires WP 3.3+
878
+ if ( '3.3' <= get_bloginfo( 'version' ) ) {
879
+
880
+ // Prepare inline CSS for media queries on floating bars
881
+ $inline_css = '';
882
+
883
+ $vertical_type = ( isset( $options['floating_vertical'] ) && 'none' != $options['floating_vertical'] ) ? $options['floating_vertical'] : false;
884
+ $horizontal_type = ( isset( $options['floating_horizontal'] ) && 'none' != $options['floating_horizontal'] ) ? $options['floating_horizontal'] : false;
885
+
886
+ // If vertical bar is enabled
887
+ if ( $vertical_type &&
888
+ // and respsonsiveness is enabled
889
+ ( ! isset( $options['floating_vertical_responsive'] ) || '-1' != $options['floating_vertical_responsive'] )
890
+ ) {
891
+
892
+ // Get min-width for media query
893
+ $vertical_max_width = (
894
+ isset( $options['floating_vertical_responsive_max_width'] ) &&
895
+ is_numeric( $options['floating_vertical_responsive_max_width'] )
896
+ ) ? $options['floating_vertical_responsive_max_width'] : '980';
897
+
898
+ // Set media query
899
+ $inline_css .= '@media screen and (max-width:' . $vertical_max_width . 'px){' . "\n"
900
+ . '.a2a_floating_style.a2a_vertical_style{display:none;}' . "\n"
901
+ . '}';
902
+
903
+ }
904
+
905
+ // If horizontal bar is enabled
906
+ if ( $horizontal_type &&
907
+ // and respsonsiveness is enabled
908
+ ( ! isset( $options['floating_horizontal_responsive'] ) || '-1' != $options['floating_horizontal_responsive'] )
909
+ ) {
910
+
911
+ // Get max-width for media query
912
+ $horizontal_min_width = (
913
+ isset( $options['floating_horizontal_responsive_min_width'] ) &&
914
+ is_numeric( $options['floating_horizontal_responsive_min_width'] )
915
+ ) ? $options['floating_horizontal_responsive_min_width'] : '981';
916
+
917
+ // If there is inline CSS already
918
+ if ( 0 < strlen( $inline_css ) ) {
919
+ // Insert newline
920
+ $inline_css .= "\n";
921
+ }
922
+
923
+ // Set media query
924
+ $inline_css .= '@media screen and (min-width:' . $horizontal_min_width . 'px){' . "\n"
925
+ . '.a2a_floating_style.a2a_default_style{display:none;}' . "\n"
926
+ . '}';
927
+
928
+ }
929
+
930
+ // If there is inline CSS
931
+ if ( 0 < strlen( $inline_css ) ) {
932
+
933
+ // Insert inline CSS
934
+ wp_add_inline_style( 'A2A_SHARE_SAVE', $inline_css );
935
+ }
936
+
937
+ }
938
+
939
  }
940
+
941
  }
942
 
943
  add_action( 'wp_print_styles', 'A2A_SHARE_SAVE_stylesheet' );
addtoany.admin.php CHANGED
@@ -216,6 +216,16 @@ function A2A_SHARE_SAVE_options_page() {
216
  is_numeric( $_POST['A2A_SHARE_SAVE_floating_vertical_offset'] )
217
  ) ? $_POST['A2A_SHARE_SAVE_floating_vertical_offset'] : '0';
218
 
 
 
 
 
 
 
 
 
 
 
219
  $new_options['floating_horizontal_position'] = (
220
  isset( $_POST['A2A_SHARE_SAVE_floating_horizontal_position'] ) &&
221
  is_numeric( $_POST['A2A_SHARE_SAVE_floating_horizontal_position'] )
@@ -226,6 +236,17 @@ function A2A_SHARE_SAVE_options_page() {
226
  is_numeric( $_POST['A2A_SHARE_SAVE_floating_horizontal_offset'] )
227
  ) ? $_POST['A2A_SHARE_SAVE_floating_horizontal_offset'] : '0';
228
 
 
 
 
 
 
 
 
 
 
 
 
229
  } else {
230
  // Standard options screen
231
 
@@ -631,6 +652,16 @@ function A2A_SHARE_SAVE_options_page() {
631
  </fieldset></td>
632
  </tr>
633
  <tr valign="top">
 
 
 
 
 
 
 
 
 
 
634
  <th scope="row"><?php _e("Position", "add-to-any"); ?></th>
635
  <td><fieldset>
636
  <label><input name="A2A_SHARE_SAVE_floating_vertical_position" type="number" step="1" value="<?php if ( isset( $options['floating_vertical_position'] ) ) echo $options['floating_vertical_position']; else echo '100'; ?>" class="small-text" /> pixels from top</label>
@@ -657,6 +688,16 @@ function A2A_SHARE_SAVE_options_page() {
657
  </fieldset></td>
658
  </tr>
659
  <tr valign="top">
 
 
 
 
 
 
 
 
 
 
660
  <th scope="row"><?php _e("Position", "add-to-any"); ?></th>
661
  <td><fieldset>
662
  <label><input name="A2A_SHARE_SAVE_floating_horizontal_position" type="number" step="1" value="<?php if ( isset( $options['floating_horizontal_position'] ) ) echo $options['floating_horizontal_position']; else echo '0'; ?>" class="small-text" /> pixels from left or right</label>
216
  is_numeric( $_POST['A2A_SHARE_SAVE_floating_vertical_offset'] )
217
  ) ? $_POST['A2A_SHARE_SAVE_floating_vertical_offset'] : '0';
218
 
219
+ $new_options['floating_vertical_responsive'] = (
220
+ isset( $_POST['A2A_SHARE_SAVE_floating_vertical_responsive'] ) &&
221
+ '1' == $_POST['A2A_SHARE_SAVE_floating_vertical_responsive']
222
+ ) ? '1' : '-1';
223
+
224
+ $new_options['floating_vertical_responsive_max_width'] = (
225
+ isset( $_POST['A2A_SHARE_SAVE_floating_vertical_responsive_max_width'] ) &&
226
+ is_numeric( $_POST['A2A_SHARE_SAVE_floating_vertical_responsive_max_width'] )
227
+ ) ? $_POST['A2A_SHARE_SAVE_floating_vertical_responsive_max_width'] : '980';
228
+
229
  $new_options['floating_horizontal_position'] = (
230
  isset( $_POST['A2A_SHARE_SAVE_floating_horizontal_position'] ) &&
231
  is_numeric( $_POST['A2A_SHARE_SAVE_floating_horizontal_position'] )
236
  is_numeric( $_POST['A2A_SHARE_SAVE_floating_horizontal_offset'] )
237
  ) ? $_POST['A2A_SHARE_SAVE_floating_horizontal_offset'] : '0';
238
 
239
+
240
+ $new_options['floating_horizontal_responsive'] = (
241
+ isset( $_POST['A2A_SHARE_SAVE_floating_horizontal_responsive'] ) &&
242
+ '1' == $_POST['A2A_SHARE_SAVE_floating_horizontal_responsive']
243
+ ) ? '1' : '-1';
244
+
245
+ $new_options['floating_horizontal_responsive_min_width'] = (
246
+ isset( $_POST['A2A_SHARE_SAVE_floating_horizontal_responsive_min_width'] ) &&
247
+ is_numeric( $_POST['A2A_SHARE_SAVE_floating_horizontal_responsive_min_width'] )
248
+ ) ? $_POST['A2A_SHARE_SAVE_floating_horizontal_responsive_min_width'] : '981';
249
+
250
  } else {
251
  // Standard options screen
252
 
652
  </fieldset></td>
653
  </tr>
654
  <tr valign="top">
655
+ <th scope="row"><?php _e("Responsiveness", "add-to-any"); ?></th>
656
+ <td><fieldset>
657
+ <label>
658
+ <input id="A2A_SHARE_SAVE_floating_vertical_responsive" name="A2A_SHARE_SAVE_floating_vertical_responsive" type="checkbox"<?php
659
+ if ( ! isset( $options['floating_vertical_responsive'] ) || $options['floating_vertical_responsive'] != '-1' ) echo ' checked="checked"'; ?> value="1" />
660
+ Only display when screen is larger than <input name="A2A_SHARE_SAVE_floating_vertical_responsive_max_width" type="number" step="1" value="<?php if ( isset( $options['floating_vertical_responsive_max_width'] ) ) echo $options['floating_vertical_responsive_max_width']; else echo '980'; ?>" class="small-text" /> pixels wide
661
+ </label>
662
+ </fieldset></td>
663
+ </tr>
664
+ <tr valign="top">
665
  <th scope="row"><?php _e("Position", "add-to-any"); ?></th>
666
  <td><fieldset>
667
  <label><input name="A2A_SHARE_SAVE_floating_vertical_position" type="number" step="1" value="<?php if ( isset( $options['floating_vertical_position'] ) ) echo $options['floating_vertical_position']; else echo '100'; ?>" class="small-text" /> pixels from top</label>
688
  </fieldset></td>
689
  </tr>
690
  <tr valign="top">
691
+ <th scope="row"><?php _e("Responsiveness", "add-to-any"); ?></th>
692
+ <td><fieldset>
693
+ <label>
694
+ <input id="A2A_SHARE_SAVE_floating_horizontal_responsive" name="A2A_SHARE_SAVE_floating_horizontal_responsive" type="checkbox"<?php
695
+ if ( ! isset( $options['floating_horizontal_responsive'] ) || $options['floating_horizontal_responsive'] != '-1' ) echo ' checked="checked"'; ?> value="1" />
696
+ Only display when screen is smaller than <input name="A2A_SHARE_SAVE_floating_horizontal_responsive_min_width" type="number" step="1" value="<?php if ( isset( $options['floating_horizontal_responsive_min_width'] ) ) echo $options['floating_horizontal_responsive_min_width']; else echo '981'; ?>" class="small-text" /> pixels wide
697
+ </label>
698
+ </fieldset></td>
699
+ </tr>
700
+ <tr valign="top">
701
  <th scope="row"><?php _e("Position", "add-to-any"); ?></th>
702
  <td><fieldset>
703
  <label><input name="A2A_SHARE_SAVE_floating_horizontal_position" type="number" step="1" value="<?php if ( isset( $options['floating_horizontal_position'] ) ) echo $options['floating_horizontal_position']; else echo '0'; ?>" class="small-text" /> pixels from left or right</label>