# automatorwp/5.8.5/integrations/wp-booking-calendar/includes/functions.php

AutomatorWP – No-Code Workflow Automation, Integration &amp; Webhooks Plugin, now with AI, version 5.8.5. 48 lines.

- Page: https://pluginprobe.com/plugins/automatorwp/5.8.5/code/integrations/wp-booking-calendar/includes/functions.php
- Raw: https://pluginprobe.com/plugins/automatorwp/5.8.5/raw/integrations/wp-booking-calendar/includes/functions.php
- Modified: 2026-08-20T08:53:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/automatorwp/5.8.5/code/integrations/wp-booking-calendar/includes/functions.php#L10-L20`.

```php
<?php

/**
 * Functions
 *
 * @package     AutomatorWP\BookingCalendar\Functions
 * @since       1.0.0
 */
// Exit if accessed directly
if( !defined( 'ABSPATH' ) ) exit;


/**
 * Options callback for select2 fields assigned to bookings
 *
 * @since 1.0.0
 *
 * @param stdClass $field
 *
 * @return array
 */
function automatorwp_wp_booking_calendar_options_cb_booking( $field ) {

    // Setup vars
    $value = $field->escaped_value;
    $none_value = 'any';
    $none_label = __( 'any booking', 'automatorwp' );
    $options = automatorwp_options_cb_none_option( $field, $none_value, $none_label );

    if( ! empty( $value ) ) {
        if( ! is_array( $value ) ) {
            $value = array( $value );
        }

        foreach( $value as $booking_id ) {

            // Skip option none
            if( $booking_id === $none_value ) {
                continue;
            }

            $options[$booking_id] = $booking_id;
        }
    }

    return $options;

}
```
