Created
October 26, 2013 01:39
-
-
Save FriendlyWP/7164317 to your computer and use it in GitHub Desktop.
Display custom image sizes in Media uploader; insert custom image sizes into posts and pages
This file contains hidden or 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
// Allows users to insert your custom image sizes via the Add Media button | |
// In this example, two custom image sizes are added to the defaults | |
add_filter( 'image_size_names_choose', 'my_custom_sizes' ); | |
function my_custom_sizes( $sizes ) { | |
return array_merge( $sizes, array( | |
'thumb-narrow' => __('Narrow Thumbnail'), | |
'thumb-wide' => __('Wide Thumbnail'), | |
) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment