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
- framework for plugin/theme options panel? [closed]
- Post meta vs separate database tables
- How do I add CSS options to my plugin without using inline styles?
- “Error: Options Page Not Found” on Settings Page Submission for an OOP Plugin
- Is it mandatory to use $wpdb->prefix in custom tables
- Is get_option function cached?
- 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
- Where to store plugin settings fields
- Is get_option() faster than accessing get_transient()?
- Default table collation on plugin activation?
- What’s the best method for emptying an option created with the Settings API?
- Releasing new plugin version, how to rename old options keys?
- Using a database view = evil incarnate?
- WordPress updates defined vs add_filter?
- Creating Settings Page with dropdowns for Plugin
- 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?
- WordPress and multithreading
- How to add a new plugin page under desired Options page?
- 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
- How is the data stored in the database?
- Formatting of curly brackets array from WP database to get more readable output
- How to modify post content before writing to database?
- Actions or filters fired when data is saved in a custom table
- How do I handle multiple Submit buttons in plugin’s option page?
- Deletion of shared options using uninstall.php
- Why won’t register_setting() create a setting?
- Multiple entries in get_option results? or why is _multiwidget set to 1?
- 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!
- update_option_{$option} Too Few Arguments
- Sample — test — data for large WordPress install
- 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
- Is there any reason only 1 (my) IP would be added to this table using $wpdn->insert?
- Creating option to allow user to select the page my plugin content will display on
- How to store data for posts/pages built with drag-n-drop builder?
- Database for development
- Unified Approach for Placing Option Pages
- array_map() for sanitizing $_POST
- 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
- Extend plugin options page
- Activation hook not creating table
- Is the usage of ON DELETE CASCADE wrong or not allowed on wordpress?
- Can I use the different settings sections over different pages using the save options group?
- Options API – Validation Callback $input is NULL
- Version upgrade: can my plugin filter the SQL statements issued during a database upgrade?
- Saving data from block editor to the database
- Best choice of options/settings framework for plugin/theme development
- What for the tables ending with the meta used in database of wordpress?
- Correct way check nonce (security) using old Options API
- Creating table with plugin is not working
- How to store a medium amount of options?
- dbDelta() Error – Incorrect index name ” for query ALTER TABLE
- 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
- Default Plugin Settings Not Writing to Database
- What could cause my plugin’s options/settings page not to load?
- How to set “Site Address (URL)” programmatically on WP multisite?
- Update/insert only a column of database table
- WordPress setting with select – where is my mistake?
- How to Create database table when Plugin installed/activated, and delete database when Plugin deleted
- Subscribe to author?
- Using wp_parse_args to set up Plugin Default Settings
- I’m designing a plugin to create database indexes. Suggestions?
- WordPress database error for query INSERT INTO
- How to connect to AWS RDS external database (not for the core WordPress db)
- Custom delete option button in plugin settings
- Storing product price data in the database
- How To Change Post Author Default?
- 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?
- Editing options pages?
- Using WPDB to output raw XML fails because of wp-blog-header.php
- Are there any scripts, classes, and/or functions built-in to WP for a plugin to export/import its saved data from wp_options?
- Multiple options pages validation for a plugin
- Strange issue saving custom field data for a WooCommerce order
- How to perform a heavy and long process in cron jobs?
- Form doesnt save to database
- Updating Woocommerce Settings API when WordPress Settings API saved and vise versa
- get_option() not returning expected value from plugin
- Parse form values before sending to options.php
- Is using custom table to suit business needs instead of transients a big hit to page load speed?
- Prevent invalid or empty values from being saved to the database and retain the form field values upon error