Add Fominator submission value to CPT programmatically
-
correct way to get the value (1981) in the following array> Assume all fields are text in ACF since I am aware that for radio buttons etc I wili need spefic code to insert the fields into ACF
array(17) { [0]=> array(6) { ["name"]=> string(7) "radio-1" ["value"]=> string(14) "Detached-House" ["field_type"]=> string(5) "radio" ["key"]=> int(0) ["field_array"]=> array(14) { ["element_id"]=> string(7) "radio-1" ["type"]=> string(5) "radio" ["options"]=> array(4) { [0]=> array(6) { ["label"]=> string(14) "Detached House" ["value"]=> string(14) "Detached-House" ["key"]=> string(9) "6462-5239" ["image"]=> string(0) "" ["image_filename"]=> string(0) "" ["default"]=> string(0) "" } [1]=> array(4) { ["label"]=> string(18) "Apartment Building" ["value"]=> string(18) "Apartment-Building" ["key"]=> string(9) "5498-8088" ["default"]=> string(0) "" } [2]=> array(5) { ["label"]=> string(18) "Corporate Building" ["value"]=> string(18) "Corporate-Building" ["limit"]=> string(0) "" ["default"]=> string(0) "" ["key"]=> string(9) "7981-3293" } [3]=> array(5) { ["label"]=> string(5) "Other" ["value"]=> string(5) "Other" ["limit"]=> string(0) "" ["default"]=> string(0) "" ["key"]=> string(9) "6836-7194" } } ["cols"]=> string(2) "12" ["conditions"]=> array(0) { } ["wrapper_id"]=> string(17) "wrapper-6777-2173" ["value_type"]=> string(5) "radio" ["field_label"]=> string(63) "What type of property should the solar system be installed for?" ["layout"]=> string(8) "vertical" ["options_bulk_editor"]=> string(129) "Detached House;Detached-House; 0 Apartment Building;Apartment-Building; 0 Corporate Building;Corporate-Building; 0 Other;Other; 0" ["enable_images"]=> string(0) "" ["options_expanded"]=> string(1) "1" ["bulk_edit"]=> string(0) "" ["required"]=> string(1) "1" } ["form_field_obj"]=> object(Forminator_Radio)#1271 (16) { ["name"]=> string(5) "Radio" ["slug"]=> string(5) "radio" ["type"]=> string(5) "radio" ["position"]=> int(9) ["options"]=> array(0) { } ["category"]=> string(8) "standard" ["icon"]=> string(22) "sui-icon-element-radio" ["is_calculable"]=> bool(true) ["settings"]=> array(0) { } ["defaults"]=> array(0) { } ["hide_advanced"]=> bool(false) ["is_input"]=> bool(false) ["has_counter"]=> bool(false) ["is_valid"]=> bool(true) ["validation_message"]=> array(0) { } ["activated_autofill_providers":protected]=> array(0) { } } } [1]=> array(6) { ["name"]=> string(8) "number-1" ["value"]=> string(4) "1981" ["field_type"]=> string(6) "number" ["key"]=> int(3) ["field_array"]=> array(18) { ["element_id"]=> string(8) "number-1" ["type"]=> string(6) "number" ["options"]=> array(0) { } ["cols"]=> string(2) "12" ["conditions"]=> array(0) { } ["wrapper_id"]=> string(17) "wrapper-7229-8564" ["calculations"]=> string(4) "true" ["limit_min"]=> string(4) "1950" ["limit_max"]=> string(4) "2023" ["field_label"]=> string(25) "When was the house built?" ["placeholder"]=> string(0) "" ["required"]=> string(1) "1" ["limit_message"]=> string(4) "true" ["precision"]=> string(1) "0" ["limit_min_message"]=> string(42) "Please enter a year between 1950 and 2023." ["limit_max_message"]=> string(42) "Please enter a year between 1950 and 2023." ["default_value"]=> string(0) "" ["condition_action"]=> string(4) "hide" } ["form_field_obj"]=> object(Forminator_Number)#1265 (16) { ["name"]=> string(6) "Number" ["slug"]=> string(6) "number" ["type"]=> string(6) "number" ["position"]=> int(8) ["options"]=> array(0) { } ["category"]=> string(8) "standard" ["is_input"]=> bool(true) ["icon"]=> string(23) "sui-icon-element-number" ["is_calculable"]=> bool(true) ["settings"]=> array(0) { } ["defaults"]=> array(0) { } ["hide_advanced"]=> bool(false) ["has_counter"]=> bool(false) ["is_valid"]=> bool(true) ["validation_message"]=> array(0) { } ["activated_autofill_providers":protected]=> array(0) { } } } [2]=> array(6) { ["name"]=> string(7) "radio-2" ["value"]=> string(3) "Yes" ["field_type"]=> string(5) "radio" ["key"]=> int(6) ["field_array"]=> array(12) { ["element_id"]=> string(7) "radio-2" ["type"]=> string(5) "radio" ["options"]=> array(2) { [0]=> array(3) { ["label"]=> string(3) "Yes" ["value"]=> string(3) "Yes" ["key"]=> string(9) "6462-5239" } [1]=> array(3) { ["label"]=> string(2) "No" ["value"]=> string(2) "No" ["key"]=> string(9) "5498-8088" } } ["cols"]=> string(2) "12" ["conditions"]=> array(0) { } ["wrapper_id"]=> string(17) "wrapper-9379-7830" ["value_type"]=> string(5) "radio" ["field_label"]=> string(62) "Was the building permit issued before the 1st of January 2017?" ["layout"]=> string(8) "vertical" ["options_bulk_editor"]=> string(19) "Yes;Yes; 0 No;No; 0" ["formid"]=> string(17) "wrapper-9379-7830" ["required"]=> string(1) "1" } ["form_field_obj"]=> object(Forminator_Radio)#1271 (16) { ["name"]=> string(5) "Radio" ["slug"]=> string(5) "radio" ["type"]=> string(5) "radio" ["position"]=> int(9) ["options"]=> array(0) { } ["category"]=> string(8) "standard" ["icon"]=> string(22) "sui-icon-element-radio" ["is_calculable"]=> bool(true) ["settings"]=> array(0) { } ["defaults"]=> array(0) { } ["hide_advanced"]=> bool(false) ["is_input"]=> bool(false) ["has_counter"]=> bool(false) ["is_valid"]=> bool(true) ["validation_message"]=> array(0) { } ["activated_autofill_providers":protected]=> array(0) { } } } [3]=> array(6) { ["name"]=> string(7) "radio-3" ["value"]=> string(22) "On the building's roof" ["field_type"]=> string(5) "radio" ["key"]=> int(8) ["field_array"]=> array(14) { ["element_id"]=> string(7) "radio-3" ["type"]=> string(5) "radio" ["options"]=> array(3) { [0]=> array(6) { ["key"]=> string(9) "8437-6743" ["label"]=> string(22) "On the building's roof" ["value"]=> string(22) "On the building's roof" ["default"]=> string(0) "" ["image"]=> string(84) "https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/On-the-buildings-roof.jpg" ["image_filename"]=> string(0) "" } [1]=> array(6) { ["key"]=> string(9) "3713-6701" ["label"]=> string(34) "On the ground at the same property" ["value"]=> string(34) "On the ground at the same property" ["default"]=> string(0) "" ["image"]=> string(97) "https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/On-the-ground-at-the-same-property.jpg" ["image_filename"]=> string(0) "" } [2]=> array(6) { ["key"]=> string(9) "1572-2119" ["label"]=> string(37) "On the ground at a different property" ["value"]=> string(37) "On the ground at a different property" ["default"]=> string(0) "" ["image"]=> string(100) "https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/On-the-ground-at-a-different-property.jpg" ["image_filename"]=> string(0) "" } } ["cols"]=> string(2) "12" ["conditions"]=> array(0) { } ["wrapper_id"]=> string(17) "wrapper-6106-5327" ["value_type"]=> string(5) "radio" ["field_label"]=> string(46) "Where do you want to install the solar panels?" ["layout"]=> string(8) "vertical" ["options_bulk_editor"]=> string(487) "On the building's roof;On the building's roof; 0; https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/On-the-buildings-roof.jpg On the ground at the same property;On the ground at the same property; 0; https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/On-the-ground-at-the-same-property.jpg On the ground at a different property;On the ground at a different property; 0; https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/On-the-ground-at-a-different-property.jpg" ["bulk_edit"]=> string(0) "" ["options_expanded"]=> string(1) "1" ["required"]=> string(1) "1" ["enable_images"]=> string(1) "1" } ["form_field_obj"]=> object(Forminator_Radio)#1271 (16) { ["name"]=> string(5) "Radio" ["slug"]=> string(5) "radio" ["type"]=> string(5) "radio" ["position"]=> int(9) ["options"]=> array(0) { } ["category"]=> string(8) "standard" ["icon"]=> string(22) "sui-icon-element-radio" ["is_calculable"]=> bool(true) ["settings"]=> array(0) { } ["defaults"]=> array(0) { } ["hide_advanced"]=> bool(false) ["is_input"]=> bool(false) ["has_counter"]=> bool(false) ["is_valid"]=> bool(true) ["validation_message"]=> array(0) { } ["activated_autofill_providers":protected]=> array(0) { } } } [4]=> array(6) { ["name"]=> string(7) "radio-4" ["value"]=> string(12) "Single Story" ["field_type"]=> string(5) "radio" ["key"]=> int(10) ["field_array"]=> array(15) { ["element_id"]=> string(7) "radio-4" ["type"]=> string(5) "radio" ["options"]=> array(4) { [0]=> array(6) { ["key"]=> string(9) "5339-1046" ["label"]=> string(12) "Single Story" ["value"]=> string(12) "Single Story" ["default"]=> string(0) "" ["image"]=> string(84) "https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/story-single-02d76dd0.png" ["image_filename"]=> string(0) "" } [1]=> array(6) { ["key"]=> string(9) "6044-9245" ["label"]=> string(7) "2 Story" ["value"]=> string(7) "2 Story" ["default"]=> string(0) "" ["image"]=> string(79) "https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/story-2-990cf5fd.png" ["image_filename"]=> string(0) "" } [2]=> array(6) { ["key"]=> string(9) "5220-7974" ["label"]=> string(7) "3 Story" ["value"]=> string(7) "3 Story" ["default"]=> string(0) "" ["image"]=> string(79) "https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/story-3-403317c0.png" ["image_filename"]=> string(0) "" } [3]=> array(6) { ["key"]=> string(9) "8438-3909" ["label"]=> string(9) "4+ Story"" ["value"]=> string(9) "4+ Story"" ["default"]=> string(0) "" ["image"]=> string(84) "https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/story-4-plus-6893e8b8.png" ["image_filename"]=> string(0) "" } } ["cols"]=> string(2) "12" ["conditions"]=> array(1) { [0]=> array(3) { ["element_id"]=> string(7) "radio-3" ["rule"]=> string(2) "is" ["value"]=> string(22) "On the building's roof" } } ["wrapper_id"]=> string(17) "wrapper-7703-4965" ["value_type"]=> string(5) "radio" ["field_label"]=> string(34) "How many stories is your building?" ["layout"]=> string(8) "vertical" ["options_bulk_editor"]=> string(423) "Single Story;Single Story; 0; https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/story-single-02d76dd0.png 2 Story;2 Story; 0; https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/story-2-990cf5fd.png 3 Story;3 Story; 0; https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/story-3-403317c0.png 4+ Story";4+ Story"; 0; https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/story-4-plus-6893e8b8.png" ["bulk_edit"]=> string(0) "" ["required"]=> string(1) "1" ["enable_images"]=> string(1) "1" ["options_expanded"]=> string(1) "1" ["condition_action"]=> string(4) "show" } ["form_field_obj"]=> object(Forminator_Radio)#1271 (16) { ["name"]=> string(5) "Radio" ["slug"]=> string(5) "radio" ["type"]=> string(5) "radio" ["position"]=> int(9) ["options"]=> array(0) { } ["category"]=> string(8) "standard" ["icon"]=> string(22) "sui-icon-element-radio" ["is_calculable"]=> bool(true) ["settings"]=> array(0) { } ["defaults"]=> array(0) { } ["hide_advanced"]=> bool(false) ["is_input"]=> bool(false) ["has_counter"]=> bool(false) ["is_valid"]=> bool(true) ["validation_message"]=> array(0) { } ["activated_autofill_providers":protected]=> array(0) { } } } [5]=> array(6) { ["name"]=> string(7) "radio-5" ["value"]=> string(19) "Plain concrete roof" ["field_type"]=> string(5) "radio" ["key"]=> int(12) ["field_array"]=> array(14) { ["element_id"]=> string(7) "radio-5" ["type"]=> string(5) "radio" ["options"]=> array(4) { [0]=> array(4) { ["key"]=> string(9) "8455-7222" ["label"]=> string(19) "Plain concrete roof" ["value"]=> string(19) "Plain concrete roof" ["default"]=> string(0) "" } [1]=> array(4) { ["key"]=> string(9) "6565-6719" ["label"]=> string(30) "Tiles with concrete underneath" ["value"]=> string(30) "Tiles with concrete underneath" ["default"]=> string(0) "" } [2]=> array(4) { ["key"]=> string(9) "9077-8469" ["label"]=> string(34) "Tiles with wooden beams underneath" ["value"]=> string(34) "Tiles with wooden beams underneath" ["default"]=> string(0) "" } [3]=> array(4) { ["key"]=> string(9) "3784-1960" ["label"]=> string(8) "Not sure" ["value"]=> string(8) "Not sure" ["default"]=> string(0) "" } } ["cols"]=> string(2) "12" ["conditions"]=> array(0) { } ["wrapper_id"]=> string(17) "wrapper-7765-6689" ["value_type"]=> string(5) "radio" ["field_label"]=> string(45) "What is the type of the roof on the building?" ["layout"]=> string(8) "vertical" ["options_bulk_editor"]=> string(94) "Plain concrete roof Tiles with concrete underneath Tiles with wooden beams underneath Not sure" ["bulk_edit"]=> string(0) "" ["enable_images"]=> string(0) "" ["options_expanded"]=> string(1) "1" ["required"]=> string(1) "1" } ["form_field_obj"]=> object(Forminator_Radio)#1271 (16) { ["name"]=> string(5) "Radio" ["slug"]=> string(5) "radio" ["type"]=> string(5) "radio" ["position"]=> int(9) ["options"]=> array(0) { } ["category"]=> string(8) "standard" ["icon"]=> string(22) "sui-icon-element-radio" ["is_calculable"]=> bool(true) ["settings"]=> array(0) { } ["defaults"]=> array(0) { } ["hide_advanced"]=> bool(false) ["is_input"]=> bool(false) ["has_counter"]=> bool(false) ["is_valid"]=> bool(true) ["validation_message"]=> array(0) { } ["activated_autofill_providers":protected]=> array(0) { } } } [6]=> array(6) { ["name"]=> string(7) "radio-6" ["value"]=> string(5) "South" ["field_type"]=> string(5) "radio" ["key"]=> int(14) ["field_array"]=> array(15) { ["element_id"]=> string(7) "radio-6" ["type"]=> string(5) "radio" ["options"]=> array(5) { [0]=> array(6) { ["key"]=> string(9) "5358-8392" ["label"]=> string(5) "South" ["value"]=> string(5) "South" ["default"]=> string(0) "" ["image"]=> string(68) "https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/South.jpg" ["image_filename"]=> string(0) "" } [1]=> array(6) { ["key"]=> string(9) "1279-7071" ["label"]=> string(9) "SouthEast" ["value"]=> string(9) "SouthEast" ["default"]=> string(0) "" ["image"]=> string(72) "https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/SouthEast.jpg" ["image_filename"]=> string(0) "" } [2]=> array(6) { ["key"]=> string(9) "1946-7967" ["label"]=> string(4) "East" ["value"]=> string(4) "East" ["default"]=> string(0) "" ["image"]=> string(67) "https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/East.jpg" ["image_filename"]=> string(0) "" } [3]=> array(6) { ["key"]=> string(9) "4669-2393" ["label"]=> string(9) "SouthWest" ["value"]=> string(9) "SouthWest" ["default"]=> string(0) "" ["image"]=> string(72) "https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/SouthWest.jpg" ["image_filename"]=> string(0) "" } [4]=> array(6) { ["key"]=> string(9) "5595-4526" ["label"]=> string(4) "West" ["value"]=> string(4) "West" ["default"]=> string(0) "" ["image"]=> string(67) "https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/West.jpg" ["image_filename"]=> string(0) "" } } ["cols"]=> string(2) "12" ["conditions"]=> array(0) { } ["wrapper_id"]=> string(17) "wrapper-2440-9149" ["value_type"]=> string(5) "radio" ["field_label"]=> string(45) "In which direction is your roof area aligned?" ["layout"]=> string(8) "vertical" ["options_bulk_editor"]=> string(442) "South;South; 0; https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/South.jpg SouthEast;SouthEast; 0; https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/SouthEast.jpg East;East; 0; https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/East.jpg SouthWest;SouthWest; 0; https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/SouthWest.jpg West;West; 0; https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/West.jpg" ["bulk_edit"]=> string(0) "" ["enable_images"]=> string(1) "1" ["options_expanded"]=> string(1) "1" ["formid"]=> string(17) "wrapper-8830-1792" ["required"]=> string(1) "1" } ["form_field_obj"]=> object(Forminator_Radio)#1271 (16) { ["name"]=> string(5) "Radio" ["slug"]=> string(5) "radio" ["type"]=> string(5) "radio" ["position"]=> int(9) ["options"]=> array(0) { } ["category"]=> string(8) "standard" ["icon"]=> string(22) "sui-icon-element-radio" ["is_calculable"]=> bool(true) ["settings"]=> array(0) { } ["defaults"]=> array(0) { } ["hide_advanced"]=> bool(false) ["is_input"]=> bool(false) ["has_counter"]=> bool(false) ["is_valid"]=> bool(true) ["validation_message"]=> array(0) { } ["activated_autofill_providers":protected]=> array(0) { } } } [7]=> array(6) { ["name"]=> string(7) "radio-7" ["value"]=> string(13) "Minor repairs" ["field_type"]=> string(5) "radio" ["key"]=> int(16) ["field_array"]=> array(14) { ["element_id"]=> string(7) "radio-7" ["type"]=> string(5) "radio" ["options"]=> array(4) { [0]=> array(6) { ["key"]=> string(9) "9411-9383" ["label"]=> string(12) "Roof is fine" ["value"]=> string(12) "Roof is fine" ["default"]=> string(0) "" ["image"]=> string(93) "https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/roof_condition_good-6e8e4562-1.png" ["image_filename"]=> string(0) "" } [1]=> array(6) { ["key"]=> string(9) "9371-6127" ["label"]=> string(13) "Minor repairs" ["value"]=> string(13) "Minor repairs" ["default"]=> string(0) "" ["image"]=> string(99) "https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/roof_condition_needs_repair-5e6e8ec7.png" ["image_filename"]=> string(0) "" } [2]=> array(6) { ["key"]=> string(9) "6842-9645" ["label"]=> string(15) "Need to re-roof" ["value"]=> string(15) "Need to re-roof" ["default"]=> string(0) "" ["image"]=> string(93) "https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/roof_condition_reroof-1f1f3db7.png" ["image_filename"]=> string(0) "" } [3]=> array(6) { ["key"]=> string(9) "4534-6909" ["label"]=> string(6) "Unsure" ["value"]=> string(6) "Unsure" ["default"]=> string(0) "" ["image"]=> string(93) "https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/roof_condition_unsure-f5dfac08.png" ["image_filename"]=> string(0) "" } } ["cols"]=> string(2) "12" ["conditions"]=> array(0) { } ["wrapper_id"]=> string(17) "wrapper-6951-3133" ["value_type"]=> string(5) "radio" ["field_label"]=> string(37) "Are roof repairs needed before solar?" ["layout"]=> string(8) "vertical" ["options_bulk_editor"]=> string(497) "Roof is fine;Roof is fine; 0; https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/roof_condition_good-6e8e4562-1.png Minor repairs;Minor repairs; 0; https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/roof_condition_needs_repair-5e6e8ec7.png Need to re-roof;Need to re-roof; 0; https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/roof_condition_reroof-1f1f3db7.png Unsure;Unsure; 0; https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/roof_condition_unsure-f5dfac08.png" ["required"]=> string(1) "1" ["bulk_edit"]=> string(0) "" ["enable_images"]=> string(1) "1" ["options_expanded"]=> string(1) "1" } ["form_field_obj"]=> object(Forminator_Radio)#1271 (16) { ["name"]=> string(5) "Radio" ["slug"]=> string(5) "radio" ["type"]=> string(5) "radio" ["position"]=> int(9) ["options"]=> array(0) { } ["category"]=> string(8) "standard" ["icon"]=> string(22) "sui-icon-element-radio" ["is_calculable"]=> bool(true) ["settings"]=> array(0) { } ["defaults"]=> array(0) { } ["hide_advanced"]=> bool(false) ["is_input"]=> bool(false) ["has_counter"]=> bool(false) ["is_valid"]=> bool(true) ["validation_message"]=> array(0) { } ["activated_autofill_providers":protected]=> array(0) { } } } [8]=> array(6) { ["name"]=> string(9) "address-1" ["value"]=> array(6) { ["street_address"]=> string(17) "Alexandou Papagou" ["address_line"]=> string(2) "54" ["city"]=> string(6) "Paphos" ["state"]=> string(3) "N/A" ["zip"]=> string(4) "8027" ["country"]=> string(6) "Cyprus" } ["field_type"]=> string(7) "address" ["key"]=> int(18) ["field_array"]=> array(29) { ["element_id"]=> string(9) "address-1" ["type"]=> string(7) "address" ["options"]=> array(0) { } ["cols"]=> string(2) "12" ["conditions"]=> array(0) { } ["wrapper_id"]=> string(17) "wrapper-6184-4204" ["street_address"]=> string(4) "true" ["address_city"]=> string(4) "true" ["address_state"]=> string(1) "1" ["address_zip"]=> string(4) "true" ["address_country"]=> string(4) "true" ["address_line"]=> string(4) "true" ["street_address_label"]=> string(14) "Street Address" ["street_address_placeholder"]=> string(19) "E.g. 42 Wallaby Way" ["address_city_label"]=> string(4) "City" ["address_city_placeholder"]=> string(11) "E.g. Sydney" ["address_state_label"]=> string(14) "State/Province" ["address_state_placeholder"]=> string(20) "E.g. New South Wales" ["address_zip_label"]=> string(17) "ZIP / Postal Code" ["address_zip_placeholder"]=> string(9) "E.g. 2000" ["address_country_label"]=> string(7) "Country" ["address_line_label"]=> string(21) "Apartment, suite, etc" ["street_address_required_message"]=> string(56) "This field is required. Please enter the street address." ["address_zip_required_message"]=> string(50) "This field is required. Please enter the zip code." ["address_country_required_message"]=> string(50) "This field is required. Please select the country." ["address_city_required_message"]=> string(46) "This field is required. Please enter the city." ["address_state_required_message"]=> string(47) "This field is required. Please enter the state." ["address_line_required_message"]=> string(50) "This field is required. Please enter address line." ["street_address_required"]=> string(1) "1" } ["form_field_obj"]=> object(Forminator_Address)#1252 (16) { ["name"]=> string(7) "Address" ["slug"]=> string(7) "address" ["position"]=> int(4) ["type"]=> string(7) "address" ["options"]=> array(0) { } ["category"]=> string(8) "standard" ["icon"]=> string(12) "sui-icon-pin" ["settings"]=> array(0) { } ["defaults"]=> array(0) { } ["hide_advanced"]=> bool(false) ["is_input"]=> bool(false) ["has_counter"]=> bool(false) ["is_valid"]=> bool(true) ["validation_message"]=> array(0) { } ["activated_autofill_providers":protected]=> array(0) { } ["is_calculable"]=> bool(false) } } [9]=> array(6) { ["name"]=> string(8) "hidden-1" ["value"]=> string(69) "https://www.google.com/maps/search/?api=1&query=34.9536256,33.5609856" ["field_type"]=> string(6) "hidden" ["key"]=> int(21) ["field_array"]=> array(9) { ["element_id"]=> string(8) "hidden-1" ["type"]=> string(6) "hidden" ["options"]=> array(0) { } ["cols"]=> string(1) "6" ["conditions"]=> array(0) { } ["wrapper_id"]=> string(17) "wrapper-5454-9628" ["field_label"]=> string(0) "" ["default_value"]=> string(12) "custom_value" ["custom_value"]=> string(0) "" } ["form_field_obj"]=> object(Forminator_Hidden)#1261 (16) { ["name"]=> string(12) "Hidden Field" ["slug"]=> string(6) "hidden" ["type"]=> string(6) "hidden" ["position"]=> int(19) ["options"]=> array(0) { } ["category"]=> string(8) "standard" ["hide_advanced"]=> string(4) "true" ["icon"]=> string(17) "sui-icon-eye-hide" ["settings"]=> array(0) { } ["defaults"]=> array(0) { } ["is_input"]=> bool(false) ["has_counter"]=> bool(false) ["is_valid"]=> bool(true) ["validation_message"]=> array(0) { } ["activated_autofill_providers":protected]=> array(0) { } ["is_calculable"]=> bool(false) } } [10]=> array(6) { ["name"]=> string(8) "radio-10" ["value"]=> string(3) "EAC" ["field_type"]=> string(5) "radio" ["key"]=> int(23) ["field_array"]=> array(13) { ["element_id"]=> string(8) "radio-10" ["type"]=> string(5) "radio" ["options"]=> array(1) { [0]=> array(6) { ["label"]=> string(3) "EAC" ["value"]=> string(3) "EAC" ["key"]=> string(9) "6196-2372" ["default"]=> string(1) "1" ["image"]=> string(73) "https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/Cyprus-EAC.png" ["image_filename"]=> string(0) "" } } ["cols"]=> string(2) "12" ["conditions"]=> array(0) { } ["wrapper_id"]=> string(17) "wrapper-4791-8585" ["value_type"]=> string(5) "radio" ["field_label"]=> string(25) "Your utility provider is:" ["layout"]=> string(8) "vertical" ["options_bulk_editor"]=> string(85) "EAC;EAC; 1; https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/Cyprus-EAC.png" ["enable_images"]=> string(1) "1" ["options_expanded"]=> string(1) "1" ["input_visibility"]=> string(5) "false" } ["form_field_obj"]=> object(Forminator_Radio)#1271 (16) { ["name"]=> string(5) "Radio" ["slug"]=> string(5) "radio" ["type"]=> string(5) "radio" ["position"]=> int(9) ["options"]=> array(0) { } ["category"]=> string(8) "standard" ["icon"]=> string(22) "sui-icon-element-radio" ["is_calculable"]=> bool(true) ["settings"]=> array(0) { } ["defaults"]=> array(0) { } ["hide_advanced"]=> bool(false) ["is_input"]=> bool(false) ["has_counter"]=> bool(false) ["is_valid"]=> bool(true) ["validation_message"]=> array(0) { } ["activated_autofill_providers":protected]=> array(0) { } } } [11]=> array(6) { ["name"]=> string(7) "radio-8" ["value"]=> string(7) "1-phase" ["field_type"]=> string(5) "radio" ["key"]=> int(24) ["field_array"]=> array(13) { ["element_id"]=> string(7) "radio-8" ["type"]=> string(5) "radio" ["options"]=> array(3) { [0]=> array(5) { ["key"]=> string(9) "2820-2774" ["label"]=> string(7) "1-phase" ["value"]=> string(7) "1-phase" ["default"]=> string(0) "" ["calculation"]=> string(1) "1" } [1]=> array(5) { ["key"]=> string(9) "5581-1410" ["label"]=> string(7) "3-phase" ["value"]=> string(7) "3-phase" ["default"]=> string(0) "" ["calculation"]=> string(1) "3" } [2]=> array(5) { ["key"]=> string(9) "1021-6412" ["label"]=> string(8) "Not sure" ["value"]=> string(8) "Not sure" ["default"]=> string(0) "" ["calculation"]=> string(1) "0" } } ["cols"]=> string(2) "12" ["conditions"]=> array(0) { } ["wrapper_id"]=> string(17) "wrapper-4049-7014" ["value_type"]=> string(5) "radio" ["field_label"]=> string(39) "What is the EAC electricity connection?" ["layout"]=> string(8) "vertical" ["options_bulk_editor"]=> string(24) "1-phase 3-phase Not sure" ["bulk_edit"]=> string(1) "1" ["required"]=> string(1) "1" ["calculations"]=> string(4) "true" } ["form_field_obj"]=> object(Forminator_Radio)#1271 (16) { ["name"]=> string(5) "Radio" ["slug"]=> string(5) "radio" ["type"]=> string(5) "radio" ["position"]=> int(9) ["options"]=> array(0) { } ["category"]=> string(8) "standard" ["icon"]=> string(22) "sui-icon-element-radio" ["is_calculable"]=> bool(true) ["settings"]=> array(0) { } ["defaults"]=> array(0) { } ["hide_advanced"]=> bool(false) ["is_input"]=> bool(false) ["has_counter"]=> bool(false) ["is_valid"]=> bool(true) ["validation_message"]=> array(0) { } ["activated_autofill_providers":protected]=> array(0) { } } } [12]=> array(6) { ["name"]=> string(7) "radio-9" ["value"]=> string(68) "On the building: On the external side of one of the building's walls" ["field_type"]=> string(5) "radio" ["key"]=> int(26) ["field_array"]=> array(14) { ["element_id"]=> string(7) "radio-9" ["type"]=> string(5) "radio" ["options"]=> array(2) { [0]=> array(6) { ["key"]=> string(9) "8071-5833" ["label"]=> string(68) "On the building: On the external side of one of the building's walls" ["value"]=> string(68) "On the building: On the external side of one of the building's walls" ["default"]=> string(0) "" ["image"]=> string(129) "https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/On-the-building-On-the-external-side-of-one-of-the-buildings-walls.jpg" ["image_filename"]=> string(0) "" } [1]=> array(6) { ["key"]=> string(9) "6814-3722" ["label"]=> string(48) "Not on the building: In a room/box near the road" ["value"]=> string(48) "Not on the building: In a room/box near the road" ["default"]=> string(0) "" ["image"]=> string(109) "https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/Not-on-the-building-In-a-roombox-near-the-road.jpg" ["image_filename"]=> string(0) "" } } ["cols"]=> string(2) "12" ["conditions"]=> array(0) { } ["wrapper_id"]=> string(17) "wrapper-2429-2780" ["value_type"]=> string(5) "radio" ["field_label"]=> string(29) "Where is the EAC box located?" ["layout"]=> string(8) "vertical" ["options_bulk_editor"]=> string(483) "On the building: On the external side of one of the building's walls;On the building: On the external side of one of the building's walls; 0; https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/On-the-building-On-the-external-side-of-one-of-the-buildings-walls.jpg Not on the building: In a room/box near the road;Not on the building: In a room/box near the road; 0; https://georgiosn44.sg-host.com/wp-content/uploads/2022/06/Not-on-the-building-In-a-roombox-near-the-road.jpg" ["bulk_edit"]=> string(0) "" ["enable_images"]=> string(1) "1" ["options_expanded"]=> string(1) "1" ["required"]=> string(1) "1" } ["form_field_obj"]=> object(Forminator_Radio)#1271 (16) { ["name"]=> string(5) "Radio" ["slug"]=> string(5) "radio" ["type"]=> string(5) "radio" ["position"]=> int(9) ["options"]=> array(0) { } ["category"]=> string(8) "standard" ["icon"]=> string(22) "sui-icon-element-radio" ["is_calculable"]=> bool(true) ["settings"]=> array(0) { } ["defaults"]=> array(0) { } ["hide_advanced"]=> bool(false) ["is_input"]=> bool(false) ["has_counter"]=> bool(false) ["is_valid"]=> bool(true) ["validation_message"]=> array(0) { } ["activated_autofill_providers":protected]=> array(0) { } } } [13]=> array(6) { ["name"]=> string(8) "number-2" ["value"]=> string(5) "15000" ["field_type"]=> string(6) "number" ["key"]=> int(28) ["field_array"]=> array(15) { ["element_id"]=> string(8) "number-2" ["type"]=> string(6) "number" ["options"]=> array(0) { } ["cols"]=> string(2) "12" ["conditions"]=> array(0) { } ["wrapper_id"]=> string(17) "wrapper-8254-4969" ["calculations"]=> string(4) "true" ["limit_min"]=> string(4) "1000" ["limit_max"]=> string(0) "" ["field_label"]=> string(52) "What is your average annual electricity consumption?" ["placeholder"]=> string(0) "" ["limit_message"]=> string(5) "false" ["limit_min_message"]=> string(0) "" ["precision"]=> string(1) "0" ["required"]=> string(1) "1" } ["form_field_obj"]=> object(Forminator_Number)#1265 (16) { ["name"]=> string(6) "Number" ["slug"]=> string(6) "number" ["type"]=> string(6) "number" ["position"]=> int(8) ["options"]=> array(0) { } ["category"]=> string(8) "standard" ["is_input"]=> bool(true) ["icon"]=> string(23) "sui-icon-element-number" ["is_calculable"]=> bool(true) ["settings"]=> array(0) { } ["defaults"]=> array(0) { } ["hide_advanced"]=> bool(false) ["has_counter"]=> bool(false) ["is_valid"]=> bool(true) ["validation_message"]=> array(0) { } ["activated_autofill_providers":protected]=> array(0) { } } } [14]=> array(6) { ["name"]=> string(7) "phone-1" ["value"]=> string(8) "99313550" ["field_type"]=> string(5) "phone" ["key"]=> int(31) ["field_array"]=> array(12) { ["element_id"]=> string(7) "phone-1" ["type"]=> string(5) "phone" ["options"]=> array(0) { } ["cols"]=> string(2) "12" ["conditions"]=> array(0) { } ["wrapper_id"]=> string(17) "wrapper-3791-7774" ["required"]=> string(1) "1" ["limit"]=> string(2) "10" ["limit_type"]=> string(10) "characters" ["validation"]=> string(4) "none" ["field_label"]=> string(5) "Phone" ["placeholder"]=> string(20) "E.g. +1 300 400 5000" } ["form_field_obj"]=> object(Forminator_Phone)#1269 (16) { ["name"]=> string(5) "Phone" ["slug"]=> string(5) "phone" ["position"]=> int(3) ["type"]=> string(5) "phone" ["options"]=> array(0) { } ["category"]=> string(8) "standard" ["is_input"]=> bool(true) ["has_counter"]=> bool(true) ["icon"]=> string(14) "sui-icon-phone" ["settings"]=> array(0) { } ["defaults"]=> array(0) { } ["hide_advanced"]=> bool(false) ["is_valid"]=> bool(true) ["validation_message"]=> array(0) { } ["activated_autofill_providers":protected]=> array(0) { } ["is_calculable"]=> bool(false) } } [15]=> array(6) { ["name"]=> string(9) "consent-1" ["value"]=> string(7) "checked" ["field_type"]=> string(7) "consent" ["key"]=> int(32) ["field_array"]=> array(10) { ["element_id"]=> string(9) "consent-1" ["type"]=> string(7) "consent" ["options"]=> array(0) { } ["cols"]=> string(2) "12" ["conditions"]=> array(0) { } ["wrapper_id"]=> string(17) "wrapper-5631-7657" ["required"]=> string(4) "true" ["field_label"]=> string(7) "Consent" ["consent_description"]=> string(145) " I consent to the use of my data as described in the privacy policy and to be contacted accordingly (Cancellation is possible at any time). " ["required_message"]=> string(40) "This field is required. Please check it." } ["form_field_obj"]=> object(Forminator_Consent)#1255 (16) { ["name"]=> string(7) "Consent" ["slug"]=> string(7) "consent" ["type"]=> string(7) "consent" ["position"]=> int(21) ["options"]=> array(0) { } ["category"]=> string(8) "standard" ["icon"]=> string(13) "sui-icon-gdpr" ["settings"]=> array(0) { } ["defaults"]=> array(0) { } ["hide_advanced"]=> bool(false) ["is_input"]=> bool(false) ["has_counter"]=> bool(false) ["is_valid"]=> bool(true) ["validation_message"]=> array(0) { } ["activated_autofill_providers":protected]=> array(0) { } ["is_calculable"]=> bool(false) } } [16]=> array(2) { ["name"]=> string(19) "_forminator_user_ip" ["value"]=> string(13) "31.153.102.19" } } The code I wrote to add the sumbition vlaue to a CPT is as follows add_filter('forminator_custom_form_submit_field_data', 'custom_form_submit', 11, 2); function custom_form_submit($field_data_array, $form_id){ $form_id = "49"; //set id for form // Create post object $mydate = date("Y-m-d H:i:s"); $my_post = array( 'post_title' => wp_get_current_user()->user_login.' - '. $mydate, 'post_content' => '', 'post_status' => 'draft', 'post_author' => get_current_user_id(), 'post_type'=> 'offers', 'post_category' => array( 12 ) ); //echo("<script>console.log('PHP: " . var_dump($field_data_array) . "');</script>"); //echo("<script>console.log('PHP: " . $field_data_array ."');</script>"); // Insert the post into the database $post_id = wp_insert_post( $my_post ); $normal_array = array_values($field_data_array); $becool='<pre>'.var_dump($field_data_array).'</pre>'; echo("<script>console.log('PHP: " . $becool . "');</script>"); update_field('field_62d29fdf92a7d', $normal_array['name']['number-1']['value'],$post_id); //Todo: some code return $field_data_array; }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Add Fominator submission value to CPT programmatically’ is closed to new replies.