Title: get_link
Published: April 25, 2014
Last modified: February 24, 2026

---

# get_link( int $bookmark_id, string $output = OBJECT, string $filter ): object|array

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/get_link/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/functions/get_link/?output_format=md#see-also)
 * [Parameters](https://developer.wordpress.org/reference/functions/get_link/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/get_link/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/get_link/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/get_link/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/get_link/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/get_link/?output_format=md#wp--skip-link--target)

This function has been deprecated since 2.1.0. Use [get_bookmark()](https://developer.wordpress.org/reference/functions/get_bookmark/)
instead.

Retrieves bookmark data based on ID.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/get_link/?output_format=md#description)󠁿

### 󠀁[See also](https://developer.wordpress.org/reference/functions/get_link/?output_format=md#see-also)󠁿

 * [get_bookmark()](https://developer.wordpress.org/reference/functions/get_bookmark/)

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/get_link/?output_format=md#parameters)󠁿

 `$bookmark_id`intrequired

ID of link

`$output`stringoptional

Type of output. Accepts OBJECT, ARRAY_N, or ARRAY_A.

Default:`OBJECT`

`$filter`stringoptional

How to filter the link for output. Accepts `'raw'`, `'edit'`, `'attribute'`, `'js'`,`'
db'`, or `'display'`. Default `'raw'`.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/get_link/?output_format=md#return)󠁿

 object|array Bookmark object or array, depending on the type specified by `$output`.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/get_link/?output_format=md#source)󠁿

    ```php
    function get_link( $bookmark_id, $output = OBJECT, $filter = 'raw' ) {
    	_deprecated_function( __FUNCTION__, '2.1.0', 'get_bookmark()' );
    	return get_bookmark($bookmark_id, $output, $filter);
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/deprecated.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/deprecated.php#L2023)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/deprecated.php#L2023-L2026)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/get_link/?output_format=md#related)󠁿

| Uses | Description | 
| [get_bookmark()](https://developer.wordpress.org/reference/functions/get_bookmark/)`wp-includes/bookmark.php` |

Retrieves bookmark data.

  | 
| [_deprecated_function()](https://developer.wordpress.org/reference/functions/_deprecated_function/)`wp-includes/functions.php` |

Marks a function as deprecated and inform when it has been used.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/get_link/?output_format=md#changelog)󠁿

| Version | Description | 
| [2.1.0](https://developer.wordpress.org/reference/since/2.1.0/) | Deprecated. Use [get_bookmark()](https://developer.wordpress.org/reference/functions/get_bookmark/)  | 
| [2.0.0](https://developer.wordpress.org/reference/since/2.0.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fget_link%2F)
before being able to contribute a note or feedback.