WordPress开发者和主题制作者的搜索引擎



rest_pre_update_setting ›

Since4.7.0
已弃用n/a
apply_filters( 'rest_pre_update_setting', false, $name, $request[ $name ], $args )
参数: (4)
  • (bool) $result Whether to override the default behavior for updating the value of a setting.
    Required: Yes
  • (string) $name Setting name (as shown in REST API responses).
    Required: Yes
  • (mixed) $value Updated setting value.
    Required: Yes
  • (array) $args Arguments passed to register_setting() for this setting.
    Required: Yes
定义在:
文档:

Filters whether to preempt a setting value update.

Allows hijacking the setting update logic and overriding the built-in behavior by returning true.





源码

$updated = apply_filters( 'rest_pre_update_setting', false, $name, $request[ $name ], $args );