As far WordPress is concerned – your multi-dimensional array is one option.
To update just part of the multi-dimensional array its necessary to retrieve the entire array, alter it accordingly and then update the entire array.
Suppose your multi-dimensional array is as follows:
my_options = array(
'option_a'=>'value_a',
'option_b'=>'value_b',
'inner_array'=>array(
'foo' => 'bar',
'hello' => 'world',
),
'option_c'=>'value_c'
)
And suppose you want to update the value of the ‘hello’ option from ‘world’ to ‘moon’
//Get entire array
$my_options = get_option('my_options');
//Alter the options array appropriately
$my_options['inner_array']['hello'] = 'moon';
//Update entire array
update_option('my_options', $my_options);
Related Posts:
- Make Database query only when option is updated
- Post meta vs separate database tables
- How come `wp_options` table does not have an index on `autoload`?
- What are the advantages to the Settings API?
- Adding Widget form fields dynamically
- Default table collation on plugin activation?
- Releasing new plugin version, how to rename old options keys?
- How to properly sanitize strings for update_option()
- Writing a plugin that notify my friends of new post that mentions(@) them
- Getting wrong relationship value in $args in wp_Query?
- Not sure the best way to save custom plugin data
- The ideal place for storing persistent PHP objects
- What is the correct way for plugins to create tables with special charset/collation considerations?
- What is the added “complexity” of custom tables?
- Plugin development with unit tests
- Formatting of curly brackets array from WP database to get more readable output
- How to modify post content before writing to database?
- How do I handle multiple Submit buttons in plugin’s option page?
- Deletion of shared options using uninstall.php
- Hello dolly type plugin that allows people to add their own
- Dropdown list of pages to get page id to store in plugin options
- update_option is not working!
- Custom Plugin Database relations
- Save user-specific options in WordPress admin
- How to store accumulate multiple option values in a single array using Options_API
- Creating option to allow user to select the page my plugin content will display on
- Database for development
- Is there a naming convention for database tables created by a plugin?
- WordPress plugin options and jQuery
- WordPress Plugin Setting’s POST
- Performance of several get_option() calls
- Activation hook not creating table
- Is the usage of ON DELETE CASCADE wrong or not allowed on wordpress?
- Version upgrade: can my plugin filter the SQL statements issued during a database upgrade?
- What for the tables ending with the meta used in database of wordpress?
- How to add settings subpage from a plugin to a settings page created in theme?
- Plugin options not being saved or created
- Remove Internal Style Sheet if no Value Provided?
- Get a custom table to an array
- What could cause my plugin’s options/settings page not to load?
- How to set “Site Address (URL)” programmatically on WP multisite?
- Subscribe to author?
- Using wp_parse_args to set up Plugin Default Settings
- Storing product price data in the database
- WP_Editor – Saving Value into Plugin Option – Stripping HTML
- How should I store a log for my plugin
- How to create database table, add data, update and delete using wpdb via plugins?
- Are there any scripts, classes, and/or functions built-in to WP for a plugin to export/import its saved data from wp_options?
- How to perform a heavy and long process in cron jobs?
- Insert/Update values to a table after blogname option etc. is updated
- wordpress how to query wp_options table
- How Can I add Fields in wp-option table?
- dbDelta not installing database
- Is it necessary to do validation again when retrieving data from database?
- Checked() function on a multidimensional array
- Adding columns to core tables
- How to query custom db table?
- Delete data from database using row action
- The Correct Way to Use Nonce Field without Settings API
- Using AND and bracket grouping in SQL not working
- Two different wordpress sites – same server and IP address. Gaining Access to database 1 of 2
- how to save wp_editor html content in options table
- Custom Plugin Options Won’t Update
- What might be the reason of Couldn’t fetch mysqli_result on another domain?
- Save temporary registration data
- why does get_option( ‘home’ ) not work while using in plugin [closed]
- Plugin Options not saving options and doesn’t work
- $wpdb->update Issue
- dbdelta failing with error: “WordPress database error Table ‘wp_2_myPlugin’ already exists
- Add multiple checkboxes as single field to Custom Shipping Method Settings Page
- How does one update complex options?
- Why User_login key doesn’t work with wp_update_user()
- WordPress Fatal error: Uncaught Error: Call to undefined function dbDelta()
- Plugins Settings page not updating
- Use admin-post to submit form data to external database
- How to create plugin settings page for each admin user?
- Plugin setting page – update_option problem
- WordPress doesn’t create table on plugin activation
- Insert Data into Database
- Update database record in plugin
- add_settings_error on validating plugin options API
- pull data from wordpress database
- Array/List Edit in Backend
- Ajax not working to insert, query and result data
- What should I use instead of get_blog_option?
- How to filter get_adjacent_post()?
- Tie specific functions to options-update for limiting API requests
- Can’t switch theme after activation
- the correct way to use options from settings page [closed]
- Post data in wp-admin to external database
- Saving multiple fields as array
- Options don’t save, validation callback not executed
- Modify a Themes Appearance >> Header admin screen from a plugin
- How can I get a plugin to hook ‘dbdelta_queries’ — a filter used during version update?
- Settings API not Saving to Database or Display
- Admin Message after Plugin Option Updated
- How to create a database table in WordPress using PHP
- Programmatically creating posts based on external JSON feed (asynchronously)
- Making a user platform reachable by a qr code on a pin-back-button [closed]
- multiple record insert creating many duplicate records