'Attribute value in product availability status text [duplicate]

I'm using How to add custom stock status to products in WooCommerce 4+ answer code

For now, the text that appears on a single product page is generic: Preorder. Shipping after release.

I wish it was more precise and gave a release date for a specific product: Preorder. Ships after release (date here).

I would like the value of a product attribute named 'release' to be displayed in place of the date.

How can I achieve this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source