从当前主题列表中删除主题修改名称。
原型
remove_theme_mod( string $name )
描述
如果删除名称也会删除所有元素,则将删除整个选项。
参数
$name
(string)
(Required)
主题修改名称。
源文件
路径:wp-includes/theme.php
<?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 );
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/remove_theme_mod/