Last active
November 19, 2023 11:58
-
-
Save atanemani/07f6b899bb8c049ea84a11774a402469 to your computer and use it in GitHub Desktop.
How to remove paretn categories slug from child-categories URL?
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 | |
add_filter( 'woocommerce_taxonomy_args_product_cat', 'mrj_remove_parent_category_from_url' ); | |
function mrj_remove_parent_category_from_url( $args ) { | |
$args['rewrite']['hierarchical'] = false; | |
return $args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment