Automattic\WooCommerce\Blocks\BlockTypes

ProductGalleryLargeImage::get_product_image_processor │ private │ WC 1.0

Get a Product Image processor prepared for gallery updates.

Method of the class: ProductGalleryLargeImage{}

No Hooks.

Returns

\WP_HTML_Tag_Processor.

Usage

// private - for code of main (parent) class only
$result = $this->get_product_image_processor( $image_html );
$image_html(string) (required)
The image html.

ProductGalleryLargeImage::get_product_image_processor() code WC 11.1.2

private function get_product_image_processor( $image_html ) {
	$p = new \WP_HTML_Tag_Processor( $image_html );

	if ( $p->next_tag( array( 'tag_name' => 'a' ) ) ) {
		$p->remove_attribute( 'onclick' );
		$p->remove_attribute( 'style' );
		$p->set_attribute( 'tabindex', '-1' );
	} else {
		$p = new \WP_HTML_Tag_Processor( $image_html );
	}

	return $p;
}