term_id ) ) { $link = get_term_link( $obj->term_id, 'product_cat' ); if ( is_wp_error( $link ) ) { $link = get_term_link( $obj->term_id, 'product_tag' ); } } else { if ( get_option( 'permalink_structure' ) == '' ) { $link = get_post_type_archive_link( 'product' ); } else { $link = get_permalink( wc_get_page_id( 'shop' ) ); } } /** * Filter query link for products number * * @since 1.0.8 * @param string $link The old query url */ $link = apply_filters( 'multipurpose_num_products_link', $link ); if( ! empty( $_GET ) ) { foreach( $_GET as $key => $value ){ $link = add_query_arg( $key, $value, $link ); } } ?>