diff --git a/projects/plugins/jetpack/modules/shortcodes/slideshow.php b/projects/plugins/jetpack/modules/shortcodes/slideshow.php index 8e4da51a442cd..81fffbb0a26cf 100644 --- a/projects/plugins/jetpack/modules/shortcodes/slideshow.php +++ b/projects/plugins/jetpack/modules/shortcodes/slideshow.php @@ -186,7 +186,6 @@ public function shortcode_callback( $attr ) { if ( class_exists( 'Jetpack_AMP_Support' ) && Jetpack_AMP_Support::is_amp_request() - && class_exists( 'Automattic\Jetpack\Extensions\Slideshow' ) ) { // Load the styles and use the rendering method from the Slideshow block. Jetpack_Gutenberg::load_styles_as_required( 'slideshow' ); @@ -199,6 +198,14 @@ class_exists( 'Jetpack_AMP_Support' ) $amp_args['autoplay'] = true; } + /* + * Blocks can be disabled in Jetpack Settings. + * If that's the case, we need to include the slideshow block manually. + */ + if ( ! class_exists( 'Automattic\Jetpack\Extensions\Slideshow' ) ) { + require_once JETPACK__PLUGIN_DIR . 'extensions/blocks/slideshow/slideshow.php'; + } + return Slideshow\render_amp( $amp_args ); }