WP_REST_Font_Families_Controller::delete_item()
Deletes a single font family.
Method of the class: WP_REST_Font_Families_Controller{}
No Hooks.
Return
WP_REST_Response|WP_Error
. Response object on success, or WP_Error object on failure.
Usage
$WP_REST_Font_Families_Controller = new WP_REST_Font_Families_Controller(); $WP_REST_Font_Families_Controller->delete_item( $request );
- $request(WP_REST_Request) (required)
- Full details about the request.
Changelog
Since 6.5.0 | Introduced. |
WP_REST_Font_Families_Controller::delete_item() WP REST Font Families Controller::delete item code WP 6.7.1
public function delete_item( $request ) { $force = isset( $request['force'] ) ? (bool) $request['force'] : false; // We don't support trashing for font families. if ( ! $force ) { return new WP_Error( 'rest_trash_not_supported', /* translators: %s: force=true */ sprintf( __( 'Font faces do not support trashing. Set "%s" to delete.' ), 'force=true' ), array( 'status' => 501 ) ); } return parent::delete_item( $request ); }