array( 'title' => 'Link post format', 'applicableto' => 'post', 'location' => 'normal', 'display_condition' => 'post-format-link', 'priority' => 'high', 'fields' => array( 'title_link' => array( 'title' => 'Link', 'type' => 'text', 'description' => '', 'size' => 100 ) ) ), 'quote_post_format' => array( 'title' => 'Quote post format', 'applicableto' => 'post', 'location' => 'normal', 'display_condition' => 'post-format-quote', 'priority' => 'high', 'fields' => array( 'quote_format' => array( 'title' => 'Quote', 'type' => 'text', 'description' => '', 'size' => 100 ) ) ), 'video_post_format' => array( 'title' => 'Video post format', 'applicableto' => 'post', 'location' => 'normal', 'display_condition' => 'post-format-video', 'priority' => 'high', 'fields' => array( 'video_format_choose' => array( 'title' => 'Choose Video Type', 'type' => 'selectbox', 'description' => '' ), 'video_format_link' => array( 'title' => 'Video ID', 'type' => 'text', 'description' => '', 'size' => 100 ), 'video_format_image' => array( 'title' => 'Video image', 'type' => 'image', 'description' => '', 'size' => 100 ), 'video_format_webm' => array( 'title' => 'Video webm', 'type' => 'text', 'description' => '', 'size' => 100 ), 'video_format_mp4' => array( 'title' => 'Video mp4', 'type' => 'text', 'description' => '', 'size' => 100 ), 'video_format_ogv' => array( 'title' => 'Video ogv', 'type' => 'text', 'description' => '', 'size' => 100 ) ) ), 'audio_post_format' => array( 'title' => 'Audio post format', 'applicableto' => 'post', 'location' => 'normal', 'display_condition' => 'post-format-audio', 'priority' => 'high', 'fields' => array( 'audio_link' => array( 'title' => 'Audio Link', 'type' => 'text', 'description' => '', 'size' => 100 ) ) ), ); function add_metaboxes() { global $metaboxes; if ( ! empty( $metaboxes ) ) { foreach ( $metaboxes as $id => $metabox ) { add_meta_box( $id, $metabox['title'], 'show_metaboxes', $metabox['applicableto'], $metabox['location'], $metabox['priority'], $id ); } } } // show meta boxes function show_metaboxes( $post, $args ) { global $metaboxes; $custom = get_post_custom( $post->ID ); $fields = $metaboxes[$args['id']]['fields']; /** Nonce **/ $output = ''; if ( sizeof( $fields ) ) { foreach ( $fields as $id => $field ) { if(isset($custom[$id][0]) && $custom[$id][0] != ""){ $value = $custom[$id][0]; }else{ $value = ""; } switch ( $field['type'] ) { default: case "text": $output .= '