Version Description
- Fix the option to hide a floating bar when scrolled to a footer region
- Fix placeholders and add a description for translating a string in admin (thanks Andreas)
- Remove unnecessary data attributes from AddToAny Follow widgets
- Add some supplementary escaping
- Simplify some variable assignments
Download this release
Release Info
Developer | micropat |
Plugin | AddToAny Share Buttons |
Version | 1.7.32 |
Comparing to | |
See all releases |
Code changes from version 1.7.31 to 1.7.32
- README.txt +9 -2
- add-to-any.php +77 -91
- addtoany.admin.php +13 -8
- addtoany.widgets.php +6 -8
README.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: buttons, share, icons, social media, share buttons, sharing, share button,
|
|
4 |
Requires at least: 3.7
|
5 |
Tested up to: 5.0
|
6 |
Requires PHP: 5.2
|
7 |
-
Stable tag: 1.7.
|
8 |
|
9 |
Share buttons for WordPress including the AddToAny sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp, many more, and follow icons too.
|
10 |
|
@@ -76,7 +76,7 @@ See also:
|
|
76 |
* The <a href="https://www.addtoany.com/buttons/">share buttons</a> for all platforms
|
77 |
* The <a href="https://www.addtoany.com/buttons/for/wordpress_com">share buttons for WordPress.com</a>
|
78 |
|
79 |
-
<a href="https://www.addtoany.com/blog/">AddToAny Blog</a> | <a href="https://www.addtoany.com/privacy">Privacy Policy</a>
|
80 |
|
81 |
== Installation ==
|
82 |
|
@@ -350,6 +350,13 @@ Upload (or move) the `add-to-any` plugin directory into the `/wp-content/mu-plug
|
|
350 |
|
351 |
== Changelog ==
|
352 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
353 |
= 1.7.31 =
|
354 |
* Update language template file and extension
|
355 |
* Remove StumbleUpon
|
4 |
Requires at least: 3.7
|
5 |
Tested up to: 5.0
|
6 |
Requires PHP: 5.2
|
7 |
+
Stable tag: 1.7.32
|
8 |
|
9 |
Share buttons for WordPress including the AddToAny sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp, many more, and follow icons too.
|
10 |
|
76 |
* The <a href="https://www.addtoany.com/buttons/">share buttons</a> for all platforms
|
77 |
* The <a href="https://www.addtoany.com/buttons/for/wordpress_com">share buttons for WordPress.com</a>
|
78 |
|
79 |
+
<a href="https://www.addtoany.com/blog/">AddToAny Blog</a> | <a href="https://www.addtoany.com/privacy">Privacy Policy</a>
|
80 |
|
81 |
== Installation ==
|
82 |
|
350 |
|
351 |
== Changelog ==
|
352 |
|
353 |
+
= 1.7.32 =
|
354 |
+
* Fix the option to hide a floating bar when scrolled to a footer region
|
355 |
+
* Fix placeholders and add a description for translating a string in admin (thanks Andreas)
|
356 |
+
* Remove unnecessary data attributes from AddToAny Follow widgets
|
357 |
+
* Add some supplementary escaping
|
358 |
+
* Simplify some variable assignments
|
359 |
+
|
360 |
= 1.7.31 =
|
361 |
* Update language template file and extension
|
362 |
* Remove StumbleUpon
|
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
|
@@ -49,11 +49,16 @@ function A2A_SHARE_SAVE_init() {
|
|
49 |
}
|
50 |
add_filter( 'init', 'A2A_SHARE_SAVE_init' );
|
51 |
|
52 |
-
function A2A_SHARE_SAVE_link_vars( $
|
53 |
global $post;
|
54 |
|
55 |
-
|
56 |
-
|
|
|
|
|
|
|
|
|
|
|
57 |
if ( $use_current_page ) {
|
58 |
$linkname = is_home() || is_front_page() ? get_bloginfo( 'name' ) : rtrim( wp_title( '', false, 'right' ) );
|
59 |
} elseif ( isset( $post ) ) {
|
@@ -65,8 +70,8 @@ function A2A_SHARE_SAVE_link_vars( $linkname = false, $linkurl = false, $linkmed
|
|
65 |
|
66 |
$linkname_enc = rawurlencode( $linkname );
|
67 |
|
68 |
-
// Set linkurl
|
69 |
-
if ( ! $linkurl ) {
|
70 |
if ( $use_current_page ) {
|
71 |
$linkurl = esc_url_raw( home_url( $_SERVER['REQUEST_URI'] ) );
|
72 |
} elseif ( isset( $post ) ) {
|
@@ -79,29 +84,24 @@ function A2A_SHARE_SAVE_link_vars( $linkname = false, $linkurl = false, $linkmed
|
|
79 |
$linkurl_enc = rawurlencode( $linkurl );
|
80 |
|
81 |
// Set linkmedia (only applies to services that explicitly accept media; Pinterest does, most do not)
|
82 |
-
$linkmedia_enc = ! empty( $linkmedia ) ? rawurlencode( $linkmedia ) :
|
83 |
|
84 |
-
return compact( 'linkname', 'linkname_enc', 'linkurl', 'linkurl_enc', 'linkmedia', 'linkmedia_enc' );
|
85 |
}
|
86 |
|
87 |
// Combine ADDTOANY_SHARE_SAVE_ICONS and ADDTOANY_SHARE_SAVE_BUTTON
|
88 |
function ADDTOANY_SHARE_SAVE_KIT( $args = array() ) {
|
89 |
$options = get_option( 'addtoany_options', array() );
|
90 |
|
91 |
-
$
|
92 |
-
$linkurl = isset( $args['linkurl'] ) ? $args['linkurl'] : false;
|
93 |
-
$linkmedia = isset( $args['linkmedia'] ) ? $args['linkmedia'] : false;
|
94 |
-
$use_current_page = isset( $args['use_current_page'] ) ? $args['use_current_page'] : false;
|
95 |
-
|
96 |
-
$args = array_merge( $args, A2A_SHARE_SAVE_link_vars( $linkname, $linkurl, $linkmedia, $use_current_page ) ); // linkname_enc, etc.
|
97 |
|
98 |
$defaults = array(
|
99 |
'output_later' => false,
|
100 |
'icon_size' => isset( $options['icon_size'] ) ? $options['icon_size'] : '32',
|
|
|
101 |
);
|
102 |
|
103 |
$args = wp_parse_args( $args, $defaults );
|
104 |
-
extract( $args );
|
105 |
|
106 |
// If universal button disabled, and not manually disabled through args
|
107 |
if ( isset( $options['button'] ) && $options['button'] == 'NONE' && ! isset( $args['no_universal_button'] ) ) {
|
@@ -114,10 +114,10 @@ function ADDTOANY_SHARE_SAVE_KIT( $args = array() ) {
|
|
114 |
$custom_icons = ( isset( $options['custom_icons'] ) && $options['custom_icons'] == 'url' && isset( $options['custom_icons_url'] ) ) ? true : false;
|
115 |
|
116 |
$kit_additional_classes = '';
|
117 |
-
$kit_data_media = empty( $linkmedia ) ? '' : ' data-a2a-media="' . $linkmedia . '"';
|
118 |
-
$kit_data_title = empty( $linkname ) || $use_current_page ? '' : ' data-a2a-title="' . $linkname . '"';
|
119 |
-
$kit_data_url = empty( $linkurl ) || $use_current_page ? '' : ' data-a2a-url="' . $linkurl . '"';
|
120 |
-
$kit_data_scroll_show = empty( $scroll_show ) ? '' : ' data-a2a-scroll-show="' . $scroll_show . '"';
|
121 |
$kit_style = '';
|
122 |
|
123 |
// Add additional classNames to .a2a_kit
|
@@ -138,7 +138,7 @@ function ADDTOANY_SHARE_SAVE_KIT( $args = array() ) {
|
|
138 |
}
|
139 |
// a2a_kit_size_## icon size
|
140 |
} else {
|
141 |
-
$icon_size_classname = ' a2a_kit_size_' . $icon_size;
|
142 |
}
|
143 |
|
144 |
// Add addtoany_list className unless disabled (for floating buttons)
|
@@ -147,12 +147,12 @@ function ADDTOANY_SHARE_SAVE_KIT( $args = array() ) {
|
|
147 |
}
|
148 |
|
149 |
// Add style attribute if set
|
150 |
-
if (
|
151 |
-
$kit_style = ' style="' . $args['kit_style'] . '"';
|
152 |
}
|
153 |
|
154 |
if ( ! isset( $args['html_container_open'] ) ) {
|
155 |
-
$args['html_container_open'] = '<div class="a2a_kit' . $icon_size_classname . $kit_additional_classes . '"'
|
156 |
. $kit_data_url . $kit_data_title . $kit_data_media . $kit_data_scroll_show . $kit_style . '>';
|
157 |
$args['is_kit'] = true;
|
158 |
}
|
@@ -174,7 +174,7 @@ function ADDTOANY_SHARE_SAVE_KIT( $args = array() ) {
|
|
174 |
|
175 |
$kit_html .= ADDTOANY_SHARE_SAVE_BUTTON( $args );
|
176 |
|
177 |
-
if ( true == $output_later )
|
178 |
return $kit_html;
|
179 |
else
|
180 |
echo $kit_html;
|
@@ -189,11 +189,7 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
|
|
189 |
|
190 |
$options = get_option( 'addtoany_options', array() );
|
191 |
|
192 |
-
$
|
193 |
-
$linkurl = isset( $args['linkurl'] ) ? $args['linkurl'] : false;
|
194 |
-
$linkmedia = isset( $args['linkmedia'] ) ? $args['linkmedia'] : false;
|
195 |
-
|
196 |
-
$args = array_merge( $args, A2A_SHARE_SAVE_link_vars( $linkname, $linkurl, $linkmedia ) ); // linkname_enc, etc.
|
197 |
|
198 |
$defaults = array(
|
199 |
'linkname' => '',
|
@@ -215,7 +211,6 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
|
|
215 |
);
|
216 |
|
217 |
$args = wp_parse_args( $args, $defaults );
|
218 |
-
extract( $args );
|
219 |
|
220 |
$is_amp = function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ? true : false;
|
221 |
$amp_css = '.a2a_dd img{background-color:#0166FF;}';
|
@@ -238,13 +233,13 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
|
|
238 |
}
|
239 |
|
240 |
// If Follow kit
|
241 |
-
if ( $is_follow ) {
|
242 |
// Make available services extensible via plugins, themes (functions.php), etc.
|
243 |
$services = apply_filters( 'A2A_FOLLOW_services', $A2A_FOLLOW_services );
|
244 |
$service_codes = ( is_array( $services ) ) ? array_keys( $services ) : array();
|
245 |
|
246 |
// Services set by "buttons" arg
|
247 |
-
$active_services =
|
248 |
// Else Share kit
|
249 |
} else {
|
250 |
// Make available services extensible via plugins, themes (functions.php), etc.
|
@@ -252,17 +247,17 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
|
|
252 |
$service_codes = ( is_array( $services ) ) ? array_keys( $services ) : array();
|
253 |
|
254 |
// Include Facebook Like and Twitter Tweet etc. unless no_special_services arg is true
|
255 |
-
if ( ! isset( $no_special_services ) || false == $no_special_services ) {
|
256 |
array_unshift( $service_codes, 'facebook_like', 'twitter_tweet', 'google_plusone', 'google_plus_share', 'pinterest_pin' );
|
257 |
}
|
258 |
|
259 |
// Use default services if services have not been selected yet
|
260 |
-
$active_services =
|
261 |
// Services set by "buttons" arg? Then use "buttons" arg instead
|
262 |
-
$active_services =
|
263 |
}
|
264 |
|
265 |
-
$ind_html = "" . $html_container_open;
|
266 |
|
267 |
foreach( $active_services as $active_service ) {
|
268 |
|
@@ -281,8 +276,8 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
|
|
281 |
$name = $service['name'];
|
282 |
|
283 |
// If Follow kit and HREF specified
|
284 |
-
if ( $is_follow && isset( $service['href'] ) ) {
|
285 |
-
$follow_id = $buttons[ $active_service ]['id'];
|
286 |
$is_url = in_array( parse_url( $follow_id, PHP_URL_SCHEME ), array( 'http', 'https' ) );
|
287 |
|
288 |
// If it's a URL instead of a service ID
|
@@ -304,11 +299,11 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
|
|
304 |
$custom_service = true;
|
305 |
$href = $service['href'];
|
306 |
if ( isset( $service['href_js_esc'] ) ) {
|
307 |
-
$href_linkurl = str_replace( "'", "\'", $linkurl );
|
308 |
-
$href_linkname = str_replace( "'", "\'", $linkname );
|
309 |
} else {
|
310 |
-
$href_linkurl = $linkurl_enc;
|
311 |
-
$href_linkname = $linkname_enc;
|
312 |
}
|
313 |
$href = str_replace( "A2A_LINKURL", $href_linkurl, $href );
|
314 |
$href = str_replace( "A2A_LINKNAME", $href_linkname, $href );
|
@@ -316,7 +311,7 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
|
|
316 |
}
|
317 |
|
318 |
// AddToAny counter enabled?
|
319 |
-
$counter_enabled = ( ! $is_follow // Disable counters on Follow Kits
|
320 |
&& in_array( $active_service, array( 'facebook', 'pinterest', 'reddit' ) )
|
321 |
&& isset( $options['special_' . $active_service . '_options'] )
|
322 |
&& isset( $options['special_' . $active_service . '_options']['show_count'] )
|
@@ -327,22 +322,22 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
|
|
327 |
$icon_url = isset( $service['icon_url'] ) ? $service['icon_url'] : false;
|
328 |
$icon_url = $is_amp && ! $icon_url ? 'https://static.addtoany.com/buttons/' . $icon . '.svg' : $icon_url;
|
329 |
$width_attr = isset( $service['icon_width'] ) ? ' width="' . $service['icon_width'] . '"' : ' width="16"';
|
330 |
-
$width_attr = $is_amp && ! empty( $icon_size ) ? ' width="' . $icon_size . '"' : $width_attr;
|
331 |
$height_attr = isset( $service['icon_height'] ) ? ' height="' . $service['icon_height'] . '"' : ' height="16"';
|
332 |
-
$height_attr = $is_amp && ! empty( $icon_size ) ? ' height="' . $icon_size . '"' : $height_attr;
|
333 |
|
334 |
$amp_css .= $is_amp && ! empty( $service['color'] ) ? '.a2a_button_' . $safe_name . ' img{background-color:#' . $service['color'] . ';}' : '';
|
335 |
|
336 |
-
$url = isset( $href ) ? $href : 'https://www.addtoany.com/add_to/' . $safe_name . '?linkurl=' . $linkurl_enc .'&linkname=' . $linkname_enc;
|
337 |
$src = $icon_url ? $icon_url : $icons_dir . $icon . '.' . $icons_type;
|
338 |
$counter = $counter_enabled ? ' a2a_counter' : '';
|
339 |
$class_attr = $custom_service ? '' : ' class="a2a_button_' . $safe_name . $counter . '"';
|
340 |
-
$href_attr = $basic_html && ! isset( $href ) ? '' : ' href="' . $url . '"';
|
341 |
-
$title_attr = $basic_html ? '' : ' title="' . $name . '"';
|
342 |
|
343 |
if ( isset( $service['target'] ) ) {
|
344 |
-
$target_attr = empty( $service['target'] ) ? '' : ' target="' . $service['target'] . '"';
|
345 |
-
} elseif ( ! $basic_html ) {
|
346 |
$target_attr = ' target="_blank"';
|
347 |
} else {
|
348 |
$target_attr = '';
|
@@ -351,8 +346,8 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
|
|
351 |
// Use rel="noopener" for links that open in a new tab/window
|
352 |
$rel_noopener = $custom_service || ! $target_attr ? '' : ' noopener';
|
353 |
$rel_noopener_only = $rel_noopener || $target_attr ? ' rel="noopener"' : '';
|
354 |
-
$rel_attr = $is_follow ? $rel_noopener_only : ' rel="nofollow' . $rel_noopener . '"'; // ($is_follow indicates a Follow Kit. 'nofollow' is for search crawlers. Different things)
|
355 |
-
$rel_attr = $basic_html ? '' : $rel_attr;
|
356 |
|
357 |
// Set dimension attributes if using custom icons and dimension is specified
|
358 |
if ( isset( $custom_icons ) ) {
|
@@ -360,22 +355,22 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
|
|
360 |
$height_attr = ! empty( $icons_height ) ? ' height="' . $icons_height . '"' : '';
|
361 |
}
|
362 |
|
363 |
-
$link = $html_wrap_open . "<a$class_attr$href_attr$title_attr$rel_attr$target_attr>";
|
364 |
-
$link .= ( $large_icons && ! isset( $custom_icons ) && ! $custom_service ) ?
|
365 |
-
$link .= "</a>" . $html_wrap_close;
|
366 |
}
|
367 |
|
368 |
$ind_html .= $link;
|
369 |
}
|
370 |
|
371 |
-
$ind_html .= $html_container_close;
|
372 |
|
373 |
if ( $is_amp ) {
|
374 |
$A2A_SHARE_SAVE_amp_icons_css = $amp_css;
|
375 |
add_action( 'amp_post_template_css', 'addtoany_amp_icons_css' );
|
376 |
}
|
377 |
|
378 |
-
if ( true == $output_later )
|
379 |
return $ind_html;
|
380 |
else
|
381 |
echo $ind_html;
|
@@ -386,12 +381,8 @@ function ADDTOANY_SHARE_SAVE_BUTTON( $args = array() ) {
|
|
386 |
// $args array = output_later, html_container_open, html_container_close, html_wrap_open, html_wrap_close, linkname, linkurl, no_universal_button
|
387 |
|
388 |
$options = get_option( 'addtoany_options', array() );
|
389 |
-
|
390 |
-
$linkname = isset( $args['linkname'] ) ? $args['linkname'] : false;
|
391 |
-
$linkurl = isset( $args['linkurl'] ) ? $args['linkurl'] : false;
|
392 |
-
$linkmedia = isset( $args['linkmedia'] ) ? $args['linkmedia'] : false;
|
393 |
|
394 |
-
$args = array_merge($args, A2A_SHARE_SAVE_link_vars(
|
395 |
|
396 |
$defaults = array(
|
397 |
'linkname' => '',
|
@@ -414,16 +405,15 @@ function ADDTOANY_SHARE_SAVE_BUTTON( $args = array() ) {
|
|
414 |
);
|
415 |
|
416 |
$args = wp_parse_args( $args, $defaults );
|
417 |
-
extract( $args );
|
418 |
|
419 |
$is_feed = is_feed();
|
420 |
$is_amp = function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ? true : false;
|
421 |
$button_class = '';
|
422 |
-
$button_data_media = $is_kit || empty( $linkmedia ) ? '' : ' data-a2a-media="' . $linkmedia . '"';
|
423 |
-
$button_data_title = $is_kit || empty( $linkname ) ? '' : ' data-a2a-title="' . $linkname . '"';
|
424 |
-
$button_data_url = $is_kit || empty( $linkurl ) ? '' : ' data-a2a-url="' . $linkurl . '"';
|
425 |
$button_target = $is_amp ? ' target="_blank"' : '';
|
426 |
-
$button_href_querystring = ($is_feed || $is_amp) ? '#url=' . $linkurl_enc . '&title=' . $linkname_enc : '';
|
427 |
|
428 |
// If universal button is enabled
|
429 |
if ( ! $args['no_universal_button'] ) {
|
@@ -443,8 +433,8 @@ function ADDTOANY_SHARE_SAVE_BUTTON( $args = array() ) {
|
|
443 |
if ( $is_amp ) {
|
444 |
// AMP (Accelerated Mobile Page)
|
445 |
$button_src = 'https://static.addtoany.com/buttons/a2a.svg';
|
446 |
-
$button_width = ! empty( $icon_size ) ? ' width="' . $icon_size .'"' : ' width="32"';
|
447 |
-
$button_height = ! empty( $icon_size ) ? ' height="' . $icon_size .'"' : ' height="32"';
|
448 |
}
|
449 |
}
|
450 |
|
@@ -465,7 +455,8 @@ function ADDTOANY_SHARE_SAVE_BUTTON( $args = array() ) {
|
|
465 |
$button_class .= ' a2a_counter';
|
466 |
}
|
467 |
|
468 |
-
$button_html = $html_container_open . $html_wrap_open . '<a class="a2a_dd' . $button_class . $button_additional_classes . ' addtoany_share_save addtoany_share" href="
|
|
|
469 |
. $button_data_url . $button_data_title . $button_data_media . $button_target
|
470 |
. '>' . $button . '</a>';
|
471 |
|
@@ -475,9 +466,9 @@ function ADDTOANY_SHARE_SAVE_BUTTON( $args = array() ) {
|
|
475 |
}
|
476 |
|
477 |
// Closing tags come after <script> to validate in case the container is a list element
|
478 |
-
$button_html .= $html_wrap_close . $html_container_close;
|
479 |
|
480 |
-
if ( isset( $output_later ) && $output_later == true )
|
481 |
return $button_html;
|
482 |
else
|
483 |
echo $button_html;
|
@@ -492,12 +483,7 @@ function ADDTOANY_SHARE_SAVE_SPECIAL( $special_service_code, $args = array() ) {
|
|
492 |
|
493 |
$options = get_option( 'addtoany_options', array() );
|
494 |
|
495 |
-
$
|
496 |
-
$linkurl = ( isset( $args['linkurl'] ) ) ? $args['linkurl'] : false;
|
497 |
-
$linkmedia = ( isset( $args['linkmedia'] ) ) ? $args['linkmedia'] : false;
|
498 |
-
|
499 |
-
$args = array_merge( $args, A2A_SHARE_SAVE_link_vars( $linkname, $linkurl, $linkmedia ) ); // linkname_enc, etc.
|
500 |
-
extract( $args );
|
501 |
|
502 |
$special_anchor_template = '<a class="a2a_button_%1$s addtoany_special_service"%2$s></a>';
|
503 |
$custom_attributes = '';
|
@@ -507,35 +493,35 @@ function ADDTOANY_SHARE_SAVE_SPECIAL( $special_service_code, $args = array() ) {
|
|
507 |
&& 'recommend' == $options['special_facebook_like_options']['verb'] ) ? ' data-action="recommend"' : '';
|
508 |
$custom_attributes .= ( isset( $options['special_facebook_like_options']['show_count'] )
|
509 |
&& $options['special_facebook_like_options']['show_count'] == '1' ) ? '' : ' data-layout="button"';
|
510 |
-
$custom_attributes .= ' data-href="' . $linkurl . '"';
|
511 |
$special_html = sprintf( $special_anchor_template, $special_service_code, $custom_attributes );
|
512 |
}
|
513 |
|
514 |
elseif ( $special_service_code == 'twitter_tweet' ) {
|
515 |
-
$custom_attributes .= ' data-url="' . $linkurl . '"';
|
516 |
-
$custom_attributes .= ' data-text="' . $linkname . '"';
|
517 |
$special_html = sprintf( $special_anchor_template, $special_service_code, $custom_attributes );
|
518 |
}
|
519 |
|
520 |
elseif ( $special_service_code == 'google_plusone' ) {
|
521 |
-
$custom_attributes .= ' data-href="' . $linkurl . '"';
|
522 |
$special_html = sprintf( $special_anchor_template, $special_service_code, $custom_attributes );
|
523 |
}
|
524 |
|
525 |
elseif ( $special_service_code == 'google_plus_share' ) {
|
526 |
-
$custom_attributes .= ' data-href="' . $linkurl . '"';
|
527 |
$special_html = sprintf( $special_anchor_template, $special_service_code, $custom_attributes );
|
528 |
}
|
529 |
|
530 |
elseif ( $special_service_code == 'pinterest_pin' ) {
|
531 |
$custom_attributes .= ( isset( $options['special_pinterest_pin_options']['show_count'] )
|
532 |
&& $options['special_pinterest_pin_options']['show_count'] == '1' ) ? '' : ' data-pin-config="none"';
|
533 |
-
$custom_attributes .= ' data-url="' . $linkurl . '"';
|
534 |
-
$custom_attributes .= (
|
535 |
$special_html = sprintf( $special_anchor_template, $special_service_code, $custom_attributes );
|
536 |
}
|
537 |
|
538 |
-
if ( isset( $output_later ) && $output_later == true )
|
539 |
return $special_html;
|
540 |
else
|
541 |
echo $special_html;
|
@@ -682,7 +668,7 @@ function ADDTOANY_SHARE_SAVE_FLOATING( $args = array() ) {
|
|
682 |
&& isset( $options['floating_vertical_scroll_top_pixels'] )
|
683 |
&& is_numeric( $options['floating_vertical_scroll_top_pixels'] ) ? $options['floating_vertical_scroll_top_pixels'] : '';
|
684 |
// Show on scroll value from the bottom
|
685 |
-
$vertical_scroll_show_bottom = isset( $options['floating_vertical_scroll_bottom'] ) && '1' == $options['
|
686 |
&& isset( $options['floating_vertical_scroll_bottom_pixels'] )
|
687 |
&& is_numeric( $options['floating_vertical_scroll_bottom_pixels'] ) ? $options['floating_vertical_scroll_bottom_pixels'] : '';
|
688 |
// Merge values as required
|
@@ -727,7 +713,7 @@ function ADDTOANY_SHARE_SAVE_FLOATING( $args = array() ) {
|
|
727 |
&& isset( $options['floating_horizontal_scroll_top_pixels'] )
|
728 |
&& is_numeric( $options['floating_horizontal_scroll_top_pixels'] ) ? $options['floating_horizontal_scroll_top_pixels'] : '';
|
729 |
// Show on scroll value from the bottom
|
730 |
-
$horizontal_scroll_show_bottom = isset( $options['floating_horizontal_scroll_bottom'] ) && '1' == $options['
|
731 |
&& isset( $options['floating_horizontal_scroll_bottom_pixels'] )
|
732 |
&& is_numeric( $options['floating_horizontal_scroll_bottom_pixels'] ) ? $options['floating_horizontal_scroll_bottom_pixels'] : '';
|
733 |
// Merge values as required
|
@@ -1011,9 +997,9 @@ function A2A_SHARE_SAVE_shortcode( $attributes ) {
|
|
1011 |
'buttons' => '',
|
1012 |
), $attributes, 'addtoany' );
|
1013 |
|
1014 |
-
$linkname =
|
1015 |
-
$linkurl =
|
1016 |
-
$linkmedia =
|
1017 |
$buttons = ! empty( $attributes['buttons'] ) ? explode( ',', $attributes['buttons'] ) : array();
|
1018 |
|
1019 |
$output_later = true;
|
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.32
|
7 |
Author: AddToAny
|
8 |
Author URI: https://www.addtoany.com/
|
9 |
Text Domain: add-to-any
|
49 |
}
|
50 |
add_filter( 'init', 'A2A_SHARE_SAVE_init' );
|
51 |
|
52 |
+
function A2A_SHARE_SAVE_link_vars( $args = array() ) {
|
53 |
global $post;
|
54 |
|
55 |
+
$linkname = empty( $args['linkname'] ) ? '' : $args['linkname'];
|
56 |
+
$linkurl = empty( $args['linkurl'] ) ? '' : $args['linkurl'];
|
57 |
+
$linkmedia = empty( $args['linkmedia'] ) ? '' : $args['linkmedia'];
|
58 |
+
$use_current_page = isset( $args['use_current_page'] ) ? $args['use_current_page'] : false;
|
59 |
+
|
60 |
+
// Set linkname if needed, and not a Follow kit
|
61 |
+
if ( ! $linkname && empty( $args['is_follow'] ) ) {
|
62 |
if ( $use_current_page ) {
|
63 |
$linkname = is_home() || is_front_page() ? get_bloginfo( 'name' ) : rtrim( wp_title( '', false, 'right' ) );
|
64 |
} elseif ( isset( $post ) ) {
|
70 |
|
71 |
$linkname_enc = rawurlencode( $linkname );
|
72 |
|
73 |
+
// Set linkurl if needed, and not a Follow kit
|
74 |
+
if ( ! $linkurl && empty( $args['is_follow'] ) ) {
|
75 |
if ( $use_current_page ) {
|
76 |
$linkurl = esc_url_raw( home_url( $_SERVER['REQUEST_URI'] ) );
|
77 |
} elseif ( isset( $post ) ) {
|
84 |
$linkurl_enc = rawurlencode( $linkurl );
|
85 |
|
86 |
// Set linkmedia (only applies to services that explicitly accept media; Pinterest does, most do not)
|
87 |
+
$linkmedia_enc = ! empty( $args['linkmedia'] ) ? rawurlencode( $args['linkmedia'] ) : '';
|
88 |
|
89 |
+
return compact( 'linkname', 'linkname_enc', 'linkurl', 'linkurl_enc', 'linkmedia', 'linkmedia_enc', 'use_current_page' );
|
90 |
}
|
91 |
|
92 |
// Combine ADDTOANY_SHARE_SAVE_ICONS and ADDTOANY_SHARE_SAVE_BUTTON
|
93 |
function ADDTOANY_SHARE_SAVE_KIT( $args = array() ) {
|
94 |
$options = get_option( 'addtoany_options', array() );
|
95 |
|
96 |
+
$args = array_merge( $args, A2A_SHARE_SAVE_link_vars( $args ) ); // linkname_enc, etc.
|
|
|
|
|
|
|
|
|
|
|
97 |
|
98 |
$defaults = array(
|
99 |
'output_later' => false,
|
100 |
'icon_size' => isset( $options['icon_size'] ) ? $options['icon_size'] : '32',
|
101 |
+
'is_follow' => false,
|
102 |
);
|
103 |
|
104 |
$args = wp_parse_args( $args, $defaults );
|
|
|
105 |
|
106 |
// If universal button disabled, and not manually disabled through args
|
107 |
if ( isset( $options['button'] ) && $options['button'] == 'NONE' && ! isset( $args['no_universal_button'] ) ) {
|
114 |
$custom_icons = ( isset( $options['custom_icons'] ) && $options['custom_icons'] == 'url' && isset( $options['custom_icons_url'] ) ) ? true : false;
|
115 |
|
116 |
$kit_additional_classes = '';
|
117 |
+
$kit_data_media = empty( $args['linkmedia'] ) ? '' : ' data-a2a-media="' . esc_attr( $args['linkmedia'] ) . '"';
|
118 |
+
$kit_data_title = empty( $args['linkname'] ) || $args['use_current_page'] ? '' : ' data-a2a-title="' . esc_attr( $args['linkname'] ) . '"';
|
119 |
+
$kit_data_url = empty( $args['linkurl'] ) || $args['use_current_page'] ? '' : ' data-a2a-url="' . esc_attr( $args['linkurl'] ) . '"';
|
120 |
+
$kit_data_scroll_show = empty( $args['scroll_show'] ) ? '' : ' data-a2a-scroll-show="' . esc_attr( $args['scroll_show'] ) . '"';
|
121 |
$kit_style = '';
|
122 |
|
123 |
// Add additional classNames to .a2a_kit
|
138 |
}
|
139 |
// a2a_kit_size_## icon size
|
140 |
} else {
|
141 |
+
$icon_size_classname = ' a2a_kit_size_' . $args['icon_size'];
|
142 |
}
|
143 |
|
144 |
// Add addtoany_list className unless disabled (for floating buttons)
|
147 |
}
|
148 |
|
149 |
// Add style attribute if set
|
150 |
+
if ( ! empty( $args['kit_style'] ) ) {
|
151 |
+
$kit_style = ' style="' . esc_attr( $args['kit_style'] ) . '"';
|
152 |
}
|
153 |
|
154 |
if ( ! isset( $args['html_container_open'] ) ) {
|
155 |
+
$args['html_container_open'] = '<div class="a2a_kit' . esc_attr( $icon_size_classname . $kit_additional_classes ) . '"'
|
156 |
. $kit_data_url . $kit_data_title . $kit_data_media . $kit_data_scroll_show . $kit_style . '>';
|
157 |
$args['is_kit'] = true;
|
158 |
}
|
174 |
|
175 |
$kit_html .= ADDTOANY_SHARE_SAVE_BUTTON( $args );
|
176 |
|
177 |
+
if ( true == $args['output_later'] )
|
178 |
return $kit_html;
|
179 |
else
|
180 |
echo $kit_html;
|
189 |
|
190 |
$options = get_option( 'addtoany_options', array() );
|
191 |
|
192 |
+
$args = array_merge( $args, A2A_SHARE_SAVE_link_vars( $args ) ); // linkname_enc, etc.
|
|
|
|
|
|
|
|
|
193 |
|
194 |
$defaults = array(
|
195 |
'linkname' => '',
|
211 |
);
|
212 |
|
213 |
$args = wp_parse_args( $args, $defaults );
|
|
|
214 |
|
215 |
$is_amp = function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ? true : false;
|
216 |
$amp_css = '.a2a_dd img{background-color:#0166FF;}';
|
233 |
}
|
234 |
|
235 |
// If Follow kit
|
236 |
+
if ( $args['is_follow'] ) {
|
237 |
// Make available services extensible via plugins, themes (functions.php), etc.
|
238 |
$services = apply_filters( 'A2A_FOLLOW_services', $A2A_FOLLOW_services );
|
239 |
$service_codes = ( is_array( $services ) ) ? array_keys( $services ) : array();
|
240 |
|
241 |
// Services set by "buttons" arg
|
242 |
+
$active_services = empty( $args['buttons'] ) ? array() : array_keys( $args['buttons'] );
|
243 |
// Else Share kit
|
244 |
} else {
|
245 |
// Make available services extensible via plugins, themes (functions.php), etc.
|
247 |
$service_codes = ( is_array( $services ) ) ? array_keys( $services ) : array();
|
248 |
|
249 |
// Include Facebook Like and Twitter Tweet etc. unless no_special_services arg is true
|
250 |
+
if ( ! isset( $args['no_special_services'] ) || false == $args['no_special_services'] ) {
|
251 |
array_unshift( $service_codes, 'facebook_like', 'twitter_tweet', 'google_plusone', 'google_plus_share', 'pinterest_pin' );
|
252 |
}
|
253 |
|
254 |
// Use default services if services have not been selected yet
|
255 |
+
$active_services = isset( $options['active_services'] ) ? $options['active_services'] : array( 'facebook', 'twitter', 'google_plus' );
|
256 |
// Services set by "buttons" arg? Then use "buttons" arg instead
|
257 |
+
$active_services = empty( $args['buttons'] ) ? $active_services : $args['buttons'];
|
258 |
}
|
259 |
|
260 |
+
$ind_html = "" . $args['html_container_open'];
|
261 |
|
262 |
foreach( $active_services as $active_service ) {
|
263 |
|
276 |
$name = $service['name'];
|
277 |
|
278 |
// If Follow kit and HREF specified
|
279 |
+
if ( $args['is_follow'] && isset( $service['href'] ) ) {
|
280 |
+
$follow_id = $args['buttons'][ $active_service ]['id'];
|
281 |
$is_url = in_array( parse_url( $follow_id, PHP_URL_SCHEME ), array( 'http', 'https' ) );
|
282 |
|
283 |
// If it's a URL instead of a service ID
|
299 |
$custom_service = true;
|
300 |
$href = $service['href'];
|
301 |
if ( isset( $service['href_js_esc'] ) ) {
|
302 |
+
$href_linkurl = str_replace( "'", "\'", $args['linkurl'] );
|
303 |
+
$href_linkname = str_replace( "'", "\'", $args['linkname'] );
|
304 |
} else {
|
305 |
+
$href_linkurl = $args['linkurl_enc'];
|
306 |
+
$href_linkname = $args['linkname_enc'];
|
307 |
}
|
308 |
$href = str_replace( "A2A_LINKURL", $href_linkurl, $href );
|
309 |
$href = str_replace( "A2A_LINKNAME", $href_linkname, $href );
|
311 |
}
|
312 |
|
313 |
// AddToAny counter enabled?
|
314 |
+
$counter_enabled = ( ! $args['is_follow'] // Disable counters on Follow Kits
|
315 |
&& in_array( $active_service, array( 'facebook', 'pinterest', 'reddit' ) )
|
316 |
&& isset( $options['special_' . $active_service . '_options'] )
|
317 |
&& isset( $options['special_' . $active_service . '_options']['show_count'] )
|
322 |
$icon_url = isset( $service['icon_url'] ) ? $service['icon_url'] : false;
|
323 |
$icon_url = $is_amp && ! $icon_url ? 'https://static.addtoany.com/buttons/' . $icon . '.svg' : $icon_url;
|
324 |
$width_attr = isset( $service['icon_width'] ) ? ' width="' . $service['icon_width'] . '"' : ' width="16"';
|
325 |
+
$width_attr = $is_amp && ! empty( $args['icon_size'] ) ? ' width="' . $args['icon_size'] . '"' : $width_attr;
|
326 |
$height_attr = isset( $service['icon_height'] ) ? ' height="' . $service['icon_height'] . '"' : ' height="16"';
|
327 |
+
$height_attr = $is_amp && ! empty( $args['icon_size'] ) ? ' height="' . $args['icon_size'] . '"' : $height_attr;
|
328 |
|
329 |
$amp_css .= $is_amp && ! empty( $service['color'] ) ? '.a2a_button_' . $safe_name . ' img{background-color:#' . $service['color'] . ';}' : '';
|
330 |
|
331 |
+
$url = isset( $href ) ? $href : 'https://www.addtoany.com/add_to/' . $safe_name . '?linkurl=' . $args['linkurl_enc'] .'&linkname=' . $args['linkname_enc'];
|
332 |
$src = $icon_url ? $icon_url : $icons_dir . $icon . '.' . $icons_type;
|
333 |
$counter = $counter_enabled ? ' a2a_counter' : '';
|
334 |
$class_attr = $custom_service ? '' : ' class="a2a_button_' . $safe_name . $counter . '"';
|
335 |
+
$href_attr = $args['basic_html'] && ! isset( $href ) ? '' : ' href="' . esc_attr( $url ) . '"';
|
336 |
+
$title_attr = $args['basic_html'] ? '' : ' title="' . esc_attr( $name ) . '"';
|
337 |
|
338 |
if ( isset( $service['target'] ) ) {
|
339 |
+
$target_attr = empty( $service['target'] ) ? '' : ' target="' . esc_attr( $service['target'] ) . '"';
|
340 |
+
} elseif ( ! $args['basic_html'] ) {
|
341 |
$target_attr = ' target="_blank"';
|
342 |
} else {
|
343 |
$target_attr = '';
|
346 |
// Use rel="noopener" for links that open in a new tab/window
|
347 |
$rel_noopener = $custom_service || ! $target_attr ? '' : ' noopener';
|
348 |
$rel_noopener_only = $rel_noopener || $target_attr ? ' rel="noopener"' : '';
|
349 |
+
$rel_attr = $args['is_follow'] ? $rel_noopener_only : ' rel="nofollow' . $rel_noopener . '"'; // ($args['is_follow'] indicates a Follow Kit. 'nofollow' is for search crawlers. Different things)
|
350 |
+
$rel_attr = $args['basic_html'] ? '' : $rel_attr;
|
351 |
|
352 |
// Set dimension attributes if using custom icons and dimension is specified
|
353 |
if ( isset( $custom_icons ) ) {
|
355 |
$height_attr = ! empty( $icons_height ) ? ' height="' . $icons_height . '"' : '';
|
356 |
}
|
357 |
|
358 |
+
$link = $args['html_wrap_open'] . "<a$class_attr$href_attr$title_attr$rel_attr$target_attr>";
|
359 |
+
$link .= ( $large_icons && ! isset( $custom_icons ) && ! $custom_service ) ? '' : '<img src="' . esc_attr( $src ) . '"' . $width_attr . $height_attr . ' alt="' . esc_attr( $name ) . '">';
|
360 |
+
$link .= "</a>" . $args['html_wrap_close'];
|
361 |
}
|
362 |
|
363 |
$ind_html .= $link;
|
364 |
}
|
365 |
|
366 |
+
$ind_html .= $args['html_container_close'];
|
367 |
|
368 |
if ( $is_amp ) {
|
369 |
$A2A_SHARE_SAVE_amp_icons_css = $amp_css;
|
370 |
add_action( 'amp_post_template_css', 'addtoany_amp_icons_css' );
|
371 |
}
|
372 |
|
373 |
+
if ( true == $args['output_later'] )
|
374 |
return $ind_html;
|
375 |
else
|
376 |
echo $ind_html;
|
381 |
// $args array = output_later, html_container_open, html_container_close, html_wrap_open, html_wrap_close, linkname, linkurl, no_universal_button
|
382 |
|
383 |
$options = get_option( 'addtoany_options', array() );
|
|
|
|
|
|
|
|
|
384 |
|
385 |
+
$args = array_merge( $args, A2A_SHARE_SAVE_link_vars( $args ) ); // linkname_enc, etc.
|
386 |
|
387 |
$defaults = array(
|
388 |
'linkname' => '',
|
405 |
);
|
406 |
|
407 |
$args = wp_parse_args( $args, $defaults );
|
|
|
408 |
|
409 |
$is_feed = is_feed();
|
410 |
$is_amp = function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ? true : false;
|
411 |
$button_class = '';
|
412 |
+
$button_data_media = $args['is_kit'] || empty( $args['linkmedia'] ) ? '' : ' data-a2a-media="' . esc_attr( $args['linkmedia'] ) . '"';
|
413 |
+
$button_data_title = $args['is_kit'] || empty( $args['linkname'] ) ? '' : ' data-a2a-title="' . esc_attr( $args['linkname'] ) . '"';
|
414 |
+
$button_data_url = $args['is_kit'] || empty( $args['linkurl'] ) ? '' : ' data-a2a-url="' . esc_attr( $args['linkurl'] ) . '"';
|
415 |
$button_target = $is_amp ? ' target="_blank"' : '';
|
416 |
+
$button_href_querystring = ($is_feed || $is_amp) ? '#url=' . $args['linkurl_enc'] . '&title=' . $args['linkname_enc'] : '';
|
417 |
|
418 |
// If universal button is enabled
|
419 |
if ( ! $args['no_universal_button'] ) {
|
433 |
if ( $is_amp ) {
|
434 |
// AMP (Accelerated Mobile Page)
|
435 |
$button_src = 'https://static.addtoany.com/buttons/a2a.svg';
|
436 |
+
$button_width = ! empty( $args['icon_size'] ) ? ' width="' . $args['icon_size'] .'"' : ' width="32"';
|
437 |
+
$button_height = ! empty( $args['icon_size'] ) ? ' height="' . $args['icon_size'] .'"' : ' height="32"';
|
438 |
}
|
439 |
}
|
440 |
|
455 |
$button_class .= ' a2a_counter';
|
456 |
}
|
457 |
|
458 |
+
$button_html = $args['html_container_open'] . $args['html_wrap_open'] . '<a class="a2a_dd' . $button_class . $button_additional_classes . ' addtoany_share_save addtoany_share" href="'
|
459 |
+
. esc_url( 'https://www.addtoany.com/share' .$button_href_querystring ) . '"'
|
460 |
. $button_data_url . $button_data_title . $button_data_media . $button_target
|
461 |
. '>' . $button . '</a>';
|
462 |
|
466 |
}
|
467 |
|
468 |
// Closing tags come after <script> to validate in case the container is a list element
|
469 |
+
$button_html .= $args['html_wrap_close'] . $args['html_container_close'];
|
470 |
|
471 |
+
if ( isset( $args['output_later'] ) && $args['output_later'] == true )
|
472 |
return $button_html;
|
473 |
else
|
474 |
echo $button_html;
|
483 |
|
484 |
$options = get_option( 'addtoany_options', array() );
|
485 |
|
486 |
+
$args = array_merge( $args, A2A_SHARE_SAVE_link_vars( $args ) ); // linkname_enc, etc.
|
|
|
|
|
|
|
|
|
|
|
487 |
|
488 |
$special_anchor_template = '<a class="a2a_button_%1$s addtoany_special_service"%2$s></a>';
|
489 |
$custom_attributes = '';
|
493 |
&& 'recommend' == $options['special_facebook_like_options']['verb'] ) ? ' data-action="recommend"' : '';
|
494 |
$custom_attributes .= ( isset( $options['special_facebook_like_options']['show_count'] )
|
495 |
&& $options['special_facebook_like_options']['show_count'] == '1' ) ? '' : ' data-layout="button"';
|
496 |
+
$custom_attributes .= ' data-href="' . esc_attr( $args['linkurl'] ) . '"';
|
497 |
$special_html = sprintf( $special_anchor_template, $special_service_code, $custom_attributes );
|
498 |
}
|
499 |
|
500 |
elseif ( $special_service_code == 'twitter_tweet' ) {
|
501 |
+
$custom_attributes .= ' data-url="' . esc_attr( $args['linkurl'] ) . '"';
|
502 |
+
$custom_attributes .= ' data-text="' . esc_attr( $args['linkname'] ) . '"';
|
503 |
$special_html = sprintf( $special_anchor_template, $special_service_code, $custom_attributes );
|
504 |
}
|
505 |
|
506 |
elseif ( $special_service_code == 'google_plusone' ) {
|
507 |
+
$custom_attributes .= ' data-href="' . esc_attr( $args['linkurl'] ) . '"';
|
508 |
$special_html = sprintf( $special_anchor_template, $special_service_code, $custom_attributes );
|
509 |
}
|
510 |
|
511 |
elseif ( $special_service_code == 'google_plus_share' ) {
|
512 |
+
$custom_attributes .= ' data-href="' . esc_attr( $args['linkurl'] ) . '"';
|
513 |
$special_html = sprintf( $special_anchor_template, $special_service_code, $custom_attributes );
|
514 |
}
|
515 |
|
516 |
elseif ( $special_service_code == 'pinterest_pin' ) {
|
517 |
$custom_attributes .= ( isset( $options['special_pinterest_pin_options']['show_count'] )
|
518 |
&& $options['special_pinterest_pin_options']['show_count'] == '1' ) ? '' : ' data-pin-config="none"';
|
519 |
+
$custom_attributes .= ' data-url="' . esc_attr( $args['linkurl'] ) . '"';
|
520 |
+
$custom_attributes .= ( empty( $args['linkmedia'] ) ) ? '' : ' data-media="' . esc_attr( $args['linkmedia'] ) . '"';
|
521 |
$special_html = sprintf( $special_anchor_template, $special_service_code, $custom_attributes );
|
522 |
}
|
523 |
|
524 |
+
if ( isset( $args['output_later'] ) && $args['output_later'] == true )
|
525 |
return $special_html;
|
526 |
else
|
527 |
echo $special_html;
|
668 |
&& isset( $options['floating_vertical_scroll_top_pixels'] )
|
669 |
&& is_numeric( $options['floating_vertical_scroll_top_pixels'] ) ? $options['floating_vertical_scroll_top_pixels'] : '';
|
670 |
// Show on scroll value from the bottom
|
671 |
+
$vertical_scroll_show_bottom = isset( $options['floating_vertical_scroll_bottom'] ) && '1' == $options['floating_vertical_scroll_bottom']
|
672 |
&& isset( $options['floating_vertical_scroll_bottom_pixels'] )
|
673 |
&& is_numeric( $options['floating_vertical_scroll_bottom_pixels'] ) ? $options['floating_vertical_scroll_bottom_pixels'] : '';
|
674 |
// Merge values as required
|
713 |
&& isset( $options['floating_horizontal_scroll_top_pixels'] )
|
714 |
&& is_numeric( $options['floating_horizontal_scroll_top_pixels'] ) ? $options['floating_horizontal_scroll_top_pixels'] : '';
|
715 |
// Show on scroll value from the bottom
|
716 |
+
$horizontal_scroll_show_bottom = isset( $options['floating_horizontal_scroll_bottom'] ) && '1' == $options['floating_horizontal_scroll_bottom']
|
717 |
&& isset( $options['floating_horizontal_scroll_bottom_pixels'] )
|
718 |
&& is_numeric( $options['floating_horizontal_scroll_bottom_pixels'] ) ? $options['floating_horizontal_scroll_bottom_pixels'] : '';
|
719 |
// Merge values as required
|
997 |
'buttons' => '',
|
998 |
), $attributes, 'addtoany' );
|
999 |
|
1000 |
+
$linkname = $attributes['title'];
|
1001 |
+
$linkurl = $attributes['url'];
|
1002 |
+
$linkmedia = $attributes['media'];
|
1003 |
$buttons = ! empty( $attributes['buttons'] ) ? explode( ',', $attributes['buttons'] ) : array();
|
1004 |
|
1005 |
$output_later = true;
|
addtoany.admin.php
CHANGED
@@ -587,7 +587,7 @@ function A2A_SHARE_SAVE_options_page() {
|
|
587 |
<label>
|
588 |
<input id="A2A_SHARE_SAVE_display_in_posts" name="A2A_SHARE_SAVE_display_in_posts" type="checkbox"<?php
|
589 |
if ( ! isset( $options['display_in_posts'] ) || $options['display_in_posts'] != '-1' ) echo ' checked="checked"'; ?> value="1"/>
|
590 |
-
<?php printf(__('Display at the %s of posts', 'add-to-any'), _a2a_position_in_content( $options, true )); ?>
|
591 |
</label>
|
592 |
<br/>
|
593 |
<label>
|
@@ -595,7 +595,7 @@ function A2A_SHARE_SAVE_options_page() {
|
|
595 |
if ( ! isset( $options['display_in_posts_on_front_page'] ) || $options['display_in_posts_on_front_page'] != '-1' ) echo ' checked="checked"';
|
596 |
if ( isset( $options['display_in_posts'] ) && $options['display_in_posts'] == '-1' ) echo ' disabled="disabled"';
|
597 |
?> value="1"/>
|
598 |
-
<?php printf(__('Display at the %s of posts on the front page', 'add-to-any'), _a2a_position_in_content( $options )); ?>
|
599 |
</label>
|
600 |
<br/>
|
601 |
<label>
|
@@ -603,7 +603,7 @@ function A2A_SHARE_SAVE_options_page() {
|
|
603 |
if ( ! isset( $options['display_in_posts_on_archive_pages'] ) || $options['display_in_posts_on_archive_pages'] != '-1' ) echo ' checked="checked"';
|
604 |
if ( isset( $options['display_in_posts'] ) && $options['display_in_posts'] == '-1' ) echo ' disabled="disabled"';
|
605 |
?> value="1"/>
|
606 |
-
<?php printf(__('Display at the %s of posts on archive pages', 'add-to-any'), _a2a_position_in_content( $options )); ?>
|
607 |
</label>
|
608 |
<br/>
|
609 |
<label>
|
@@ -611,26 +611,26 @@ function A2A_SHARE_SAVE_options_page() {
|
|
611 |
if ( ! isset( $options['display_in_feed'] ) || $options['display_in_feed'] != '-1' ) echo ' checked="checked"';
|
612 |
if ( isset( $options['display_in_posts'] ) && $options['display_in_posts'] == '-1' ) echo ' disabled="disabled"';
|
613 |
?> value="1"/>
|
614 |
-
<?php printf(__('Display at the %s of posts in the feed', 'add-to-any'), _a2a_position_in_content( $options )); ?>
|
615 |
</label>
|
616 |
<br/>
|
617 |
<label>
|
618 |
<input name="A2A_SHARE_SAVE_display_in_excerpts" type="checkbox"<?php
|
619 |
if ( ! isset( $options['display_in_excerpts'] ) || $options['display_in_excerpts'] != '-1' ) echo ' checked="checked"';
|
620 |
?> value="1"/>
|
621 |
-
<?php printf(__('Display at the %s of excerpts', 'add-to-any'), _a2a_position_in_content( $options, false )); ?>
|
622 |
</label>
|
623 |
<br/>
|
624 |
<label>
|
625 |
<input name="A2A_SHARE_SAVE_display_in_pages" type="checkbox"<?php if ( ! isset( $options['display_in_pages'] ) || $options['display_in_pages'] != '-1' ) echo ' checked="checked"'; ?> value="1"/>
|
626 |
-
<?php printf(__('Display at the %s of pages', 'add-to-any'), _a2a_position_in_content( $options, false )); ?>
|
627 |
</label>
|
628 |
<br/>
|
629 |
<label>
|
630 |
<input name="A2A_SHARE_SAVE_display_in_attachments" type="checkbox"<?php
|
631 |
if ( ! isset( $options['display_in_attachments'] ) || $options['display_in_attachments'] != '-1' ) echo ' checked="checked"';
|
632 |
?> value="1"/>
|
633 |
-
<?php printf(__('Display at the %s of media pages', 'add-to-any'), _a2a_position_in_content( $options, false )); ?>
|
634 |
</label>
|
635 |
|
636 |
<?php
|
@@ -642,7 +642,12 @@ function A2A_SHARE_SAVE_options_page() {
|
|
642 |
<br/>
|
643 |
<label>
|
644 |
<input name="A2A_SHARE_SAVE_display_in_cpt_<?php echo $placement_name; ?>" type="checkbox"<?php if ( ! isset( $options['display_in_cpt_' . $placement_name] ) || $options['display_in_cpt_' . $placement_name] != '-1' ) echo ' checked="checked"'; ?> value="1"/>
|
645 |
-
<?php printf(
|
|
|
|
|
|
|
|
|
|
|
646 |
</label>
|
647 |
<?php endforeach; ?>
|
648 |
|
587 |
<label>
|
588 |
<input id="A2A_SHARE_SAVE_display_in_posts" name="A2A_SHARE_SAVE_display_in_posts" type="checkbox"<?php
|
589 |
if ( ! isset( $options['display_in_posts'] ) || $options['display_in_posts'] != '-1' ) echo ' checked="checked"'; ?> value="1"/>
|
590 |
+
<?php printf( __( 'Display at the %s of posts', 'add-to-any' ), _a2a_position_in_content( $options, true ) ); ?>
|
591 |
</label>
|
592 |
<br/>
|
593 |
<label>
|
595 |
if ( ! isset( $options['display_in_posts_on_front_page'] ) || $options['display_in_posts_on_front_page'] != '-1' ) echo ' checked="checked"';
|
596 |
if ( isset( $options['display_in_posts'] ) && $options['display_in_posts'] == '-1' ) echo ' disabled="disabled"';
|
597 |
?> value="1"/>
|
598 |
+
<?php printf( __( 'Display at the %s of posts on the front page', 'add-to-any' ), _a2a_position_in_content( $options ) ); ?>
|
599 |
</label>
|
600 |
<br/>
|
601 |
<label>
|
603 |
if ( ! isset( $options['display_in_posts_on_archive_pages'] ) || $options['display_in_posts_on_archive_pages'] != '-1' ) echo ' checked="checked"';
|
604 |
if ( isset( $options['display_in_posts'] ) && $options['display_in_posts'] == '-1' ) echo ' disabled="disabled"';
|
605 |
?> value="1"/>
|
606 |
+
<?php printf( __( 'Display at the %s of posts on archive pages', 'add-to-any' ), _a2a_position_in_content( $options ) ); ?>
|
607 |
</label>
|
608 |
<br/>
|
609 |
<label>
|
611 |
if ( ! isset( $options['display_in_feed'] ) || $options['display_in_feed'] != '-1' ) echo ' checked="checked"';
|
612 |
if ( isset( $options['display_in_posts'] ) && $options['display_in_posts'] == '-1' ) echo ' disabled="disabled"';
|
613 |
?> value="1"/>
|
614 |
+
<?php printf( __( 'Display at the %s of posts in the feed', 'add-to-any' ), _a2a_position_in_content( $options ) ); ?>
|
615 |
</label>
|
616 |
<br/>
|
617 |
<label>
|
618 |
<input name="A2A_SHARE_SAVE_display_in_excerpts" type="checkbox"<?php
|
619 |
if ( ! isset( $options['display_in_excerpts'] ) || $options['display_in_excerpts'] != '-1' ) echo ' checked="checked"';
|
620 |
?> value="1"/>
|
621 |
+
<?php printf( __( 'Display at the %s of excerpts' , 'add-to-any'), _a2a_position_in_content( $options, false ) ); ?>
|
622 |
</label>
|
623 |
<br/>
|
624 |
<label>
|
625 |
<input name="A2A_SHARE_SAVE_display_in_pages" type="checkbox"<?php if ( ! isset( $options['display_in_pages'] ) || $options['display_in_pages'] != '-1' ) echo ' checked="checked"'; ?> value="1"/>
|
626 |
+
<?php printf( __( 'Display at the %s of pages', 'add-to-any' ), _a2a_position_in_content( $options, false ) ); ?>
|
627 |
</label>
|
628 |
<br/>
|
629 |
<label>
|
630 |
<input name="A2A_SHARE_SAVE_display_in_attachments" type="checkbox"<?php
|
631 |
if ( ! isset( $options['display_in_attachments'] ) || $options['display_in_attachments'] != '-1' ) echo ' checked="checked"';
|
632 |
?> value="1"/>
|
633 |
+
<?php printf( __( 'Display at the %s of media pages', 'add-to-any' ), _a2a_position_in_content( $options, false ) ); ?>
|
634 |
</label>
|
635 |
|
636 |
<?php
|
642 |
<br/>
|
643 |
<label>
|
644 |
<input name="A2A_SHARE_SAVE_display_in_cpt_<?php echo $placement_name; ?>" type="checkbox"<?php if ( ! isset( $options['display_in_cpt_' . $placement_name] ) || $options['display_in_cpt_' . $placement_name] != '-1' ) echo ' checked="checked"'; ?> value="1"/>
|
645 |
+
<?php printf(
|
646 |
+
/* translators: 1: Position in content 2: Name of the custom post type */
|
647 |
+
__( 'Display at the %1$s of %2$s', 'add-to-any' ),
|
648 |
+
_a2a_position_in_content( $options, false ),
|
649 |
+
esc_html( $placement_label )
|
650 |
+
); ?>
|
651 |
</label>
|
652 |
<?php endforeach; ?>
|
653 |
|
addtoany.widgets.php
CHANGED
@@ -48,20 +48,19 @@ class A2A_SHARE_SAVE_Widget extends WP_Widget {
|
|
48 |
);
|
49 |
|
50 |
$args = wp_parse_args( $args, $defaults );
|
51 |
-
extract( $args );
|
52 |
|
53 |
-
echo $before_widget;
|
54 |
|
55 |
if ( isset( $instance ) && ! empty( $instance['title'] ) ) {
|
56 |
$title = apply_filters( 'widget_title', $instance['title'] );
|
57 |
-
echo $before_title . $title . $after_title;
|
58 |
}
|
59 |
|
60 |
ADDTOANY_SHARE_SAVE_KIT( array(
|
61 |
"use_current_page" => true,
|
62 |
) );
|
63 |
|
64 |
-
echo $after_widget;
|
65 |
}
|
66 |
|
67 |
/**
|
@@ -135,15 +134,14 @@ class A2A_Follow_Widget extends WP_Widget {
|
|
135 |
);
|
136 |
|
137 |
$args = wp_parse_args( $args, $defaults );
|
138 |
-
extract( $args );
|
139 |
|
140 |
-
echo $before_widget;
|
141 |
|
142 |
$instance = is_array( $instance ) ? $instance : array();
|
143 |
|
144 |
if ( ! empty( $instance['title'] ) ) {
|
145 |
$title = apply_filters( 'widget_title', $instance['title'] );
|
146 |
-
echo $before_title . $title . $after_title;
|
147 |
}
|
148 |
|
149 |
$active_services = array();
|
@@ -163,7 +161,7 @@ class A2A_Follow_Widget extends WP_Widget {
|
|
163 |
'icon_size' => ! empty( $instance['icon_size'] ) ? $instance['icon_size'] : '32',
|
164 |
) );
|
165 |
|
166 |
-
echo $after_widget;
|
167 |
}
|
168 |
|
169 |
/**
|
48 |
);
|
49 |
|
50 |
$args = wp_parse_args( $args, $defaults );
|
|
|
51 |
|
52 |
+
echo $args['before_widget'];
|
53 |
|
54 |
if ( isset( $instance ) && ! empty( $instance['title'] ) ) {
|
55 |
$title = apply_filters( 'widget_title', $instance['title'] );
|
56 |
+
echo $args['before_title'] . $title . $args['after_title'];
|
57 |
}
|
58 |
|
59 |
ADDTOANY_SHARE_SAVE_KIT( array(
|
60 |
"use_current_page" => true,
|
61 |
) );
|
62 |
|
63 |
+
echo $args['after_widget'];
|
64 |
}
|
65 |
|
66 |
/**
|
134 |
);
|
135 |
|
136 |
$args = wp_parse_args( $args, $defaults );
|
|
|
137 |
|
138 |
+
echo $args['before_widget'];
|
139 |
|
140 |
$instance = is_array( $instance ) ? $instance : array();
|
141 |
|
142 |
if ( ! empty( $instance['title'] ) ) {
|
143 |
$title = apply_filters( 'widget_title', $instance['title'] );
|
144 |
+
echo $args['before_title'] . $title . $args['after_title'];
|
145 |
}
|
146 |
|
147 |
$active_services = array();
|
161 |
'icon_size' => ! empty( $instance['icon_size'] ) ? $instance['icon_size'] : '32',
|
162 |
) );
|
163 |
|
164 |
+
echo $args['after_widget'];
|
165 |
}
|
166 |
|
167 |
/**
|