wp_mail_from_name WordPress Filter Hook

The wp_mail_from_name hook allows you to change the name that appears in the "From" field when sending emails from your Wordpress site. This can be useful if you want to make it clear that the email is coming from your site, or if you want to use a different name than the one that appears in the "From" field by default.

apply_filters( 'wp_mail_from_name', string $from_name ) #

Filters the name to associate with the “from” email address.


Parameters

$from_name

(string)Name associated with the "from" email address.


Top ↑

More Information

  • The filter modifies the “from name” used in an email sent using the wp_mail() function. When used together with the ‘wp_mail_from‘ filter, it creates a from address like “Name <[email protected]>”. The filter should return a string.
  • If you apply your filter using an anonymous function, you cannot remove it using remove_filter().

Top ↑

Source

File: wp-includes/pluggable.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.3.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.