Changeset 38689
- Timestamp:
- 09/30/2016 08:11:10 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/class-wp-rest-server.php
r38601 r38689 874 874 } 875 875 } 876 877 /** 878 * Call a filter before executing any REST API callbacks. 879 * 880 * Allows plugins to perform additional validation after a 881 * request is initialized and matched to a registered route, 882 * but before it is executed. 883 * 884 * Note that this filter will not be called for requests that 885 * fail to authenticate or match to a registered route. 886 * 887 * @since 4.7.0 888 * 889 * @param WP_HTTP_Response $response Result to send to the client. Usually a WP_REST_Response. 890 * @param WP_REST_Server $handler ResponseHandler instance (usually WP_REST_Server). 891 * @param WP_REST_Request $request Request used to generate the response. 892 */ 893 $response = apply_filters( 'rest_request_before_callbacks', $response, $handler, $request ); 876 894 877 895 if ( ! is_wp_error( $response ) ) { … … 911 929 } 912 930 } 931 932 /** 933 * Call a filter immediately after executing any REST API 934 * callbacks. 935 * 936 * Allows plugins to perform any needed cleanup, for example, 937 * to undo changes made during `rest_request_before_callbacks`. 938 * 939 * Note that this filter will not be called for requests that 940 * fail to authenticate or match to a registered route. 941 * 942 * Note that an endpoint's `permission_callback` can still be 943 * called after this filter - see the `rest_send_allow_header` 944 * function. 945 * 946 * @since 4.7.0 947 * 948 * @param WP_HTTP_Response $response Result to send to the client. Usually a WP_REST_Response. 949 * @param WP_REST_Server $handler ResponseHandler instance (usually WP_REST_Server). 950 * @param WP_REST_Request $request Request used to generate the response. 951 */ 952 $response = apply_filters( 'rest_request_after_callbacks', $response, $handler, $request ); 913 953 914 954 if ( is_wp_error( $response ) ) {
Note: See TracChangeset
for help on using the changeset viewer.