Tagged: default pages
- This topic has 3 replies, 2 voices, and was last updated 7 years, 11 months ago by
Steve.
-
AuthorPosts
-
-
February 26, 2014 at 12:25 pm #1466
iwillhappy1314MemberI created two custom post types with piklist, then the post in default pages gone, here is my code:
add_filter(‘piklist_post_types’, ‘product_post_type’);
function product_post_type($post_types)
{$labels_pro = array(
‘name’ => ‘产品’,
‘singular_name’ => ‘产品’,
‘add_new’ => ‘添加产品’,
‘add_new_item’ => ‘添加新产品’,
‘edit_item’ => ‘编辑产品’,
‘new_item’ => ‘新产品’,
‘all_items’ => ‘所有产品’,
‘view_item’ => ‘查看产品’,
‘search_items’ => ‘搜索产品’,
‘not_found’ => ‘没有找到产品’,
‘not_found_in_trash’ => ‘没有在回收站中找到产品’,
‘parent_item_colon’ => ”,
‘menu_name’ => ‘产品’,
);$labels_order = array(
‘name’ => ‘订单’,
‘singular_name’ => ‘订单’,
‘add_new’ => ‘添加订单’,
‘add_new_item’ => ‘添加新订单’,
‘edit_item’ => ‘编辑订单’,
‘new_item’ => ‘新订单’,
‘all_items’ => ‘所有订单’,
‘view_item’ => ‘查看订单’,
‘search_items’ => ‘搜索订单’,
‘not_found’ => ‘没有找到订单’,
‘not_found_in_trash’ => ‘没有在回收站中找到订单’,
‘parent_item_colon’ => ”,
‘menu_name’ => ‘订单’,
);$post_types[‘product’] = array(
‘labels’ => $labels_pro
,’public’ => true
,’has_archive’ => true
,’show_ui’ => true
,’rewrite’ => array(
‘slug’ => ‘product’
,’with_front’ => true
)
,’supports’ => array(
‘title’
,’author’
,’revisions’
,’commentstatus’
)
,’hide_meta_box’ => array(
‘slug’
,’author’
)
,’edit_columns’ => array(
‘title’ => __(‘名称’)
,’author’ => __(‘作者’)
)
);$post_types[‘order’] = array(
‘labels’ => $labels_order
, ‘public’ => false
, ‘has_archive’ => false
, ‘show_ui’ => true
, ‘rewrite’ => array(
‘slug’ => ‘order’
, ‘with_front’ => false
)
, ‘supports’ => array(
‘title’
, ‘author’
, ‘revisions’
)
, ‘hide_meta_box’ => array(
‘slug’
, ‘author’
)
, ‘edit_columns’ => array(
‘title’ => __(‘姓名’)
)
);return $post_types;
}is there any error? or this is a bug for now?
-
February 26, 2014 at 12:45 pm #1468
SteveKeymaster@iwillhappy1314– I just updated our doc to reflect registering multiple post types. Let me know if it solves your issue.
-
February 28, 2014 at 1:21 pm #1481
iwillhappy1314MemberI think the issue is caused by the slug name ,I change “order” to “ord”, the problem resolved.
-
February 28, 2014 at 4:50 pm #1484
SteveKeymasterWe found this as well in some of our projects. WordPress doesn’t like
'slug' => 'order'. I added to the docs for future reference >
-
-
AuthorPosts
- You must be logged in to reply to this topic.