Last active
December 2, 2021 13:06
-
-
Save plugin-republic/3a4ae9c4454a177f6dd8ed9267ece034 to your computer and use it in GitHub Desktop.
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
<?php | |
/** | |
* Enable/disable the grid for specific product IDs | |
*/ | |
function prefix_enable_variations_grid( $enable, $product_id ) { | |
// Only enable these products | |
if( in_array( $product_id, array( 123, 456, 789 ) ) ) { | |
return true; | |
} | |
// Don't enable these products | |
if( in_array( $product_id, array( 987, 654, 321 ) ) ) { | |
return false; | |
} | |
return $enable; | |
} | |
apply_filters( 'wcbvp_enable_variations_grid', 'prefix_enable_variations_grid', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment