很可能你在什么地方有某种勾结。你有可能有这样的东西吗?
register_post_type( \'balloon\', $args );
还有register_taxonomy( \'balloon\', array(\'balloon\'), $args );
看看下面的代码。这是一个完整的插件。将其与您的代码进行比较。
<?php
/*
@Plugin Name: Balloons - Balloons Directory
@Plugin URI: http://azizur-rahman.co.uk/
@Description: Balloons Directory Manager
@Author: Azizur Rahman
@Version: 1.0
@Author URI: http://azizur-rahman.co.uk/
@package balloons
*/
add_action( \'init\', \'azizur_register_cpt_balloons\' );
function azizur_register_cpt_balloons() {
$labels = array(
\'name\' => _x( \'balloons\', \'balloons\' ),
\'singular_name\' => _x( \'balloon\', \'balloons\' ),
\'add_new\' => _x( \'Add New\', \'balloons\' ),
\'add_new_item\' => _x( \'Add New balloon\', \'balloons\' ),
\'edit_item\' => _x( \'Edit balloon\', \'balloons\' ),
\'new_item\' => _x( \'New balloon\', \'balloons\' ),
\'view_item\' => _x( \'View balloon\', \'balloons\' ),
\'search_items\' => _x( \'Search balloons\', \'balloons\' ),
\'not_found\' => _x( \'No balloons found\', \'balloons\' ),
\'not_found_in_trash\' => _x( \'No balloons found in Trash\', \'balloons\' ),
\'parent_item_colon\' => _x( \'Parent balloon:\', \'balloons\' ),
\'menu_name\' => _x( \'balloons\', \'balloons\' ),
);
$args = array(
\'labels\' => $labels,
\'hierarchical\' => false,
\'description\' => \'balloons content type\',
\'supports\' => array( \'title\', \'editor\', \'excerpt\', \'author\', \'thumbnail\', \'trackbacks\', \'custom-fields\', \'comments\', \'revisions\', \'post-formats\' ),
// \'taxonomies\' => array( \'page-category\', \'balloon-category\' ),
\'public\' => true,
\'show_ui\' => true,
\'show_in_menu\' => true,
\'show_in_nav_menus\' => true,
\'publicly_queryable\' => true,
\'exclude_from_search\' => false,
\'has_archive\' => true,
\'query_var\' => true,
\'can_export\' => true,
\'rewrite\' => true,
\'capability_type\' => \'post\'
);
register_post_type( \'balloons\', $args );
}
add_action( \'init\', \'azizur_register_taxonomy_balloon_types\' );
function azizur_register_taxonomy_balloon_types() {
$labels = array(
\'name\' => _x( \'Balloon Types\', \'balloon types\' ),
\'singular_name\' => _x( \'Balloon Type\', \'balloon types\' ),
\'search_items\' => _x( \'Search Balloon Type\', \'balloon types\' ),
\'popular_items\' => _x( \'Popular Balloon Type\', \'balloon types\' ),
\'all_items\' => _x( \'All Balloon Type\', \'balloon types\' ),
\'parent_item\' => _x( \'Parent Balloon Types\', \'balloon types\' ),
\'parent_item_colon\' => _x( \'Parent Balloon Types:\', \'balloon types\' ),
\'edit_item\' => _x( \'Edit Balloon Types\', \'balloon types\' ),
\'update_item\' => _x( \'Update Balloon Types\', \'balloon types\' ),
\'add_new_item\' => _x( \'Add New Balloon Types\', \'balloon types\' ),
\'new_item_name\' => _x( \'New Balloon Types Name\', \'balloon types\' ),
\'separate_items_with_commas\' => _x( \'Separate balloon type with commas\', \'balloon types\' ),
\'add_or_remove_items\' => _x( \'Add or remove balloon type\', \'balloon types\' ),
\'choose_from_most_used\' => _x( \'Choose from the most used balloon type\', \'balloon types\' ),
\'menu_name\' => _x( \'Balloon Types\', \'balloon types\' ),
);
$args = array(
\'labels\' => $labels,
\'public\' => true,
\'show_in_nav_menus\' => true,
\'show_ui\' => true,
\'show_tagcloud\' => true,
\'hierarchical\' => true,
\'rewrite\' => true,
\'query_var\' => true
);
register_taxonomy( \'balloon_types\', array(\'balloons\'), $args );
}
function azizur_balloons_cpt_rewrite_flush() {
flush_rewrite_rules();
}
register_activation_hook(__FILE__, \'azizur_balloons_cpt_rewrite_flush\');
register_deactivation_hook(__FILE__, \'azizur_balloons_cpt_rewrite_flush\');
?>