rest_api_default_filters() - WordPress 函数参考中文文档

返回介绍

rest_api_default_filters()

发布于 2017-09-11 字数1432 浏览 1064 评论 0

rest_api_default_filters()

Registers the default REST API filters.


描述

Attached to the ‘rest_api_init’ action to make testing and disabling these filters easier.


源代码

File: wp-includes/rest-api.php

function rest_api_default_filters() {
	// Deprecated reporting.
	add_action( 'deprecated_function_run', 'rest_handle_deprecated_function', 10, 3 );
	add_filter( 'deprecated_function_trigger_error', '__return_false' );
	add_action( 'deprecated_argument_run', 'rest_handle_deprecated_argument', 10, 3 );
	add_filter( 'deprecated_argument_trigger_error', '__return_false' );

	// Default serving.
	add_filter( 'rest_pre_serve_request', 'rest_send_cors_headers' );
	add_filter( 'rest_post_dispatch', 'rest_send_allow_header', 10, 3 );

	add_filter( 'rest_pre_dispatch', 'rest_handle_options_request', 10, 3 );
}

更新日志

Version 描述
4.4.0 Introduced.

相关函数

Uses

  • wp-includes/plugin.php:
    add_action()
  • wp-includes/plugin.php:
    add_filter()

User Contributed Notes

上一篇:restore_previous_locale()

下一篇:rest_api_init()

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!