Adding meta boxes to custom post type
Let’s say your post type is named product. You register your metabox with … add_action( ‘add_meta_boxes_product’, ‘register_product_metabox’ ); function register_product_metabox() { // register the metabox } You get the post id in your callback per post object now: function metabox_callback( $post ) { $field = get_post_meta( $post->ID ); } This happens because WordPress calls the … Read more