"page_setting",
"title" => "Layout setting",
"description" => "All the following items are optional",
"type" => "title",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "layout",
"title" => "Page Layout",
"description" => "",
"type" => "select-layout",
"scope" => array( "page" ),
"capability" => "manage_options"
),
array(
"name" => "select_sidebar",
"title" => "Sidebar",
"description" => "",
"type" => "select-sidebar",
"scope" => array("page"),
"capability" => "manage_options"
),
array(
"name" => "close",
"type" => "optionclose",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "slide_setting",
"title" => "Slide settings",
"description" => "",
"type" => "title",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "slide_setimage",
"title" => "",
"description" => "You need to upload the slider images from your computer",
"type" => "slide-btn",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "home_slide_style",
"title" => "Style",
"description" => "",
"type" => "home-slide-style",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "slide_order_by",
"title" => "Order images by",
"description" => "",
"type" => "slide-order-by",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "slide_order",
"title" => "Order",
"description" => "",
"type" => "slide-order",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "numbers_nivo",
"title" => "Nivo Slide - Number of Pictures",
"description" => "e.g. '3'",
"type" => "wormbox",
"scope" => array("page"),
"capability" => "manage_options"
),
array(
"name" => "nivo_effect",
"title" => "Nivo Slide Effect",
"description" => "",
"type" => "nivo-effect",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "nivo_slices",
"title" => "Nivo Slide Slices",
"description" => "e.g. '3'",
"type" => "wormbox",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "nivo_animSpeed",
"title" => "Nivo Slide transition speed",
"description" => "Default 500 (1000 = 1 second)",
"type" => "wormbox",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "close",
"type" => "optionclose",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "general_setting",
"title" => "General settings",
"description" => "",
"type" => "title",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "guideif",
"title" => "Show Breadcrumbs",
"description" => "",
"type" => "checkbox",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "slogan",
"title" => "Slogan",
"description" => "e.g.'Design is about how it works, not just how it looks!'",
"type" => "textarea",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "quote",
"title" => "Quoted text",
"description" => "e.g.'Stay hungry, stay foolish! <p align=right>--Steve Jobs</p>'",
"type" => "textarea",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "close",
"type" => "optionclose",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "item_setting",
"title" => "List settings",
"description" => "",
"type" => "title",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "home_promotion_cat",
"title" => "List - Category",
"description" => "Please select the category what you want to show in list",
"type" => "select-cat",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "home_promotion_nums",
"title" => "List - Number of posts",
"description" => "Number of posts in one page",
"type" => "wormbox",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "list_order_by",
"title" => "Order posts by",
"description" => "",
"type" => "list-order-by",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "list_order",
"title" => "Order",
"description" => "",
"type" => "list-order",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "pagination",
"title" => "Pagination",
"description" => "",
"type" => "select-pagination",
"scope" => array("page"),
"capability" => "manage_options"
),
array(
"name" => "col",
"title" => "Columns",
"description" => "",
"type" => "select-col",
"scope" => array("page"),
"capability" => "manage_options"
),
array(
"name" => "close",
"type" => "optionclose",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "ad_setting",
"title" => "Advertising settings",
"description" => "",
"type" => "title",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "pagead_top",
"title" => "Top of page",
"description" => "Please enter the AD code.
e.g.<a href="http://sample.com"><img src="http://sample.com/sample.gif"></a>",
"type" => "textareaadtop",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "pagead_middle",
"title" => "Middle of page",
"description" => "Please enter the AD code.
e.g.<a href="http://sample.com"><img src="http://sample.com/sample.gif"></a>",
"type" => "textareaadmiddle",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "pagead_insert",
"title" => "Insert List",
"description" => "Please enter the AD code.
Note:1. Not support JavaScript code. 2. Need set a height for img label. 3. Not for Filterable template.
e.g.<a href="http://sample.com"><img src="http://sample.com/sample.gif" height="300" ></a>",
"type" => "textareaadinsert",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "insert_posi",
"title" => "Insert List - Position",
"description" => "",
"type" => "listad_posi",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "pagead_bottom",
"title" => "Bottom of page",
"description" => "Please enter the AD code.
e.g.<a href="http://sample.com"><img src="http://sample.com/sample.gif"></a>",
"type" => "textareaadbottom",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "close",
"type" => "optionclose",
"scope" => array( "page"),
"capability" => "manage_options"
),
array(
"name" => "post_setting",
"title" => "Post settings",
"description" => "",
"type" => "title",
"scope" => array( "post","gallery"),
"capability" => "manage_options"
),
array(
"name" => "layout",
"title" => "Layout",
"description" => "",
"type" => "select-layout",
"scope" => array( "post" ),
"capability" => "manage_options"
),
array(
"name" => "select_sidebar",
"title" => "Sidebar",
"description" => "",
"type" => "select-sidebar",
"scope" => array( "post","gallery"),
"capability" => "manage_options"
),
array(
"name" => "layoutinlist",
"title" => "Layout in list",
"description" => "",
"type" => "select-layoutinlist",
"scope" => array( "post","gallery" ),
"capability" => "manage_options"
),
array(
"name" => "video_link",
"title" => "Video URL",
"description" => "Show in list, support Youtube(e.g.'http://www.youtube.com/watch?v=xxxxxxxxx'), Vimeo(e.g.'http://vimeo.com/12345678') and SWF(e.g.'http://www.flashrul.com/flashname.swf')",
"type" => "text",
"scope" => array( "post","gallery"),
"capability" => "manage_options"
),
array(
"name" => "guideif",
"title" => "Show Breadcrumbs",
"description" => "",
"type" => "checkbox",
"scope" => array( "post","gallery"),
"capability" => "manage_options"
),
array(
"name" => "showadif",
"title" => "Advertising",
"description" => "Not show Advertising in this post.",
"type" => "checkboxad",
"scope" => array( "post"),
"capability" => "manage_options"
),
array(
"name" => "close",
"type" => "optionclose",
"scope" => array( "post","gallery"),
"capability" => "manage_options"
)
);
/**
* PHP 4 Compatible Constructor
*/
function myCustomFields() { $this->__construct(); }
/**
* PHP 5 Constructor
*/
function __construct() {
add_action( 'admin_menu', array( &$this, 'createCustomFields' ) );
add_action( 'save_post', array( &$this, 'saveCustomFields' ), 1, 2 );
// Comment this line out if you want to keep default custom fields meta box
add_action( 'do_meta_boxes', array( &$this, 'removeDefaultCustomFields' ), 10, 3 );
}
/**
* Remove the default Custom Fields meta box
*/
function removeDefaultCustomFields( $type, $context, $post ) {
foreach ( array( 'normal', 'advanced', 'side' ) as $context ) {
remove_meta_box( 'postcustom', 'post', $context );
remove_meta_box( 'postcustom', 'page', $context );
remove_meta_box( 'postcustom', 'gallery', $context );
//Use the line below instead of the line above for WP versions older than 2.9.1
//remove_meta_box( 'pagecustomdiv', 'page', $context );
}
}
/**
* Create the new Custom Fields meta box
*/
function createCustomFields() {
if ( function_exists( 'add_meta_box' ) ) {
add_meta_box( 'my-custom-fields', 'Custom Fields', array( &$this, 'displayCustomFields' ), 'page', 'normal', 'high' );
add_meta_box( 'my-custom-fields', 'Custom Fields', array( &$this, 'displayCustomFields' ), 'post', 'normal', 'high' );
add_meta_box( 'my-custom-fields', 'Custom Fields', array( &$this, 'displayCustomFields' ), 'gallery', 'normal', 'high' );
}
}
/**
* Display the new Custom Fields meta box
*/
function displayCustomFields() {
global $post;
$all_category_ids = get_all_category_ids();
$no_of_categories = count($all_category_ids);
$categories = get_categories("taxonomy=catalog");
$all_page_names = all_names("page");
$all_page_titles = all_titles("page");
$all_page_ids = all_IDs("page");
$no_of_pages = count($all_page_ids);
$all_post_names = all_names("post");
$all_post_titles = all_titles("post");
$all_post_ids = all_IDs("post");
$no_of_posts = count($all_post_ids);
$all_post_names = all_names("gallery");
$all_post_titles = all_titles("gallery");
$all_post_ids = all_IDs("gallery");
$no_of_posts = count($all_post_ids);
?>