Add custom image sizes to media insert dialog box with image_size_names_choose

Go to source ( Example: screenshot )

snippet :  PHPcopy
if ( function_exists( 'add_image_size' ) ) {
    add_image_size( 'new-size', 300, 100, true ); //(cropped)
}
add_filter('image_size_names_choose', 'my_image_sizes');
function my_image_sizes($sizes) {
        $addsizes = array(
                "new-size" => __( "New Size")
                );
        $newsizes = array_merge($sizes, $addsizes);
        return $newsizes;
}

source →

Add custom image sizes to media insert dialog box with image_size_names_choose is a post from: wpsnipp.comWordPress Snippets, Code, Hacks, 590+ for your theme, blog
which is not allowed to be copied on other sites.”

Share this post.


<a
href="http://www.facebook.com/sharer.php?u=Add custom image sizes to media insert dialog box with image_size_names_choose“>Facebook | <a
href="http://www.stumbleupon.com/submit?url=Add custom image sizes to media insert dialog box with image_size_names_choose“>StumbleUpon | <a
href="http://delicious.com/post?url=Add custom image sizes to media insert dialog box with image_size_names_choose“>Delicious | <a
href="http://twitter.com/home?status=Reading: Add custom image sizes to media insert dialog box with image_size_names_choose @wpsnipp”>Tweet It | <a
href="http://digg.com/submit?url=Add custom image sizes to media insert dialog box with image_size_names_choose“>Digg This

© wpsnipp.com All Rights reserved.

source: wpsnipp.com