我用php创建了一个自定义的帖子类型,我的问题是这个帖子类型没有出现在Toolset Types插件的菜单中。我想这一定是我必须要做的选择,但我几乎每件事都试过了,我不知道为什么会这样。
我想编辑帖子类型之间的关系,特别是汽车和新闻之间的关系。
我创建自定义帖子类型的代码如下。
function car_post_type() {
$labels = array(
\'name\' => \'Coches\',
\'singular_name\' => \'Coche\',
\'menu_name\' => \'Coches\',
\'name_admin_bar\' => \'Coches\',
\'parent_item_colon\' => \'Padre:\',
\'all_items\' => \'Todos los coches\',
\'add_new_item\' => \'Añadir nuevo coche\',
\'add_new\' => \'Añadir coche\',
\'new_item\' => \'Nuevo coche\',
\'edit_item\' => \'Editar coche\',
\'update_item\' => \'Actualizar coche\',
\'view_item\' => \'Ver coche\',
\'search_items\' => \'Buscar coches\',
\'not_found\' => \'No hay resultados\',
\'not_found_in_trash\' => \'No se han encontrado coches en la papelera\',
);
$rewrite = array(
\'slug\' => \'coche\',
\'with_front\' => true,
\'pages\' => true,
\'feeds\' => true,
);
$args = array(
\'label\' => __( \'Car\', \'clever\' ),
\'description\' => __( \'Cars\', \'clever\' ),
\'labels\' => $labels,
\'supports\' => array(
\'title\', \'editor\', \'excerpt\', \'thumbnail\', \'revisions\',
),
\'taxonomies\' => array(),
\'hierarchical\' => false,
\'public\' => true,
\'show_ui\' => true,
\'show_in_menu\' => true,
\'menu_position\' => 5,
\'menu_icon\' => \'dashicons-dashboard\',
\'show_in_admin_bar\' => true,
\'show_in_nav_menus\' => true,
\'can_export\' => true,
\'has_archive\' => true,
\'exclude_from_search\' => false,
\'publicly_queryable\' => true,
\'rewrite\' => $rewrite,
\'capability_type\' => \'post\',
);
register_post_type(\'car\', $args);
}
add_action(\'init\', \'car_post_type\', 0);
谢谢你的帮助。