I created a new meta box for a custom post type, but I cannot get the data (the user's city) to show up under Location.
Here is my code:
function wporg_add_custom_box()
{
add_meta_box(
'wporg_box_id', // Unique ID
'Location', // Box title
'custom_meta_box_markup', // Content callback, must be of type callable
'project', // Post Type
'side',
'core');
}
add_action('add_meta_boxes', 'wporg_add_custom_box');
function custom_meta_box_markup() {
global $post;
$custom_fields = get_the_author_meta( 'city', $author_id );
?>
<div>
<input name="custom_fields" type="text" value="<?php echo $custom_fields;?>">
</div>
<?php }