( ! empty( $content ) ) { parent::register_block_type_assets(); $this->register_chunk_translations( [ $this->block_name ] ); return $content; } $classes_and_styles = StyleAttributesUtils::get_classes_and_styles_by_attributes( $attributes ); $post_id = $block->context['postId'] ?? ''; $product = wc_get_product( $post_id ); if ( $product ) { $crop_images = $block->context['cropImages'] ?? false; $product_gallery_images = ProductGalleryUtils::get_product_gallery_images( $post_id, 'full', array(), 'wc-block-product-gallery-thumbnails__thumbnail', $crop_images ); if ( $product_gallery_images && count( $product_gallery_images ) > 1 ) { $html = ''; $number_of_thumbnails = isset( $block->context['thumbnailsNumberOfThumbnails'] ) ? $block->context['thumbnailsNumberOfThumbnails'] : 3; $mode = $block->context['mode'] ?? ''; $thumbnails_count = 1; foreach ( $product_gallery_images as $product_gallery_image_html ) { // Limit the number of thumbnails only in the standard mode (and not in dialog). if ( $this->should_limit_thumbnails( $mode, $thumbnails_count, $number_of_thumbnails ) ) { break; } // If not in dialog and it's the last thumbnail and the number of product gallery images is greater than the number of thumbnails settings output the View All markup. if ( $this->should_display_view_all( $mode, $thumbnails_count, $product_gallery_images, $number_of_thumbnails ) ) { $remaining_thumbnails_count = count( $product_gallery_images ) - $number_of_thumbnails; $product_gallery_image_html = $this->inject_view_all( $product_gallery_image_html, $this->generate_view_all_html( $remaining_thumbnails_count ) ); $html .= $product_gallery_image_html; } else { $processor = new \WP_HTML_Tag_Processor( $product_gallery_image_html ); if ( $processor->next_tag( 'img' ) ) { $processor->set_attribute( 'data-wc-on--keydown', 'actions.onThumbnailKeyDown' ); $processor->set_attribute( 'tabindex', '0' ); $processor->set_attribute( 'data-wc-on--click', 'actions.selectImage' ); $html .= $processor->get_updated_html(); } } $thumbnails_count++; } return sprintf( '', esc_attr( $classes_and_styles['classes'] ), esc_attr( $classes_and_styles['styles'] ), $html, wp_json_encode( array( 'namespace' => 'woocommerce/product-gallery' ) ) ); } } return; } } }
Fatal error: Uncaught Error: Class "Automattic\WooCommerce\Blocks\BlockTypes\ProductGalleryThumbnails" not found in /htdocs/wp-content/plugins/woocommerce/src/Blocks/BlockTypesController.php:106 Stack trace: #0 /htdocs/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Blocks\BlockTypesController->register_blocks('') #1 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #2 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #3 /htdocs/wp-settings.php(704): do_action('init') #4 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...') #5 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #6 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #7 /htdocs/index.php(17): require('/htdocs/wp-blog...') #8 {main} thrown in /htdocs/wp-content/plugins/woocommerce/src/Blocks/BlockTypesController.php on line 106