The 'recovery_email_support_info'
filter allows you to customize the support message included in the fatal error protection email sent by WordPress.
Usage
To use this filter, you need to add a function that modifies the $message
parameter, and then hook that function to the 'recovery_email_support_info'
filter using add_filter()
. Here’s a simple code example:
function my_custom_recovery_email_support_info( $message ) { $message .= "\n\nFor further assistance, please contact our support team."; return $message; } add_filter( 'recovery_email_support_info', 'my_custom_recovery_email_support_info' );
Parameters
$message
(string): The message to include in the email.
Examples
Add Support Hours
Scenario: You want to inform users about your support team’s working hours.
function add_support_hours( $message ) { $message .= "\n\nOur support team is available from 9 AM to 5 PM (GMT) Monday to Friday."; return $message; } add_filter( 'recovery_email_support_info', 'add_support_hours' );
This code appends the support team’s working hours to the original support message.
Add Phone Support
Scenario: You want to provide a phone number for users to call for support.
function add_phone_support( $message ) { $message .= "\n\nYou can also reach us by phone at 1-800-123-4567."; return $message; } add_filter( 'recovery_email_support_info', 'add_phone_support' );
This code adds a phone number to the support message.
Add a Support Email Address
Scenario: You want to provide an email address for users to contact for support.
function add_support_email( $message ) { $message .= "\n\nAlternatively, you can email us at [email protected]."; return $message; } add_filter( 'recovery_email_support_info', 'add_support_email' );
This code appends a support email address to the original support message.
Add a Custom Message
Scenario: You want to add a custom message to the email.
function add_custom_message( $message ) { $message .= "\n\nWe're here to help you! Don't hesitate to reach out."; return $message; } add_filter( 'recovery_email_support_info', 'add_custom_message' );
This code adds a custom message to the support message, encouraging users to contact the support team.
Replace the Support Message
Scenario: You want to replace the default support message with your own.
function replace_support_message( $message ) { $message = "\n\nFor assistance, please visit our support center at https://www.example.com/support."; return $message; } add_filter( 'recovery_email_support_info', 'replace_support_message' );
This code replaces the default support message with a custom message directing users to your support center.