Skip to content

Instantly share code, notes, and snippets.

@digitalchild
Created September 16, 2020 03:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save digitalchild/9209af91333ef1d5fe3d6fe2f1c5a391 to your computer and use it in GitHub Desktop.
Save digitalchild/9209af91333ef1d5fe3d6fe2f1c5a391 to your computer and use it in GitHub Desktop.
Filter the vendor address on the vendor list page only.
<?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