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

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

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

```php
<?php
/**
 * Functions
 *
 * @package     AutomatorWP\MailPoet\Functions
 * @since       1.0.0
 */
// Exit if accessed directly
if( !defined( 'ABSPATH' ) ) exit;

/**
 * Options callback for lists
 *
 * @since 1.0.0
 *
 * @param stdClass $field
 *
 * @return array
 */
function automatorwp_mailpoet_lists_options_cb( $field ) {

    $none_value = '';
    $none_label = __( 'a list', 'automatorwp' );
    $options = automatorwp_options_cb_none_option( $field, $none_value, $none_label );

    if ( ! class_exists( '\MailPoet\API\API' ) ) {
        return $options;
    }

    $mailpoet  = \MailPoet\API\API::MP( 'v1' );
    $lists = $mailpoet->getLists();

    if( is_array( $lists ) ) {
        foreach( $lists as $list ) {
            $options[$list['id']] = $list['name'];
        }
    }

    return $options;

}
```
