Changeset 1394811 for add-to-any
- Timestamp:
- 04/13/2016 10:22:33 PM (2 years ago)
- Location:
- add-to-any/trunk
- Files:
-
- 6 added
- 5 edited
-
README.txt (modified) (7 diffs)
-
add-to-any.php (modified) (5 diffs)
-
addtoany.admin.js (added)
-
addtoany.admin.php (modified) (1 diff)
-
addtoany.services.php (modified) (7 diffs)
-
addtoany.widgets.php (modified) (2 diffs)
-
icons/kik.png (added)
-
icons/skype.png (added)
-
icons/snapchat.png (added)
-
icons/viber.png (added)
-
icons/wechat.png (added)
Legend:
- Unmodified
- Added
- Removed
-
add-to-any/trunk/README.txt
r1363025 r1394811 1 1 === AddToAny Share Buttons === 2 2 Contributors: micropat, addtoany 3 Tags: AddToAny, sharing, share, social, share button, share buttons, share links, social icons, social media, media, marketing, bookmark, bookmarks, save, post, posts, page, pages, images, image, admin, analytics, statistics, stats, links, plugin, shortcode, sidebar, widget, responsive, email, e-mail, print, seo, button, amp, woocommerce, ecommerce, e-commerce, amazon, delicious, google, tumblr, linkedin, digg, reddit, facebook, facebook share, facebook like, like, twitter, twitter button, twitter share, tweet, tweet button, google plus, pinterest, pin, pin it, pinit, wanelo, buffer, stumbleupon, bitly, whatsapp, instagram, behance, flickr, foursquare, vimeo, youtube, feed, rss, lockerz,addthis, sociable, share this, sharethis, shareaholic, icon, icons, vector, SVG, floating, floating buttons, wpml, wpmu, Add to Any3 Tags: AddToAny, sharing, share, social, share button, share buttons, share links, social icons, social media, media, marketing, bookmark, bookmarks, save, post, posts, page, pages, images, image, admin, analytics, statistics, stats, links, plugin, shortcode, sidebar, widget, responsive, email, e-mail, print, seo, button, amp, woocommerce, ecommerce, e-commerce, amazon, delicious, google, tumblr, linkedin, digg, reddit, facebook, facebook share, facebook like, like, twitter, twitter button, twitter share, tweet, tweet button, google plus, pinterest, pin, pin it, pinit, wanelo, buffer, stumbleupon, bitly, whatsapp, instagram, behance, flickr, foursquare, vimeo, youtube, feed, rss, addthis, sociable, share this, sharethis, shareaholic, icon, icons, vector, SVG, floating, floating buttons, wpml, wpmu, Add to Any 4 4 Requires at least: 2.8 5 5 Tested up to: 4.5 6 Stable tag: 1.6.1 46 Stable tag: 1.6.15 7 7 8 8 Share buttons for WordPress including the AddToAny sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp, many more, and follow icons too. … … 63 63 = Wide Support = 64 64 65 * Over 8years of active development66 * Over 4million downloads65 * Over 9 years of active development 66 * Over 5 million downloads 67 67 * Translated into dozens of languages 68 68 * Ongoing support from the community … … 97 97 = Where are the options, and how can I customize the sharing plugin? = 98 98 99 In your Admin panel, go to `Settings` > `AddToAny`. Among other options, you can choose individual sharing icons, a universal share button, and official 3rd party sharing buttons (Facebook Like Button, Twitter Tweet Button, Pinterest Pin It Button, Google+ Share Button, Google +1 Button) to display, and where and how to display them.100 101 To place the buttons as a "widget" in your theme (if your theme supports WordPress Widgets), go to `Appearance` > `Widgets`, then drag AddToAny to an available Widget Area and click `Save`.102 103 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 JavaScript code into "Additional JavaScript" box. The Additional JavaScript box isin `Settings` > `AddToAny`.99 In your Admin panel, go to `Settings` > `AddToAny`. 100 101 Setup Follow buttons (like Instagram, YouTube, etc.) using the AddToAny Follow widget in `Appearance` > `Widgets` (or `Appearance` > `Customize`). 102 103 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`. 104 104 105 105 = Something is wrong. What should I try first? = … … 128 128 = For Facebook sharing, how can I set the thumbnail image and description Facebook uses? = 129 129 130 Facebook expects the Title, Description, and Thumbnail of a shared page to be defined in the actual HTML code of a shared page. Unlike other services that accept common parameters, Facebook only accepts a URL, then Facebook scans the actual page for details. To change the title, description or image on Facebook, you will need to modify your theme or use another plugin that filters your theme.131 132 Use Facebook's <a href="https://developers.facebook.com/tools/debug/ ">URL Debugger</a> on your pages to see how Facebook reads your site. "Fetch new scrape information" to test site changes and clear Facebook's cache of a page.130 Facebook expects the Title, Description, and Thumbnail of a shared page to be defined in the Open Graph <a href="https://www.addtoany.com/ext/meta-tags/" target="_blank">meta tags</a> of a shared page. 131 132 Use Facebook's <a href="https://developers.facebook.com/tools/debug/og/object/">URL Debugger</a> on your pages to see how Facebook reads your site. "Fetch new scrape information" to test site changes and clear Facebook's cache of a page. 133 133 134 134 To change the title, description and/or image on Facebook, your theme's header file should be modified according to <a href="https://developers.facebook.com/docs/sharing/opengraph">Facebook's OpenGraph specification</a>. With WordPress, this can be accomplished with plugins such as the <a href="https://wordpress.org/plugins/wordpress-seo/">Yoast SEO</a> or the <a href="https://wordpress.org/plugins/all-in-one-seo-pack/">All in One SEO Pack</a>. Please see those plugins for details, and post in the WordPress or plugin author's forums for more support. … … 165 165 166 166 = How can I add a custom standalone share button? = 167 You can create a plugin or customize the following example PHP code to add to your theme's function .php file:167 You can create a plugin or customize the following example PHP code to add to your theme's functions.php file: 168 168 169 169 `function addtoany_add_services( $services ) { … … 180 180 181 181 = How can I add a custom follow button? = 182 You can create a plugin or customize the following example PHP code to add to your theme's function .php file:182 You can create a plugin or customize the following example PHP code to add to your theme's functions.php file: 183 183 184 184 `function addtoany_add_follow_services( $services ) { … … 300 300 301 301 == Changelog == 302 303 = 1.6.15 = 304 * AddToAny widgets support new selective refresh in the WordPress 4.5 Customizer 305 * AddToAny share endpoints default to HTTPS on HTTPS sites 306 * Permit changing the target attribute for custom services (thanks Jasper) 307 * The meta box ("Show sharing buttons") below the WordPress editor will no longer show when standard placement is disabled for the current post type 308 * Add Kik share button 309 * Add Skype share button 310 * Add Viber share button 311 * Add WeChat share button 312 * Add Snapchat follow button 302 313 303 314 = 1.6.14 = -
add-to-any/trunk/add-to-any.php
r1363025 r1394811 4 4 Plugin URI: https://www.addtoany.com/ 5 5 Description: Share buttons for your pages including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp and many more. [<a href="options-general.php?page=addtoany">Settings</a>] 6 Version: 1.6.1 46 Version: 1.6.15 7 7 Author: AddToAny 8 8 Author URI: https://www.addtoany.com/ … … 203 203 extract( $args ); 204 204 205 $https_or_http = is_ssl() ? 'https' : 'http'; 205 206 $is_amp = function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ? true : false; 206 207 … … 317 318 $height_attr = $is_amp && isset( $icon_size ) ? ' height="' . $icon_size . '"' : $height_attr; 318 319 319 $url = ( isset( $href ) ) ? $href : "http://www.addtoany.com/add_to/" . $safe_name . "?linkurl=" . $linkurl_enc . "&linkname=". $linkname_enc;320 $url = ( isset( $href ) ) ? $href : $https_or_http . '://www.addtoany.com/add_to/' . $safe_name . '?linkurl=' . $linkurl_enc .'&linkname=' . $linkname_enc; 320 321 $src = ( $icon_url ) ? $icon_url : $icons_dir . $icon . '.' . $icons_type; 321 322 $counter = ( $counter_enabled ) ? ' a2a_counter' : ''; 322 323 $class_attr = ( $custom_service ) ? '' : ' class="a2a_button_' . $safe_name . $counter . '"'; 323 324 $rel_nofollow = $is_follow ? '' : ' rel="nofollow"'; // ($is_follow indicates a Follow Kit. 'nofollow' is for search crawlers. Different things) 325 326 if ( isset( $service['target'] ) ) { 327 $target_attr = empty( $service['target'] ) ? '' : ' target="' . $service['target'] . '"'; 328 } else { 329 $target_attr = ' target="_blank"'; 330 } 324 331 325 332 // Set dimension attributes if using custom icons and dimension is specified … … 329 336 } 330 337 331 $link = $html_wrap_open . "<a$class_attr href=\"$url\" title=\"$name\"$rel_nofollow target=\"_blank\">";338 $link = $html_wrap_open . "<a$class_attr href=\"$url\" title=\"$name\"$rel_nofollow$target_attr>"; 332 339 $link .= ( $large_icons && ! isset( $custom_icons ) && ! $custom_service ) ? "" : "<img src=\"$src\"" . $width_attr . $height_attr . " alt=\"$name\"/>"; 333 340 $link .= "</a>" . $html_wrap_close; … … 753 760 $options = get_option( 'addtoany_options' ); 754 761 755 $http _or_https = ( is_ssl()) ? 'https' : 'http';762 $https_or_http = is_ssl() ? 'https' : 'http'; 756 763 757 764 // Use local cache? 758 765 $cache = ( isset( $options['cache'] ) && '1' == $options['cache'] ) ? true : false; 759 766 $upload_dir = wp_upload_dir(); 760 $static_server = ( $cache ) ? $upload_dir['baseurl'] . '/addtoany' : $http _or_https. '://static.addtoany.com/menu';767 $static_server = ( $cache ) ? $upload_dir['baseurl'] . '/addtoany' : $https_or_http . '://static.addtoany.com/menu'; 761 768 762 769 // Enternal script call + initial JS + set-once variables -
add-to-any/trunk/addtoany.admin.php
r1346380 r1394811 8 8 $post_types = ( function_exists( 'get_post_types' ) ) ? get_post_types( array( 'public' => true ) ) : array( 'post', 'page' ) ; 9 9 10 $options = get_option( 'addtoany_options' ); 11 10 12 $title = apply_filters( 'A2A_SHARE_SAVE_meta_box_title', __( 'AddToAny', 'add-to-any' ) ); 11 13 foreach( $post_types as $post_type ) { 14 // If automatic placement is disabled for the post type 15 if ( 16 'post' == $post_type && isset( $options['display_in_posts'] ) && $options['display_in_posts'] == '-1' || 17 'page' == $post_type && isset( $options['display_in_pages'] ) && $options['display_in_pages'] == '-1' || 18 // Custom post type 19 isset( $options['display_in_cpt_' . $post_type] ) && $options['display_in_cpt_' . $post_type] == '-1' 20 ) { 21 // Skip current post type 22 continue; 23 } 24 25 // Add meta box (unless we skipped this post type above) 12 26 add_meta_box( 'A2A_SHARE_SAVE_meta', $title, 'A2A_SHARE_SAVE_meta_box_content', $post_type, 'advanced', 'high' ); 13 27 } -
add-to-any/trunk/addtoany.services.php
r1338434 r1394811 191 191 "icon" => "kakao", 192 192 ), 193 "kik" => array( 194 "name" => "Kik", 195 "icon" => "kik", 196 ), 193 197 "kindle_it" => array( 194 198 "name" => "Kindle It", … … 307 311 "icon" => "sitejot", 308 312 ), 313 "skype" => array( 314 "name" => "Skype", 315 "icon" => "skype", 316 ), 309 317 "slashdot" => array( 310 318 "name" => "Slashdot", … … 347 355 "icon" => "viadeo", 348 356 ), 357 "viber" => array( 358 "name" => "Viber", 359 "icon" => "viber", 360 ), 349 361 "vk" => array( 350 362 "name" => "VK", … … 358 370 "name" => "Webnews", 359 371 "icon" => "webnews", 372 ), 373 "wechat" => array( 374 "name" => "WeChat", 375 "icon" => "wechat", 360 376 ), 361 377 "wordpress" => array( … … 399 415 400 416 $A2A_FOLLOW_services = array( 417 401 418 'facebook' => array( 402 419 'name' => 'Facebook', … … 454 471 'icon' => 'linkedin', 455 472 ), 473 'snapchat' => array( 474 'name' => 'Snapchat', 475 'href' => 'https://www.snapchat.com/add/${id}', 476 'icon' => 'snapchat', 477 ), 456 478 'tumblr' => array( 457 479 'name' => 'Tumblr', … … 479 501 'icon' => 'feed', 480 502 ), 503 481 504 ); -
add-to-any/trunk/addtoany.widgets.php
r1346380 r1394811 14 14 /** constructor */ 15 15 function __construct() { 16 $widget_ops = array( 'description' => 'Share buttons for sharing your content.' ); 17 parent::__construct( '', 'AddToAny Share', $widget_ops ); 18 } 16 $widget_ops = array( 17 'description' => 'Share buttons for sharing your content.', 18 'customize_selective_refresh' => true, 19 ); 20 parent::__construct( '', 'AddToAny Share', $widget_ops ); 21 22 // Enqueue script if widget is active (appears in a sidebar) or if in Customizer preview. 23 if ( is_active_widget( false, false, $this->id_base ) || is_customize_preview() ) { 24 add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); 25 } 26 } 27 28 public function enqueue_scripts() { 29 wp_enqueue_script( 'addtoany-widget-init', plugins_url( 'addtoany.admin.js', __FILE__ ), array(), '0.1', true ); 30 } 19 31 20 32 /** Backwards compatibility for A2A_SHARE_SAVE_Widget::display(); usage */ … … 93 105 /** constructor */ 94 106 function __construct() { 95 $widget_ops = array( 'description' => 'Follow buttons link to your social media.' ); 107 $widget_ops = array( 108 'description' => 'Follow buttons link to your social media.', 109 'customize_selective_refresh' => true, 110 ); 96 111 parent::__construct( '', 'AddToAny Follow', $widget_ops ); 97 } 112 113 // Enqueue script if widget is active (appears in a sidebar) or if in Customizer preview. 114 if ( is_active_widget( false, false, $this->id_base ) || is_customize_preview() ) { 115 add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); 116 } 117 } 118 119 /** 120 * Enqueue a script with jQuery as a dependency. 121 */ 122 public function enqueue_scripts() { 123 wp_enqueue_script( 'addtoany-widget-init', plugins_url( 'addtoany.admin.js', __FILE__ ), array('jquery'), '0.1', true ); 124 } 98 125 99 126 /**
Note: See TracChangeset
for help on using the changeset viewer.