2017-10-16 6 views
0

を私は次のように私がやっている一つのサイトで定義されたカスタムポストタイプしている結果:ワードプレスの管理パネルの検索

$labels = array(
    'name' => 'Clients', 
    'singular_name' => 'Client', 
    'add_new' => 'Add New', 
    'all_items' => 'All Items', 
    'add_new_item' => 'Add New', 
    'edit_item' => 'Edit Item', 
    'new_item' => 'Add New', 
    'view_item' => 'View Item', 
    'search_item' => 'Search Item', 
    'not_found' => 'Item Not Found', 
    'not_found_in_trash' => 'Item Not Found', 
    'parent_item_color' => 'Parent Item' 
); 

$args = array(
    'labels' => $labels, 
    'public' => true, 
    'show_ui' => true, 
    'has_archive' => true, 
    'publicly_queryable' => true, 
    'query_var' => true, 
    'rewrite' => true, 
    'capability_type' => 'post', 
    'hierarchical' => false, 
    'supports' => array('title', 'editor', 'thumbnail', 'revisions'), 
    'taxonomies' => array('category', 'post_tag'), 
    'menu_position' => 20, 
    'exclude_from_search' => false, 
    'menu_icon' => 'dashicons-admin-users' 
); 

register_post_type('clients', $args); 

を私の問題は、私は管理者のクライアントのセクションで私の記事を検索しようとするということですパネル(検索フォームではなく、WordPress管理パネル)に表示される結果は、クライアントのカスタム投稿タイプではなく、通常の投稿からのものです。明らかに私はクライアントのための結果が必要です。私はここに何か議論がないのですか?または、これはフィルターで行うべきことですか?私はここで少し失われている、私はそれを受け入れる必要があります。追加

答えて

0

試し:カスタムポストタイプの$args配列に
'rewrite' => array('slug' => 'your-slug-name')),

0

OK、私は自分の質問に答えるつもりです。実際、投稿タイプには何も問題はありませんでした。ここの有罪な人は私が持っていなかったpre_get_postsでした!is_admin()そして管理パネルに機能を伝えていました。それを探している悪い時...ありがとうとにかく