Created
May 16, 2013 13:30
-
-
Save yoren/5591733 to your computer and use it in GitHub Desktop.
WordPress: Custom Media Size Dropdown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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