Personally I think keeping your mods in an array is a nice solution, but transferring them shouldn’t be too difficult. Just loop through the array like this:
$all_mods = get_theme_mod('thefunk_theme_options'); // retrieve array
foreach ($all_mods as $key -> $value) {
if (!empty($value)) set_theme_mod ($key,$value); // set array element as separate mod
}
Since you have to do this only once, when the updated theme is ran first, you may want to insert an extra check upfront and delete the array afterwards.
Related Posts:
- Is it possible ( or advisable) to allow open access to the new theme customizer for potential clients?
- Add a dropdown to theme customizer
- How to deploy a new theme/theme options from staging to production site
- WordPress Customizer Typography: How to load just the unique Google Fonts?
- How to remove menus section from WordPress theme customizer
- How to hook CSS file according to theme selection in the customizer section
- How Can I Create a List of Values to Be Iterated Through via WordPress Customization API?
- after_setup_theme, Global Variable and Theme Customizer
- For best DB performance should I serialize all theme options together or by type?
- get_option in header.php not returning value from customizer
- Internal error 500 accessing Theme > Customize
- Using an if statement in the theme customizer page
- How can I make my options in an array and store theme in WP options one DB row?
- How to disable wordpress from overload my stylesheet styles with customizer styles
- How to enqueue javascript for WP Customize options sidebar?
- Efficiency of wp_options vs a new table
- Change WordPress header color using customizer
- How to transfer one domain to another domain without losing theme options (customizer)?
- Alignment Problem [closed]
- WP Customazation API doesn’t save the default Value
- Customize Option Framework
- Related Post Category Filter
- In wordpress customizer div still showing even if I hid it with javascript
- Customizer API Multi Sections in single Panel
- Duplicate child theme incl. design changes
- How to customize the colors within a stylesheet using a WordPress setting
- Customizer_register theme options not saving
- Using Customizer value in an external PHP file inside a theme
- “No Data Received” error in Chrome every time i try to update the theme functions file
- trying to figure out how to use more that one image upload in the same section in theme customizer
- How to show associated fields if checkbox is checked in customize widget screen using wp_customize?
- WordPress 6.4.2 – can’t load editor style css using ‘after_setup_theme’ or ‘admin_init’ actions
- How To extend WP_Customize_Control
- How do I remove a pre-existing customizer setting?
- WordPress API Menu/Submenu Order
- Theme customizer – settings order
- Custom Image section in Customizer
- Get entered value of customiser field for live preview
- What are the advantages and disadvantages of Option Tree over the Customization API?
- How do I add settings to the Background Options Page?
- How to remove the Theme Customization Button from the dashboard and themes options page?
- How To Add New Option Types To Option Tree?
- What WP folder can I use to write files to?
- WordPress Settings API error
- Understanding wp_add_inline_style
- Add a new checkbox in theme options
- Theme Customizer : how to create multiple-level panel
- Allow Shortcode in Theme Customizer
- Theme Customizer – Nested Sections?
- How to add Color Picker in Theme Options for the following?
- Customizer Active Callback not working
- Setting multiple default background images?
- Can I create customizer setting that can handle plugin shortcode?
- How to export/import theme customizer settings?
- Best practice way to implement custom sections into a WordPress theme
- Editing the custom background CSS
- How to execute conditional script when on new customize.php (Theme Customize) screen
- Is the theme customizer slowing down my site?
- Trigger Customizer saving process with Javascript only
- Adding customizer styles with wp_add_inline_style
- Best practice (forward compatibility) for theme options
- How to set the default value of a option in a theme?
- Where is default wp_head() implemented?
- Add a preview to a WordPress Control Panel
- WordPress settings API error when checkbox unchecked
- WordPress Customize — Move “menus” options / field to another section
- Can we add more than one control under a setting in WP theme customizer?
- Widgets panel not displaying in the Theme Customizer
- What is the best way to export and import theme options?
- Is it possible to display the admin bar while in the Theme Customizer?
- How do I get a parent theme modification from a child theme?
- Changing the entire control choices using wp.customize with JavaScript
- esc_url not working within add_settings_field callback
- How to Change CSS Variable value in Theme Customizer Live Preview
- WordPress Errors in generated by theme check plugin [closed]
- WordPress Theme customisation CSS
- Get background color for Live Preview with Theme Customization API?
- Checking if there is an Image inserted – if not don’t display anything
- “Display Site Title and Tagline” checkbox not working?
- Select front page and blog page in custom theme settings page
- How to set page template on front using starter content?
- Default header image does not display
- WordPress Customizer Control with React
- Responsive Images – Generating multiple images from Theme Customizer control upload?
- Modify Javascript Configuration Options for Theme Customizer Colour Picker
- Using the theme options to change background
- Modify the Additional CSS section (adding a disclaimer)
- How to change the customizer´s sidebar width?
- Cannot update WordPress General Settings Site Title and Tagline
- Theme Customizer – Choose where widget area appears, to let users organise widgets
- Theme Options page not showing up in admin menu
- wordpress custom theme import and export options for sample data [closed]
- How i can get widgets areas working in customizer?
- Is there a way to activate different theme for specified users? [closed]
- Custom Script Section Only Echoes Text
- How to disable automatic colors in the Twenty Twenty theme?
- WordPress not registering Theme Customization Section
- Is there an action for save_menu and/or update_menu?
- How can i add edit shortcut icon in wordpress customizer without using selective refresh?
- Add new panel inside parent panel in WP Customize?