WordPress.org

Plugin Directory

Changeset 479994


Ignore:
Timestamp:
12/23/11 20:33:30 (2 years ago)
Author:
csixty4
Message:

Fixed handling of post thumbnails

File:
1 edited

Legend:

Unmodified
Added
Removed
  • daves-wordpress-live-search/trunk/DavesWordPressLiveSearchResults.php

    r469928 r479994  
    9090      $result->permalink = get_permalink($result->ID); 
    9191 
    92       if (function_exists('get_post_image_id')) { 
     92      if (function_exists('get_post_thumbnail_id')) { 
    9393        // Support for WP 2.9 post thumbnails 
    94         $postImageID = get_post_image_id($result->ID); 
     94        $postImageID = get_post_thumbnail_id($result->ID); 
    9595        $postImageData = wp_get_attachment_image_src($postImageID, apply_filters('post_image_size', 'thumbnail')); 
     96        $hasThumbnailSet = ($postImageData !== false); 
     97      } 
     98      else { 
     99        // No support for post thumbnails 
     100        $hasThumbnailSet = false; 
     101      } 
     102 
     103      if($hasThumbnailSet) { 
    96104        $result->attachment_thumbnail = $postImageData[0]; 
    97105      } else { 
Note: See TracChangeset for help on using the changeset viewer.