<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; }
	/**
	 * 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 array( '0' => __( 'Mailchimp for WP is not installed or active.', 'sifency-addons' ) );
	}

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

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

	return $options;
}
