Support » Plugins and Hacks » Hacks » Save multiple arrays in wp_options

  • Hello everyone, I wondering to create a menu page for Elastic slideshows to add some date for each image in Elastice slideshows, but the question is how can I save multiple arrays in “ wp_options” alike below images ( I made necessary function for increasing index in name value for creating a new array item )
    name=”mf_eis_add_options[‘.$index.’][‘.$name.’]”

    Images One : first datas that I have added to wp_options

    item one

    Images Two : and the second datas

    item two

    Images Three: this is what I want it.
    final

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    I’m not sure what you’re doing, but it’s fairly clear what you want. For each image, do something like this:

    $image_data[] = array( 'h2'=> 'Main Title',
      'h3'=>'Sub Title',
      'url'=>'http://sample.com/slide.jpg',
      'thumb'=>'http://sample.com/thumbs/slide.jpg');

    $image_data will eventually have all the data for the whole slideshow. If you need to add data to information already stored in a table, you should retrieve the existing data before adding to it. Then everything can overwrite the old data.

Viewing 1 replies (of 1 total)
  • The topic ‘Save multiple arrays in wp_options’ is closed to new replies.