web-dev-qa-db-ja.com

カスタム投稿タイプに親ドロップダウンが表示されない

私は親投稿に関連付けることができるカスタム投稿タイプを作成しようとしています(それらはページではなく投稿です)。 Wordpressはバージョン3.0.1です。 Page-Attributesの下にある親の投稿のドロップダウンリストに投稿のリストを表示したいと思っていましたが、そのすべてに 'Order'フィールドがあります。私は重要な何かを逃しましたか?

register_post_type( 'mytest_post_type',
    array(
        'labels' => array(
                'name' => __( 'mytest Interviews' ),
                'singular_name' => __( 'mytest Interview' ),
                'add_new' => __( 'Add New' ),
                'add_new_item' => __( 'Add New mytest Interview' ),
                'edit' => __( 'Edit' ),
                'edit_item' => __( 'Edit mytest Interview' ),
                'new_item' => __( 'New mytest Int.' ),
                'view' => __( 'View mytest Inteview' ),
                'view_item' => __( 'View mytest Int.' ),
                'search_items' => __( 'Search mytest Interviews' ),
                'not_found' => __( 'No mytest Interviews found' ),
                'not_found_in_trash' => __( 'No mytest Interviews found in Trash' ),
                'parent' => __( 'Parent mytest Interview' ),

        ),
        'public' => true,
        'show_ui' => true,
        'hierarchical' => true,
        'query_var' => true,
        'supports' => array('title', 'editor', 'author','custom-fields','page-attributes'),

    )
);

それとも、新しいカスタム投稿タイプを作成して、それらの新しい投稿を既存の投稿の子にすることはできませんか。

ありがとうございます。

2
codecowboy

これは私のために働きます。 コードを見ると 、ドロップダウンは投稿タイプが階層型(あなたの場合はそうです)で、そして他の投稿がある場合にのみ現れますデータベース内の同じタイプのそのため、投稿は別の投稿タイプ(通常の投稿やページなど)の子にはなれず、タイプの最初の新しい投稿にドロップダウンメニューは表示されません。

5
Jan Fabry