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 |
---|---|
2879 | if ( ! empty( $path_parts['query'] ) ) { |
2880 | parse_str( $path_parts['query'], $query_params ); |
2881 | $request->set_query_params( $query_params ); |
2882 | } |
2883 |
|
2884 | $response = rest_do_request( $request ); |
2885 | if ( 200 === $response->status ) { |
2886 | $server = rest_get_server(); |
2887 | /** This filter is documented in wp-includes/rest-api/class-wp-rest-server.php */ |
2888 | $response = apply_filters( 'rest_post_dispatch', rest_ensure_response( $response ), $server, $request ); |
2889 | $embed = $request->has_param( '_embed' ) ? rest_parse_embed_param( $request['_embed'] ) : false; |
2890 | $data = (array) $server->response_to_data( $response, $embed ); |
2891 |
|
2892 | if ( 'OPTIONS' === $method ) { |
2893 | $memo[ $method ][ $path ] = array( |
2894 | 'body' => $data, |
2895 | 'headers' => $response->headers, |
2896 | ); |
2897 | } else { |