WordPress.org

Plugin Directory

Changeset 634494


Ignore:
Timestamp:
12/05/12 18:54:06 (17 months ago)
Author:
mitchoyoshitaka
Message:

change generate_thumbnails to use a const instead of an option

Location:
yet-another-related-posts-plugin/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • yet-another-related-posts-plugin/trunk/class-core.php

    r634487 r634494  
    123123            'auto_display_post_types' => array( 'post' ), // new in 4, replacing auto_display 
    124124            'pools' => array( 'message' => mt_rand(0,5) ), // new in 4 
    125             'generate_thumbnails' => false, // new in 4.0.1 
    126125        ); 
    127126    } 
     
    292291 
    293292        return $this->cache->cache_status() > 0.1 && $avg > 2; 
     293    } 
     294     
     295    function diagnostic_generate_thumbnails() { 
     296        return defined('YARPP_GENERATE_THUMBNAILS') && YARPP_GENERATE_THUMBNAILS; 
    294297    } 
    295298     
     
    633636            'rss_after_title', 'rss_before_post', 'rss_after_post', 'rss_after_related', 
    634637            'rss_no_results', 'rss_order', 'exclude', 'thumbnails_heading', 
    635             'thumbnails_default', 'rss_thumbnails_heading', 'rss_thumbnails_default', 'display_code', 
    636             'generate_thumbnails' 
     638            'thumbnails_default', 'rss_thumbnails_heading', 'rss_thumbnails_default', 'display_code' 
    637639        ); 
    638640 
     
    652654                'hidden_metaboxes' => $this->diagnostic_hidden_metaboxes(), 
    653655                'post_thumbnails' => $this->diagnostic_post_thumbnails(), 
    654                 'happy' => $this->diagnostic_happy() 
     656                'happy' => $this->diagnostic_happy(), 
     657                'generate_thumbnails' => $this->diagnostic_generate_thumbnails() 
    655658            ), 
    656659            'stats' => array( 
  • yet-another-related-posts-plugin/trunk/template-thumbnails.php

    r634233 r634494  
    4141 
    4242        if ( has_post_thumbnail() ) { 
    43             if ( $this->get_option( 'generate_thumbnails' ) ) 
     43            if ( $this->diagnostic_generate_thumbnails() ) 
    4444                $this->ensure_resized_post_thumbnail( get_the_ID(), $size, $dimensions ); 
    4545            $output .= get_the_post_thumbnail( null, $size ); 
Note: See TracChangeset for help on using the changeset viewer.