Created
June 23, 2021 15:12
-
-
Save titodevera/714dd5d79a9531f95180a744f5359bb3 to your computer and use it in GitHub Desktop.
Perfect Brands for WooCommerce: Allow external URLs in brands banners
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
<?php | |
add_filter( 'site_url', function( $url ) { | |
if ( ! is_tax( 'pwb-brand' ) ) return $url; | |
preg_match( '/http(s)?:\/\/.*(?=http(s)?)/', $url, $matches ); | |
if ( ! empty( $matches[0] ) ) $url = str_replace( $matches[0], '', $url ); | |
return $url; | |
}, 90 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment