Last active
May 17, 2022 06:27
-
-
Save braddalton/d4ca7524ee18d6da71de54436cd44fbd to your computer and use it in GitHub Desktop.
Remove Current Single Product From WooCommerce Shortcode Products https://wpsites.net/?p=109648
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
add_filter( 'woocommerce_shortcode_products_query', 'woocommerce_shortcode_products_remove_current_product' ); | |
function woocommerce_shortcode_products_remove_current_product( $args ) { | |
$args['post__not_in'] = array( get_the_ID() ); | |
return $args; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment