函数原型
remove_theme_mod( string $name )
函数描述
Removes theme modification name from active theme list.
是否弃用
未弃用
函数参数
-
$name
string
Required - Theme modification name.
函数返回值
无
函数位置
File: wp-includes/theme.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 );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 2.1.0 | Introduced. |

