2013-01-22 18 views

回答

0

您沒有提供太多細節有關的項目,但你可能want to make some meta_boxes,並將數據保存爲custom fields

這裏是截斷的例子culled from something I put together for a question at wordpress.stackexchange。一些功能的細節對於你的問題並不重要,但它說明了一般的'如何'。按照鏈接工作,但真誠的測試代碼。

// author checkboxes 
add_action('add_meta_boxes', 'assisting_editor'); 
function assisting_editor() { 
    add_meta_box(
     'assisting_editor', // id, used as the html id att 
     __('Editorial Tasks'), // meta box title 
     'editor_tasks', // callback function, spits out the content 
     'post', // post type or page. This adds to posts only 
     'side', // context, where on the screen 
     'low' // priority, where should this go in the context 
    ); 
} 

// this is the callback that creates the meta box content 
function editor_tasks($post) { 
    // function details skipped; follow the link 
} 

// to save the data 
add_action('save_post', 'save_metadata'); 
// callback for the save hook ^^ 
function save_metadata($postid) { 
    // function details skipped; follow the link 
}