array( 'title' => esc_html__('Post Options', 'aden'), 'applicableto' => 'post', 'location' => 'normal', 'priority' => 'high', 'fields' => array( 'carousel-meta-checkbox' => array( 'title' => esc_html__(' Show Post in Carousel', 'aden'), 'type' => 'checkbox', 'description' => '', 'class' => '' ), 'post-fullwidth-checkbox' => array( 'title' => esc_html__(' Full Width Post', 'aden'), 'type' => 'checkbox', 'description' => '', 'class' => '' ), 'disable-sidebar-checkbox' => array( 'title' => esc_html__(' Disable Sidebar on Single Page', 'aden'), 'type' => 'checkbox', 'description' => '', 'class' => '' ), 'disable-feature-img-checkbox' => array( 'title' => esc_html__(' Disable Sidebar on Single Page', 'aden'), 'type' => 'checkbox', 'description' => '', 'class' => '' ) ) ), // Link metaboxes 'adenit-link' => array( 'title' => esc_html__('Link Format', 'aden'), 'applicableto' => 'post', 'location' => 'normal', 'display_condition' => 'post-format-link', 'priority' => 'core', 'fields' => array( 'link' => array( 'title' => esc_html__('Link Description:', 'aden'), 'type' => 'input', 'description' => '', 'class' => 'adenit-metabox' ), 'link_author' => array( 'title' => esc_html__('Link Title:', 'aden'), 'type' => 'input', 'description' => '', 'class' => 'adenit-metabox' ), 'link_author_url' => array( 'title' => esc_html__('Link Author (URL):', 'aden'), 'type' => 'input', 'description' => '', 'class' => 'adenit-metabox' ) ) ), // quote metaboxes 'adenit-quote' => array( 'title' => esc_html__('Quote Format', 'aden'), 'applicableto' => 'post', 'location' => 'normal', 'display_condition' => 'post-format-quote', 'priority' => 'core', 'fields' => array( 'quote' => array( 'title' => esc_html__('Quote:', 'aden'), 'type' => 'input', 'description' => '', 'class' => 'adenit-metabox' ), 'quote_author' => array( 'title' => esc_html__('Quote Author:', 'aden'), 'type' => 'input', 'description' => '', 'class' => 'adenit-metabox' ) ) ), // video metaboxes 'adenit-video' => array( 'title' => esc_html__('Video Format', 'aden'), 'applicableto' => 'post', 'location' => 'normal', 'display_condition' => 'post-format-video', 'priority' => 'core', 'fields' => array( 'video_embed' => array( 'title' => esc_html__('Video Embed Code:', 'aden'), 'type' => 'textarea', 'description' => '', 'class' => 'adenit-metabox' ) ) ), // Audio metaboxes 'adenit-audio' => array( 'title' => esc_html__('Audio Format', 'aden'), 'applicableto' => 'post', 'location' => 'normal', 'display_condition' => 'post-format-audio', 'priority' => 'core', 'fields' => array( 'audio_embed' => array( 'title' => esc_html__('Audio Embed Code:', 'aden'), 'type' => 'textarea', 'description' => '', 'class' => 'adenit-metabox' ) ) ) ); //Add metaboxes function adenit_add_post_format_metabox() { global $adenit_metaboxes; if ( ! empty( $adenit_metaboxes ) ) { foreach ( $adenit_metaboxes as $id => $metabox ) { add_meta_box( $id, $metabox['title'], 'adenit_show_metaboxes', $metabox['applicableto'], $metabox['location'], $metabox['priority'], $id ); } } } add_action( 'admin_init', 'adenit_add_post_format_metabox' ); //Show metaboxes function adenit_show_metaboxes( $post, $args ) { global $adenit_metaboxes; global $post; $custom = get_post_custom( $post->ID ); $fields = $adenit_metaboxes[$args['id']]['fields']; /** Nonce **/ $output = ''; if ( sizeof( $fields ) ) { foreach ( $fields as $id => $field ) { $meta_box_text = isset($custom[$id][0])?$custom[$id][0]:''; switch ( $field['type'] ) { default: case "input": $output .= ''; break; case "textarea": $output .= ''; break; case "checkbox": $field_id_value = get_post_meta($post->ID, $id, true); $field_id_checked = ''; if($field_id_value == "yes") $field_id_checked = 'checked'; ?>