# automatorwp/6.0.1/integrations/bookingpress/includes/functions.php

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

- Page: https://pluginprobe.com/plugins/automatorwp/6.0.1/code/integrations/bookingpress/includes/functions.php
- Raw: https://pluginprobe.com/plugins/automatorwp/6.0.1/raw/integrations/bookingpress/includes/functions.php
- Modified: 2026-09-02T08:56:26+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/6.0.1/code/integrations/bookingpress/includes/functions.php#L10-L20`.

```php
<?php
/**
 * Functions
 *
 * @package     AutomatorWP\Integrations\BookingPress\Functions
 * @author      AutomatorWP <contact@automatorwp.com>, Ruben Garcia <rubengcdev@gmail.com>
 * @since       1.0.0
 */
// Exit if accessed directly
if( !defined( 'ABSPATH' ) ) exit;

/**
 * Get the related WordPress user ID from a BookingPress customer ID.
 *
 * @since 1.0.0
 *
 * @param int $customer_id BookingPress customer ID.
 *
 * @return int WordPress user ID or 0 when there is no linked account.
 */
function automatorwp_bookingpress_get_wp_user_id_from_customer_id( $customer_id ) {

    global $wpdb;

    $customer_id = absint( $customer_id );

    if( empty( $customer_id ) ) {
        return 0;
    }

    $customer_table = $wpdb->prefix . 'bookingpress_customers';
    $wp_user_id = $wpdb->get_var(
        $wpdb->prepare(
            "SELECT bookingpress_wpuser_id FROM {$customer_table} WHERE bookingpress_customer_id = %d",
            $customer_id
        )
    );

    return absint( $wp_user_id );

}

/**
 * Get BookingPress customer data
 *
 * @since 1.0.0
 *
 * @return array|false
 */
function automatorwp_bookingpress_get_customer_data( $customer_id ) {

    global $wpdb;

    // Empty if no ID provided
    if( absint( $customer_id ) === 0 ) {
        return '';
    }
    
    $customer = $wpdb->get_row( "SELECT * FROM {$wpdb->prefix}bookingpress_customers WHERE bookingpress_customer_id = {$customer_id}" );

    return $customer;

}
```
