Plugin Directory

Changeset 181933


Ignore:
Timestamp:
12/12/2009 07:27:35 AM (16 years ago)
Author:
fairweb
Message:

Changed filter name for post_thumbnail_html (previously post_image_html)
Changed action name for begin_fetch_post_thumbnail_html(previously begin_fetch_post_image_html)
Changed action name for end_fetch_post_thumbnail_html(previously end_fetch_post_image_html)

Location:
fw-post-image/trunk/fw-post-image
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • fw-post-image/trunk/fw-post-image/fw-post-image.class.php

    r180683 r181933  
    33 * @package fw-post-image
    44 * @author Myriam Faulkner
    5  * @version 1.0
     5 * @version 1.1
    66 */
    77class fw_post_image {
     
    2626         $this->post_image_id = $this->get_post_image_id ();
    2727         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 filters
     28           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
    2929        $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 );
    3131   
    3232    } else {
  • fw-post-image/trunk/fw-post-image/fw-post-image.php

    r180683 r181933  
    1010Description: If no post image is defined, get first image belonging to post or first image found post content. WP 2.9 > only.
    1111Author: Myriam Faulkner
    12 Version: 1.0
    13 Author URI: http://Fairweb.fr/
     12Version: 1.1
     13Author URI: http://www.fairweb.fr/
    1414*/
    1515
     
    2929
    3030    $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 );
    3232
    3333?>
  • fw-post-image/trunk/fw-post-image/readme.txt

    r180683 r181933  
    77Stable tag: '/trunk'
    88
    9 Filters the_post_image() function. If no post image is defined, get the first image belonging to post or first image found in post content.
     9Filters the_post_thumbnail() function. If no post thumbnail is defined, get the first image belonging to post or first image found in post content.
    1010
    1111== Description ==
    1212This plugin does not work with Wordpress version prior to 2.9 !
    1313Since 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 image 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.
     14It 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.
    1515
    16 The image will be displayed according to the arguments (size and attributes) set when calling `the_post_image()`.
     16The image will be displayed according to the arguments (size and attributes) set when calling `the_post_thumbnail()`.
    1717
    1818== Installation ==
     
    21212. Activate the plugin through the 'Plugins' menu in WordPress
    22223. 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'); ?>`
     234. 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'); ?>`
    2525
    2626== Frequently Asked Questions ==
     
    30301. Make sure you are running Wordpress 2.9 or above
    31313. 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'); ?>`
     324. 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'); ?>`
    3434
    3535== Screenshots ==
    36 
     361. This is an example for displaying post thumbnails on the index page of your theme.
    3737
    3838== 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)
    4043= 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.