Automattic\WooCommerce\Blocks\BlockTypes
ProductSummary::create_anchor
Create anchor element based on input.
Method of the class: ProductSummary{}
No Hooks.
Returns
String.
Usage
// private - for code of main (parent) class only $result = $this->create_anchor( $product, $link_text );
- $product(WC_Product) (required)
- Product object.
- $link_text(string) (required)
- Link text.
ProductSummary::create_anchor() ProductSummary::create anchor code WC 10.8.1
private function create_anchor( $product, $link_text ) {
$href = esc_url( $product->get_permalink() );
$text = wp_kses_post( $link_text );
return '<a class="wp-block-woocommerce-product-summary__read_more" href="' . $href . '#tab-description">' . $text . '</a>';
}