Image sizes (wordpress)

Add custom image sizes and names.

<?php
/**
 * Add custom image sizes and names.
 */
add_image_size('small', 400, 0, false); // name, width, height, crop

add_filter('image_size_names_choose', function($sizes) {
    $sizes = array_merge($sizes, array(
        'small' => 'Small'
    ));
    return $sizes;
});
?>

functions.php

< toolbox