我已经运行这个网站4年了,今天我的自定义帖子类型突然从管理菜单中消失了。内容也未显示。无法找到问题。这是代码
add_action( \'init\', \'create_article_type\' );
function create_article_type() {
register_post_type( \'article\',
array(
\'labels\' => array(
\'name\' => __( \'Article Posts\' ),
\'singular_name\' => __( \'Article\' )
),
\'public\' => true,
\'has_archive\' => true,
\'taxonomies\' => array(\'post_category\'),
\'supports\' => array( \'title\', \'editor\', \'thumbnail\' ),
)
);
}
function add_issuelink_metabox($postType) {
global $post,$wpdb;
$types = array(\'article\',\'post\');
if(in_array($postType, $types)){
add_meta_box("add_issuelink_metabox-meta", "Issue Link", "show_issuelink_metabox", $postType);
}
}
add_action (\'add_meta_boxes\',\'add_issuelink_metabox\');
function show_issuelink_metabox()
{
global $post,$wpdb;
$issuelink=get_post_meta($post->ID, "issuelink", 1);
?>
Issue Link: <input type="text" style="width:700px" name="issuelink" id="issuelink" value="<?php echo $issuelink;?>"></input>
<?php
}
add_action (\'save_post\',\'save_articlepost_metabox\');
function save_articlepost_metabox(){
global $post;
update_post_meta($post->ID, "issuelink", $_POST["issuelink"]);
}
register_taxonomy("post_category", array("article"),
array("hierarchical" => true,
"label" => "Posts Category",
"singular_label" => "Post Category",
"show_in_nav_menus"=>true,
));
提前感谢