Wordpress自定义分类未定义错误?
每次在自定义帖子类型中创建新类别时,都会出现一个奇怪的错误: 当我尝试删除类别时,我还收到一个错误:发生了一个未定义的错误 我在调试模式下尝试了wp,但没有添加任何额外的内容 希望有人能帮忙:) 以下是我的分类代码:Wordpress自定义分类未定义错误?,wordpress,custom-taxonomy,Wordpress,Custom Taxonomy,每次在自定义帖子类型中创建新类别时,都会出现一个奇怪的错误: 当我尝试删除类别时,我还收到一个错误:发生了一个未定义的错误 我在调试模式下尝试了wp,但没有添加任何额外的内容 希望有人能帮忙:) 以下是我的分类代码: function store_categories() { $labels = array( 'name' => _x( 'Store Categories', 'taxonomy general name' ), 'singul
function store_categories() {
$labels = array(
'name' => _x( 'Store Categories', 'taxonomy general name' ),
'singular_name' => _x( 'Store Category', 'taxonomy singular name' ),
'search_items' => __( 'Search Store Categories' ),
'all_items' => __( 'All Store Categories' ),
'parent_item' => __( 'Parent Store Category' ),
'parent_item_colon' => __( 'Parent Store Category:' ),
'edit_item' => __( 'Edit Store Category' ),
'update_item' => __( 'Update Store Category' ),
'add_new_item' => __( 'Add New Store Category' ),
'new_item_name' => __( 'New Store Category' ),
'menu_name' => __( 'Store Categories' ),
);
$args = array(
'labels' => $labels,
'hierarchical' => true,
'query_var' => true,
'rewrite' => true,
'public' => true,
'show_ui' => true,
);
register_taxonomy( 'store-category', 'stores', $args );
}
add_action( 'init', 'store_categories', 0 );
以及自定义邮政类型代码:
function custom_store_post_type() {
$labels = array(
'name' => _x( 'Custom Stores', 'post type general name' ),
'singular_name' => _x( 'Custom Store', 'post type singular name' ),
'add_new' => _x( 'Add New', 'Custom Store' ),
'add_new_item' => __( 'Add New Custom Store' ),
'edit_item' => __( 'Edit Custom Store' ),
'new_item' => __( 'New Custom Store' ),
'all_items' => __( 'All Custom Stores' ),
'view_item' => __( 'View Success Story' ),
'search_items' => __( 'Search Custom Stores' ),
'not_found' => __( 'No Custom Stores found' ),
'not_found_in_trash' => __( 'No Custom Stores found in the Trash' ),
'parent_item_colon' => '',
'menu_name' => 'Custom Stores'
);
$args = array(
'labels' => $labels,
'description' => 'Holds our Custom Stores and Custom Store specific data',
'public' => true,
'menu_position' => 20,
'supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes', 'excerpt' ),
'has_archive' => true,
);
register_post_type( 'stores', $args );
}
add_action( 'init', 'custom_store_post_type' );
问题解决了
在插件详细信息中有一个导致问题的关闭php标记