Skip to content

Instantly share code, notes, and snippets.

@bekarice
Created November 22, 2016 19:49
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
<?php // only copy if needed
/**
* Removes the stock / availability HTML from the product variation
* since this is added via js the stock HTML filter is ignored
*
* @param array $data the variation data
* @return array updated data
*/
function sww_wc_remove_variation_stock_display( $data ) {
unset( $data['availability_html'] );
return $data;
}
add_filter( 'woocommerce_available_variation', 'sww_wc_remove_variation_stock_display', 99 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment