welcome_user_msg_filter

函式
welcome_user_msg_filter ( $text )
引數
  • (string) $text
    Required:
返回值
  • (string)
定義位置
相關方法
wpmu_welcome_user_notificationdelete_user_metawp_resolve_numeric_slug_conflictswp_list_filtercore_update_footer
引入
-
棄用
-

welcome_user_msg_filter。這個過濾器用於定製新使用者首次登入網站時顯示的歡迎資訊。它需要兩個引數–$message和$user_id。$message是預設的歡迎詞,$user_id是使用者的ID。

確保歡迎詞不是空的。目前未使用。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
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;
}
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; }
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;
}

常見問題

FAQs
檢視更多 >