Created
September 16, 2020 03:34
-
-
Save digitalchild/9209af91333ef1d5fe3d6fe2f1c5a391 to your computer and use it in GitHub Desktop.
Filter the vendor address on the vendor list page only.
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 this to your themes functions.php and replace the page number with yours | |
// as this will then only filter the address on this page and not sidewide | |
add_filter( 'wcv_format_store_address_args', 'my_wcv_format_store_address', 11, 2 ); | |
function my_wcv_format_store_address( $address_args, $vendor_id ) { | |
// Change this number to the page id of your vendor list page. | |
if ( is_page( '394') ){ | |
unset( $address_args['address1']); | |
unset( $address_args['postcode']); | |
unset( $address_args['country']); | |
} | |
return $address_args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment