{$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
$overrides = apply_filters( "{$action}_overrides", $overrides, $file );

常见问题

FAQs
查看更多 >