WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
2863 | if ( ! empty( $path_parts['query'] ) ) { |
2864 | parse_str( $path_parts['query'], $query_params ); |
2865 | $request->set_query_params( $query_params ); |
2866 | } |
2867 |
|
2868 | $response = rest_do_request( $request ); |
2869 | if ( 200 === $response->status ) { |
2870 | $server = rest_get_server(); |
2871 | /** This filter is documented in wp-includes/rest-api/class-wp-rest-server.php */ |
2872 | $response = apply_filters( 'rest_post_dispatch', rest_ensure_response( $response ), $server, $request ); |
2873 | $embed = $request->has_param( '_embed' ) ? rest_parse_embed_param( $request['_embed'] ) : false; |
2874 | $data = (array) $server->response_to_data( $response, $embed ); |
2875 |
|
2876 | if ( 'OPTIONS' === $method ) { |
2877 | $memo[ $method ][ $path ] = array( |
2878 | 'body' => $data, |
2879 | 'headers' => $response->headers, |
2880 | ); |
2881 | } else { |