Add option in th event calendar

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

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(
    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!

Topic plugin-events-calendar events Wordpress

Category Web


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


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

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.