wp-includes の post.php と post-template.php に追加されたアタッチメント関連関数についてまとめます。 wp-includes/post.php get_attached_file($attachment_id) アタッチメントのファイルパスを返す。具体的にはアタッチメントの _wp_attached_file ポストメタに保存されたファイルパスを返す。適用フィルタ: get_attached_file update_attached_file($attachment_id, $file) アタッチメントのファイルパスを _wp_attached_file ポストメタに保存する。すでに値があればそれを更新する。適用フィルタ: update_attached_file is_local_attachment($url) URL がローカルのリソースを指し
![WordPress 2.1 のアタッチメント API � iDeasilo](https://cdn-ak-scissors.b.st-hatena.com/image/square/8d71ff5111e05619a10d29bb40d7aebaa75c8fbc/height=288;version=1;width=512/https%3A%2F%2Fs0.wp.com%2Fi%2Fblank.jpg)