diff --git a/includes/plugins/class-jetpack.php b/includes/plugins/class-jetpack.php index 4947b11260..c3c1c643bc 100644 --- a/includes/plugins/class-jetpack.php +++ b/includes/plugins/class-jetpack.php @@ -161,6 +161,9 @@ public static function init() { // Modify the related posts timeframe. add_filter( 'jetpack_relatedposts_filter_date_range', [ __CLASS__, 'restrict_age_of_related_posts' ] ); + + // Disable Jetpack Image Studio as late as possible so dequeues cannot be overridden. + add_action( 'admin_print_scripts', [ __CLASS__, 'disable_image_studio' ], 999 ); } /** @@ -345,5 +348,17 @@ public static function restrict_age_of_related_posts( $date_range ) { return $date_range; } + + /** + * Disable Jetpack Image Studio scripts and styles. + * + * Image Studio's full-screen AI editor replaces the Media Library attachment + * view, hiding custom fields like photo credits. Dequeuing the assets using + * the current handles has been tested with Jetpack 15.7+ (handles: image-studio / image-studio-style). + */ + public static function disable_image_studio() { + wp_dequeue_script( 'image-studio' ); + wp_dequeue_style( 'image-studio-style' ); + } } Jetpack::init();