WP_REST_Font_Families_Controller::delete_item( WP_REST_Request $request ): WP_REST_Response|WP_Error

In this article

Deletes a single font family.

Parameters

$requestWP_REST_Requestrequired
Full details about the request.

Return

WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.

Source

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 );
}

Changelog

VersionDescription
6.5.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.