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 |
---|---|
2952 | if ( ! empty( $path_parts['query'] ) ) { |
2953 | parse_str( $path_parts['query'], $query_params ); |
2954 | $request->set_query_params( $query_params ); |
2955 | } |
2956 |
|
2957 | $response = rest_do_request( $request ); |
2958 | if ( 200 === $response->status ) { |
2959 | $server = rest_get_server(); |
2960 | /** This filter is documented in wp-includes/rest-api/class-wp-rest-server.php */ |
2961 | $response = apply_filters( 'rest_post_dispatch', rest_ensure_response( $response ), $server, $request ); |
2962 | $embed = $request->has_param( '_embed' ) ? rest_parse_embed_param( $request['_embed'] ) : false; |
2963 | $data = (array) $server->response_to_data( $response, $embed ); |
2964 |
|
2965 | if ( 'OPTIONS' === $method ) { |
2966 | $memo[ $method ][ $path ] = array( |
2967 | 'body' => $data, |
2968 | 'headers' => $response->headers, |
2969 | ); |
2970 | } else { |