Skip to content

Instantly share code, notes, and snippets.

@plugin-republic
Created January 16, 2020 09:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plugin-republic/97c3b7ca584801b6def11bdedc88f7ee to your computer and use it in GitHub Desktop.
Save plugin-republic/97c3b7ca584801b6def11bdedc88f7ee to your computer and use it in GitHub Desktop.
<?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