welcome_user_msg_filter() WordPress Function

Welcome User Message Filter is a simple and effective way to customize the messages your users see when they login. It allows you to filter the message by user role, so you can tailor the message to specific groups of users.

welcome_user_msg_filter( string $text ) #

Ensures that the welcome message is not empty. Currently unused.


Parameters

$text

(string)(Required)


Top ↑

Return

(string)


Top ↑

Source

File: wp-includes/ms-functions.php

function welcome_user_msg_filter( $text ) {
	if ( ! $text ) {
		remove_filter( 'site_option_welcome_user_email', 'welcome_user_msg_filter' );

		/* translators: Do not translate USERNAME, PASSWORD, LOGINLINK, SITE_NAME: those are placeholders. */
		$text = __(
			'Howdy USERNAME,

Your new account is set up.

You can log in with the following information:
Username: USERNAME
Password: PASSWORD
LOGINLINK

Thanks!

--The Team @ SITE_NAME'
		);
		update_site_option( 'welcome_user_email', $text );
	}
	return $text;
}


Top ↑

Changelog

Changelog
VersionDescription
MU (3.0.0)Introduced.

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.

Show More
Show More