admin管理员组文章数量:1279017
When WordPress is installed, it sends a notification
New WordPress Site
Your new WordPress site has been successfully set up at:
...
I would like to change the text of the e-mail but am not successfull. Here is what I tried:
I added the following code to the main file of a plugin which I add before the installation
function changed_install_mail($installed_email, $user, $blog_title, $blog_url, $password ) {
$installed_email['subject'] = 'test';
return $installed_email;
}
add_filter( 'wp_installed_email', 'changed_install_mail', 10, 5 );
I tried to play around with the priority, but the filter never gets added. But other code in this plugin file is executed.
This filter gets applied in upgrade.php
$installed_email = apply_filters( 'wp_installed_email', $installed_email, $user, $blog_title, $blog_url, $password );
Maybe it's the wrong time or wrong location I'm trying it?
When WordPress is installed, it sends a notification
New WordPress Site
Your new WordPress site has been successfully set up at:
...
I would like to change the text of the e-mail but am not successfull. Here is what I tried:
I added the following code to the main file of a plugin which I add before the installation
function changed_install_mail($installed_email, $user, $blog_title, $blog_url, $password ) {
$installed_email['subject'] = 'test';
return $installed_email;
}
add_filter( 'wp_installed_email', 'changed_install_mail', 10, 5 );
I tried to play around with the priority, but the filter never gets added. But other code in this plugin file is executed.
This filter gets applied in upgrade.php
$installed_email = apply_filters( 'wp_installed_email', $installed_email, $user, $blog_title, $blog_url, $password );
Maybe it's the wrong time or wrong location I'm trying it?
Share Improve this question asked Nov 8, 2021 at 16:47 parvanehparvaneh 515 bronze badges2 Answers
Reset to default 2I found a solution: mu-plugins. My code isn't executed in this early state, but that's what mu-plugins are for. https://wordpress/support/article/must-use-plugins/ This did the trick.
just an opinium, each wordpress plataform is only instaled one time, and each time only the email registered will receive the email. Not my business, but isnt this worthless, if the person is installing wordpress, he knows the wordpress is being installed. if some other email is being their instead of the one who is installing it, why just not send a personal email giving the information. Also if you personalize one wordpress files to do so, you will need to use that files always you install a new wordpress. Also update your files each time wordpress has a new release/update. I must confess, I have installed a few and never had receive such email. And for the email to work always had to put some code on the theme functions.php
本文标签: pluginsModify wpinstalledemailwpnewblognotification
版权声明:本文标题:plugins - Modify wp_installed_emailwp_new_blog_notification 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741224187a2361547.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论