• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress core a2z

WordPress core a2z

WordPress core only

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / rest_api_default_filters() – Registers the default REST API filters.

You appear to be a bot. Output may be restricted

Description

Registers the default REST API filters.

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

Usage

rest_api_default_filters();

Parameters

Returns

void

Source

File name: wordpress/wp-includes/rest-api.php


Lines:

1 to 20 of 20
function rest_api_default_filters() {
  if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
    // 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' )  <;
    add_action( 'doing_it_wrong_run', 'rest_handle_doing_it_wrong', 10, 3 );
    add_filter( 'doing_it_wrong_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_post_dispatch', 'rest_filter_response_fields',  < 10, 3 );

  add_filter( 'rest_pre_dispatch', 'rest_handle_options_request',  < 10, 3 );
  add_filter( 'rest_index', 'rest_add_application_passwords_to_index' );
}
 

 View on GitHub View on Trac

Published: 25th November 2019 | Last updated: 9th December 2020

Primary Sidebar

Information

Function name: rest_api_default_filters
Plugin ref: WordPress
Version: 5.6
Sourcefile: wp-includes/rest-api.php
File ref: wp-includes/rest-api.php
Deprecated?: No
API Letters: A,D,F,R

Footer

WP-a2z
WordPress core a2z
WordPress core only
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  core.wp-a2z.org
© Copyright WP-a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites