Skip to content

Instantly share code, notes, and snippets.

@kreamweb
Created February 21, 2017 08:54
Show Gist options
  • Select an option

  • Save kreamweb/2cd2bb2ce755fe63bf29f2d6b2a0de15 to your computer and use it in GitHub Desktop.

Select an option

Save kreamweb/2cd2bb2ce755fe63bf29f2d6b2a0de15 to your computer and use it in GitHub Desktop.
function that hide the popup in a specific category function that changes a popup in a specific category
<?php
add_action( 'template_redirect', 'ywpop_hide_popup', 9);
function ywpop_hide_popup(){
if( is_product_category() ){
add_filter( 'enable_yit_popup', '__return_false');
}
}
add_action( 'template_redirect', 'ywpop_change_popup', 9);
function ywpop_change_popup(){
if( is_product_category('music') ){
add_filter( 'ypop_current_popup', function( $id ) { return 102; } );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment