function gffd_admin_feeds_page()
{
    gffd_admin_enqueue_css();
    wp_enqueue_style('gffd-admin-feeds-css', plugins_url('gffd-gfadmin-feeds.css', ___GFFDFILE___), array(), '', false);
    wp_enqueue_script('gffd-admi-feeds-js', plugins_url('gffd-gfadmin-feeds.js', ___GFFDFILE___), array(), '', false);
    // JS Translate data
    wp_localize_script('gffd-admi-feeds-js', '_e', array('admin_feeds_button_error' => __('There were errors, please review and try again.'), 'admin_feeds_button_save' => gffd_language_terms('as_object')->term_feed_admin_save));
    if (gffd_admin_feeds_is_subpage('add-new-edit')) {
        // include "gffd-gfadmin-feed.html.php"; //here just to show how it's done.
    } else {
        include "gffd-gfadmin-feeds.html.php";
    }
}
function gffd_get_purchase_field_requirements($as_object_or_gffd_index = false, $as_object = false)
{
    $fields = array(array('gffd_index' => 'gffd_fd_cc_firstname', 'label' => __('Name'), 'meta' => __("Usually called <strong>Credit Card (Cardholder's Name)</strong>"), 'validate_bad_message' => function () {
        return gffd_language_terms('term_validate_bad_message_most_card_fields');
    }, 'validate_pre_format' => function ($value) {
        if ($value != '') {
            return $value;
        } else {
            return false;
        }
    }), array('gffd_index' => 'gffd_fd_cc_type', 'label' => __('Credit Card Type'), 'meta' => __('Usually called <strong>Credit Card (Card Type)</strong>'), 'validate_bad_message' => function () {
        return gffd_language_terms('term_validate_bad_message_most_card_fields');
    }, 'validate_pre_format' => function ($value) {
        // Right now the value that is selected from the form
        // feed setup does not work because GF does not send
        // the cc type when it's submitted like you would think.
        //
        // So, gffd-gf-forms.js should give us a
        // $_REQUEST['gffd_cc_type']
        if (gffd_request('gffd_cc_type')) {
            return gffd_request('gffd_cc_type');
        } else {
            return false;
        }
    }), array('gffd_index' => 'gffd_fd_cc_number', 'label' => __('Credit Card Number'), 'meta' => __('Usually called <strong>Credit Card (Card Number)</strong>'), 'validate_bad_message' => function () {
        return gffd_language_terms('term_validate_bad_message_most_card_fields');
    }, 'validate_pre_format' => function ($value) {
        if ($value != '') {
            return $value;
        } else {
            return false;
        }
    }), array('gffd_index' => 'gffd_fd_cc_exp', 'label' => __('Card Expiration Date'), 'meta' => __('Usually called <strong>Credit Card (Expiration Date)</strong>'), 'validate_bad_message' => function () {
        return gffd_language_terms('term_validate_bad_message_most_card_fields');
    }, 'validate_pre_format' => function ($value) {
        if (is_array($value)) {
            // The value (when submitted by $_POST)
            // is an array:
            //
            // array(2) { [0]=> string(1) "1" [1]=> string(4) "2016" }
            //
            // So, let's chop those two array
            // structs into a value that is good for FD.
            if (isset($value[0]) && isset($value[1])) {
                return str_pad($value[0], 2, '0', STR_PAD_LEFT) . substr($value[1], -2);
            } else {
                return false;
            }
        } else {
            return false;
        }
    }), array('gffd_index' => 'gffd_fd_cc_cvv', 'label' => __('CVV/Security Code'), 'meta' => __('Usually called <strong>Credit Card (Security Code)</strong>'), 'validate_bad_message' => function () {
        return gffd_language_terms('term_validate_bad_message_most_card_fields');
    }, 'validate_pre_format' => function ($value) {
        if ($value != '') {
            return $value;
        } else {
            return false;
        }
    }), array('gffd_index' => 'gffd_fd_cc_amount', 'label' => __('Charge Amount'), 'meta' => __('Here you will need to select a <strong>' . 'total field</strong> to your form'), 'validate_bad_message' => function () {
        return gffd_language_terms('term_validate_bad_message_most_card_fields');
    }, 'validate_pre_format' => function ($value) {
        if ($value != '') {
            return str_replace("\$", "", $value);
        } else {
            return false;
        }
    }), array('gffd_index' => 'gffd_fd_cc_address', 'label' => __('Address'), 'meta' => gffd_language_terms('you_will_need_address_field_select_here'), 'validate_bad_message' => function () {
        return gffd_language_terms('term_validate_bad_message_most_address');
    }, 'validate_pre_format' => function ($value) {
        if ($value != '') {
            return $value;
        } else {
            return false;
        }
    }), array('gffd_index' => 'gffd_fd_cc_address2', 'label' => __('Address2'), 'meta' => gffd_language_terms('you_will_need_address_field_select_here'), 'validate_bad_message' => function () {
        return true;
    }, 'validate_pre_format' => function ($value) {
        return true;
    }), array('gffd_index' => 'gffd_fd_cc_zip', 'label' => __('Zip'), 'meta' => gffd_language_terms('you_will_need_address_field_select_here'), 'validate_bad_message' => function () {
        return gffd_language_terms('term_validate_bad_message_most_address');
    }, 'validate_pre_format' => function ($value) {
        if ($value != '') {
            return $value;
        } else {
            return false;
        }
    }), array('gffd_index' => 'gffd_fd_cc_city', 'label' => __('City'), 'meta' => gffd_language_terms('you_will_need_address_field_select_here'), 'validate_bad_message' => function () {
        return gffd_language_terms('term_validate_bad_message_most_address');
    }, 'validate_pre_format' => function ($value) {
        if ($value != '') {
            return $value;
        } else {
            return false;
        }
    }), array('gffd_index' => 'gffd_fd_cc_state', 'label' => __('State'), 'meta' => gffd_language_terms('you_will_need_address_field_select_here'), 'validate_bad_message' => function () {
        return gffd_language_terms('term_validate_bad_message_most_address');
    }, 'validate_pre_format' => function ($value) {
        if ($value != '') {
            return $value;
        } else {
            return false;
        }
    }), array('gffd_index' => 'gffd_fd_cc_country', 'label' => __('Country'), 'meta' => gffd_language_terms('you_will_need_address_field_select_here'), 'validate_bad_message' => function () {
        return gffd_language_terms('term_validate_bad_message_most_address');
    }, 'validate_pre_format' => function ($value) {
        if ($value != '') {
            return $value;
        } else {
            return "US";
        }
    }));
    // If they ask for 'gffd_fd_cc_zip' or 'as_object'
    if (is_string($as_object_or_gffd_index)) {
        // If it is 'as_object'
        if ($as_object_or_gffd_index == 'as_object') {
            return gffd_array_as_object($fields);
            // If it's not 'as_object', let's assume
            // it's a gffd_index.
        } else {
            //Pull out just the field they are asking for.
            foreach ($fields as $field) {
                if ($field['gffd_index'] == $as_object_or_gffd_index) {
                    $_the_field = $field;
                }
            }
            // If they also said, 'gffd_fd_cc_zip', 'as_object',
            // return as an object.
            if ($as_object) {
                return gffd_array_as_object($_the_field);
                // If they just said 'gffd_fd_cc_zip' then return
                // it as an array
            } else {
                return $_the_field;
            }
        }
        // If they pass (true), then just pass as an
        // object.
    } elseif ($as_object_or_gffd_index == true) {
        return gffd_array_as_object($fields);
        // If they just pass () then return
        // as an array.
    } else {
        return $fields;
    }
}
<?php

// At times we may be repeating ourselves when saying
// the same language over and over.
//
// This will return the same language to them all.
function gffd_language_terms($as_object_or_index = 'whole_as_object')
{
    $terms = array('term_feed_admin_save' => __('Save'), 'term_validate_bad_message_most_card_fields' => __("You must provide the Credit Card Number, Expiration Date, \n\t\t\tSecurity Code, and Cardholder's Name."), 'term_validate_bad_message_most_address' => __("You must provide Street Address, City, State, and Zip."), 'you_will_need_address_field_select_here' => __('You will need to have an <strong>Address field</strong> to select from here'));
    if ($as_object_or_index === 'as_object' || $as_object_or_index === true) {
        return json_decode(json_encode($terms));
    } elseif (is_string($as_object_or_index)) {
        if (isset($terms[$as_object_or_index])) {
            return $terms[$as_object_or_index];
        }
    } elseif ($as_object_or_index == 'whole_as_object') {
        return json_decode(json_encode($terms));
    }
}
// Set a global variable that can be used in ""
$gffd_language_terms = gffd_language_terms('whole_as_object');