Kit Feed Meta

Introduction

The Feed Meta Object for the Kit Add-On is an associative array with properties determining how the add-on should process the form submission.

$feed['meta'] = array(
    'feed_name' => 'Kit Feed',
    'form_id' => '5500223',
    'tag_id' => '4282109',
    'convertkit_custom_fields' => array(
        0 => array(
            'key' => '',
            'custom_key' => '',
            'value' => '',
            'custom_value' => '',
        ),
    ),
    'feed_condition_conditional_logic_object' => array(),
    'feed_condition_conditional_logic' => '0',
    'field_map_email' => '',
    'field_map_name' => '',
    'field_map_tag' => '',
    'conditions' => '',
    'trial_product' => NULL,
    'trial_amount' => NULL,
);

Usage

We recommend accessing the $feed meta using the rgar() or rgars() functions, e.g.:

$conditional_logic_enabled = rgars( $feed, 'meta/feedCondition' );

if ( $conditional_logic_enabled ) {
    // Conditional logic is enabled for this feed.
    $logic_rules = rgars( $feed, 'meta/feed_condition_conditional_logic_object/conditionalLogic/rules' );
    foreach ( $logic_rules as $rule ) {
        // Process each conditional logic rule.
        $field_id  = rgar( $rule, 'fieldId' );
        $operator  = rgar( $rule, 'operator' );
        $value     = rgar( $rule, 'value' );
        // Example: Use $field_id, $operator, and $value in your logic.
    }
}

Properties

PropertyTypeDescription
feed_namestringA unique name for the Kit feed.
form_idstringThe ID of the form associated with the feed.
tag_idstringThe ID of the tag to be assigned.
convertkit_custom_fieldsarrayAn array of custom fields to map additional data.
feed_condition_conditional_logic_objectarrayStores the conditional logic rules for the feed. Empty if no rules are defined.
feed_condition_conditional_logicbooleanDetermines whether conditional logic is enabled for the feed.
field_map_emailintegerSpecifies the field ID used to map the email address.
field_map_namestringSpecifies the field ID used to map the name.
field_map_tagstringSpecifies the field ID used to map the tag.
conditionsstringSpecifies additional conditions for running the feed.
trial_productnullSpecifies the trial product. NULL if not applicable.
trial_amountnullDefines the trial amount. NULL if not applicable.

Custom Fields Properties

array(
    'key'          => '',
    'custom_key'   => '',
    'value'        => '',
    'custom_value' => '',
);
SettingTypeDescription
keystringThe name of the custom field.
custom_keystringCustom key if any.
valuestringThe ID of the form field or entry meta item contains this custom field’s value. Merge tags supported.
custom_valuestringCustom value for the field.