Skip Navigation

[Resolved] Filtering User Posts for Foul Language

This thread is resolved. Here is a description of the problem and solution.

Problem:
Filtering User Posts for Foul Language using Toolset form

Solution:
There is no native solution available to check for foul words.

But a possible workaround would be using the Toolset Form's hook: cred_before_save_data
=> https://toolset.com/documentation/programmer-reference/cred-api/#cred_before_save_data

You can make a list of foul words and check against the submitted content and if found remove those words and then assign the filtered content to the field.

Relevant Documentation:
Following links may help you to build such filter:
- https://www.hashbangcode.com/article/simple-swear-filter-php

This support ticket is created 3 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by garyN-2 3 years, 6 months ago.

Assisted by: Minesh.

Author
Posts
#2041665

Tell us what you are trying to do? I would like to ensure that custom posts made by users, using the Toolset Post Forms, do not contain inappropriate language. How can I do that?

Is there any documentation that you are following? I couldn't find any.

Is there a similar example that we can see?

What is the link to your site? svep2p.info

#2042381

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

There is no native solution available to check for foul words.

But a possible workaround would be using the Toolset Form's hook: cred_before_save_data
=> https://toolset.com/documentation/programmer-reference/cred-api/#cred_before_save_data

You can make a list of foul words and check against the submitted content and if found remove those words and then assign the filtered content to the field.

Following links may help you to build such filter:
- hidden link

#2049911

My issue is resolved now. Thank you!