Hi, I'm looking to find a way to remove a comma from a string and all of the text after it. This is for a real estate website, and the post title is the full address (for example: 1234 Main Street, Los Angeles, CA 90001). In one of my views, I am inserting this using just the [wpv-post-title] shortcode. However, I'm looking to show this address as shortened in certain instances, so that it shows just the street address (1234 Main Street).
I've looked at this support topic about doing the opposite and adding a comma to a number (https://toolset.com/forums/topic/comma-format/) which was very helpful and I like the idea of just adding a custom shortcode and wrapping the Toolset shortcode in it for when I need this alternative formatting. For example, [wp_format_address address='[wpv-post-title]'] or something like that. Any help would be greatly appreciated!
That worked beautifully, thank you so much for your help!
Just out of curiosity, what would that code look like if I was using a custom field shortcode with my address instead of the post title? For example, [types field="property-address"][/types]