/** * Applies user moderation upon registration * * @since 6.0 * @access public */ public function register_post() { // Remove default new user notification if (has_action('tml_new_user_registered', 'wp_new_user_notification')) { remove_action('tml_new_user_registered', 'wp_new_user_notification', 10, 2); } // Remove Custom Email new user notification if (class_exists('Theme_My_Login_Custom_Email')) { $custom_email = Theme_My_Login_Custom_Email::get_object(); if (has_action('tml_new_user_registered', array(&$custom_email, 'new_user_notification'))) { remove_action('tml_new_user_registered', array(&$custom_email, 'new_user_notification'), 10, 2); } } // Moderate user upon registration add_action('tml_new_user_registered', array(&$this, 'moderate_user'), 100, 2); }
* @access public * * @param object $user User object */ public function password_change_notification(&$user) { global $current_site; $to = apply_filters('password_change_notification_mail_to', get_option('admin_email')); // send a copy of password change notification to the admin // but check to see if it's the admin whose password we're changing, and skip this if ($user->user_email != $to && apply_filters('send_password_change_notification', true)) { if (is_multisite()) { $blogname = $current_site->site_name; } else { // The blogname option is escaped with esc_html on the way into the database in sanitize_option // we want to reverse this for the plain text arena of emails. $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); } $title = sprintf(__('[%s] Password Lost/Changed', 'theme-my-login'), $blogname); $message = sprintf(__('Password Lost and Changed for user: %s', 'theme-my-login'), $user->user_login) . "\r\n"; $title = apply_filters('password_change_notification_title', $title, $user->ID); $message = apply_filters('password_change_notification_message', $message, $user->ID); wp_mail($to, $title, $message); } } } Theme_My_Login_Custom_Email::get_object(); } if (is_admin()) { include_once dirname(__FILE__) . '/admin/custom-email-admin.php'; }