我对此代码有这个问题,它会继续向收件人发送邮件。
我已将完整插件上传到:" github.com/adu4/immab_invoice"在它里面你会找到一个.json文件,它是高级自定义帖子导出文件。
add_action('save_post','save_post_callback');
function save_post_callback($post_id){
global $post;
if ($post->post_type == 'immab_invoice')
$permalink = get_the_permalink();
$post_password = $post->post_password;
$to = get_field('kund_epost');
$subject = "Logging detaeljar";
$message = "Test";
// More headers
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$headers .= 'From: <info@example.s>' . "\r\n";
wp_mail($to,$subject,$message,$headers);
}