2011-07-30 2 views

답변

2

필터 media_send_to_editor을 사용해야합니다.

add_filter('media_send_to_editor', 'so_6884350_send_to_editor', 10, 3); 

function so_6884350_send_to_editor($html, $send_id, $attachment) 
{ 
    /* Manipulate $html result */ 
    return $html; 
} 

$html은 게시물에 삽입 될 코드입니다. 예 : <a href='http://example.com/wp-content/uploads/2012/11/README.rtf'>README</a>

$send_id은 삽입되는 첨부 파일의 ID입니다. 이를 사용하여 첨부 파일에 대한 정보 (예 : get_post_mime_type($send_id);)를 가져옵니다.

array(
    ['menu_order'] => 
    ['post_title'] => 'README' 
    ['post_excerpt'] => 
    ['post_content'] => 
    ['url'] => 'http://example.com/wp-content/uploads/2012/11/README.rtf' 
) 
:

$attachment

는 다음의 구조와 배열
관련 문제