Skip to content

Instantly share code, notes, and snippets.

@NickGreen
Last active April 5, 2018 19:22
Show Gist options
  • Save NickGreen/15b1ca64ed9b461a037019f5f470bc77 to your computer and use it in GitHub Desktop.
Save NickGreen/15b1ca64ed9b461a037019f5f470bc77 to your computer and use it in GitHub Desktop.
hide variation with ID 99
function hide_variation( $is_visible, $id ) {
if ( $id == 99 ) {
$is_visible = false;
}
return $is_visible;
}
add_filter( 'woocommerce_variation_is_visible', 'hide_variation', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment