Automattic\WooCommerce\Blocks\BlockTypes
ProductGalleryLargeImage::get_product_image_processor
Get a Product Image processor prepared for gallery updates.
Метод класса: ProductGalleryLargeImage{}
Хуков нет.
Возвращает
\WP_HTML_Tag_Processor.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_product_image_processor( $image_html );
- $image_html(строка) (обязательный)
- The image html.
Код ProductGalleryLargeImage::get_product_image_processor() ProductGalleryLargeImage::get product image processor WC 11.3.0
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;
}