Block Words From Users
-
Hello!
Kudos to the great job on this plugin:)Question: how can you block certain words from users so they can not be used. I see you can block users not do not see the words.
If this is not implemented, can it be?
Looking foward to the reply! Thank you –
-
Message is go through
fep_filter_message_before_send
filter hook. Use this hook to block any word(s).Shamim!
THank you for your reply. As a novice in wordpress, can you please assist further on this hook and how to exactly block certain words.
Thank you so much!! ??
You can contact with me through https://shamimbiplob.wordpress.com/contact-us/
Thanks
Hello Shamim,
When using the same hook, I must have made a mistake, as no more messages are being sent at all.
As a user you do get the ‘message successfully sent’ warning, but on top of the page you get this:Warning: call_user_func_array() expects parameter 1 to be a valid callback, no array or string given in /home/content/p3pnexwpnas07_data02/65/2797965/html/wp-includes/plugin.php on line 213
When checking, no message was sent/received.
Where did I go wrong?
Thank you for assisting with this.
Hello,
I thought a little more input of the code I’ve used might come in handy.
I’ll just paste the beginning as the replacement list is quite long.// Cut contact details add_filter( 'fep_filter_message_before_send',10,1); { // Replace "contact" with "****" $contact = str_replace ( "@" , "****" , $contact ); $contact = str_replace ( ".net" , "****" , $contact ); $contact = str_replace ( "yahoo" , "****" , $contact ); $contact = str_replace ( "hotmail" , "****" , $contact ); $contact = str_replace ( "gmail" , "****" , $contact ); $contact = str_replace ( "outlook" , "****" , $contact );
No error messages from the functions.php, but when trying to use the plugin to send a message, this is the error warning:
Warning: call_user_func_array() expects parameter 1 to be a valid callback, no array or string given in /home/content/p3pnexwpnas07_data02/65/2797965/html/wp-includes/plugin.php on line 213
Any advice would be highly appreciated!
Other than that, great plugin, love it!Thank you Shahim for replying.
I read the link, but it doesn’t apply to this specific issue.What is the valid callback in this specific case?
Shahim,
What would you charge to deliver me the correct version of the filter, after I send you the whole list of things to filter?
use like this
//filter before output add_filter( 'fep_filter_display_message', my_custom_filter, 5); function my_custom_filter( $contact ) { // Replace "contact" with "****" $contact = str_replace ( "@" , "****" , $contact ); $contact = str_replace ( ".net" , "****" , $contact ); $contact = str_replace ( "yahoo" , "****" , $contact ); $contact = str_replace ( "hotmail" , "****" , $contact ); $contact = str_replace ( "gmail" , "****" , $contact ); $contact = str_replace ( "outlook" , "****" , $contact ); return $contact; }
Thank you so much Shamim, great service. I’ll have to leave you a donation!
Still, I get an error after modifying to your version:
Parse error: syntax error, unexpected ‘function’ (T_FUNCTION) in /home/content/p3pnexwpnas07_data02/65/2797965/html/wp-content/themes/listify-child/functions.php on line 95
That would be this line:
function my_custom_filter( $contact)
Any ideas?
sorry, typos
use
add_filter( 'fep_filter_display_message', 'my_custom_filter', 5);
instead of
add_filter( 'fep_filter_display_message', my_custom_filter, 5);
Hi Shamim,
No apologies. But the parse error is in this line of code
function my_custom_filter( $contact )
So I guess there is still something here too.
give me full code which you added from here. (including line before this line, do not change anything).
Hi Shamim,
Thank you for assisting. This is the full code:
//filter before output add_filter( 'fep_filter_display_message', 'my_custom_filter', 5); function my_custom_filter( $contact ) { ? // Replace "contact" with "****" $contact = str_replace ( "@" , "****" , $contact ); $contact = str_replace ( ".net" , "****" , $contact ); $contact = str_replace ( "yahoo" , "****" , $contact ); $contact = str_replace ( "hotmail" , "****" , $contact ); $contact = str_replace ( "gmail" , "****" , $contact ); $contact = str_replace ( "outlook" , "****" , $contact ); $contact = str_replace ( ".eu" , "****" , $contact ); $contact = str_replace ( ".org" , "****" , $contact ); $contact = str_replace ( ".int" , "****" , $contact ); $contact = str_replace ( ".edu" , "****" , $contact ); $contact = str_replace ( ".gov" , "****" , $contact ); $contact = str_replace ( ".mil" , "****" , $contact ); $contact = str_replace ( ".biz" , "****" , $contact ); $contact = str_replace ( ".info" , "****" , $contact ); $contact = str_replace ( ".mobi" , "****" , $contact ); $contact = str_replace ( ".us" , "****" , $contact ); $contact = str_replace ( ".ly" , "****" , $contact ); $contact = str_replace ( ".cc" , "****" , $contact ); $contact = str_replace ( ".bz" , "****" , $contact ); $contact = str_replace ( ".tv" , "****" , $contact ); $contact = str_replace ( ".me" , "****" , $contact ); $contact = str_replace ( ".vg" , "****" , $contact ); $contact = str_replace ( ".ws" , "****" , $contact ); $contact = str_replace ( ".name" , "****" , $contact ); $contact = str_replace ( ".co.uk" , "****" , $contact ); $contact = str_replace ( ".org.uk" , "****" , $contact ); $contact = str_replace ( ".me.uk" , "****" , $contact ); $contact = str_replace ( ".be" , "****" , $contact ); $contact = str_replace ( ".de" , "****" , $contact ); $contact = str_replace ( ".cn" , "****" , $contact ); $contact = str_replace ( ".com.cn" , "****" , $contact ); $contact = str_replace ( ".org.cn" , "****" , $contact ); $contact = str_replace ( ".net.cn" , "****" , $contact ); $contact = str_replace ( ".tw" , "****" , $contact ); $contact = str_replace ( ".org.tw" , "****" , $contact ); $contact = str_replace ( ".com.tw" , "****" , $contact ); $contact = str_replace ( ".com" , "****" , $contact ); $contact = str_replace ( ".at" , "****" , $contact ); $contact = str_replace ( ".com.mx" , "****" , $contact ); $contact = str_replace ( ".co.nz" , "****" , $contact ); $contact = str_replace ( ".org.nz" , "****" , $contact ); $contact = str_replace ( ".net.nz" , "****" , $contact ); $contact = str_replace ( ".gs" , "****" , $contact ); $contact = str_replace ( ".tc" , "****" , $contact ); $contact = str_replace ( ".ms" , "****" , $contact ); $contact = str_replace ( "msn." , "****" , $contact ); $contact = str_replace ( "live." , "****" , $contact ); ?return $contact; }
i do not see any error where you pointed (function) but why quot encoded?
- The topic ‘Block Words From Users’ is closed to new replies.