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' ),   ) ); } 

enter image description here

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

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -