I have not quite got it live as yet.
Within the filter I put this into a new variable like this $new_url = str_replace('https://', '', '<%= url %>');
Then called this like so $info_window_template .= "\t\t" . '<span><a href="<%= url %>">' . $new_url . '</span>' . "\r\n";
I have tried a few different options to accomplish this including str_replace above and ltrim, both pass the url and show the web address but continue to tag the protocol first. This is fine to actually have as a link but not keen on on showing this on the the front end in this case.
Could I add the url to the filter for store_meta? If so I am assuming i can add to this?
add_filter( 'wpsl_store_meta', 'custom_store_meta', 10, 2 );
function custom_store_meta( $store_meta, $store_id ) {
$terms = wp_get_post_terms( $store_id, 'wpsl_store_category' );
if ( count( $terms ) > 1 ) {
$location_terms = array();
foreach ( $terms as $term ) {
$location_terms[] = $term->name;
}
$store_meta['terms'] = implode( ', ', $location_terms );
} else if ( !empty( $terms ) ) {
$store_meta['terms'] = $terms[0]->name;
}
return $store_meta;
}
Any help would be appreciated.
Thanks
James