bloqhead
12/16/2013 - 10:42 PM

Register some custom image sizes in your WordPress theme's functions.php file and then add them to the Media Manager image size dropdown.

Register some custom image sizes in your WordPress theme's functions.php file and then add them to the Media Manager image size dropdown.

<?php

/**
 * Register your custom image sizes
 */

add_image_size( 'custom-image-small', 640, 480, true );
add_image_size( 'custom-image-medium', 1024, 768, true );
add_image_size( 'custom-image-large', 1140, 900, true );

/**
 * Add your custom images to the media manager image size selector
 * You can define a human-readable name for each of your newly created
 * image sizes. Format: "registered-name" => __("Human Readable Name")
 */

function custom_image_size_names_choose( $sizes ) {
	$custom_sizes = array(
	        "custom-image-small" => __("Custom Image - Small"),
	        "custom-image-medium" => __("Custom Image - Medium"),
	        "custom-image-medium" => __("Custom Image - Large")
        );
	return array_merge( $sizes, $custom_sizes );
}
add_filter( 'image_size_names_choose', 'custom_image_size_names_choose' );

?>