Skip to:
Content
Pages
Categories
Search
Top
Bottom

friends_notification_new_request_message


  • elpix
    Participant

    @elpix

    Hi everyone,

    I’m trying to modify the email received by users after friend request.

    In the source code, I can see :
    $message = apply_filters( 'friends_notification_new_request_message', $message, $initiator_name, $initiator_link, $all_requests_link, $settings_link );

    So I try, in bp-custom.php, to write :

    
    add_filter('friends_notification_new_request_message' , 'my_bp_friends_notification_new_request_message' , 110 , 2);
    
    function my_bp_friends_notification_new_request_message($message, $initiator_name, $initiator_link, $all_requests_link, $settings_link) {
    	
    	$retour = '';
    
    	$retour .= "<p>->".$message;
    	$retour .= "<p>->".$initiator_name;
    	$retour .= "<p>->".$initiator_link;
    	$retour .= "<p>->".$all_requests_link;
    	$retour .= "<p>->".$settings_link;
    
    	return $retour;
    
    }
    

    But I have the following error :

    Warning: Missing argument 3 for my_bp_friends_notification_new_request_message() in C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\BiowebspinLocal\wp-content\plugins\bp-custom.php on line 10

    Warning: Missing argument 4 for my_bp_friends_notification_new_request_message() in C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\BiowebspinLocal\wp-content\plugins\bp-custom.php on line 10

    Warning: Missing argument 5 for my_bp_friends_notification_new_request_message() in C:\Program Files (x86)\EasyPHP-DevServer-13.1VC11\data\localweb\BiowebspinLocal\wp-content\plugins\bp-custom.php on line 10

    Do you know what is the problem ?

    Thanks a lot

Viewing 1 replies (of 1 total)

  • shanebp
    Moderator

    @shanebp

    This:
    add_filter('friends_notification_new_request_message' , 'my_bp_friends_notification_new_request_message' , 110 , 2);

    Should be:
    add_filter('friends_notification_new_request_message' , 'my_bp_friends_notification_new_request_message', 110, 5);

    5 is the number of arguments you are passing, not 2.

Viewing 1 replies (of 1 total)
  • The topic ‘friends_notification_new_request_message’ is closed to new replies.
Skip to toolbar