admin管理员组文章数量:1414614
I have a form that users should upload multiple images but the code doesn't run correctly. This code works perfectly but when I add foreach
to upload more images it doesn't work. it seems that $_FILES
only gets the first image. I would be grateful if you could help.
if(isset($_FILES['uploadfile']['name'])){
if(! function_exists('wp_handle_upload')){
require_once(ABSPATH.'wp-admin/includes/file.php');
}
$uploadedfile = $_FILES ['uploadfile'];
$upload_overrides = array('test_form' => false );
$movefile = wp_handle_upload($uploadedfile, $upload_overrides);
if($movefile && !isset($movefile['error'])){
echo '<a href="'.$movefile['url'].'">view the link</a>';
}else{
echo '<p>'.$movefile['error'].'</p>';
}
}
本文标签: pluginsupload multiple images using wphandleupload
版权声明:本文标题:plugins - upload multiple images using wp_handle_upload 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745192139a2646960.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论