rest_pre_dispatch

rest_pre_dispatch

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7

apply_filters('rest_pre_dispatch') is found 2 times:

  • /wp-includes/rest-api/class-wp-rest-server.php line 1078
    		 *                                 a normal endpoint can return, or null to not hijack the request.
    		 * @param WP_REST_Server  $server  Server instance.
    		 * @param WP_REST_Request $request Request used to generate the response.
    		 */
    		$result = apply_filters( 'rest_pre_dispatch', null, $this, $request );
    
    		if ( ! empty( $result ) ) {
    
    			// Normalize to either WP_Error or WP_REST_Response...
    			$result = rest_ensure_response( $result );
    
    
  • /wp-includes/rest-api/class-wp-rest-server.php line 1829
    			$clean_request->set_attributes( array() );
    			$clean_request->set_default_params( array() );
    
    			/** This filter is documented in wp-includes/rest-api/class-wp-rest-server.php */
    			$result = apply_filters( 'rest_pre_dispatch', null, $this, $clean_request );
    
    			if ( empty( $result ) ) {
    				$match = $matches[ $i ];
    				$error = null;
    
    				if ( is_wp_error( $validation[ $i ] ) ) {
    

See this hook used in plugins: