remove_theme_mods() WordPress Function
The remove_theme_mods() function is a WordPress function that removes theme modifications made by a user. This function is useful for resetting your theme to its default settings.
remove_theme_mods() #
Removes theme modifications option for the active theme.
Source
File: wp-includes/theme.php
function remove_theme_mods() {
delete_option( 'theme_mods_' . get_option( 'stylesheet' ) );
// Old style.
$theme_name = get_option( 'current_theme' );
if ( false === $theme_name ) {
$theme_name = wp_get_theme()->get( 'Name' );
}
delete_option( 'mods_' . $theme_name );
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 2.1.0 | Introduced. |