remove_theme_mods

The timeline below displays how wordpress function remove_theme_mods has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Removes theme modifications option for the active theme.
 *
 * @since 2.1.0
 */
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);
}

WordPress Version: 5.5

/**
 * Removes theme modifications option for current theme.
 *
 * @since 2.1.0
 */
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);
}

WordPress Version: 3.7

/**
 * Remove theme modifications option for current theme.
 *
 * @since 2.1.0
 */
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);
}