remove_theme_mod

Remove theme modification name from current theme list.

Description

remove_theme_mod( (string) $name ); 

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

Parameters (1)

0. $name (string)
Theme modification name.

Usage

  1. if ( !function_exists( 'remove_theme_mod' ) ) { 
  2. require_once ABSPATH . WPINC . '/theme.php'; 
  3.  
  4. // Theme modification name. 
  5. $name = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = remove_theme_mod($name); 
  9.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/theme.php  
  1. function remove_theme_mod( $name ) { 
  2. $mods = get_theme_mods(); 
  3.  
  4. if ( ! isset( $mods[ $name ] ) ) 
  5. return; 
  6.  
  7. unset( $mods[ $name ] ); 
  8.  
  9. if ( empty( $mods ) ) { 
  10. return; 
  11. $theme = get_option( 'stylesheet' ); 
  12. update_option( "theme_mods_$theme", $mods );