Created
March 7, 2017 13:14
-
-
Save ingozoell/1a4ab8bd53e72c046678950426c26079 to your computer and use it in GitHub Desktop.
Adding Alt Tag Column to Media Library List
http://wordpress.stackexchange.com/questions/137082/adding-alt-tag-column-to-media-library-list
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
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