wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



get_bookmark_field › WordPress Function

Od2.3.0
Przestarzałyn/a
get_bookmark_field ( $field, $bookmark, $context = 'display' )
Parametry: (3)
  • (string) $field The name of the data field to return.
    Wymagane: Tak
  • (int) $bookmark The bookmark ID to get field.
    Wymagane: Tak
  • (string) $context Optional. The context of how the field will be used. Default 'display'.
    Wymagane: Nie
    Domyślny: 'display'
Powrót:
  • (string|WP_Error)
Zdefiniowane na:
Codex:

Retrieves single bookmark data item or field.



Źródło

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