こちらに掲載されていた内容がいつかどこかで使えそうなのでメモしておきます。
Merge two custom post types into one admin page?
「投稿のpost」「固定ページのpage」「カスタム投稿のowners」を追加したい場合は以下の記述をfunctions.phpに追加します。
function join_cpt_list_wspe_113808( $query )
{
// If not backend, bail out
if( !is_admin() )
return $query;
// Detect current page and list of CPTs to be shown in Dashboard > Posts > Edit screen
global $pagenow;
$cpts = array( 'post', 'page', 'owners' );
if( 'edit.php' == $pagenow && ( get_query_var('post_type') && 'post' == get_query_var('post_type') ) )
$query->set( 'post_type', $cpts );
return $query;
}
add_filter( 'manage_edit-post_columns', 'add_cpt_column_wspe_113808' );
foreach( array( 'post', 'page', 'owners' ) as $cpt )
add_action( "manage_{$cpt}_posts_custom_column", 'show_cpt_column_wspe_113808', 10, 2 );
function add_cpt_column_wspe_113808( $columns )
{
$columns[ 'cpt' ] = '投稿タイプ';
return $columns;
}
function show_cpt_column_wspe_113808( $column_name, $post_id )
{
if ( 'cpt' != $column_name )
return;
echo get_post_type( $post_id );
}
その後
/wp-admin/edit.php
にアクセスすると3つの投稿タイプの投稿が一覧になって表示されています。
「投稿タイプ」という欄にその投稿がどのタイプの投稿かが表示されています。
ちなみに表示数の制限はできないようです。。


