Support » Plugin: Category Grid View Gallery » Filter option for image source to avoid Timbthumb

  • 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];

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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?

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Filter option for image source to avoid Timbthumb’ is closed to new replies.