Skip to content

Instantly share code, notes, and snippets.

@pavelrich
Created August 13, 2019 19:03
Show Gist options
  • Save pavelrich/4edafbd5bf329d90ea56f379c841f8e7 to your computer and use it in GitHub Desktop.
Save pavelrich/4edafbd5bf329d90ea56f379c841f8e7 to your computer and use it in GitHub Desktop.
FORQY — Reservations - Add Custom Metabox
<?php
// Add Custom Metabox to Reservations
if ( ! function_exists( 'forqy_metabox_reservation_custom_register' ) ) {
function forqy_metabox_reservation_custom_register( $meta_boxes ) {
$meta_boxes[] = array(
'id' => 'forqy-metabox-reservation-custom',
'title' => 'Internal Reservation Details',
'post_types' => array( 'reservation' ),
'context' => 'normal',
'priority' => 'high',
'fields' => array(
array(
'name' => 'Event Type',
'id' => 'custom_reservation_event_type',
'type' => 'select',
'options' => array(
'---' => '---',
'conference' => 'Conference',
'seminar' => 'Seminar',
'meeting' => 'Meeting',
'business' => 'Business',
'wedding' => 'Wedding',
)
),
array(
'type' => 'divider',
),
array(
'name' => 'Deposit?',
'desc' => 'Check if the deposit has been paid.',
'id' => 'custom_reservation_deposit',
'type' => 'checkbox'
),
array(
'name' => 'Equipment',
'id' => 'custom_reservation_equipment',
'type' => 'textarea'
),
array(
'name' => 'Menu',
'id' => 'custom_reservation_menu',
'type' => 'textarea'
),
array(
'name' => 'Notes',
'id' => 'custom_reservation_notes',
'type' => 'textarea'
),
)
);
return $meta_boxes;
}
add_filter( 'rwmb_meta_boxes', 'forqy_metabox_reservation_custom_register' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment