WordPress at Your Fingertips
function is not described

wp_ajax_delete_link() WP 3.1.0

Ajax handler for deleting a link.

No Hooks.

Return

null. Nothing.

Usage

wp_ajax_delete_link();

Changelog

Since 3.1.0 Introduced.

Code of wp_ajax_delete_link() WP 5.8.2

function wp_ajax_delete_link() {
	$id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;

	check_ajax_referer( "delete-bookmark_$id" );

	if ( ! current_user_can( 'manage_links' ) ) {
		wp_die( -1 );
	}

	$link = get_bookmark( $id );
	if ( ! $link || is_wp_error( $link ) ) {
		wp_die( 1 );
	}

	if ( wp_delete_link( $id ) ) {
		wp_die( 1 );
	} else {
		wp_die( 0 );
	}
}