UPDATE_Interface.php
| 1 | <?php |
| 2 | |
| 3 | namespace Pods\REST\Interfaces\Endpoints; |
| 4 | |
| 5 | use WP_Error; |
| 6 | use WP_REST_Request; |
| 7 | use WP_REST_Response; |
| 8 | |
| 9 | /** |
| 10 | * UPDATE endpoint interface. |
| 11 | * |
| 12 | * @credit The Events Calendar team - https://github.com/the-events-calendar/tribe-common |
| 13 | * |
| 14 | * @since 3.0 |
| 15 | */ |
| 16 | interface UPDATE_Interface { |
| 17 | /** |
| 18 | * Handles UPDATE requests on the endpoint. |
| 19 | * |
| 20 | * @since 3.0 |
| 21 | * |
| 22 | * @param WP_REST_Request $request |
| 23 | * |
| 24 | * @return WP_Error|WP_REST_Response An array containing the data of the updated post on |
| 25 | * success or a WP_Error instance on failure. |
| 26 | */ |
| 27 | public function update( WP_REST_Request $request ); |
| 28 | |
| 29 | /** |
| 30 | * Returns the content of the `args` array that should be used to register the endpoint |
| 31 | * with the `register_rest_route` function. |
| 32 | * |
| 33 | * @since 3.0 |
| 34 | * |
| 35 | * @return array |
| 36 | */ |
| 37 | public function EDIT_args(); |
| 38 | |
| 39 | /** |
| 40 | * Whether the current user can update content of this type or not. |
| 41 | * |
| 42 | * @since 3.0 |
| 43 | * |
| 44 | * @return bool Whether the current user can update or not. |
| 45 | */ |
| 46 | public function can_edit(); |
| 47 | } |
| 48 |