# automatorwp/6.0.0/integrations/woocommerce/includes/functions.php

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

- Page: https://pluginprobe.com/plugins/automatorwp/6.0.0/code/integrations/woocommerce/includes/functions.php
- Raw: https://pluginprobe.com/plugins/automatorwp/6.0.0/raw/integrations/woocommerce/includes/functions.php
- Modified: 2026-08-31T06:40:04+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.0/code/integrations/woocommerce/includes/functions.php#L10-L20`.

```php
<?php
/**
 * Functions
 *
 * @package     AutomatorWP\Integrations\WooCommerce\Functions
 * @author      AutomatorWP <contact@automatorwp.com>, Ruben Garcia <rubengcdev@gmail.com>
 * @since       1.0.0
 */
// Exit if accessed directly
if( !defined( 'ABSPATH' ) ) exit;

/**
 * Helper function to get the address fields
 *
 * @since 1.0.0
 *
 * @return array
 */
function automatorwp_woocommerce_get_address_fields() {

    return array(
        'first_name',
        'last_name',
        'company',
        'address_1',
        'address_2',
        'city',
        'postcode',
        'country',
        'state',
        'phone',
        'email',
    );

}

/**
 * Helper function to get an address field label
 *
 * @since 1.0.0
 *
 * @param string $field
 *
 * @return string
 */
function automatorwp_woocommerce_get_address_field_label( $field ) {

    $labels = array(
        'first_name' => __( 'First name', 'automatorwp' ),
        'last_name' => __( 'Last name', 'automatorwp' ),
        'company' => __( 'Company', 'automatorwp' ),
        'address_1' => __( 'Address line 1', 'automatorwp' ),
        'address_2' => __( 'Address line 2', 'automatorwp' ),
        'city' => __( 'City', 'automatorwp' ),
        'postcode' => __( 'Postcode / ZIP', 'automatorwp' ),
        'country' => __( 'Country / Region', 'automatorwp' ),
        'state' => __( 'State / County', 'automatorwp' ),
        'phone' => __( 'Phone', 'automatorwp' ),
        'email' => __( 'Email', 'automatorwp' ),
    );

    return isset( $labels[$field] ) ? $labels[$field] : '';

}

/**
 * Helper function to get an address field preview
 *
 * @since 1.0.0
 *
 * @param string $field
 *
 * @return string
 */
function automatorwp_woocommerce_get_address_field_preview( $field ) {

    $previews = array(
        'first_name' => 'AutomatorWP',
        'last_name' => __( 'Plugin', 'automatorwp' ),
        'company' => __( 'AutomatorWP Ltd.', 'automatorwp' ),
        'address_1' => __( 'False Street, 123', 'automatorwp' ),
        'address_2' => __( 'First floor, door 2', 'automatorwp' ),
        'city' => __( 'Brooklyn', 'automatorwp' ),
        'postcode' => __( '12345', 'automatorwp' ),
        'country' => __( 'United States', 'automatorwp' ),
        'state' => __( 'New York', 'automatorwp' ),
        'phone' => __( '202-555-1234', 'automatorwp' ),
        'email' => __( 'contact@automatorwp.com', 'automatorwp' ),
    );

    return isset( $previews[$field] ) ? $previews[$field] : '';

}
```
