Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions includes/plugins/class-jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

/**
Expand Down Expand Up @@ -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();
Loading