next_tag() && $tag->next_tag() ) { if ( 'A' === $tag->get_tag() ) { $tag->set_attribute( 'aria-label', $product->get_name() ); } } $html = $tag->get_updated_html(); return $html; } public function alter_image_alt( $attr, $attachment, $size ) { if ( ! empty( $attachment->post_parent ) && empty( $attr['alt'] ) ) { $product = \wc_get_product( $attachment->post_parent ); if ( $product && is_object_in_term( $attachment->post_parent, 'product_tag', 'brandy-demo' ) ) { $attr['alt'] = $product->get_name(); } } return $attr; } } Hooks::get_instance();