0

wordpress のデフォルトの wp_mail.php を使用してメール投稿を取得しています。ここで、メールから添付ファイルを取得し、投稿で公開したいと考えています。プラグインなしでどうやってそれを行うことができますか?

前もって感謝します。

4

1 に答える 1

0

次のような意味ですか:

$args = array(
    'post_type' => 'attachment',
    'numberposts' => null,
    'post_status' => null,
    'post_parent' => $post->ID
); 
$attachments = get_posts($args);
if ($attachments) {
    foreach ($attachments as $attachment) {
        echo apply_filters('the_title', $attachment->post_title);
        the_attachment_link($attachment->ID, false);
    }
}
于 2013-09-13T07:12:42.580 に答える