WP_REST_Controller::delete_item() WordPress Method
The delete_item() method is used to delete a single item from a WordPress site. This method is called when the user makes a DELETE request to the WordPress site.
WP_REST_Controller::delete_item( WP_REST_Request $request ) #
Deletes one item from the collection.
Parameters
- $request
(WP_REST_Request)(Required)Full details about the request.
Return
(WP_REST_Response|WP_Error) Response object on success, or WP_Error object on failure.
Source
File: wp-includes/rest-api/endpoints/class-wp-rest-controller.php
public function delete_item( $request ) { return new WP_Error( 'invalid-method', /* translators: %s: Method name. */ sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array( 'status' => 405 ) ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
4.7.0 | Introduced. |