Skip to content

Commit

Permalink
Carousel / Lightbox: take wpcom simple shortcircuit into account (#36…
Browse files Browse the repository at this point in the history
…914)

Fixes Automattic/wp-calypso#89564

Follow-up to #36565

This is a second take on #36565; we need to ensure that when one disables the Carousel feature on their wpcom simple site, we do not remove Core's Lightbox feature.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/8720831825

Upstream-Ref: Automattic/jetpack@6dd4d98
  • Loading branch information
jeherve authored and matticbot committed Apr 17, 2024
1 parent 2933d11 commit b00f541
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ This is an alpha version! The changes listed here are not final.
### Other changes <!-- Non-user-facing changes go here. This section will not be copied to readme.txt. -->
- Adds the ability to filter users in the WPCOM_JSON_API_List_Users_Endpoint endpoint by capability
- AI Assistant: Extract Markdown and HTML conversions to AI Client
- Carousel: ensure that disabling the feature on WordPress.com Simple brings back Core's Lightbox back.
- Enabled SIG even if publicize is disabled
- Remove unnecessary react imports
- Tiled Gallery Block: do not use image CDN on private WordPress.com Simple sites.
Expand Down
9 changes: 6 additions & 3 deletions modules/carousel/jetpack-carousel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -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 ) ) {
Expand Down Expand Up @@ -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 ) {
Expand Down

0 comments on commit b00f541

Please sign in to comment.