remove_theme_mod()

从当前主题列表中删除主题修改名称。

remove_theme_mod(string $name)

说明(Description)

如果移除名称也会移除所有元素,则会移除整个选项。


参数(Parameters)

参数类型必填说明
$name(string)必需主题修改名称。

返回(Return)

无返回值


源码(Source)

/**
 * Remove theme modification name from current theme list.
 *
 * If removing the name also removes all elements, then the entire option will
 * be removed.
 *
 * @since 2.1.0
 *
 * @param string $name Theme modification name.
 */
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 );
}
更新版本源码位置使用被使用
2.1.0wp-includes/theme.php:99054
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索