Changeset 192313
- Timestamp:
- 01/10/2010 06:43:29 PM (16 years ago)
- Location:
- fw-post-image
- Files:
-
- 5 added
- 3 edited
-
tags/1.2 (added)
-
tags/1.2/fw-post-image.class.php (added)
-
tags/1.2/fw-post-image.php (added)
-
tags/1.2/readme.txt (added)
-
tags/1.2/screenshot-1.png (added)
-
trunk/fw-post-image.class.php (modified) (4 diffs)
-
trunk/fw-post-image.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
fw-post-image/trunk/fw-post-image.class.php
r184668 r192313 3 3 * @package fw-post-image 4 4 * @author Myriam Faulkner 5 * @version 1. 15 * @version 1.2 6 6 */ 7 7 class fw_post_image { … … 61 61 } 62 62 63 public function remote_file_exists($image) { 64 if ( @file($image)) { 65 return true; 66 } 67 return false; 68 } 69 63 70 public function get_image_in_content () { 64 71 … … 67 74 preg_match_all( '|<img.*?src=[\'"](.*?)[\'"].*?>|i', $my_post->post_content, $matches ); 68 75 69 if ( isset( $matches ) ) $image = $matches[1][0]; 76 if ( isset( $matches ) ) { 77 $image = $matches[1][0]; 70 78 71 if ( $matches[1][0] ) {79 if ( $matches[1][0] && $this->remote_file_exists($image) ) { 72 80 73 81 // determine alt attribute … … 98 106 return $this->html; 99 107 } 100 else { 108 109 } else { 101 110 return NULL; 102 111 } -
fw-post-image/trunk/fw-post-image.php
r184672 r192313 2 2 * @package fw-post-image 3 3 * @author Myriam Faulkner 4 * @version 1. 14 * @version 1.2 5 5 */ 6 6 /* 7 7 Plugin Name: fw-post-image 8 Plugin URI: http://www.fairweb.fr/ plugins-wordpress/fw-post-image8 Plugin URI: http://www.fairweb.fr/en/plugins-wordpress/fw-post-image/ 9 9 Description: If no post image is defined, get first image belonging to post or first image found post content. WP 2.9 > only. 10 10 Author: Myriam Faulkner 11 Version: 1. 111 Version: 1.2 12 12 Author URI: http://www.fairweb.fr/ 13 13 */ … … 26 26 */ 27 27 require_once(WP_PLUGIN_DIR .'/fw-post-image/fw-post-image.class.php'); 28 29 28 $fw_pimg = new fw_post_image(); 30 29 add_filter( 'post_thumbnail_html', array(&$fw_pimg, 'get_post_image'),1,5 ); 31 32 30 ?> -
fw-post-image/trunk/readme.txt
r184668 r192313 4 4 Tags: post image, image, photo, thumbnail 5 5 Requires at least: 2.9 6 Tested up to: 2.9 6 Tested up to: 2.9.1 7 7 Stable tag: '/trunk' 8 8 … … 37 37 38 38 == Changelog == 39 = 1.2 = 40 * Prevent error on getimagesize (line 92) when scanning post content for an image and finding an image which does not exist. 39 41 = 1.1 = 40 42 * Changed filter name for post_thumbnail_html (previously post_image_html)
Note: See TracChangeset
for help on using the changeset viewer.