Separate ID and display name for add_image_size
|Reported by:||GaryJ||Owned by:|
Currently, the first argument in add_image_size() is used as both the id (and key in the global array _wp_additional_image_sizes, and as the displayed name, since nothing else is available.
As such, the $name, when it is displayed, is not translatable, since some other code might be hard-coded to use a specific image size.
Instead of adding a 5th argument to the function, one solution might be to allow the first argument to be a string or array, and if it is an array, passing that as a new item in the array that is set. Theme or plugin authors could then check for the existence of this array value item, before falling back to using the key as per now.
add_image_size( 'primary-sidebar', 150, 100 );
New Optional Usage:
add_image_size( array( 'primary-sidebar' => __( 'Primary Sidebar', 'my-textdomain' ) ), 150, 100 );