Changeset 615367
- Timestamp:
- 10/21/2012 08:21:20 PM (13 years ago)
- Location:
- wpsocialite/trunk
- Files:
-
- 3 edited
-
readme.txt (modified) (4 diffs)
-
wpsocialite.js (modified) (2 diffs)
-
wpsocialite.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpsocialite/trunk/readme.txt
r612879 r615367 5 5 Requires at least: 3.0 6 6 Tested up to: 3.4.2 7 Stable tag: 1.4. 17 Stable tag: 1.4.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 37 37 Of course! Use the "manual" setting under the plugin settings (Settings->Discussion) and then use the following PHP in your template to display the links however you please. 38 38 39 `<?php echo $wpsocialite->wpsocialite_markup('large'); ?>`39 `<?php echo wpsocialite::wpsocialite_markup('large'); ?>` 40 40 41 41 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. … … 59 59 60 60 == Changelog == 61 62 = 1.4.2 = 63 * Fixed Pinterest loading all at once. Corrected readme instructions for manual usage. Removed class selection option. 61 64 62 65 = 1.4.1 = … … 82 85 == Upgrade Notice == 83 86 87 = 1.4.2 = 88 Fixed Pinterest loading all at once. Removed class selection option. 89 84 90 = 1.4.1 = 85 91 Cleaned up files and added ability to disable automatic loading of JS and CSS. Upgrade to ensure no compatability issues arise. -
wpsocialite/trunk/wpsocialite.js
r612276 r615367 1 1 jQuery(function($) { 2 2 3 Socialite.process(); //processing each instance before we take any action. Makes sure pinterest loads individually and not all together. 4 3 5 if ( $("body").hasClass("wpsocialite-scroll") ) { //If set to 'scroll' 4 5 var articles = $(thePostClasses), socialised = { }, win = $(window), updateArticles, onUpdate, updateTimeout; 6 var articles = $('.social-buttons'), socialised = { }, win = $(window), updateArticles, onUpdate, updateTimeout; 6 7 7 8 updateArticles = function() … … 45 46 46 47 setTimeout(updateArticles, 100); 47 48 48 49 } else { //If not set to 'scroll', default to hover 49 50 $( thePostClasses).one('mouseenter', function(){50 51 $('.social-buttons').parent().one('mouseenter', function(){ 51 52 Socialite.load($(this)[0]); 52 }); 53 53 }); 54 54 55 } 55 56 -
wpsocialite/trunk/wpsocialite.php
r612879 r615367 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. 17 Version: 1.4.2 8 8 Author URI: http://twmorton.com/ 9 9 … … 51 51 add_action( 'init', array( &$this, 'init' ) ); 52 52 53 add_action( 'wp_head', array( &$this, 'wpsocialite_vardefine_head' ) );54 55 53 add_filter( 'body_class', array( &$this, 'wpsocialite_body_class' ) ); 56 54 … … 75 73 } 76 74 } // init 77 function wpsocialite_vardefine_head() 78 { 79 global $wp; 80 81 $value = get_option('wpsocialite_classes'); 82 83 if($value == ''){ 84 $value = 'article.post, .post, .page, .social-buttons'; 85 } 86 87 $script = "<script type=\"text/javascript\"> var thePostClasses = '$value'; </script>\n"; 88 89 echo $script; 90 } 75 91 76 function wpsocialite_body_class($classes) 92 77 { … … 175 160 $size = get_option('wpsocialite_style'); 176 161 162 if(is_feed()) 163 return $content; //do not include social markup in feed 164 177 165 switch($position){ 178 166 179 167 case 'manual': 180 //n ada168 //nothing 181 169 break; 182 170 … … 234 222 ); 235 223 register_setting( $option_group = 'discussion', $option_name = 'wpsocialite_excerpt' ); 236 237 add_settings_field(238 $id = 'wpsocialite_classes',239 $title = "WPSocialite Classes",240 $callback = array( &$this, 'wpsocialite_classes' ),241 $page = 'discussion'242 );243 register_setting( $option_group = 'discussion', $option_name = 'wpsocialite_classes' );244 224 245 225 add_settings_field( … … 348 328 '.$options.' 349 329 </select> 350 Choose where you would like the social icons to appear, before or after the main content. 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> 351 331 </label>'; 352 332 … … 376 356 377 357 378 379 } // function380 381 function wpsocialite_classes()382 {383 $value = get_option('wpsocialite_classes');384 if($value == ''){385 $value = 'article.post, .post, .page, .social-buttons';386 }387 # echo your form fields here containing the value received from get_option388 389 echo '<label for="wpsocialite_classes">390 <input type="text" name="wpsocialite_classes" id="wpsocialite_classes" value="'.$value.'" class="large-text" >391 Define the class that your posts and pages are wrapped in. If you are unsure, leave it as is.392 </label>';393 358 394 359 } // function … … 457 422 'external_file' => false 458 423 ), 459 'pint rest' => array(460 'name' => 'Pint rest',461 'slug' => 'pint rest',424 'pinterest' => array( 425 'name' => 'Pinterest', 426 'slug' => 'pinterest', 462 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>', 463 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>',
Note: See TracChangeset
for help on using the changeset viewer.