我在我的插件/文件夾中有一個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