Created
June 26, 2015 21:18
-
-
Save michaeldoye/590c69c7b798398c0c27 to your computer and use it in GitHub Desktop.
Hide "Products" in WooCommerce breadcrumb
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
/* | |
* Hide "Products" in WooCommerce breadcrumb | |
*/ | |
function woo_custom_filter_breadcrumbs_trail ( $trail ) { | |
foreach ( $trail as $k => $v ) { | |
if ( strtolower( strip_tags( $v ) ) == 'products' ) { | |
unset( $trail[$k] ); | |
break; | |
} | |
} | |
return $trail; | |
} | |
add_filter( 'woo_breadcrumbs_trail', 'woo_custom_filter_breadcrumbs_trail', 10 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment