Changeset 620715
- Timestamp:
- 11/03/2012 03:43:17 PM (13 years ago)
- Location:
- wpsocialite/trunk
- Files:
-
- 4 added
- 2 edited
-
lang (added)
-
lang/wpsocialite-fr_FR.mo (added)
-
lang/wpsocialite-fr_FR.po (added)
-
lang/wpsocialite-xx_XX.pot (added)
-
readme.txt (modified) (5 diffs)
-
wpsocialite.php (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpsocialite/trunk/readme.txt
r615367 r620715 5 5 Requires at least: 3.0 6 6 Tested up to: 3.4.2 7 Stable tag: 1.4. 27 Stable tag: 1.4.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 35 35 = Can I add the social links myself instead of letting the plugin place them? = 36 36 37 Of course! Use the "manual" setting under the plugin settings (Settings->Discussion) and then use the following PHPin your template to display the links however you please.37 Of course! Use the "manual" setting under the plugin settings (Settings->Discussion) and then use the following template tags in your template to display the links however you please. 38 38 39 `<?php echo wpsocialite::wpsocialite_markup('large'); ?>` 39 The first template tag is to echo out the markup and display WPSocialite: 40 41 `<?php wpsocialite_markup('large'); ?>` 42 43 The second template tag is to get WPSocialite's mark up and place it in an object, if needed: 44 45 `<?php 46 $wpsocialite = get_wpsocialite_markup('small'); 47 echo $wpsocialite; 48 ?>` 40 49 41 50 When using this method, be sure to include "large" or "small" inside the function (as seen above) to define which style WPSocialite will use to display your social links. … … 47 56 `define('WPSOCIALITE_LOADSCRIPTS', false);` 48 57 49 Setting this to false tells the plugin to not load any Javascript or CSS. If you want the plugin to automatically load it again, simply set this to true or remove it completely. 58 Setting this to false tells the plugin to not load any Javascript. If you want the plugin to automatically load it again, simply set this to true or remove it completely. 59 60 To stop the plugin from automatically loading its CSS, you would use the following line in the same way: 61 62 `define( 'WPSOCIALITE_LOADSTYLES', false);` 63 50 64 51 65 Please note, when using this method if you are loading any social networks with an external file (Pinterest, for example), you will also have to load the javascript file associated with the network (wpsocialite/Socialite/extensions/socialite.pinterest.js). … … 59 73 60 74 == Changelog == 75 76 = 1.4.3 = 77 * Adds localization support and allows you to select the CPT WPSocialite displays on. 61 78 62 79 = 1.4.2 = … … 85 102 == Upgrade Notice == 86 103 104 = 1.4.3 = 105 * Adds localization support and allows you to select the CPT WPSocialite displays on. 106 87 107 = 1.4.2 = 88 108 Fixed Pinterest loading all at once. Removed class selection option. -
wpsocialite/trunk/wpsocialite.php
r615367 r620715 5 5 Description: No one likes long load times! Yet we all want to be able to share our content via Facebook, Twitter, and all other social networks. These take a long time to load. Paradox? Not anymore! With WPSocialite (utilizing David Bushnell's amazing SocialiteJS plugin [http://www.socialitejs.com/]) we can manage the loading process of our social sharing links. Load them on hover, on page scroll, and more! 6 6 Author: Tom Morton 7 Version: 1.4. 27 Version: 1.4.3 8 8 Author URI: http://twmorton.com/ 9 9 10 This plugin uses the Socialitejs library created by David Bushell. The author of this plugin does not wish to claim this tool as his own but ensure that David gets proper credit for his work. I've simply wrapped his fantastic tool into a Wordpress plugin for us all to use. Please be sure to check him out: @dbushell or '.$postlink.'11 12 This program is free software; you can redistribute it and/or modify13 it under the terms of the GNU General Public License as published by14 the Free Software Foundation; either version 2 of the License, or15 (at your option) any later version.16 17 This program is distributed in the hope that it will be useful,18 but WITHOUT ANY WARRANTY; without even the implied warranty of19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the20 GNU General Public License for more details.21 22 You should have received a copy of the GNU General Public License23 along with this program; if not, write to the Free Software24 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA10 This plugin uses the Socialitejs library created by David Bushell. The author of this plugin does not wish to claim this tool as his own but ensure that David gets proper credit for his work. I've simply wrapped his fantastic tool into a Wordpress plugin for us all to use. Please be sure to check him out: @dbushell or http://socialitejs.com 11 12 This program is free software; you can redistribute it and/or modify 13 it under the terms of the GNU General Public License as published by 14 the Free Software Foundation; either version 2 of the License, or 15 (at your option) any later version. 16 17 This program is distributed in the hope that it will be useful, 18 but WITHOUT ANY WARRANTY; without even the implied warranty of 19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 GNU General Public License for more details. 21 22 You should have received a copy of the GNU General Public License 23 along with this program; if not, write to the Free Software 24 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 25 25 26 26 */ … … 35 35 if ( !defined('WPSOCIALITE_LOADSCRIPTS') ) 36 36 define( 'WPSOCIALITE_LOADSCRIPTS', true ); 37 // split style from scripts 38 if ( !defined('WPSOCIALITE_LOADSTYLES') ) 39 define( 'WPSOCIALITE_LOADSTYLES', true ); 40 37 41 38 42 if (!class_exists("wpsocialite")) { … … 50 54 51 55 add_action( 'init', array( &$this, 'init' ) ); 56 57 // localizes the buttons depending on the get_locale(). 58 add_action( 'wp_footer', array( &$this, 'wpsocialite_localize_script'),20); 52 59 53 60 add_filter( 'body_class', array( &$this, 'wpsocialite_body_class' ) ); … … 68 75 function init() 69 76 { 77 load_plugin_textdomain('wpsocialite', false, dirname(plugin_basename(__FILE__)).'/lang/'); 78 70 79 if( WPSOCIALITE_LOADSCRIPTS ){ 71 80 $this->wpsocialite_enqueue_scripts(); 81 } 82 if( WPSOCIALITE_LOADSTYLES ){ 72 83 $this->wpsocialite_enqueue_styles(); 73 84 } … … 91 102 if(!is_admin()){ 92 103 93 wp_enqueue_script('socialite-lib', WPSOCIALITE_URL_SOCIALITE.'/socialite.min.js', array('jquery'), ' 1.0', true);94 95 wp_enqueue_script('wpsocialite', WPSOCIALITE_URL.'wpsocialite.js', array(' jquery'), '1.0', true);104 wp_enqueue_script('socialite-lib', WPSOCIALITE_URL_SOCIALITE.'/socialite.min.js', array('jquery'), '2.0', true); 105 106 wp_enqueue_script('wpsocialite', WPSOCIALITE_URL.'wpsocialite.js', array('socialite-lib'), '1.0', true); 96 107 97 108 $scripts = WPSocialite_Options::wpsocialite_list_network_options(null, null, null, null); … … 108 119 } // wpsocialite_enqueue_scripts() 109 120 121 function wpsocialite_localize_script() 122 { 123 // overrides Socialite setup with valid locales 124 125 $locale = get_locale(); 126 $c5 = $locale; 127 $c2 = substr($c5, 0, 2); 128 129 $fb_locales = array('af_ZA','ar_AR','az_AZ','be_BY','bg_BG','bn_IN','bs_BA','ca_ES','cs_CZ','cy_GB','da_DK','de_DE','el_GR','en_GB','en_US','eo_EO','es_ES','es_LA','et_EE','eu_ES','fa_IR','fi_FI','fo_FO','fr_CA','fr_FR','fy_NL','ga_IE','gl_ES','he_IL','hi_IN','hr_HR','hu_HU','hy_AM','id_ID','is_IS','it_IT','ja_JP','ka_GE','km_KH','ko_KR','ku_TR','la_VA','lt_LT','lv_LV','mk_MK','ml_IN','ms_MY','nb_NO','ne_NP','nl_NL','nn_NO','pa_IN','pl_PL','ps_AF','pt_BR','pt_PT','ro_RO','ru_RU','sk_SK','sl_SI','sq_AL','sr_RS','sv_SE','sw_KE','ta_IN','te_IN','th_TH','tl_PH','tr_TR','uk_UA','vi_VN','zh_CN','zh_HK','zh_TW'); 130 $tw_locales = array('en','fr','de','it','es','ko','ja'); 131 $gp_locales = array('af','am','ar','eu','bn','bg','ca','zh-HK','zh-CN','zh-TW','hr','cs','da','nl','en-GB','en-US','et','fil','fi','fr','fr-CA','gl','de','el','gu','iw','hi','hu','is','id','it','ja','kn','ko','lb','lt','ms','ml','mr','no','fa','pl','pt-BR','pt-PT','ro','ru','sr','sk','sl','es','es-419','sw','sv','ta','te','th','tr','uk','ur','vi','zu'); 132 133 $fb_locale = (in_array($c5,$fb_locales))? $c5 : 'en_US'; 134 $tw_locale = (in_array($c2,$tw_locales))? $c2 : 'en'; 135 $gp_locale = (in_array($c5,$gp_locales))? str_replace('_', '-', $c5) : (in_array($c2,$gp_locales))? $c2 : 'en'; 136 137 138 echo "<script type=\"text/javascript\">Socialite.setup({facebook:{lang:'$fb_locale',appId:null},twitter:{lang:'$tw_locale'},googleplus:{lang:'$gp_locale'}});</script>"; 139 140 } 141 110 142 function wpsocialite_enqueue_styles() 111 143 { … … 121 153 122 154 123 function wpsocialite_markup($size = null) 124 { 155 function wpsocialite_markup($args = array()) 156 { 157 // use the wp_parse_arg paradigm to permit easy addition of parameters in the future. 158 $default_args = array( 159 'size'=>get_option('wpsocialite_style') 160 ); 161 extract(wp_parse_args($args,$default_args),EXTR_SKIP); 162 125 163 global $wp_query; 126 164 $post = $wp_query->post; //get post content … … 155 193 function wpsocialite_add_to_content( $content ) 156 194 { 195 // added single and post type filters 196 197 $single = get_option('wpsocialite_single'); 157 198 158 199 $position = get_option('wpsocialite_position'); 159 200 160 $size = get_option('wpsocialite_style'); 201 $post_types = get_option('wpsocialite_post_types',array()); 202 $pt = get_post_type(); 203 204 if ($single && !is_single()) //Do not display unless single if user specified 205 return $content; 206 207 if(!in_array($pt,$post_types)) //Do not display on the specified post type 208 return $content; 161 209 162 210 if(is_feed()) … … 171 219 case 'before': 172 220 173 $content = $this->wpsocialite_markup( $size) . $content;221 $content = $this->wpsocialite_markup() . $content; 174 222 175 223 break; … … 177 225 case 'after': 178 226 179 $content .= $this->wpsocialite_markup( $size);227 $content .= $this->wpsocialite_markup(); 180 228 181 229 break; … … 207 255 function admin_init() 208 256 { 257 add_settings_section( 258 $id = 'wpsocialite', 259 $title = __('WPSocialite','wpsocialite'), 260 $callback = array(&$this,'wpsocialite_section'), 261 $page = 'discussion' 262 ); 209 263 add_settings_field( 210 264 $id = 'wpsocialite_mode', 211 $title = "WPSocialite Mode",265 $title = __('Mode','wpsocialite'), 212 266 $callback = array( &$this, 'wpsocialite_mode' ), 213 $page = 'discussion' 214 ); 267 $page = 'discussion', 268 $section = 'wpsocialite' 269 ); 215 270 register_setting( $option_group = 'discussion', $option_name = 'wpsocialite_mode' ); 216 271 217 272 add_settings_field( 218 273 $id = 'wpsocialite_excerpt', 219 $title = "WPSocialite Excerpt",274 $title = __('Apply to Excerpt','wpsocialite'), 220 275 $callback = array( &$this, 'wpsocialite_excerpt' ), 221 $page = 'discussion' 222 ); 276 $page = 'discussion', 277 $section = 'wpsocialite' 278 ); 223 279 register_setting( $option_group = 'discussion', $option_name = 'wpsocialite_excerpt' ); 224 280 225 281 add_settings_field( 282 $id = 'wpsocialite_single', 283 $title = __('Apply to Single only','wpsocialite'), 284 $callback = array( &$this, 'wpsocialite_single' ), 285 $page = 'discussion', 286 $section = 'wpsocialite' 287 ); 288 register_setting( $option_group = 'discussion', $option_name = 'wpsocialite_single' ); 289 290 add_settings_field( 226 291 $id = 'wpsocialite_style', 227 $title = "WPSocialite Style",292 $title = __('Style','wpsocialite'), 228 293 $callback = array( &$this, 'wpsocialite_style' ), 229 $page = 'discussion' 230 ); 294 $page = 'discussion', 295 $section = 'wpsocialite' 296 ); 231 297 register_setting( $option_group = 'discussion', $option_name = 'wpsocialite_style' ); 232 298 233 299 add_settings_field( 234 300 $id = 'wpsocialite_position', 235 $title = "WPSocialite Position",301 $title = __('Position','wpsocialite'), 236 302 $callback = array( &$this, 'wpsocialite_position' ), 237 $page = 'discussion' 238 ); 303 $page = 'discussion', 304 $section = 'wpsocialite' 305 ); 239 306 register_setting( $option_group = 'discussion', $option_name = 'wpsocialite_position' ); 240 307 241 308 add_settings_field( 242 $id = 'wpsocialite_position', 243 $title = "WPSocialite Position", 244 $callback = array( &$this, 'wpsocialite_position' ), 245 $page = 'discussion' 246 ); 247 register_setting( $option_group = 'discussion', $option_name = 'wpsocialite_position' ); 309 $id = 'wpsocialite_post_types', 310 $title = __('Post Types','wpsocialite'), 311 $callback = array( &$this, 'wpsocialite_post_types' ), 312 $page = 'discussion', 313 $section = 'wpsocialite' 314 ); 315 register_setting( $option_group = 'discussion', $option_name = 'wpsocialite_post_types' ); 248 316 249 317 add_settings_field( 250 318 $id = 'wpsocialite_networkoptions', 251 $title = "WPSocialite Options",319 $title = __('Network Options','wpsocialite'), 252 320 $callback = array( &$this, 'wpsocialite_networkoptions' ), 253 $page = 'discussion' 254 ); 321 $page = 'discussion', 322 $section = 'wpsocialite' 323 ); 255 324 register_setting( $option_group = 'discussion', $option_name = 'wpsocialite_networkoptions' ); 256 325 257 326 258 327 } // function 328 329 function wpsocialite_section(){ 330 _e('The configuration of the WP Socialite Plugin.','wpsocialite'); 331 } 259 332 260 333 function wpsocialite_mode() … … 263 336 # echo your form fields here containing the value received from get_option 264 337 265 if($value == 'hover'){266 $options = '<option value="hover" selected="selected">Hover</option>267 <option value="scroll">Scroll</option>';268 269 } elseif($value == 'scroll'){270 $options = '<option value="hover">Hover</option>271 <option value="scroll" selected="selected">Scroll</option>';272 } else{273 $options = '<option value="hover">Hover</option>274 <option value="scroll" selected="selected">Scroll</option>';275 }276 277 338 echo '<label for="wpsocialite_mode"> 278 339 <select name="wpsocialite_mode" id="wpsocialite_mode"> 279 '.$options.' 340 <option value="scroll" '.selected($value,'scroll',false).'>'.__('Scroll','wpsocialite').'</option> 341 <option value="hover" '.selected($value,'hover',false).'>'.__('Hover','wpsocialite').'</option> 280 342 </select> 281 Choose the type of socialite style you would like to use.343 '.__('Choose the event to which Socialite will activate.','wpsocialite').' 282 344 </label>'; 283 345 … … 288 350 $value = get_option('wpsocialite_excerpt'); 289 351 # echo your form fields here containing the value received from get_option 290 if($value == 1) :291 $checked = 'checked';292 else :293 $checked = '';294 endif;295 352 296 353 echo '<label for="wpsocialite_excerpt"> 297 <input name="wpsocialite_excerpt" type="checkbox" id="wpsocialite_excerpt" value="1" '. $checked.'>298 Display WPSocialite sharing options in the excerpt of your posts.354 <input name="wpsocialite_excerpt" type="checkbox" id="wpsocialite_excerpt" value="1" '.checked($value,1,false).'> 355 '.__('Display WPSocialite sharing buttons in the excerpt of your posts.','wpsocialite').' 299 356 </label>'; 300 357 301 358 } // function 302 359 303 function wpsocialite_position() 360 function wpsocialite_single() 361 { 362 $value = get_option('wpsocialite_single'); 363 # echo your form fields here containing the value received from get_option 364 365 echo '<label for="wpsocialite_single"> 366 <input name="wpsocialite_single" type="checkbox" id="wpsocialite_single" value="1" '.checked($value,1,false).'> 367 '.__('Display WPSocialite sharing buttons only on single posts.','wpsocialite').' 368 </label>'; 369 370 } // function 371 372 function wpsocialite_position() 304 373 { 305 374 $value = get_option('wpsocialite_position'); 306 375 # echo your form fields here containing the value received from get_option 307 376 308 if($value == 'before'){309 $options = '<option value="before" selected="selected">Before</option>310 <option value="after">After</option>311 <option value="manual">Manual</option>';312 } elseif($value == 'after'){313 $options = '<option value="before">Before</option>314 <option value="after" selected="selected">After</option>315 <option value="manual">Manual</option>';316 } elseif($value == 'manual'){317 $options = '<option value="before">Before</option>318 <option value="after">After</option>319 <option value="manual" selected="selected">Manual</option>';320 } else {321 $options = '<option value="before" selected="selected">Before</option>322 <option value="after">After</option>323 <option value="manual">Manual</option>';324 }325 326 377 echo '<label for="wpsocialite_position"> 327 378 <select name="wpsocialite_position" id="wpsocialite_position"> 328 '.$options.' 379 <option value="before" '.selected($value,'before',false).'>'.__('Before','wpsocialite').'</option> 380 <option value="after" '.selected($value,'after',false).'>'.__('After','wpsocialite').'</option> 381 <option value="manual" '.selected($value,'manual',false).'>'.__('Manual','wpsocialite').'</option> 329 382 </select> 330 Choose where you would like the social icons to appear, before or after the main content. If set to <strong>Manual</strong>, you can use this code to place your Social links anywhere you like: <pre><?php echo wpsocialite::wpsocialite_markup("large"); ?></pre>383 '.sprintf(__('Choose where you would like the social icons to appear, before or after the main content. If set to <strong>Manual</strong>, you can use this code to place your Social links anywhere you like in your templates files: %s','wpsocialite'),'<pre><?php wpsocialite_markup(); ?></pre>').' 331 384 </label>'; 332 385 … … 340 393 # echo your form fields here containing the value received from get_option 341 394 342 if($value == 'small'){343 $options = '<option value="large">Large</option>344 <option value="small" selected="selected">Small</option>';345 } else {346 $options = '<option value="large" selected="selected">Large</option>347 <option value="small">Small</option>';348 }349 350 395 echo '<label for="wpsocialite_style"> 351 396 <select name="wpsocialite_style" id="wpsocialite_style"> 352 '.$options.' 397 <option value="large" '.selected($value,'large',false).'>'.__('Large','wpsocialite').'</option> 398 <option value="small" '.selected($value,'small',false).'>'.__('Small','wpsocialite').'</option> 353 399 </select> 354 Choose the type of socialite style you would like to use.400 '.__('Choose the type of socialite style you would like to use.','wpsocialite').' 355 401 </label>'; 356 402 … … 358 404 359 405 } // function 406 407 // specify to which post type to show the buttons 408 function wpsocialite_post_types(){ 409 $value = get_option('wpsocialite_post_types',array()); 410 $post_types = get_post_types(array('public'=>true),'objects'); 411 412 foreach($post_types as $pt=>$ptobj){ 413 $checked = (in_array($pt, $value))?' checked="CHECKED"': ''; 414 echo '<label for="wpsocialite_post_type_'.$pt.'"> 415 <input name="wpsocialite_post_types[]" type="checkbox" id="wpsocialite_post_type_'.$pt.'" value="'.$pt.'" '.$checked.' > ' 416 .$ptobj->label. 417 '</label><br />'; 418 } 419 420 }// function 360 421 361 422 function wpsocialite_networkoptions(){ … … 371 432 endif; 372 433 373 if($buttonvalue == 1) :374 $checked = 'checked';375 else :376 $checked = '';377 endif;378 379 434 $output .= ' 380 435 <label for="wpsocialite_networkoptions['.$button['slug'].']"> 381 <input name="wpsocialite_networkoptions['.$button['slug'].']" type="checkbox" id="wpsocialite_networkoptions['.$button['slug'].']" value="1" '. $checked.'>436 <input name="wpsocialite_networkoptions['.$button['slug'].']" type="checkbox" id="wpsocialite_networkoptions['.$button['slug'].']" value="1" '.checked($buttonvalue,1,false).'> 382 437 '.$button['name'].' 383 438 </label><br />'; 384 439 } 385 440 386 echo 'Select the social networks to display.<br /> 387 '.$output.' 388 '; 441 echo __('Select the social networks to display.','wpsocialite').'<br /> 442 '.$output; 389 443 390 444 } … … 392 446 function wpsocialite_list_network_options($link = null, $title = null, $size = null, $image = null) { 393 447 if( $image == '') { $image = null; } //link post featured image with Pinterest, if available 394 395 $buttons = array(396 'facebook' => array(397 'name' => 'Facebook',398 'slug' => 'facebook',399 'markup_large' => '<a href="http://www.facebook.com/sharer.php?u='.$link.'&t='.$title.'" class="socialite facebook-like" data-href="'.$link.'" data-send="false" data-layout="box_count" data-width="60" data-show-faces="false" rel="nofollow" target="_blank"><span class="vhidden">Share on Facebook</span></a>',400 'markup_small' => '<a href="http://www.facebook.com/sharer.php?u='.$link.'&t='.$title.'" class="socialite facebook-like" data-href="'.$link.'" data-send="false" data-layout="button_count" data-width="60" data-show-faces="false" rel="nofollow" target="_blank"><span class="vhidden">Share on Facebook</span></a>',401 'external_file' => false402 ),403 'twitter' => array(404 'name' => 'Twitter',405 'slug' => 'twitter',406 'markup_large' => '<a href="http://twitter.com/share" class="socialite twitter-share" data-text="'.$title.'" data-url="'.$link.'" data-count="vertical" rel="nofollow" target="_blank"><span class="vhidden">Share on Twitter</span></a>',407 'markup_small' => '<a href="http://twitter.com/share" class="socialite twitter-share" data-text="'.$title.'" data-url="'.$link.'" data-count="horizontal" data-via="" rel="nofollow" target="_blank"><span class="vhidden">Share on Twitter</span></a>',408 'external_file' => false409 ),410 'gplus' => array(411 'name' => 'Google Plus',412 'slug' => 'gplus',413 'markup_large' => '<a href="https://plus.google.com/share?url='.$link.'" class="socialite googleplus-one" data-size="tall" data-href="'.$link.'" rel="nofollow" target="_blank"><span class="vhidden">Share on Google+</span></a>',414 'markup_small' => '<a href="https://plus.google.com/share?url='.$link.'" class="socialite googleplus-one" data-size="medium" data-href="'.$link.'" rel="nofollow" target="_blank"><span class="vhidden">Share on Google+</span></a>',415 'external_file' => false416 ),417 'linkedin' => array(418 'name' => 'Linkedin',419 'slug' => 'linkedin',420 'markup_large' => '<a href="http://www.linkedin.com/shareArticle?mini=true&url='.$link.'&title='.$title.'" class="socialite linkedin-share" data-url="'.$link.'" data-counter="top" rel="nofollow" target="_blank"><span class="vhidden">Share on LinkedIn</span></a>',421 'markup_small' => '<a href="http://www.linkedin.com/shareArticle?mini=true&url='.$link.'&title='.$title.'" class="socialite linkedin-share" data-url="'.$link.'" data-counter="right" rel="nofollow" target="_blank"><span class="vhidden">Share on LinkedIn</span></a>',422 'external_file' => false423 ),424 'pinterest' => array(425 'name' => 'Pinterest',426 'slug' => 'pinterest',427 'markup_large' => '<a href="http://pinterest.com/pin/create/button/?url='.$link.'&media=' . $image . '&description='.$title.'" class="socialite pinterest-pinit" data-count-layout="vertical"><span class="vhidden">Pin It!</span></a>',428 'markup_small' => '<a href="http://pinterest.com/pin/create/button/?url='.$link.'&media=' . $image . '&description='.$title.'" class="socialite pinterest-pinit" data-count-layout="horizontal"><span class="vhidden">Pin It!</span></a>',429 'external_file' => 'socialite.pinterest.js'430 ),431 );448 $locale = get_locale(); 449 $buttons = array( 450 'facebook' => array( 451 'name' => 'Facebook', 452 'slug' => 'facebook', 453 'markup_large' => '<a href="http://www.facebook.com/sharer.php?u='.$link.'&locale='.$locale.'&t='.$title.'" class="socialite facebook-like" data-lang="'.$locale.'" data-href="'.$link.'" data-send="false" data-layout="box_count" data-width="60" data-show-faces="false" rel="nofollow" target="_blank"><span class="vhidden">'.apply_filters('wpsocialite_share_facebook_label',__('Share on Facebook.','wpsocialite')).'</span></a>', 454 'markup_small' => '<a href="http://www.facebook.com/sharer.php?u='.$link.'&locale='.$locale.'&t='.$title.'" class="socialite facebook-like" data-lang="'.$locale.'" data-href="'.$link.'" data-send="false" data-layout="button_count" data-width="60" data-show-faces="false" rel="nofollow" target="_blank"><span class="vhidden">'.apply_filters('wpsocialite_share_facebook_label',__('Share on Facebook.','wpsocialite')).'</span></a>', 455 'external_file' => false 456 ), 457 'twitter' => array( 458 'name' => 'Twitter', 459 'slug' => 'twitter', 460 'markup_large' => '<a href="http://twitter.com/share" class="socialite twitter-share" data-text="'.$title.'" data-url="'.$link.'" data-count="vertical" data-lang="'.$locale.'" rel="nofollow" target="_blank"><span class="vhidden">'.apply_filters('wpsocialite_share_twitter_label',__('Share on Twitter.','wpsocialite')).'</span></a>', 461 'markup_small' => '<a href="http://twitter.com/share" class="socialite twitter-share" data-text="'.$title.'" data-url="'.$link.'" data-count="horizontal" data-lang="'.$locale.'" data-via="" rel="nofollow" target="_blank"><span class="vhidden">'.apply_filters('wpsocialite_share_twitter_label',__('Share on Twitter.','wpsocialite')).'</span></a>', 462 'external_file' => false 463 ), 464 'gplus' => array( 465 'name' => 'Google Plus', 466 'slug' => 'gplus', 467 'markup_large' => '<a href="https://plus.google.com/share?url='.$link.'" class="socialite googleplus-one" data-size="tall" data-href="'.$link.'" rel="nofollow" target="_blank"><span class="vhidden">'.apply_filters('wpsocialite_share_googleplus_label',__('Share on Google+','wpsocialite')).'</span></a>', 468 'markup_small' => '<a href="https://plus.google.com/share?url='.$link.'" class="socialite googleplus-one" data-size="medium" data-href="'.$link.'" rel="nofollow" target="_blank"><span class="vhidden">'.apply_filters('wpsocialite_share_googleplus_label',__('Share on Google+','wpsocialite')).'</span></a>', 469 'external_file' => false 470 ), 471 'linkedin' => array( 472 'name' => 'Linkedin', 473 'slug' => 'linkedin', 474 'markup_large' => '<a href="http://www.linkedin.com/shareArticle?mini=true&url='.$link.'&title='.$title.'" class="socialite linkedin-share" data-url="'.$link.'" data-counter="top" rel="nofollow" target="_blank"><span class="vhidden">'.apply_filters('wpsocialite_share_linkedin_label',__('Share on LinkedIn','wpsocialite')).'</span></a>', 475 'markup_small' => '<a href="http://www.linkedin.com/shareArticle?mini=true&url='.$link.'&title='.$title.'" class="socialite linkedin-share" data-url="'.$link.'" data-counter="right" rel="nofollow" target="_blank"><span class="vhidden">'.apply_filters('wpsocialite_share_linkedin_label',__('Share on LinkedIn','wpsocialite')).'</span></a>', 476 'external_file' => false 477 ), 478 'pinterest' => array( 479 'name' => 'Pinterest', 480 'slug' => 'pinterest', 481 'markup_large' => '<a href="http://pinterest.com/pin/create/button/?url='.$link.'&media=' . $image . '&description='.$title.'" class="socialite pinterest-pinit" data-count-layout="vertical"><span class="vhidden">'.apply_filters('wpsocialite_share_pinterest_label',__('Pin It!','wpsocialite')).'</span></a>', 482 'markup_small' => '<a href="http://pinterest.com/pin/create/button/?url='.$link.'&media=' . $image . '&description='.$title.'" class="socialite pinterest-pinit" data-count-layout="horizontal"><span class="vhidden">'.apply_filters('wpsocialite_share_pinterest_label',__('Pin It!','wpsocialite')).'</span></a>', 483 'external_file' => 'socialite.pinterest.js' 484 ), 485 ); 432 486 433 487 return $buttons; 434 488 } 435 436 489 437 490 function wpsocialite_settings_link($links, $file) { … … 440 493 441 494 if ($file == $this_plugin){ 442 $settings_link = '<a href="options-discussion.php#wpsocialite_mode">'.__( "Settings", "wpsocialite").'</a>';495 $settings_link = '<a href="options-discussion.php#wpsocialite_mode">'.__('Settings', 'wpsocialite').'</a>'; 443 496 array_unshift($links, $settings_link); 444 497 } … … 452 505 453 506 $wpsocialite = new wpsocialite; 507 508 /* Template Tags 509 * 510 */ 511 function get_wpsocialite_markup($args = array()){ 512 $wpsocialite = wpsocialite::wpsocialite_markup($args); 513 return $wpsocialite; 514 } 515 function wpsocialite_markup($args = array()){ 516 $wpsocialite = get_wpsocialite_markup($args); 517 echo $wpsocialite; 518 }
Note: See TracChangeset
for help on using the changeset viewer.