Created
February 26, 2020 08:31
-
-
Save MjHead/cd7b725f165e5dc2b0ab981a45dfae6a to your computer and use it in GitHub Desktop.
Register custom meta box for JetEngine from code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'jet-engine/meta-boxes/register-instances', 'my_register_meta_box' ); | |
function my_register_meta_box( $meta_boxes_manager ) { | |
// Replace my_post_type_slug with your actual post type slug | |
$post_type = 'my_post_type_slug'; | |
$object_name = $post_type . '_group'; | |
$meta_boxes_manager->register_custom_group( | |
$object_name, | |
__( 'My Post Type Settings', 'jet-appointments-booking' ) | |
); | |
$meta_boxes_manager->register_metabox( | |
$post_type, | |
array( | |
array( | |
'type' => 'text', | |
'name' => '_app_price', | |
'title' => __( 'Price per slot', 'jet-appointments-booking' ), | |
), | |
), | |
__( 'My Post Type Settings', 'jet-appointments-booking' ), | |
$object_name | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment