diff --git a/projects/plugins/jetpack/changelog/fix-carousel-lightbox-disable-wpcom-simple b/projects/plugins/jetpack/changelog/fix-carousel-lightbox-disable-wpcom-simple new file mode 100644 index 0000000000000..a27c97d94502e --- /dev/null +++ b/projects/plugins/jetpack/changelog/fix-carousel-lightbox-disable-wpcom-simple @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Carousel: ensure that disabling the feature on WordPress.com Simple brings back Core's Lightbox back. diff --git a/projects/plugins/jetpack/modules/carousel/jetpack-carousel.php b/projects/plugins/jetpack/modules/carousel/jetpack-carousel.php index 2e1f30529047d..9c5bdb4611309 100644 --- a/projects/plugins/jetpack/modules/carousel/jetpack-carousel.php +++ b/projects/plugins/jetpack/modules/carousel/jetpack-carousel.php @@ -83,9 +83,6 @@ public function init() { $this->single_image_gallery_enabled = ! $this->maybe_disable_jp_carousel_single_images(); $this->single_image_gallery_enabled_media_file = $this->maybe_enable_jp_carousel_single_images_media_file(); - // Disable core lightbox when Carousel is enabled. - add_action( 'wp_theme_json_data_theme', array( $this, 'disable_core_lightbox' ) ); - if ( is_admin() ) { // Register the Carousel-related related settings. add_action( 'admin_init', array( $this, 'register_settings' ), 5 ); @@ -99,6 +96,9 @@ public function init() { add_action( 'wp_ajax_nopriv_get_attachment_comments', array( $this, 'get_attachment_comments' ) ); add_action( 'wp_ajax_post_attachment_comment', array( $this, 'post_attachment_comment' ) ); add_action( 'wp_ajax_nopriv_post_attachment_comment', array( $this, 'post_attachment_comment' ) ); + + // Disable core lightbox when Carousel is enabled. + add_action( 'wp_theme_json_data_theme', array( $this, 'disable_core_lightbox' ) ); } else { if ( ! $this->in_jetpack ) { if ( 0 === $this->test_1or0_option( get_option( 'carousel_enable_it' ), true ) ) { @@ -128,6 +128,9 @@ public function init() { // `is_amp_request()` can't be called until the 'wp' filter. add_action( 'wp', array( $this, 'check_amp_support' ) ); + + // Disable core lightbox when Carousel is enabled. + add_action( 'wp_theme_json_data_theme', array( $this, 'disable_core_lightbox' ) ); } if ( $this->in_jetpack ) {