Skip to content

Instantly share code, notes, and snippets.

@yoren
Created May 16, 2013 13:30
Show Gist options
  • Save yoren/5591733 to your computer and use it in GitHub Desktop.
Save yoren/5591733 to your computer and use it in GitHub Desktop.
WordPress: Custom Media Size Dropdown
// Set the new image sizes
if(function_exists( 'add_image_size')){
add_image_size('blog-large', 900, 700, false);
}
// Tell the media panel to add the new size to the dropbown
function custom_image_sizes($sizes) {
$addsizes = array(
"blog-large" => __("X-Large")
);
$newsizes = array_merge($sizes, $addsizes);
return $newsizes;
}
add_filter('image_size_names_choose', 'custom_image_sizes');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment