CSS styling not working in a custom metabox

The metabox div gets an ID of ‘meta_’ + your metabox ID, thus: Sorry, that was me looking at my own metaboxes, forgetting that I actually prefix them like that to differentiate the container from elements within the container 🙁 Let’s work through your code and see if we can find the answer. First, your … Read more

Saving an upload media meta box field

use these: $imgurl = isset( $values[‘upload_image’] ) ? esc_attr( $values[‘upload_image’][0] ) : ”; <input id=”upload_image” type=”text” size=”36″ name=”upload_image” value=”<?php echo $imgurl; ?>” /> <input id=”upload_image_button” type=”button” value=”Upload Image” /> if( isset( $_POST[‘upload_image’] ) ) update_post_meta( $post_id, ‘upload_image’, wp_kses_data( $_POST[‘upload_image’] ) );

Custom select box meta field

To save post meta fields from custom meta boxes you need to hook into save_post with something like this: add_action( ‘save_post’, ‘myplugin_save_postdata’ ); There is some full example code on adding meta boxes on the codex Function Reference/add meta box