Last active
August 29, 2015 14:22
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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