Last active
May 4, 2016 05:13
-
-
Save sworup/e7d30b4efd671d38fb6bbbd2d578f5a1 to your computer and use it in GitHub Desktop.
Wordkpress: Add Custom Image Sizes to Media Uploader. https://pippinsplugins.com/add-custom-image-sizes-to-media-uploader/
This file contains hidden or 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
<?php | |
function pw_add_image_sizes() { | |
add_image_size( 'pw-thumb', 300, 100, true ); | |
add_image_size( 'pw-large', 600, 300, true ); | |
} | |
add_action( 'init', 'pw_add_image_sizes' ); | |
function pw_show_image_sizes($sizes) { | |
$sizes['pw-thumb'] = __( 'Custom Thumb', 'pippin' ); | |
$sizes['pw-large'] = __( 'Custom Large', 'pippin' ); | |
return $sizes; | |
} | |
add_filter('image_size_names_choose', 'pw_show_image_sizes'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment