Code
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
<?php | |
add_filter('manage_media_columns', 'posts_columns_attachment_id', 1); | |
add_action('manage_media_custom_column', 'posts_custom_columns_attachment_id', 1, 2); | |
function posts_columns_attachment_id($defaults){ | |
$defaults['wps_post_attachments_id'] = __('ID'); | |
return $defaults; | |
} | |
function posts_custom_columns_attachment_id($column_name, $id){ | |
if($column_name === 'wps_post_attachments_id'){ | |
echo $id; | |
} | |
} | |
?> |
Screen shot
Note
Description | 管理画面のメディアライブラリのテーブルに紐付けされてる記事のIDを表示させる列を追加する。 |
---|---|
WordPress Ver. | 3.3.1 |
Via | Media library admin columns with attachment id |