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 |
---|---|
2906 | if ( ! empty( $path_parts['query'] ) ) { |
2907 | parse_str( $path_parts['query'], $query_params ); |
2908 | $request->set_query_params( $query_params ); |
2909 | } |
2910 |
|
2911 | $response = rest_do_request( $request ); |
2912 | if ( 200 === $response->status ) { |
2913 | $server = rest_get_server(); |
2914 | /** This filter is documented in wp-includes/rest-api/class-wp-rest-server.php */ |
2915 | $response = apply_filters( 'rest_post_dispatch', rest_ensure_response( $response ), $server, $request ); |
2916 | $embed = $request->has_param( '_embed' ) ? rest_parse_embed_param( $request['_embed'] ) : false; |
2917 | $data = (array) $server->response_to_data( $response, $embed ); |
2918 |
|
2919 | if ( 'OPTIONS' === $method ) { |
2920 | $memo[ $method ][ $path ] = array( |
2921 | 'body' => $data, |
2922 | 'headers' => $response->headers, |
2923 | ); |
2924 | } else { |