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?
- 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
- WordPress Nonce and check admin referer help needed
- Upload multiple images via theme options [closed]
- 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
- WordPress: update_option, don’t update empty options?
- How to hook CSS file according to theme selection in the customizer section
- 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?
- 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
- Insert content between sections in WP customizer
- get option framework options returns Call to undefined function of_get_option()
- How to disable wordpress from overload my stylesheet styles with customizer styles
- Theme Options page not saving data correctly
- Create an Options page with two image upload fields
- Additional custom header image
- Options Theme – WordPress [closed]
- Change WordPress header color using customizer
- Is there a function to add additional options to the Twentyeleven option page?
- Retrieve uploaded image attibutes value from option tree theme options
- 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
- My title won’t update
- Shorter admin url for options page
- Alignment Problem [closed]
- WP Customazation API doesn’t save the default Value
- How to customize this theme? [closed]
- 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
- 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?
- Options Framework not saving options correctly
- Admin menus and submenus
- Theme Options Page – Select, Radio, Tabs
- WordPress Options Framework, add to main menu not appearance menu
- 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
- In wordpress customizer div still showing even if I hid it with javascript
- Theme options period being replaced
- Customizer API Multi Sections in single Panel
- Change CSS Variable value in Theme Customizer Live Preview
- In 2016 Theme where is the Posts page thumbnail image stored?
- Why Settings API Options Override Customizer Settings?
- Show multiple option in URL with Redux framework in front end
- Do not want to display random category. Want to exclude a few or make post show only the category I want [closed]
- Issues Saving Long String Option
- How to customize the colors within a stylesheet using a WordPress setting
- Can’t save multiple sections on one page with register_setting
- Moving wordpress site from one machine into another
- Customizer_register theme options not saving
- Echo content based on current tabbed page in theme options
- What should I use to store options for a single blog on a network site?
- Delete Transient when clicking ‘Save Changes’ on options page
- Using Customizer value in an external PHP file inside a theme
- Build Form on Dashboard
- How to give site owner the ability to change to footer text via theme options (1 post)
- “No Data Received” error in Chrome every time i try to update the theme functions file
- File input returns null in theme options array
- Cloning/replicating/copying dashboard admin settings
- Activating a Theme Options page to Editor – not working [closed]
- Set option to show the slider in post – WP
- Cannot retrieve theme options on index.php
- IF statement not falling over to ELSE with Options Framework
- Theme options: Display ID of page options
- Trouble saving wp_dropdown_pages()
- change the Theme dynamically
- Notice: Undefined index: in options-framework.php
- Why has my WordPress theme disappeared from my WordPress site?
- Multiple instances of Redux WP Framework [closed]
- Can I call Options Framework in footer.php?
- Where to add the code for an outer container in a theme?