我在我的插件/文件夹中有一个test.php插件文件,我试图从这个插件发送一封电子邮件。Wp add_action参数错误
我有一个看起来像这样目前是代码我的插件
add_action('init', 'email_notifier', 10, 5);
function email_notifier($type, $email, $subject, $body, $link){
// wp_mail(....)
}
但是,我不知道是什么原因造成这个错误。
Warning: Missing argument 2 for email_notifier() in C:\....\user\templates_ajax_functions.php on line 35
Warning: Missing argument 3 for email_notifier() in C:\....\user\templates_ajax_functions.php on line 35
Warning: Missing argument 4 for email_notifier() in C:\....\user\templates_ajax_functions.php on line 35
Warning: Missing argument 5 for email_notifier() in C:\....\user\templates_ajax_functions.php on line 35
那么,有没有办法解决这个问题?我能做些什么吗? – meskerem
为什么你要写这个函数?所以我可以建议你适当的胡。你在寻找wp邮件钩子吗? –
是的,我不能在我的插件中使用wp_mail,它说未定义的函数。所以,我需要使用wp_mail发送电子邮件,问题是告诉wp_mail使用主题,身体... – meskerem