Skip to content

Instantly share code, notes, and snippets.

@bUxEE
Created November 22, 2016 23:04
Show Gist options
  • Save bUxEE/4726d99242d398e50cd64012e4eb495e to your computer and use it in GitHub Desktop.
Save bUxEE/4726d99242d398e50cd64012e4eb495e to your computer and use it in GitHub Desktop.
Add images size Wordpress
//////////////////////////////////////////////////////////////
///////// ADD CUSTOM IMAGE SIZES TO WP EDITOR
//////////////////////////////////////////////////////////////
add_image_size( 'icon100', '100', '100', false );
function my_editor_image_sizes( $sizes ) {
$sizes = array_merge( $sizes, array(
'icon100' => __( 'icon 100px' )
));
return $sizes;
}
add_filter( 'image_size_names_choose', 'my_editor_image_sizes' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment