Skip to content

Instantly share code, notes, and snippets.

@samholguin
Last active August 29, 2015 14:22
Show Gist options
  • Save samholguin/225eb3865f1d1a3db4dd to your computer and use it in GitHub Desktop.
Save samholguin/225eb3865f1d1a3db4dd to your computer and use it in GitHub Desktop.
WordPress - Filter [ image_size_names_choose ] - Adding Custom Images Sizes to the WordPress Media Library
/**
* Adding Custom Images Sizes to the WordPress Media Library
*
* @access public
* @param array $sizes
* @return array
*/
function shgist_add_image_sizes($sizes) {
$addsizes = array(
"new-size" => __( "New Size")
);
$newsizes = array_merge($sizes, $addsizes);
return $newsizes;
}
add_filter('image_size_names_choose', 'shgist_add_image_sizes');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment