我已经创建了一个自定义帖子部分,并删除了所有默认项(标题、编辑器等)使用add\\u操作并添加了我自己的自定义元框。
问题:由于我删除了默认的标题框,因此无法返回帖子,因为它在节的顶层的自定义列中显示了自定义元框内容:
问题:如何像WordPress在默认情况下对标题所做的那样,将“编辑|快速编辑|垃圾箱|查看”选项添加到自定义列?
节使用的代码:
add_action(\'init\', \'addchic_register\');
function addchic_register() {
$labels = array(
\'name\' => _x(\'Addy Chicken\', \'post type general name\'),
\'singular_name\' => _x(\'Addy Chicken\', \'post type singular name\'),
\'add_new\' => _x(\'Add New\', \'addchic item\'),
\'add_new_item\' => __(\'Add New Convo Item\'),
\'edit_item\' => __(\'Edit Convo Item\'),
\'new_item\' => __(\'New Convo Item\'),
\'view_item\' => __(\'View Convos Item\'),
\'search_items\' => __(\'Search Convos\'),
\'not_found\' => __(\'Nothing found\'),
\'not_found_in_trash\' => __(\'Nothing found in Trash\'),
\'parent_item_colon\' => \'\'
);
$args = array(
\'labels\' => $labels,
\'public\' => true,
\'publicly_queryable\' => true,
\'show_ui\' => true,
\'query_var\' => true,
/*\'menu_icon\' => get_stylesheet_directory_uri() . \'/article16.png\',*/
\'rewrite\' => true,
\'capability_type\' => \'post\',
\'hierarchical\' => false,
\'menu_position\' => null,
\'supports\' => array(\'\')
);
register_post_type( \'addchic\' , $args );
}
元框:
add_meta_box("addy_meta", "Addy", "addy_meta", "addchic", "normal", "low");
function addy_meta(){
global $post;
$custom = get_post_custom($post->ID);
$addy = $custom["addy"][0];
?>
<input size="100" name="addy" value="<?php echo $addy; ?>" />
<?php
}
谢谢!