我正在向自定义帖子类型添加字段。我如何在元数据中拥有编辑选项,就像它们在编辑器框中一样?
add_action(\'add_meta_boxes\', \'add_property\');
function add_property(){
add_meta_box("description-meta", "Property Description", "desc_options", "property", "normal");
}
function desc_options(){
global $post;
$values = get_post_custom($post->ID);
$description = isset( $values[\'description\'] ) ? esc_attr( $values[\'description\'][0] ) : \'\';
wp_nonce_field( \'my_meta_box_nonce\', \'meta_box_nonce\' );
?>
<p>
<label>Description:</label><br/><textarea name="description" cols="100" rows="20"><?php echo $description; ?></textarea>
</p>