remove_theme_mods

函式
remove_theme_mods ( No parameters )

remove_theme_mods: 這個函式用來從WordPress中刪除所有的主題修改: 這個函式不接受任何引數。

移除活動主題的主題修改選項。

function remove_theme_mods() {
	delete_option( 'theme_mods_' . get_option( 'stylesheet' ) );

	// Old style.
	$theme_name = get_option( 'current_theme' );
	if ( false === $theme_name ) {
		$theme_name = wp_get_theme()->get( 'Name' );
	}

	delete_option( 'mods_' . $theme_name );
}

常見問題

FAQs
檢視更多 >