您在“编辑帖子”列中看到的内容由manage_posts_columns
滤器
通过playlist_id
我想你在找post_id
(因为你提到的播放列表只是自定义的帖子类型)。您可以在主题的functions.php
文件:
if ( !function_exists(\'add_playlist_id_to_column\') && function_exists(\'add_theme_support\') ) {
// Add our own column
function add_playlist_id_to_column($cols) {
$cols[\'playlist_id\'] = __(\'PlayList ID\',\'text-domain\');
return $cols;
}
// Get the post\'s ID
function add_playlist_value($column_name, $post_id) {
// If there is a post_id set, output it. Otherwise, print NONE.
if ( $post_id ) {
echo $post_id;
} else {
echo __(\'None\',\'text-domain\');
}
}
// Hook to `manage_posts_columns` to run our function
add_filter( \'manage_posts_columns\', \'add_playlist_id_to_column\' );
add_action( \'manage_posts_custom_column\', \'add_playlist_value\', 10, 2 );
}