我正在使用自定义字段创建一个metabox,这是我尝试的代码,但是前端没有显示任何字段。我没有走错路,谁能向我指出正确的方向。提前致意
function jobs( $meta_boxes ) {
// $prefix = '';
$meta_boxes[] = array(
'id' => 'jobs',
'title' => esc_html__( 'Jobs', 'metabox' ),
'post_types' => array('post' ),
'context' => 'normal',
'priority' => 'default',
'autosave' => 'false',
);
return $meta_boxes;
}
add_filter( 'rwmb_meta_boxes', 'jobs' );
function job( $meta_boxes ) {
// $prefix = '';
$meta_boxes[] = array(
'id' => 'jobs',
'title' => esc_html__( 'Job', 'metabox' ),
'post_types' => array('post' ),
'context' => 'normal',
'priority' => 'default',
'autosave' => 'false',
'fields' => array(
array(
'id' => $prefix . 'select_1',
'name' => esc_html__( 'Filters', 'metabox' ),
'type' => 'select',
'placeholder' => esc_html__( 'Select', 'metabox' ),
'options' => array(
'all jobs' => 'all jobs',
'in progress jobs' => 'in progress jobs',
'scheduled jobs' => 'scheduled jobs',
'unscheduled jobs' => 'unscheduled jobs',
),
),
),
);
return $meta_boxes;
}
add_filter( 'rwmb_meta_boxes', 'job' );