wordpress - Adding custom sizes to Media Uploader to select it when inserting new image -
i building custom theme , trying customize sizes list of media library,but did not work me, i`m using code in codex
add_image_size( 'custom-size', 220, 180, true ); add_filter( 'image_size_names_choose', 'my_custom_sizes' ); function my_custom_sizes( $sizes ) { return array_merge( $sizes, array( 'custom-size' => __( 'your custom size name' ), ) ); }
note: i`m using wordpress 4.1 :)
the image size name doesn't match in array_merge function
'your-custom-size' => __( 'your custom size name' ),
should be
'custom-size' => __( 'your custom size name' ),
Comments
Post a Comment