Created
March 27, 2013 05:20
-
-
Save hissy/5251873 to your computer and use it in GitHub Desktop.
#WordPress add_image_sizeで追加した画像サイズを投稿画面で選べるようにする
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 additional_image_size_names_choose($sizes){ | |
global $_wp_additional_image_sizes; | |
if ( $_wp_additional_image_sizes ) { | |
foreach ( $_wp_additional_image_sizes as $key => $value ) { | |
if ( !$sizes[$key] ) | |
$sizes[$key] = $key; | |
} | |
} | |
return $sizes; | |
} | |
add_filter('image_size_names_choose','additional_image_size_names_choose'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment