Skip to content

Instantly share code, notes, and snippets.

@HeadStudios

HeadStudios/custom fields Secret

Created Sep 14, 2020
Embed
What would you like to do?
add_filter( 'rwmb_meta_boxes', 'your_prefix_register_meta_boxes' );
function your_prefix_register_meta_boxes( $meta_boxes ) {
$prefix = 'prefix-';
$meta_boxes[] = [
'title' => esc_html__( 'Custom Fields', 'online-generator' ),
'id' => 'custom-fields-7',
'post_types' => ['project'],
'context' => 'normal',
'priority' => 'high',
'fields' => [
[
'type' => 'text',
'id' => $prefix . 'project_budget',
'name' => esc_html__( 'Project Budget', 'online-generator' ),
],
[
'type' => 'text',
'id' => $prefix . 'medical_installation_budget',
'name' => esc_html__( 'Medical Gas Installation Budget', 'online-generator' ),
],
],
];
return $meta_boxes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment