Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'term_link', array( $this, 'replace_term_link' ), 9000, 2);
- function replace_term_link ( $termlink, $term ) {
- if( $term->taxonomy == 'product_cat' ) {
- $permalinks = (array)get_option( 'product_cat_custom_permalinks' );
- if( array_key_exists( (int)$term->term_id, $permalinks ) )
- $termlink = empty( $permalinks[$term->term_id] ) ? $termlink : $permalinks[$term->term_id];
- }
- return $termlink;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement