wp_handle_upload

過濾鉤子
引數
  • (array) $upload { Array of upload data. @type string $file Filename of the newly-uploaded file. @type string $url URL of the newly-uploaded file. @type string $type Mime type of the newly-uploaded file. }
    Required:
    Default:
  • (string) $context The type of upload action. Values include 'upload' or 'sideload'.
    Required:
    Default: $action ? 'sideload' : 'upload'
定義位置
相關勾子
wp_create_file_in_uploadswp_embed_handler_audiowp_headpre_handle_404wpmu_delete_blog_upload_dir
相關方法
wp_handle_upload_wp_handle_uploadwp_handle_sideloadwp_import_handle_uploadmedia_handle_uploadwp_get_upload_dir
引入
2.1.0
棄用
-

wp_handle_upload: 這是一個WordPress函式,用於處理上傳檔案。它接受檔案資訊,並將其儲存在伺服器上。它還生成一個錯誤陣列,如果上傳檔案時出現問題,則可以顯示錯誤資訊。

過濾上傳檔案的資料陣列。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
return apply_filters(
return apply_filters(
return apply_filters(

常見問題

FAQs
檢視更多 >