• the metabox defaults to the value that was set through set_post_thumbnail_size, it’d be great if you could pass in the constructor either size or name and use that size where the new interface exists, i.e.:

    set_post_thumbnail_size( 298, 167, true ); //the default size used in the thumbnail interface
    
    add_image_size( 'athlete_thumb', 138, 174, true ); //the size i want in the new interface
    
    new MultiPostThumbnails( array(
        	'label' => 'Athlete Thumbnail Image',
        	'id' => 'id_athlete_thumb',
        	'post_type' => 'athlete',
            'size' => 'athlete_thumb' //new addition
        ));

    besides its great! thanks for the effort!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Amit

    (@obvio)

    I managed it in a workaround for now:

    class changes:

    starting at line 54

    public function register($args = array()) {
    			$defaults = array(
    				'label' => null,
    				'id' => null,
    				'post_type' => 'post',
    				'priority' => 'low',
    				'new_width' => null,        //<=ADDED THAT
    				'new_height' => null        //<=ADDED THAT
    			);
    
    			$args = wp_parse_args($args, $defaults);

    then at line 241 (last array arguments changed)

    $thumbnail_html = wp_get_attachment_image($thumbnail_id, array($this->new_width, $this->new_height));

    and the just instantiate it like that:

    new MultiPostThumbnails( array(
        	'label' => 'Athlete Thumbnail Image',
        	'id' => 'id_athlete_thumb',
        	'post_type' => 'my_type',
    		'new_width' => 138,      //<=ADDED THAT
    		'new_height' => 174      //<=ADDED THAT
        ));

    Thanks for posting this mod/fix!

    Was a bit annoyed that a 300×300 image was in place of my 150×150 thumbnails.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Multiple Post Thumbnails] show the correct size on post editing area’ is closed to new replies.