{$action}_overrides

過濾鉤子
apply_filters( "{$action}_overrides", $overrides, $file )
引數
  • (array|false) $overrides An array of override parameters for this file. Boolean false if none are provided. @see _wp_handle_upload().
    Required:
  • (array) $file { Reference to a single element from `$_FILES`. @type string $name The original name of the file on the client machine. @type string $type The mime type of the file, if the browser provided this information. @type string $tmp_name The temporary filename of the file in which the uploaded file was stored on the server. @type int $size The size, in bytes, of the uploaded file. @type int $error The error code associated with this file upload. }
    Required:
定義位置
相關勾子
registration_errorsadmin_noticescustom_menu_orderlang_codescron_schedules
相關方法
wp_timezone_override_offsetconvert_smiliesdo_action_ref_arrayis_active_widgetconvert_charsis_active_sidebar
引入
5.7.0
棄用
-

{$action}_overrides是一個過濾鉤,允許外掛改變或覆蓋傳遞給$action中指定的核心函式的值。例如,如果$action被設定為”update_post_meta”,那麼update_post_meta_overrides將是一個過濾器鉤子,外掛可以使用它來修改傳遞給update_post_meta函式的資料。

在檔案上傳到WordPress之前,對檔案的覆蓋引數進行過濾。

鉤子名稱的動態部分, $action,是指文章的動作。

可能的鉤子名稱包括:

  • wp_handle_sideload_overrides
  • wp_handle_upload_overrides
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
$overrides = apply_filters( "{$action}_overrides", $overrides, $file );
$overrides = apply_filters( "{$action}_overrides", $overrides, $file );
$overrides = apply_filters( "{$action}_overrides", $overrides, $file );

常見問題

FAQs
檢視更多 >