Quick question. Help me save my theme options. (2 posts)

  1. Sisir
    Posted 5 years ago #

    Hi, let i have a theme option named 'option' now i want to assign a array in it from some text input generated my jquery. now how do i update the theme option to save the content of the fields to the 'option' like this:

    'option' = array('option 1', 'option 2', etc...);

    simple to understand but if you want more code example i can give details.

  2. Sisir
    Posted 5 years ago #

    Hi, i figured out how to do it :)
    <input type="text" size="25" name="<?php echo '[home_slides][]'; ?>" value="<?php echo $slide; ?>" />
    here 'home_slides' is the theme option which is an array. the text area will be added if we add the text input name like this [home_slides][]. But this way the content of the array will be like this:

           0=>'value 0',
           1=>'value 1',
           2=>'value 2'

    But i was wondering if anyone know if there is a way to insert the data into keys to. So, the new plan is to insert text to keys and value from two text field.


    let me know if you have any idea. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic