# automatorwp/6.0.1/integrations/wp-simple-pay/includes/functions.php

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

- Page: https://pluginprobe.com/plugins/automatorwp/6.0.1/code/integrations/wp-simple-pay/includes/functions.php
- Raw: https://pluginprobe.com/plugins/automatorwp/6.0.1/raw/integrations/wp-simple-pay/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/wp-simple-pay/includes/functions.php#L10-L20`.

```php
<?php
/**
 * Functions
 *
 * @package     AutomatorWP\WP_Simple_Pay\Includes\Functions
 * @since       1.0.0
 */
// Exit if accessed directly
if( !defined( 'ABSPATH' ) ) exit;

/**
 * Get forms from WP Simple Pay
 *
 * @since 1.0.0
 * 
 * @param stdClass $field
 *
 * @return array
 */
function automatorwp_simple_pay_options_cb_form( $field ) {

    // Setup vars
    $value = $field->escaped_value;
    $none_value = 'any';
    $none_label = __( 'any form', 'automatorwp-wp-simple-pay' );
    $options = automatorwp_options_cb_none_option( $field, $none_value, $none_label );
    
    if( ! empty( $value ) ) {
        if( ! is_array( $value ) ) {
            $value = array( $value );
        }

        foreach( $value as $form_id ) {

            // Skip option none
            if( $form_id === $none_value ) {
                continue;
            }
            
            $options[$form_id] = automatorwp_simple_pay_get_form_name( $form_id );
        }
    }

    return $options;

}

/**
 * Get WP Simple Pay forms
 *
 * @since 1.0.0
 *
 * @return array|false
 */
function automatorwp_simple_pay_get_forms() {

    $forms = array();

    $args = array( 
        'numberposts' => -1,
        'post_type' => 'simple-pay',
    );

    $wp_simple_pay_posts = get_posts( $args );
    
    foreach ( $wp_simple_pay_posts as $post ){   

        $forms[] = array(
            'id'    => $post->ID,
            'name'  => get_post_meta( $post->ID, '_company_name', true ),
        );         

    }

    return $forms;

}

/**
 * Get WP Simple Pay form name
 *
 * @since 1.0.0
 *
 * @param int    $form_id         ID form
 * 
 */
function automatorwp_simple_pay_get_form_name( $form_id ) {
    
    return get_post_meta( $form_id, '_company_name', true );

}
```
