WordPress at Your Fingertips
function is not described

WC_Tracker::is_jetpack_staging_site() private WC 1.0

Test whether this site is a staging site according to the Jetpack criteria.

With Jetpack 8.1+, Jetpack::is_staging_site has been deprecated. \Automattic\Jetpack\Status::is_staging_site is the replacement. However, there are version of JP where \Automattic\Jetpack\Status exists, but does not contain is_staging_site method, so with those, code still needs to use the previous check as a fallback.

{} It's a method of the class: WC_Tracker{}

No Hooks.

Return

true|false.

Usage

$result = WC_Tracker::is_jetpack_staging_site();

Code of WC_Tracker::is_jetpack_staging_site() WC 5.9.0

private static function is_jetpack_staging_site() {
	if ( class_exists( '\Automattic\Jetpack\Status' ) ) {
		// Preferred way of checking with Jetpack 8.1+.
		$jp_status = new \Automattic\Jetpack\Status();
		if ( is_callable( array( $jp_status, 'is_staging_site' ) ) ) {
			return $jp_status->is_staging_site();
		}
	}

	return ( class_exists( 'Jetpack' ) && is_callable( 'Jetpack::is_staging_site' ) && Jetpack::is_staging_site() );
}