Changeset 2084732
- Timestamp:
- 05/09/2019 03:42:59 PM (7 years ago)
- Location:
- convertkit-gravity-forms
- Files:
-
- 16 added
- 5 edited
-
tags/1.1.0 (added)
-
tags/1.1.0/components (added)
-
tags/1.1.0/components/gravityforms (added)
-
tags/1.1.0/components/gravityforms/class-gf-convertkit.php (added)
-
tags/1.1.0/components/gravityforms/functions (added)
-
tags/1.1.0/components/gravityforms/functions/gravityforms.php (added)
-
tags/1.1.0/components/gravityforms/gravityforms.php (added)
-
tags/1.1.0/components/gravityforms/views (added)
-
tags/1.1.0/components/gravityforms/views/section.php (added)
-
tags/1.1.0/convertkit.php (added)
-
tags/1.1.0/functions (added)
-
tags/1.1.0/functions/convertkit.php (added)
-
tags/1.1.0/functions/utility.php (added)
-
tags/1.1.0/languages (added)
-
tags/1.1.0/languages/convertkit.pot (added)
-
tags/1.1.0/readme.txt (added)
-
trunk/components/gravityforms/class-gf-convertkit.php (modified) (8 diffs)
-
trunk/components/gravityforms/views/section.php (modified) (1 diff)
-
trunk/convertkit.php (modified) (3 diffs)
-
trunk/functions/convertkit.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
convertkit-gravity-forms/trunk/components/gravityforms/class-gf-convertkit.php
r1840318 r2084732 7 7 GFForms::include_feed_addon_framework(); 8 8 9 /** 10 * Class GFConvertKit 11 */ 9 12 class GFConvertKit extends GFFeedAddOn { 10 13 … … 124 127 'name' => 'n', 125 128 'label' => __( 'Name' ), 126 'required' => true,129 'required' => false, 127 130 'field_type' => '', 128 131 ), … … 131 134 ), 132 135 array( 133 'name' => 'convertkit_custom_fields',134 'label' => '',135 'type' => 'dynamic_field_map',136 'field_map' => $this->get_custom_fields(),137 'disable_custom' => true,138 ),139 array(140 136 'name' => 'conditions', 141 137 'label' => __( 'Conditional Logic' ), … … 146 142 ); 147 143 144 $base_fields = $this->maybe_add_custom_field_mapping( $base_fields ); 145 148 146 return array( $base_fields ); 149 147 } 150 148 151 149 /** 150 * If the connected account returns custom fields, add custom field mapping to the feed settings 151 * Otherwise, don't insert custom field mapping 152 * 153 * @param array $base_fields 154 * 155 * @return array 156 */ 157 public function maybe_add_custom_field_mapping( $base_fields ) { 158 $custom_mapping = array( 159 'name' => 'convertkit_custom_fields', 160 'label' => '', 161 'type' => 'dynamic_field_map', 162 'field_map' => $this->get_custom_fields(), 163 'disable_custom' => true, 164 ); 165 166 if ( $this->get_custom_fields() ) { 167 array_splice( $base_fields['fields'], 3, 0, array( $custom_mapping ) ); 168 } 169 170 return $base_fields; 171 } 172 173 /** 152 174 * Get ConvertKit Custom Fields from the API to be used for the dynamic field map 153 175 * … … 156 178 public function get_custom_fields() { 157 179 158 $path = 'custom_fields';159 $query_args = array();180 $path = 'custom_fields'; 181 $query_args = array(); 160 182 $request_body = null;