I’ve found the solution, maybe it’ll be useful to anyone:
function reset_mytheme_options() {
remove_theme_mods();
}
add_action( 'after_switch_theme', 'reset_mytheme_options' );
Related Posts:
- get_option() vs get_theme_mod(): Why is one slower?
- Adding a description to theme customizer controls
- Theme option : having the ability to select among several predefined headers
- How to create dependent field in Customizer?
- Theme Customizier sanitize_callback not working
- How to use WP Theme Option: Custom_Backgrounds on specific element?
- How can I create a rearrangeable list of items like OptionTree offers with the Theme Customization API?
- wp_editor() fields on Theme Options Page not saving
- Adding a checkbox to the theme customizer
- Is it possible ( or advisable) to allow open access to the new theme customizer for potential clients?
- Add a dropdown to theme customizer
- Theme Options Panels, What are some good examples from Frameworks or Premium Themes? [closed]
- Where are a theme’s options stored and can I export them to be imported into freshly installed themes?
- Can I install Analytics before deciding on a theme?
- Options Framework options not being output
- Using update_option() and get_option() is echoing escaped strings
- Two Ways Of Creating WordPress Options Pages
- Theme Options page with tabs
- WordPress Nonce and check admin referer help needed
- WordPress Customizer Typography: How to load just the unique Google Fonts?
- Outputting results from select box option in options panel
- Upload multiple images via theme options [closed]
- PHP stylesheet cannot use standard WP functions
- How do I use add_control to offer a list of all pages in the customiser?
- Display user HTML on website
- Need help understanding/coding with Settings API
- How to remove menus section from WordPress theme customizer
- Setting up a members area
- WordPress: update_option, don’t update empty options?
- 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?
- Change setting name in Customizer and keep the data
- Using jQuery to retrieve customizer value
- after_setup_theme, Global Variable and Theme Customizer
- How can I insert some extra validation into the theme options’ validation function using add_filter?
- How to add an alternative style sheet as a theme option?
- Disable image resizing on specific upload fields
- Put standard wordpress options into a theme options panel?
- How can I get my options in json response?
- Can i use the same sanitize function on multiple theme mod textboxes?
- Customizer – Prefix Class Extension
- 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
- Removing \\\ from Saved Data
- Use of check_admin_referer with theme options and options.php
- WordPress custom options storing?
- Insert content between sections in WP customizer
- WordPress admin panel framework weird layout on server side
- get option framework options returns Call to undefined function of_get_option()
- How to disable wordpress from overload my stylesheet styles with customizer styles
- Getting the ID of header image, even when set to random
- Theme Options page not saving data correctly
- How to enqueue javascript for WP Customize options sidebar?
- Getting error to display radio button value in General Settings page
- Create an Options page with two image upload fields
- Only allow site url in text field using wp_kses/wp_filter_nohtml_kses?
- Additional custom header image
- Options Theme – WordPress [closed]
- Change WordPress header color using customizer
- Settings API settings section not appearing
- Is there a function to add additional options to the Twentyeleven option page?
- How to set a default theme option after installing theme?
- How to get of_get_option() inside the inc folder file
- Retrieve uploaded image attibutes value from option tree theme options
- Why is an array created in a function hooked to customize register populated when customizer is loaded but not when the front-end is loaded?
- WordPress theme options framework, I can’t read them in my templates
- Color Options from Theme Customizer API not returning via get_theme_mod()
- Display and hide content using checkbox in Options Framework Theme
- How do I remove the page listing menu in the header in the Twenty Ten Theme?
- My title won’t update
- Multiple options in the options_value field of the wp_options table
- Shorter admin url for options page
- Shortcode don’t work in custom option field, any solution?
- Alignment Problem [closed]
- WP Customazation API doesn’t save the default Value
- How to customize this theme? [closed]
- WordPress Theme Settings Page
- Theme options are they necessary
- Bring page from sub menu to admin menu in option tree
- The best place of the code for creating a robots.txt file
- Customize Option Framework
- How do I display a WP Option from an array?
- Blogname and Blogdescription in Pagelines DMS Options Panel
- Can Settings API setting generate other settings?
- Cannot modify headers
- How to get functions.php to talk to options.php
- Options Framework not saving options correctly
- How to use checked() function with multiple check box group? How to properly sanitize that checkbox group?
- Admin menus and submenus
- Theme Options Page – Select, Radio, Tabs
- WordPress Options Framework, add to main menu not appearance menu
- WordPress karma theme shortcodes not working
- WordPress built-in Custom Background
- Weird undefined index: id,std notices. How to fix it?
- Splitting an eCommerce store from the WordPress Theme
- Related Post Category Filter
- Illegal string offset in PHP function in via Theme Customizer
- Defining path of content folder in WP-config solves the issue of missing header, footer, theme options. Is this a good approach? Expert Advice needed
- How do I have my widgets in a Sidebar for my http://localhost/wordpress/