Adding Meta Box Value Structure Format

Adding — meta-boxes.php in functions.php

<?php

add_action( ‘admin_init’, ‘custom_meta_boxes’ );

function custom_meta_boxes() {

$page_meta_box = array(
‘id’        => ‘page_meta_box’,
‘title’     => ‘Page Extra Fields’,
‘desc’      => ”,
‘pages’     => array( ‘page’ ),
‘context’   => ‘normal’,
‘priority’  => ‘high’,
‘fields’    => array(
array(
‘id’          => ‘page_banner_image’,
‘label’       => ‘Upload page header image’,
‘desc’        => ”,
‘std’         => ”,
‘type’        => ‘upload’,
‘class’       => ”
)
)
);
$post_meta_box = array(
‘id’        => ‘post_meta_box’,
‘title’     => ‘Post Description’,
‘desc’      => ”,
‘pages’     => array( ‘post’ ),
‘context’   => ‘normal’,
‘priority’  => ‘high’,
‘fields’    => array(
array(
‘label’       => __( ‘» Blog layout’, ‘option-tree-theme’ ),
‘id’          => ‘news_c3’,
‘type’        => ‘tab’
),
array(
‘id’          => ‘blog_select’,
‘label’       => __( ‘Select’, ‘option-tree-theme’ ),
‘desc’        => __( ‘Please select Blog Type’, ‘option-tree-theme’ ),
‘std’         => ”,
‘type’        => ‘select’,
‘section’     => ‘option_types’,
‘rows’        => ”,
‘post_type’   => ”,
‘taxonomy’    => ”,
‘min_max_step’=> ”,
‘class’       => ”,
‘condition’   => ”,
‘operator’    => ‘and’,
‘choices’     => array(
array(
‘value’       => ”,
‘label’       => __( ‘– Choose One –‘, ‘option-tree-theme’ ),
‘src’         => ”
),
array(
‘value’       => ‘image’,
‘label’       => __( ‘Image’, ‘option-tree-theme’ ),
‘src’         => ”
),
array(
‘value’       => ‘notimage’,
‘label’       => __( ‘Without Image’, ‘option-tree-theme’ ),
‘src’         => ”
),

)
),

array(
‘id’          => ‘s_desc’,
‘label’       => ‘Write Excerpt’,
‘desc’        => ”,
‘std’         => ”,
‘type’        => ‘textarea’,
‘rows’          => 4,
‘class’       => ”
),
array(
‘id’          => ‘post_img’,
‘label’       => ‘Upload Blog Image’,
‘desc’        => ”,
‘std’         => ”,
‘type’        => ‘upload’,
‘class’       => ”
),

)
);

ot_register_meta_box( $page_meta_box );
ot_register_meta_box( $post_meta_box );

}

 

Advertisements

Published by

oudarya

I am a developer

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s