0
여러 파일 (이미지 또는 파일 일 수 있음)을 업로드하기 위해 metabox를 만들려고합니다.Wordpress에서 다중 파일 업로드 Metabox 만들기
현재 업로드 필드와 작업 파일은 업로드를 누르고 데이터를 저장할 때까지 있습니다.
유일한 문제는 파일을 표시하는 것입니다. 다음은
은 내가 METABOX을 표시하기 위해 사용하고, 내 코드입니다 :case 'file_list':
echo '<input class="cmb_upload_file" type="text" size="36" name="', $field['id'], '" value="" />';
echo '<input class="cmb_upload_button button" type="button" value="Upload File" />';
echo '<p class="cmb_metabox_description">', $field['desc'], '</p>';
$args = array(
'post_type' => 'attachment',
'numberposts' => null,
'post_status' => null,
'post_parent' => $post->ID
);
$attachments = get_posts($args);
if ($attachments) {
echo '<ul class="attach_list">';
foreach ($attachments as $attachment) {
echo '<li>'.wp_get_attachment_link($attachment->ID, 'thumbnail', 0, 0, 'Download');
echo '<span>';
echo apply_filters('the_title', ' '.$attachment->post_title);
echo '</span></li>';
}
echo '</ul>';
}
break;
1) 현재의 나를 내가이 METABOX를 사용하여 업로드 파일 만 표시해야 &을 게시 첨부 된 모든 파일을 표시.
2) 작은 미리보기 이미지가 필요합니다.
감사합니다.
일부 샘플 코드를 공유 할 수 있습니까? –