WordPress at a glance
function is not described

WP_REST_Response::remove_link() public WP 4.4.0

Removes a link from the response.

{} It's a method of the class: WP_REST_Response{}

No Hooks.

Return

Null. Nothing.

Usage

$WP_REST_Response = new WP_REST_Response();
$WP_REST_Response->remove_link( $rel, $href );
$rel(string) (required)
Link relation. Either an IANA registered type, or an absolute URL.
$href(string)
Only remove links for the relation matching the given href.
Default: null

Changelog

Since 4.4.0 Introduced.

Code of WP_REST_Response::remove_link() WP 5.5.1

<?php
public function remove_link( $rel, $href = null ) {
	if ( ! isset( $this->links[ $rel ] ) ) {
		return;
	}

	if ( $href ) {
		$this->links[ $rel ] = wp_list_filter( $this->links[ $rel ], array( 'href' => $href ), 'NOT' );
	} else {
		$this->links[ $rel ] = array();
	}

	if ( ! $this->links[ $rel ] ) {
		unset( $this->links[ $rel ] );
	}
}