php - Show an error message to user trying to add a link when editing a business listing in a WP directory page
one text
I'm about to launch a business directory website in WordPress and I am looking for a way to stop business owners from adding links to their websites in their business descriptions, like how gumtree/eBay does it. (e.g. if the user types www.mywebsite.com in the description box, they don't let you publish the text as they don't want people to leave their site).
My description boxes only allow plain text entries anyway so the hyperlink itself isn't an issue - I want to somehow be able to validate whether the text they entered contains things like www.
or .com
for example, and if it does, then show an error to the user when they save their changes saying something along the lines of "Sorry, you can't use web addresses in your description".
For reference, the business listings are a custom post type. For an example of what I mean, see the "description" box on this page https://listing.downtown-directory.com/listing/off-price-fashion-outlet/
Any help here would be super useful :)
Thanks
Source