add_filter('rwmb_meta_boxes', 'your_prefix_meta_boxes');
function your_prefix_meta_boxes($meta_boxes) {
$meta_boxes[] = array(
'title' => __('Test Meta Box', 'textdomain'),
'post_types' => 'post',
'fields' => array(
array(
'id' => 'name',
'name' => __('Name', 'textdomain'),
'type' => 'text',
),
array(
'id' => 'gender',
'name' => __('Gender', 'textdomain'),
'type' => 'radio',
'options' => array(
'm' => __('Male', 'textdomain'),
'f' => __('Female', 'textdomain'),
),
),
array(
'id' => 'email',
'name' => __('Email', 'textdomain'),
'type' => 'email',
),
),
);
return $meta_boxes;
}
私はfunction.phpでこのコードをpudしていました。新しい投稿を追加するにはメタボックスを取得しています。私は私のページにもメタボックスが必要です。助けてくださいメタボックスを追加すると、新しい投稿を追加するとページに表示されません
' 'post_types' =>配列( 'ポスト'、 'ページ')、' –
特定のページのためにこれを行う方法を –
https://metabox.io/docs/meta:たとえばpage_templateフックを使用-box-include-exclude/ –