I have a stuck that make me headache so much, as you see picture, this is my result when i add option to event.

enter image description here

I'm updated code in: wp-content/theme/mytheme/lib/metabox/function.php

$meta_boxes[] = array(
'id' => 'event_date_option',
'title' => __( 'Event options', 'mytheme' ),
'pages' => array( Custom_Posts_Type_Event::POST_TYPE ), // Post type
'context' => 'normal',
'priority' => 'high',
'show_names' => true, // Show field names on the left
'fields' => array(
        'name' => __( 'Event type:', 'mytheme' ),
        'desc' => __( 'Choose event type', 'mytheme' ),
        'id' => SHORTNAME . Widget_Event::EVENT_INTERVAL_META_KEY,
        'type' => 'select',
        'options' => array(
            array( 'value'=>"n" , 'name' => __( 'Normal', 'mytheme' ) ),
            array( 'value'=>"c" , 'name' => __( 'Comunity', 'mytheme' ) ),

It's show in event post, but i don't know how to save when add new event OR when i'm update event post. Please help me, thank you!

Ahh, i save it in database with new table like: ID_POST, VALUE

Thank you!


You need to add use function for update event options of event for hint please : Click hear


You need to save you custom field with the save_post action.

You'll find the process to add and save meta boxes with this question : here

Hope it helps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.