From f970e62bcec5ec9541f0bd42591693a14dd95d5a Mon Sep 17 00:00:00 2001 From: Rinat K Date: Tue, 10 Dec 2024 14:05:52 -0600 Subject: [PATCH] Simplify the logic to display where Jetpack is loaded from (#6046) * Simplify the logic to display where Jetpack is loaded from * Fix empty string display of VIP_JETPACK_LOADED_VERSION * Only display local if it is local, otherwise leave blank --------- Co-authored-by: Rebecca Hum --- vip-jetpack/vip-jetpack.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/vip-jetpack/vip-jetpack.php b/vip-jetpack/vip-jetpack.php index 380152691a..4e2b047c84 100644 --- a/vip-jetpack/vip-jetpack.php +++ b/vip-jetpack/vip-jetpack.php @@ -364,16 +364,10 @@ function vip_filter_plugin_version_jetpack( $plugin_meta, $plugin_file ) { } if ( 'jetpack.php' === $plugin_file ) { - $type = defined( 'WPCOM_VIP_JETPACK_LOCAL' ) && constant( 'WPCOM_VIP_JETPACK_LOCAL' ) ? 'Local' : - 'MU-Plugins'; - if ( defined( 'VIP_JETPACK_LOADED_VERSION' ) ) { - $version = constant( 'VIP_JETPACK_LOADED_VERSION' ); - } else { - $version = constant( 'JETPACK__VERSION' ); - } - + $type = defined( 'WPCOM_VIP_JETPACK_LOCAL' ) && constant( 'WPCOM_VIP_JETPACK_LOCAL' ) ? '(Local)' : ''; /* translators: Loaded Jetpack version number */ - $plugin_meta[0] = sprintf( esc_html__( '%1$s - Version %2$s' ), $type, $version ); + $plugin_meta[0] = sprintf( esc_html__( 'Version %1$s %2$s' ), constant( 'JETPACK__VERSION' ), $type ); + remove_filter( 'plugin_row_meta', 'vip_filter_plugin_version_jetpack', PHP_INT_MAX, 2 ); } return $plugin_meta;