WordPress at a glance

remove_theme_mod() WP 1.0

Remove theme modification name from current theme list.

If removing the name also removes all elements, then the entire option will be removed.

✈ 1 time = 0.001562s = very slow | 50000 times = 2.79s = fast

No Hooks.

Return

Nothing (null).

Usage

remove_theme_mod( $name );
$name(string) (required)
Theme modification name.

Code of remove_theme_mod: wp-includes/theme.php VER 4.9.8

<?php
function remove_theme_mod( $name ) {
	$mods = get_theme_mods();

	if ( ! isset( $mods[ $name ] ) )
		return;

	unset( $mods[ $name ] );

	if ( empty( $mods ) ) {
		remove_theme_mods();
		return;
	}
	$theme = get_option( 'stylesheet' );
	update_option( "theme_mods_$theme", $mods );
}

Related Functions

From tag: Theme mods (theme options settings)

More from category: Other Theme Functions

No comments
    Hello, !     Log In . Register