提问人:Loid Christian 提问时间:9/12/2023 更新时间:9/12/2023 访问量:13
在调试 .log 文件中找不到自定义函数
Custom Function Not Found In debug.log File
问:
我正在创建一个插件,它用于联系表单,它们有文件字段,我将该文件保存在自定义文件夹中,为此我使用名为“aaiof_upload_dir”的函数,但在调试中.log它说函数不是 found.my 代码在下面。
remove_filter('upload_dir', 'aaiof_upload_dir');
`add_filter('upload_dir', 'aaiof_upload_dir'); //define function of aaior_upload_dir
$movefile = wp_handle_upload( $uploadedfile, $upload_overrides ); //using for upload file in default uploads folder
if (!function_exists( 'aaiof_upload_dir')){
function aaiof_upload_dir($upload) {
$upload['subdir'] = '/contact_form';
$upload['path'] = $upload['basedir'] . $upload['subdir'];
$upload['url'] = $upload['baseurl'] . $upload['subdir'];
return $upload;
}
}
答: 暂无答案
评论