Created
January 16, 2020 09:22
-
-
Save plugin-republic/97c3b7ca584801b6def11bdedc88f7ee to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
function demo_pewc_product_show_totals( $show_totals, $post_id ) { | |
// Show the Totals fields for product IDs in the array | |
$totals = array( 64, 66, 454 ); | |
if( in_array( $post_id, $totals ) ) { | |
$show_totals = 'total'; | |
} | |
// Hide the Totals fields for product IDs in this array | |
if( in_array( $post_id, array( 969, 1111 ) ) ) { | |
$show_totals = 'hide'; | |
} | |
return $show_totals; | |
} | |
add_filter( 'pewc_product_show_totals', 'demo_pewc_product_show_totals', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment