<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}
    /**
     * Helper function to get a list of Mailchimp for WP forms.
     * @return array
     */
    function sifency_addons_get_mailchimp_forms() {
        if ( ! function_exists('mc4wp_get_forms') ) {
            return [ '0' => __( 'Mailchimp for WP is not installed or active.', 'sifency-addons' ) ];
        }

        $forms = mc4wp_get_forms();
        if ( empty($forms) ) {
            return [ '0' => __( 'No Mailchimp forms found.', 'sifency-addons' ) ];
        }

        $options = ['' => __( 'Select a Form', 'sifency-addons' )];
        foreach ($forms as $form) {
            $options[$form->ID] = $form->name;
        }

        return $options;
    }