Disable default author website url sanitization in comments
-
Hello!
I created my custom function to sanitize and validate a visitor comment data to insert it to database using the “wp_insert_comment” hook. Everything ok!
But as long I really don’t care about the visitor website, I though about using that field to other useful information. So I decided to let the visitor specify their city/country name using that field. Also the website field is visible in comments moderation in admin area to quickly modify as I wish. That was very useful for me.
Here the problem starts. I don’t know why but WordPress forces the author website url field to be a url! Yeah… I know that it should behave like that, but I suppose that the wp_insert_comment hook doesn’t make any kind of sanitization or validation (that’s the reason wp recomment wp_new_comment).
Wordpres adds “https://” in the text, and all spaces became “%20”! That looks horrible in my case… I.E: “New York, USA” looks like “https://New%20York,%20USA”
Is there some way to disable this only in author websites fields in comments?
Regards!
- The topic ‘Disable default author website url sanitization in comments’ is closed to new replies.