0
我在wordpress中使用自定义帖子类型和“成员”插件。WordPress的:功能自定义帖子类型delete_post不工作
我的问题是,在我的自定义后类型我无法删除帖子,移动到垃圾链接是不是有:(
这里是我的代码:
'capabilities' => array(
'edit_post' => 'edit_entrada_tallers_activitats_grups',
'read_post' => 'read_entrada_tallers_activitats_grups',
'delete_post' => 'delete_entrada_tallers_activitats_grups',
'delete_posts' => 'delete_entradas_tallers_activitats_grups',
'delete_others_posts' => 'delete_others_entradas_tallers_activitats_grups',
'delete_published_posts' => 'delete_published_entradas_tallers_activitats_grups',
'edit_posts' => 'edit_entrada_tallers_activitats_grups',
'edit_others_posts' => 'edit_others_entrada_tallers_activitats_grups',
'publish_posts' => 'publish_entrada_tallers_activitats_grups',
'read_private_posts' => 'read_private_entrada_tallers_activitats_grups',
'create_posts' => 'edit_create_entrada_tallers_activitats_grups',
在编辑功能页面插件,它似乎和我检查的复选框:
- delete_entradas_tallers_activitats_grups(delete_posts) 个
- delete_others_entradas_tallers_activitats_grups(delete_others_posts)
- delete_published_entradas_tallers_activitats_grups(delete_published_posts)
但不是 “delete_entrada_tallers_activitats_grups”(该delete_post)也许这就是问题,但我don0t知道如何解决它? 。
更新完整代码
function my_custom_post_tallers_grup() {
$labels = array(
'name' => _x('Aquí t’escoltem', 'post type general name'),
'singular_name' => _x('Taller i activitat per a grups', 'post type singular name'),
'add_new' => _x('Afegeix', 'oferta'),
'add_new_item' => __('Afegeix nova entrada'),
'edit_item' => __('Editar'),
'new_item' => __('Nova entrada'),
'all_items' => __('Totes les entrades'),
'view_item' => __('Veure entrada'),
'search_items' => __('Cercar entrades'),
'not_found' => __('No s\'ha trobat.'),
'not_found_in_trash' => __('No s\'ha trobat a la paperera'),
'parent_item_colon' => '',
'menu_name' => 'Aquí t’escoltem'
);
$args = array(
'labels' => $labels,
'description' => 'Entrades d\'aqui t'escoltem',
'publicly_queryable' => true,
'exclude_from_search' => false,
'show_ui' => true,
'public' => true,
'query_var' => true,
'menu_position' => 3,
'rewrite' => array('slug' => 'tallers-i-activitats-per-a-grups', 'with_front' => false),
'supports' => array('title', 'editor', 'sticky', 'thumbnail'),
'has_archive' => true,
'capability_type' => 'post',
'hierarchical' => false,
'capabilities' => array(
'edit_post' => 'edit_entrada_tallers_activitats_grups',
'read_post' => 'read_entrada_tallers_activitats_grups',
'delete_post' => 'delete_entrada_tallers_activitats_grups',
'delete_posts' => 'delete_entradas_tallers_activitats_grups',
'delete_others_posts' => 'delete_others_entradas_tallers_activitats_grups',
'delete_published_posts' => 'delete_published_entradas_tallers_activitats_grups',
'edit_posts' => 'edit_entrada_tallers_activitats_grups',
'edit_others_posts' => 'edit_others_entrada_tallers_activitats_grups',
'publish_posts' => 'publish_entrada_tallers_activitats_grups',
'read_private_posts' => 'read_private_entrada_tallers_activitats_grups',
'create_posts' => 'edit_create_entrada_tallers_activitats_grups',
)
);
register_post_type('tallers_grup', $args);
register_taxonomy_for_object_type('category', 'tallers_grup');
}
add_action('init', 'my_custom_post_tallers_grup');
什么是你的自定义后类型塞在你的翻译呢? – Firefog
发布您的完整代码我将解决它 – Firefog
我更新代码;)谢谢! – curosio