0
我podcast feed不會validate,並給出了錯誤「缺少機箱屬性:長度」我看到呼籲機箱標籤,但沒有結果內sb_media_size(文件大小功能)。這是一個WordPress插件,佈道瀏覽器。幫助讚賞。謝謝!WordPress的講道瀏覽器播客飼料缺少長度屬性
//Prints size of file
function sb_media_size($media_name, $media_type) {
if ($media_type == 'URLs') {
if(ini_get('allow_url_fopen')) {
$headers = is_array($media_name) && array_change_key_case(@get_headers($media_name, 1),CASE_LOWER);
$filesize = $headers['content-length'];
if ($filesize)
return "length=\"{$filesize}\"";
}
} else
return 'length="'[email protected](SB_ABSPATH.sb_get_option('upload_dir').$media_name).'"';
}
<enclosure url="<?php echo sb_podcast_file_url($media_name, $media_type).'" '.sb_media_size($media_name, $media_type).sb_mime_type($media_name); ?> />