/** * 投稿一覧に商品コード列追加 */ function manage_posts_columns($columns) { $columns['event_type'] = "イベント"; $columns['event_title'] = "タイトル"; return $columns; } function add_column($column_name, $post_id) { if( $column_name == 'event_type' ) { $stitle = get_post_meta($post_id, 'event_type', true); } if( $column_name == 'event_title' ) { $stitle = get_post_meta($post_id, 'event_title', true); } if ( isset($stitle) && $stitle ) { echo attribute_escape($stitle); } else { echo __('None'); } } add_filter( 'manage_posts_columns', 'manage_posts_columns' ); add_action( 'manage_posts_custom_column', 'add_column', 10, 2 ); function sort_column($columns){ $columns = array( 'cb' => '<input type="checkbox" />', 'title' => '開催日', 'event_title' => 'タイトル', 'event_type' => 'イベント', 'date' => '日時', 'categories' => 'カテゴリー', 'datepicker' => '開催日' ); return $columns; } add_filter( 'manage_posts_columns', 'sort_column');