WordPress.org

Ready to get started?Download WordPress

Forums

Category Grid View Gallery
Filter option for image source to avoid Timbthumb (3 posts)

  1. bobbydonovan
    Member
    Posted 1 year ago #

    Hello,

    I was hoping you might consider adding a filter to the image source so that your plugin may be extended to avoid timthumb if necessary. Our host does not allow timbthumb, so each time the plugin is updated I'm forced to re-customise it each time to suit our setup.

    I'm referring to includes/CatGridView.php:94. Something like the following would be great.

    $cgv_img_src = apply_filters('cgv_img_src', $cg_url.'/includes/timthumb.php?src='.urlencode($cg_img).'&h='.$size[1].'&w='.$size[0].'&zc=1&q='.$this->params['quality'], $single->ID);
    return '<a href='.$returnlink.'><img src="'.$cgv_img_src.'" alt="'.$single->post_title.'" title="'.$single->post_title.'"/></a>';

    Which allows me to do this in my functions file.

    add_filter('cgv_img_src', 'cat_grid_custom_thumbnail', 10, 2);
    function cat_grid_custom_thumbnail($img_src, $post_id) {
        $custom_img_src = wp_get_attachment_image_src(get_post_thumbnail_id( $post_id ), 'custom_image_size' );
        return $custom_img_src[0];
    }

    http://wordpress.org/extend/plugins/category-grid-view-gallery/

  2. emswebs
    Member
    Posted 1 year ago #

    Hi there - will this modification work so that it will use the core wordpress recropped thumbnails? That's what I need to make the site do...

    Is it a simple / cut and paste with your code above?

  3. ryanbuckley
    Member
    Posted 2 months ago #

    I think this is a great request. I second it. Timbthumb is obsolete now that WP has its own thumbnail feature.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.