I think changing array keys is more of a PHP problem
// Get entire array
$plugin_options = get_option( 'plugin_options' );
$new_options = array();
if( isset( $plugin_options['ga_accountId'] ) )
$new_options['ga_account_id'] = $plugin_options['ga_accountId'];
// Update entire array
update_option( 'plugin_settings_general', $new_options );
// Delte old array
delete_option( 'plugin_options' );
Any end-user who might be using using your plugin’s options for something in their theme, will get errors. But if you are going to rename things, plugin_settings_general
should be name-spaced with your plugin’s actual name.
Related Posts:
- Updating Woocommerce Settings API when WordPress Settings API saved and vise versa
- Settings API with arrays example
- Post meta vs separate database tables
- “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?
- Update Option Stored in Multi-Dimensional Array
- What are the advantages to the Settings API?
- Where to store plugin settings fields
- How to Use Checkbox in Custom Option Page Using The Setting API
- How should one implement add_settings_error on custom menu pages?
- Default table collation on plugin activation?
- Accessing plugin settings in gutenberg
- What’s the best method for emptying an option created with the Settings API?
- Using a database view = evil incarnate?
- 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
- Which to use to execute code during the saving of a plugin settings page?
- Not sure the best way to save custom plugin data
- Nonce in settings API with tabbed navigation
- 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?
- How to use the settings API to set multidimensional arrays
- Actions or filters fired when data is saved in a custom table
- Add Admin Menu Inside Construct or Init
- Why won’t register_setting() create a setting?
- Settings API – Undefined Index when unchecking checkbox
- Disable $title in Plugin Options Screen?
- Hello dolly type plugin that allows people to add their own
- WordPress Settings API: saving multiple rows of similar data
- Sample — test — data for large WordPress install
- Custom Plugin Database relations
- Why isn’t the Settings API designed to work for plugins using custom admin menus? [duplicate]
- Is there any reason only 1 (my) IP would be added to this table using $wpdn->insert?
- How to store data for posts/pages built with drag-n-drop builder?
- Database for development
- Does settings API create settings on run time?
- Is there a naming convention for database tables created by a plugin?
- Performance of several get_option() calls
- What is the use of get_option method
- 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?
- Generating User(s) with Settings API
- Version upgrade: can my plugin filter the SQL statements issued during a database upgrade?
- Saving data from block editor to the database
- Callback function is being called twice
- plugin development: storing language specific options
- What for the tables ending with the meta used in database of wordpress?
- How to add a secondary button to a settings page with a custom action?
- Correct way check nonce (security) using old Options API
- Tabbed navigation for plugin options using same row in database for all?
- Creating table with plugin is not working
- Settings not set after calling register_setting()
- Using the Settings API, how should I add multiple values to an option?
- GET parameters interfere with my plugin settings
- Plugin settings not saving
- dbDelta() Error – Incorrect index name ” for query ALTER TABLE
- How to add settings subpage from a plugin to a settings page created in theme?
- Remove Internal Style Sheet if no Value Provided?
- Get a custom table to an array
- 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
- null callback in add_settings_section
- Subscribe to author?
- Single sanitization callback for multiple fields
- I’m designing a plugin to create database indexes. Suggestions?
- Callback is not called in add_settings_field() when passed as part of an array, but recognises that it’s there. It’s passed Class to Class using OOP
- 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
- When to use add_settings_section vs just register_setting?
- Adding settings link to plugin doesn’t work
- How to fix Uninitialized string offset: error on a checkbox in WP Settings API
- How should I store a log for my plugin
- Plugin development: can’t update settings with multiple settings sections
- How to create database table, add data, update and delete using wpdb via plugins?
- 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?
- 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
- The plugin does not save data
- Is using custom table to suit business needs instead of transients a big hit to page load speed?
- Settings API with arrays example
- Prevent invalid or empty values from being saved to the database and retain the form field values upon error
- Plugin Development for registered users
- Allow users to add / remove settings in plugin
- Update problem with update_option() in combination with register_setting()
- Optimising a big WordPress site
- wpdb->prepare and mysql UPDATE – how is it done?
- dbDelta SQL Query Not Working