Changeset 181933
- Timestamp:
- 12/12/2009 07:27:35 AM (16 years ago)
- Location:
- fw-post-image/trunk/fw-post-image
- Files:
-
- 3 edited
-
fw-post-image.class.php (modified) (2 diffs)
-
fw-post-image.php (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
fw-post-image/trunk/fw-post-image/fw-post-image.class.php
r180683 r181933 3 3 * @package fw-post-image 4 4 * @author Myriam Faulkner 5 * @version 1. 05 * @version 1.1 6 6 */ 7 7 class fw_post_image { … … 26 26 $this->post_image_id = $this->get_post_image_id (); 27 27 if ($this->post_image_id) { 28 do_action( 'begin_fetch_post_ image_html', $this->post_id, $this->post_image_id, $this->size ); // for "Just In Time" filtering of all of wp_get_attachment_image()'s filters28 do_action( 'begin_fetch_post_thumbnail_html', $this->post_id, $this->post_image_id, $this->size ); // for "Just In Time" filtering of all of wp_get_attachment_image()'s filters 29 29 $this->html = wp_get_attachment_image( $this->post_image_id, $this->size, false, $this->attr ); 30 do_action( 'end_fetch_post_ image_html', $this->post_id, $this->post_image_id, $this->size );30 do_action( 'end_fetch_post_thumbnail_html', $this->post_id, $this->post_image_id, $this->size ); 31 31 32 32 } else { -
fw-post-image/trunk/fw-post-image/fw-post-image.php
r180683 r181933 10 10 Description: If no post image is defined, get first image belonging to post or first image found post content. WP 2.9 > only. 11 11 Author: Myriam Faulkner 12 Version: 1. 013 Author URI: http:// Fairweb.fr/12 Version: 1.1 13 Author URI: http://www.fairweb.fr/ 14 14 */ 15 15 … … 29 29 30 30 $fw_pimg = new fw_post_image(); 31 add_filter( 'post_ image_html', array(&$fw_pimg, 'get_post_image'),1,5 );31 add_filter( 'post_thumbnail_html', array(&$fw_pimg, 'get_post_image'),1,5 ); 32 32 33 33 ?> -
fw-post-image/trunk/fw-post-image/readme.txt
r180683 r181933 7 7 Stable tag: '/trunk' 8 8 9 Filters the_post_ image() function. If no post imageis defined, get the first image belonging to post or first image found in post content.9 Filters the_post_thumbnail() function. If no post thumbnail is defined, get the first image belonging to post or first image found in post content. 10 10 11 11 == Description == 12 12 This plugin does not work with Wordpress version prior to 2.9 ! 13 13 Since Wordpress 2.9, you can choose which image will represent a post and will be displayed as thumbnail. This plugin allows backward compatibility for your former posts. 14 It filters on `the_post_ image()` function. If no post imageis defined, the plugin will get the first image belonging to post. If it still doesn't find any image, it will scan for the first image found post content.14 It filters on `the_post_thumbnail()` function. If no post thumbnail is defined, the plugin will get the first image belonging to post. If it still doesn't find any image, it will scan for the first image found post content. 15 15 16 The image will be displayed according to the arguments (size and attributes) set when calling `the_post_ image()`.16 The image will be displayed according to the arguments (size and attributes) set when calling `the_post_thumbnail()`. 17 17 18 18 == Installation == … … 21 21 2. Activate the plugin through the 'Plugins' menu in WordPress 22 22 3. Make sure your template supports post image by adding `add_theme_support('post-thumbnails');` in the functions.php file of your theme. 23 4. Put the template tag `the_post_ image($size, $attr)` in the loop in your template where you want the post image to appear. For example :24 `<?php the_post_ image('thumbnail', 'class=alignleft'); ?>`23 4. Put the template tag `the_post_thumbnail($size, $attr)` in the loop in your template where you want the post image to appear. For example : 24 `<?php the_post_thumbnail('thumbnail', 'class=alignleft'); ?>` 25 25 26 26 == Frequently Asked Questions == … … 30 30 1. Make sure you are running Wordpress 2.9 or above 31 31 3. Make sure your template supports post image by adding `add_theme_support('post-thumbnails');` in the functions.php file of your theme. 32 4. Put the template tag `the_post_ image($size, $attr)` in the loop in your template where you want the post image to appear. For example :33 `<?php the_post_ image('thumbnail', 'class=alignleft'); ?>`32 4. Put the template tag `the_post_thumbnail($size, $attr)` in the loop in your template where you want the post image to appear. For example : 33 `<?php the_post_thumbnail('thumbnail', 'class=alignleft'); ?>` 34 34 35 35 == Screenshots == 36 36 1. This is an example for displaying post thumbnails on the index page of your theme. 37 37 38 38 == Changelog == 39 39 = 1.1 = 40 * Changed filter name for post_thumbnail_html (previously post_image_html) 41 * Changed action name for begin_fetch_post_thumbnail_html(previously begin_fetch_post_image_html) 42 * Changed action name for end_fetch_post_thumbnail_html(previously end_fetch_post_image_html) 40 43 = 1.0 = 41 * First plugin release 44 * First plugin release (the 1.0 release should not work anymore)
Note: See TracChangeset
for help on using the changeset viewer.