Created
December 11, 2014 14:27
-
-
Save nicon-dev/69b88e31cd9fac286c54 to your computer and use it in GitHub Desktop.
show image dimensions in wordpress media library #wordpress
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
//show image dimentions in media library | |
function wh_column( $cols ) { | |
$cols["dimensions"] = "Dimensions"; | |
return $cols; | |
} | |
function wh_value( $column_name, $id ) { | |
$meta = wp_get_attachment_metadata($id); | |
if(isset($meta['width'])) | |
echo ' ' . $meta['width'].' x '.$meta['height'] . 'px'; | |
} | |
add_filter( 'manage_media_columns', 'wh_column' ); | |
add_action( 'manage_media_custom_column', 'wh_value', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment