Created
February 14, 2013 14:14
-
-
Save michaeloeser/4953085 to your computer and use it in GitHub Desktop.
Add Custom Image Sizes Into WordPress Media Library
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
<?php | |
function display_custom_image_sizes( $sizes ) { | |
global $_wp_additional_image_sizes; | |
if ( empty($_wp_additional_image_sizes) ) | |
return $sizes; | |
foreach ( $_wp_additional_image_sizes as $id => $data ) { | |
if ( !isset($sizes[$id]) ) | |
$sizes[$id] = ucfirst( str_replace( '-', ' ', $id ) ); | |
} | |
return $sizes; | |
} | |
add_filter( 'image_size_names_choose', 'display_custom_image_sizes' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://www.paulund.co.uk/custom-image-sizes-media-library