WordPress.org

Plugin Directory

Changeset 1656428


Ignore:
Timestamp:
05/13/17 10:08:11 (5 months ago)
Author:
ThemeZee
Message:

improved theme integration for custom image sizes

Location:
themezee-widget-bundle
Files:
30 added
2 edited

Legend:

Unmodified
Added
Removed
  • themezee-widget-bundle/trunk/readme.txt

    r1592534 r1656428  
    4444== Changelog == 
    4545 
     46= 1.0.7 = 
     47 
     48* improved theme integration for custom image sizes 
     49 
    4650= 1.0.6 = 
    4751 
  • themezee-widget-bundle/trunk/themezee-widget-bundle.php

    r1592534 r1656428  
    77 * Author: ThemeZee 
    88 * Author URI: https://themezee.com/ 
    9  * Version: 1.0.6 
     9 * Version: 1.0.7 
    1010 * Text Domain: themezee-widget-bundle 
    1111 * Domain Path: /languages/ 
     
    6363 
    6464        // Define Version Number. 
    65         define( 'TZWB_VERSION', '1.0.5' ); 
     65        define( 'TZWB_VERSION', '1.0.7' ); 
    6666 
    6767        // Plugin Folder Path. 
     
    221221    static function add_image_size() { 
    222222 
    223         // Return early if theme handles image sizes. 
     223        // Check if theme defines custom image size. 
    224224        if ( current_theme_supports( 'themezee-widget-bundle' ) ) : 
    225             return; 
    226         endif; 
    227  
    228         add_image_size( 'tzwb-thumbnail', 80, 80, true ); 
     225 
     226            $theme_support = get_theme_support( 'themezee-widget-bundle' ); 
     227 
     228            // Set custom image size. 
     229            if ( isset( $theme_support[0]['thumbnail_size'] ) && is_array( $theme_support[0]['thumbnail_size'] ) ) : 
     230 
     231                $thumbnail_size = $theme_support[0]['thumbnail_size']; 
     232                add_image_size( 'tzwb-thumbnail', $thumbnail_size[0], $thumbnail_size[1], true ); 
     233 
     234            endif; 
     235 
     236        else : 
     237 
     238            // Set default image size. 
     239            add_image_size( 'tzwb-thumbnail', 80, 80, true ); 
     240 
     241        endif; 
    229242    } 
    230243 
Note: See TracChangeset for help on using the changeset viewer.