Changeset 592497
- Timestamp:
- 08/30/2012 04:28:57 PM (13 years ago)
- Location:
- wordpress-social-ring
- Files:
-
- 24 added
- 3 edited
-
tags/1.1.8 (added)
-
tags/1.1.8/admin (added)
-
tags/1.1.8/admin/admin.php (added)
-
tags/1.1.8/admin/css (added)
-
tags/1.1.8/admin/css/style.css (added)
-
tags/1.1.8/admin/images (added)
-
tags/1.1.8/admin/images/altervista.gif (added)
-
tags/1.1.8/admin/images/av-16x16.png (added)
-
tags/1.1.8/admin/images/av32px.png (added)
-
tags/1.1.8/images (added)
-
tags/1.1.8/images/facebook.png (added)
-
tags/1.1.8/includes (added)
-
tags/1.1.8/includes/library.php (added)
-
tags/1.1.8/includes/share.php (added)
-
tags/1.1.8/includes/widgets.php (added)
-
tags/1.1.8/langs (added)
-
tags/1.1.8/langs/wp_social_ring-es_ES.mo (added)
-
tags/1.1.8/langs/wp_social_ring-es_ES.po (added)
-
tags/1.1.8/langs/wp_social_ring-it_IT.mo (added)
-
tags/1.1.8/langs/wp_social_ring-it_IT.po (added)
-
tags/1.1.8/readme.txt (added)
-
tags/1.1.8/screenshot-1.png (added)
-
tags/1.1.8/screenshot-2.png (added)
-
tags/1.1.8/wp-social-ring.php (added)
-
trunk/includes/library.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/wp-social-ring.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wordpress-social-ring/trunk/includes/library.php
r584582 r592497 16 16 echo "<meta property=\"og:site_name\" content=\"".esc_attr(get_bloginfo('name'))."\" />\n"; 17 17 echo "<meta property=\"og:description\" content=\"".esc_attr(social_ring_make_excerpt($post))."\" />\n"; 18 if ( empty( $image ) && function_exists('has_post_thumbnail') && has_post_thumbnail( $post->ID ) ) { 19 $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ); 20 if ( $thumbnail ) 21 $image = $thumbnail[0]; 22 // If that's not there, grab the first attached image 23 } else { 24 $files = get_children( 25 array( 26 'post_parent' => $post->ID, 27 'post_type' => 'attachment', 28 'post_mime_type' => 'image', 29 ) 30 ); 31 if ( $files ) { 32 $keys = array_reverse( array_keys( $files ) ); 33 $image = image_downsize( $keys[0], 'thumbnail' ); 34 $image = $image[0]; 35 //if there's no attached image, try to grab first image in content 36 } else { 37 $image = social_ring_get_first_image(); 38 } 39 } 18 $image = social_ring_get_first_image(); 40 19 if ( $image != '' ) { 41 20 echo "<meta property=\"og:image\" content=\"".esc_attr( $image )."\" />\n"; … … 47 26 48 27 function social_ring_get_first_image() { 49 global $post, $posts; 50 $first_img = ''; 51 ob_start(); 52 ob_end_clean(); 53 54 $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', 55 $post->post_content, $matches); 56 $first_img = $matches [1] [0]; 57 58 return $first_img; 28 29 global $post, $posts; 30 31 if ( function_exists('has_post_thumbnail') && has_post_thumbnail( $post->ID ) ) { 32 33 $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'post-thumbnail' ); 34 if ( $thumbnail ) 35 $image = $thumbnail[0]; 36 37 // If that's not there, grab the first attached image 38 } else { 39 40 $files = get_children( 41 array( 42 'post_parent' => $post->ID, 43 'post_type' => 'attachment', 44 'post_mime_type' => 'image', 45 ) 46 ); 47 if ( $files ) { 48 $keys = array_reverse( array_keys( $files ) ); 49 $image = image_downsize( $keys[0], 'thumbnail' ); 50 $image = $image[0]; 51 } 52 } 53 //if there's no attached image, try to grab first image in content 54 if(empty($image)) { 55 ob_start(); 56 ob_end_clean(); 57 $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', 58 $post->post_content, $matches); 59 if(!empty($matches[1][0])) { 60 $image = $matches[1][0]; 61 } 62 } 63 64 return $image; 59 65 } 60 66 -
wordpress-social-ring/trunk/readme.txt
r584840 r592497 5 5 Requires at least: 3.2 6 6 Tested up to: 3.4 7 Version: 1.1. 78 Stable tag: 1.1. 77 Version: 1.1.8 8 Stable tag: 1.1.8 9 9 10 10 WordPress Social Ring adds sharing buttons for Facebook, Twitter and Google+. … … 35 35 36 36 == Changelog == 37 38 = 1.1.8 = 39 40 * Bugfix 37 41 38 42 = 1.1.7 = -
wordpress-social-ring/trunk/wp-social-ring.php
r584582 r592497 4 4 Description: Let visitors share posts/pages on Facebook, Twitter and Google+. From admin page you can choose which button display: Facebook Like, Facebook Send, Facebook Share, Google +1 and Twitter. 5 5 Author: Niccolò Tapparo 6 Version: 1.1. 76 Version: 1.1.8 7 7 Author URI: http://wordpress.altervista.org/ 8 8 Plugin URI: http://wordpress.altervista.org/en/tag/wordpress-social-ring-en/
Note: See TracChangeset
for help on using the changeset viewer.