我一直在試圖讓我的自定義元框數據保存在Wordpress中,並且我沒有任何運氣。我試着研究其他帖子,但由於每個人都做了一點不同,所以我沒有成功地使用教程和其他帖子。如何在Wordpress中保存自定義元框
我創建了一個metabox:
add_action('add_meta_boxes', 'ic_add_heading_box');
function ic_add_heading_box($post) {
add_meta_box(
'Meta Box',
'Heading Titles',
'ic_heading_box_content',
'page',
'normal',
'high'
);
}
function ic_heading_box_content($post) {
echo '<label>Main Heading (h1)</label>';
echo '<input type="text" name="heading_box_h1" value="" />';
echo '<label>Sub Heading (h3)</label>';
echo '<input type="text" name="heading_box_h3" value="" />';
}
我不能爲我的生命得到我插入到字段中的數據在WordPress的保存。任何幫助將不勝感激。
看看文件上,有一個很好的例子,從開始到結束。 http://codex.wordpress.org/Function_Reference/add_meta_box –