Add Custom Metabox in WordPress Custom and Default Post Types
/** * Textbox Meta Box */ function textbox_meta() { add_meta_box('website', 'Website URL', 'textbox', 'post', 'normal', 'high'); } add_action('add_meta_boxes', 'textbox_meta'); function textbox($post) { wp_nonce_field('website', 'website_nonce'); $value = get_post_meta($post->ID, '_website', true); echo '<label for="website">'; _e('Add Here Site URL:', 'textbox'); echo '</label> '; echo '<input type="text" id="website" name="website" value="' . esc_attr($value) . '" size="25" />'; } function textbox_save_meta_box_data($post_id) { if (!isset($_POST['website_nonce'])) { return; } if (!wp_verify_nonce($_POST['website_nonce'], 'website')) { ...