Skip to content

Instantly share code, notes, and snippets.

@plugin-republic
Created October 1, 2025 12:57
Show Gist options
  • Select an option

  • Save plugin-republic/bcdf8e70c5e8762c12f13a8ad7e36ef3 to your computer and use it in GitHub Desktop.

Select an option

Save plugin-republic/bcdf8e70c5e8762c12f13a8ad7e36ef3 to your computer and use it in GitHub Desktop.
<?php
/**
* Hook: woocommerce_get_stock_html.
* Modify the HTML for the stock notice on the product page.
*/
function plugin_republic_get_stock_html( $html, $product ) {
// Modify the $html here
return $html;
}
add_filter( 'woocommerce_get_stock_html', 'plugin_republic_get_stock_html', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment