update_home_siteurl() WordPress Function

The update_home_siteurl() function is used to update the home siteurl option for a Wordpress site. This function takes a single parameter, which is the new siteurl value.

update_home_siteurl( string $old_value, string $value ) #

Flushes rewrite rules if siteurl, home or page_on_front changed.


Parameters

$old_value

(string)(Required)

$value

(string)(Required)


Top ↑

Source

File: wp-admin/includes/misc.php

function update_home_siteurl( $old_value, $value ) {
	if ( wp_installing() ) {
		return;
	}

	if ( is_multisite() && ms_is_switched() ) {
		delete_option( 'rewrite_rules' );
	} else {
		flush_rewrite_rules();
	}
}


Top ↑

Changelog

Changelog
VersionDescription
2.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.