Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: password_change_email

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
1994                 *                - ###ADMIN_EMAIL### The admin email in case this was unexpected.
1995                 *                - ###EMAIL###       The user's email address.
1996                 *                - ###SITENAME###    The name of the site.
1997                 *                - ###SITEURL###     The URL to the site.
1998                 *            @type string $headers Headers. Add headers in a newline (\r\n) separated string.
1999                 *        }
2000                 * @param array $user     The original user array.
2001                 * @param array $userdata The updated user array.
2002                 */
2003                $pass_change_email = apply_filters( 'password_change_email', $pass_change_email, $user, $userdata );
2004
2005                $pass_change_email['message'] = str_replace( '###USERNAME###', $user['user_login'], $pass_change_email['message'] );
2006                $pass_change_email['message'] = str_replace( '###ADMIN_EMAIL###', get_option( 'admin_email' ), $pass_change_email['message'] );
2007                $pass_change_email['message'] = str_replace( '###EMAIL###', $user['user_email'], $pass_change_email['message'] );
2008                $pass_change_email['message'] = str_replace( '###SITENAME###', $blog_name, $pass_change_email['message'] );
2009                $pass_change_email['message'] = str_replace( '###SITEURL###', home_url(), $pass_change_email['message'] );
2010
2011                wp_mail( $pass_change_email['to'], sprintf( $pass_change_email['subject'], $blog_name ), $pass_change_email['message'], $pass_change_email['headers'] );
2012           }