plugin updates
This commit is contained in:
@@ -112,13 +112,20 @@ class WC_Tracker {
|
||||
* 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.
|
||||
*
|
||||
* After upgrading Jetpack Status to v3.3.2 is_staging_site is also deprecated and in_safe_mode is the new replacement.
|
||||
* So we check this first of all.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
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' ) ) ) {
|
||||
|
||||
if ( is_callable( array( $jp_status, 'in_safe_mode' ) ) ) {
|
||||
return $jp_status->in_safe_mode();
|
||||
} elseif ( is_callable( array( $jp_status, 'is_staging_site' ) ) ) {
|
||||
// Preferred way of checking with Jetpack 8.1+.
|
||||
return $jp_status->is_staging_site();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user