Last active
December 17, 2015 03:58
-
-
Save tiborp/5546722 to your computer and use it in GitHub Desktop.
Add custom image sizes to WordPress Media Uploader choices
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 | |
/** Add Custom images sizes to Media Uploader */ | |
add_filter( 'image_size_names_choose', 'your_image_size_names_choose' ); | |
function your_image_size_names_choose( $sizes ) { | |
$sizes = get_intermediate_image_sizes(); | |
$add_sizes = array(); | |
foreach ( $sizes as $size ) | |
$add_sizes[$size] = $size; | |
return array_merge( $add_sizes, $sizes ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment