Created
November 16, 2020 03:13
-
-
Save DeveloperWil/1b9d95fc371dfb8f24fbd74873ce7267 to your computer and use it in GitHub Desktop.
WooCommerce: Change "Out of stock" message to "Sold"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Change "Out of stock" with "Sold" | |
* | |
* @author Wil Brown zeropointdevelopment.com | |
* @param $availability | |
* @return mixed | |
*/ | |
function zpd_availability_filter_func($availability) | |
{ | |
$availability['availability'] = str_ireplace( 'Out of stock', 'Sold', $availability['availability'] ); | |
return $availability; | |
} | |
add_filter('woocommerce_get_availability', 'zpd_availability_filter_func'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment