Changeset 708256
- Timestamp:
- 05/05/2013 05:07:02 PM (13 years ago)
- Location:
- wpsocialite/trunk
- Files:
-
- 3 edited
-
Socialite/extensions/socialite.stumbleupon.js (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
wpsocialite.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpsocialite/trunk/Socialite/extensions/socialite.stumbleupon.js
r702809 r708256 41 41 { 42 42 43 console.log(instance);44 43 var el = document.createElement('su:badge'); 45 44 Socialite.copyDataAttributes(instance.el, el); … … 47 46 el.setAttribute('layout', instance.el.dataset.layout); 48 47 el.setAttribute('location', instance.el.dataset.url); 49 console.log(el);50 48 instance.el.appendChild(el); 51 49 if (typeof window.STMBLPN === 'object' && typeof window.STMBLPN.parse === 'function') { -
wpsocialite/trunk/readme.txt
r702809 r708256 89 89 == Changelog == 90 90 91 = 2.3 May 5, 2013 = 92 * Fixed image function when using Pinit Button 93 91 94 = 2.2 April 24, 2013 = 92 95 * Added StumbleUpon Social Sharing Button … … 138 141 == Upgrade Notice == 139 142 143 = 2.3 May 5, 2013 = 144 * Fixed image function when using Pinit Button 145 140 146 = 2.2 April 24, 2013 = 141 147 * Added StumbleUpon Social Sharing Button -
wpsocialite/trunk/wpsocialite.php
r702809 r708256 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: 2. 27 Version: 2.3 8 8 Author URI: http://twmorton.com/ 9 9 … … 154 154 $post = $wp_query->post; 155 155 $id = $post->ID; 156 $imagelink = wp_get_attachment_image_src( get_post_thumbnail_id( $id ), 'full' ); //get the featured image url156 $imagelink = self::wpsocialite_get_image( $id ); 157 157 $title = trim($post->post_title); 158 158 159 if( $url ){ 159 160 $postlink = $url; … … 163 164 164 165 $value = get_option('wpsocialite_networkoptions'); 165 $buttons = self::wpsocialite_list_network_options($postlink, $title, $size, $imagelink [0]);166 $buttons = self::wpsocialite_list_network_options($postlink, $title, $size, $imagelink); 166 167 167 168 $return = '<ul class="wpsocialite social-buttons '.$size.'">'; … … 185 186 return $return; 186 187 188 } 189 190 public function wpsocialite_get_image( $postID ) { 191 //try the featured image first 192 if(has_post_thumbnail()){ 193 $imageattachment = wp_get_attachment_image_src( get_post_thumbnail_id( $postID ), 'full' ); 194 $imagelink = $imageattachment[0]; 195 } else { 196 //No featured image? Try for an attachment. 197 $args = array( 198 'order' => 'ASC', 199 'post_parent' => $postID, 200 'post_type' => 'attachment', 201 'post_mime_type' => 'image', 202 'post_status' => null, 203 'showposts' => '1', 204 ); 205 $attachments = get_posts($args); 206 if ($attachments) { 207 foreach ($attachments as $attachment) { 208 $imagelink = wp_get_attachment_url($attachment->ID, 'full', false, false); 209 } 210 } else{ 211 $imagelink = null; //if there are no attachments set $imagelink to null 212 } 213 } 214 return $imagelink; 187 215 } 188 216
Note: See TracChangeset
for help on using the changeset viewer.