Support » Fixing WordPress » Settings API: How to save an array within an array?

  • I’m trying to implement the settings API, but I’m having some difficulty saving data to an assigned array within my setting.

    My options page has dynamically created fields that the user can add or remove using JQuery (i.e., ‘add another field’ and ‘remove this field’.) I want to save the values from those fields to an array so that I call them back with a ‘foreach’ statement.

    What it’s saving now:

    Array ( [example_text] => Default value [example_textarea] => Default value [example_jquery] => test1 [example_jquery2] => test2 [example_jquery3] => test3 [example_select] => choice1 [recrm_lead_sources] => Website Lead Circle Of Influence Past Referral [header_logo] => [favicon] => [custom_css] => )

    What I’d like it to save:

    Array ( [example_text] => Default value [example_textarea] => Default value [example_jquery] => Array ( [example_jquery1] => test1 [example_jquery2] => test2 )[example_select] => choice1 [recrm_lead_sources] => Website Lead Circle Of Influence Past Referral [header_logo] => [favicon] => [custom_css] => )

  • The topic ‘Settings API: How to save an array within an array?’ is closed to new replies.