WordPress.org

Ready to get started?Download WordPress

Forums

Save multiple arrays in wp_options (2 posts)

  1. mehral
    Member
    Posted 1 year ago #

    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

  2. bcworkz
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic