Skip to content

Instantly share code, notes, and snippets.

@ingozoell
Created March 7, 2017 13:14
Show Gist options
  • Save ingozoell/1a4ab8bd53e72c046678950426c26079 to your computer and use it in GitHub Desktop.
Save ingozoell/1a4ab8bd53e72c046678950426c26079 to your computer and use it in GitHub Desktop.
function wpse_media_extra_column( $cols ) {
$cols["alt"] = "ALT";
return $cols;
}
function wpse_media_extra_column_value( $column_name, $id ) {
if( $column_name == 'alt' )
echo get_post_meta( $id, '_wp_attachment_image_alt', true);
}
add_filter( 'manage_media_columns', 'wpse_media_extra_column' );
add_action( 'manage_media_custom_column', 'wpse_media_extra_column_value', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment