Skip to content

Instantly share code, notes, and snippets.

@horike37
Last active July 25, 2016 12:46
Show Gist options
  • Save horike37/7410391 to your computer and use it in GitHub Desktop.
Save horike37/7410391 to your computer and use it in GitHub Desktop.
Trust Formの管理者宛メールの件名をカスタマイズする
<?php
add_filter( 'tr_subject_admin_mail', 'my_tr_subject_admin_mail', 10, 3 );
function my_tr_subject_admin_mail( $subject, $data, $id ) {
$responce = get_post_meta( $id, 'answer' );
krsort($responce);
$entry_id = key($responce);
return $subject . '[id:'.$entry_id.']';
}
@ge15
Copy link

ge15 commented Oct 28, 2014

引数 "10" と、"3" の説明をお願いできますでしょうか。
また、IDではなく、フォームの特定のinput-dataを件名に含ませる方法も教えていただけますでしょうか。
よろしくお願いします。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment