Event metabox extension

The event's Events settings panel is built from a configuration array, exposed through a filter so integrations can add tabs and fields.

The filter

add_filter( 'web_events_custom_meta', function ( $events ) {
    // Add tabs or inputs to the event panel.
    return $events;
} );

The array describes the panel: a title, a position, and a set of tabs each containing inputs.

The existing structure

Tab key Title Present when
date_time Date & Time Always
info Event info Always
form Registration form Attendee functionality enabled
attendants Attendants Attendee functionality enabled
ecommerce E-Commerce WooCommerce active

Two of those are conditional, so code that assumes a tab exists will fail on some sites. Check before modifying one.

Adding a tab

add_filter( 'web_events_custom_meta', function ( $events ) {
    $events['tabs']['my_extras'] = array(
        'title'  => __( 'Extras', 'my-plugin' ),
        'inputs' => array(
            'my_stream_url' => array(
                'label' => __( 'Stream URL', 'my-plugin' ),
                'type'  => 'url',
            ),
            'my_is_hybrid' => array(
                'label' => __( 'Hybrid event', 'my-plugin' ),
                'type'  => 'toggle',
            ),
        ),
    );

    return $events;
} );

Adding a field to an existing tab

add_filter( 'web_events_custom_meta', function ( $events ) {
    if ( ! isset( $events['tabs']['info']['inputs'] ) ) {
        return $events;
    }

    $events['tabs']['info']['inputs']['my_room'] = array(
        'label' => __( 'Room', 'my-plugin' ),
        'type'  => 'text',
    );

    return $events;
} );

Guard the array access. The form and attendants tabs may not exist.

Where values are stored

Fields declared this way are stored inside the event's pom meta array, alongside the plugin's own values:

$meta = get_post_meta( $event_id, 'pom', true );
$room = $meta['my_room'] ?? '';

A field declared with the framework's own "save as meta" option is stored as a standalone post meta key instead — the plugin uses that for the values it needs to query on, such as the datetimes and the date-hiding switch.

Choose accordingly: inside pom for display values, standalone for anything you will query.

Naming

Prefix your field keys. The pom array is shared with the plugin's own values, and a collision silently overwrites one of them.

The same filter chain adds an Events tab to the post editor carrying Related events. If you extend the post side, do it through the theme's own meta configuration rather than reusing the event filter.

Rendering your field

Adding a field stores a value; it does not print anything publicly. To render it, use the template hooks — see Template integration.

The plugin's own Custom event hashtag is an example of a stored field that the supplied template does not print.

Guard for the theme

The panel only exists on the POM theme. Hook late and check:

add_action( 'init', function () {
    if ( ! post_type_exists( 'event' ) ) {
        return;
    }

    add_filter( 'web_events_custom_meta', 'my_events_panel' );
}, 20 );