mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-29 11:32:21 +08:00
https://stackoverflow.com/questions/66820113/change-woocommerce-product-availability-in-stock-text-by-a-custom-text/66820404
5 lines
274 B
Text
5 lines
274 B
Text
add_filter( 'woocommerce_get_availability_text', 'filter_product_availability_text', 10, 2 );
|
|
function filter_product_availability_text( $availability_text, $product ) {
|
|
|
|
return str_replace( 'in stock', __('remaining copies', 'woocommerce'), $availability_text );
|
|
}
|