wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



get_bookmark_field › WordPress Function

Seit2.3.0
Veraltetn/v
get_bookmark_field ( $field, $bookmark, $context = 'display' )
Parameter: (3)
  • (string) $field The name of the data field to return.
    Erforderlich: Ja
  • (int) $bookmark The bookmark ID to get field.
    Erforderlich: Ja
  • (string) $context Optional. The context of how the field will be used. Default 'display'.
    Erforderlich: Nein
    Standard: 'display'
Gibt zurück:
  • (string|WP_Error)
Definiert in:
Codex:

Retrieves single bookmark data item or field.



Quellcode

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