Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Author Shamim Hasan

    (@shamim51)

    Message is go through fep_filter_message_before_send filter hook. Use this hook to block any word(s).

    Thread Starter dej888

    (@dej888)

    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!! ??

    Plugin Author Shamim Hasan

    (@shamim51)

    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!

    Plugin Author Shamim Hasan

    (@shamim51)

    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?

    Plugin Author Shamim Hasan

    (@shamim51)

    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?

    Plugin Author Shamim Hasan

    (@shamim51)

    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.

    Plugin Author Shamim Hasan

    (@shamim51)

    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;
    }
    Plugin Author Shamim Hasan

    (@shamim51)

    i do not see any error where you pointed (function) but why quot encoded?

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Block Words From Users’ is closed to new replies.