acf_switch_stores()ACF 5.7.11

acf_switch_stores

Triggered when switching between sites on a multisite installation.

No Hooks.

Returns

null. Nothing (null).

Usage

acf_switch_stores( $site_id, $prev_site_id );
$site_id(int) (required)
New blog ID.
$prev_site_id(required)
.

Changelog

Since 5.7.11 Introduced.

acf_switch_stores() code ACF 6.8.8

function acf_switch_stores( $site_id, $prev_site_id ) {

	// Loop over stores and call switch_site().
	global $acf_stores;
	foreach ( $acf_stores as $store ) {
		$store->switch_site( $site_id, $prev_site_id );
	}
}