get_bookmark_field

Definition:
function get_bookmark_field( $field, $bookmark, $context = 'display' ) {}

Retrieve single bookmark data item or field.

Parameters

  • string $field: The name of the data field to return
  • int $bookmark: The bookmark ID to get field
  • string $context: Optional. The context of how the field will be used.

Source code

function get_bookmark_field( $field, $bookmark, $context = 'display' ) {

	$bookmark = (int) $bookmark;

	$bookmark = get_bookmark( $bookmark );



	if ( is_wp_error($bookmark) )

		return $bookmark;



	if ( !is_object($bookmark) )

		return '';



	if ( !isset($bookmark->$field) )

		return '';



	return sanitize_bookmark_field($field, $bookmark->$field, $bookmark->link_id, $context);

}

1228

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: