attribute( 'data-wp-context', wp_json_encode( array( 'selectedImageNumber' => 1, 'isDialogOpen' => false, 'disableLeft' => true, 'disableRight' => false, 'isDragging' => false, 'touchStartX' => 0, 'touchCurrentX' => 0, 'productId' => $product_id, 'imageIds' => ProductGalleryUtils::get_product_gallery_image_ids( $product, null, false ), 'styles' => array( 'transform' => 'scale(1.0)', 'transform-origin' => '', ), ), JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP ) ); if ( $product->is_type( ProductType::VARIABLE ) ) { $p->set_attribute( 'data-wp-init--watch-changes-on-add-to-cart-form', 'callbacks.watchForChangesOnAddToCartForm' ); } $p->add_class( $classname ); $p->add_class( $classname_single_image ); $html = $p->get_updated_html(); } return $html; } /** * Disable the block type script, this uses script modules. * * @param string|null $key The key. * * @return null */ protected function get_block_type_script( $key = null ) { return null; } }