acf_get_field_rest_links()ACF 1.0

Get the REST API field links for a given field. The links are appended to the REST response under the _links property and provide API resource links to related objects. If a link is marked as 'embeddable', WordPress can load the resource in the main request under the _embedded property when the request contains the _embed URL parameter.

Хуки из функции

Возвращает

Массив.

Использование

acf_get_field_rest_links( $post_id, $field );
$post_id(строка|int) (обязательный)
-
$field(массив) (обязательный)
-

Заметки

Код acf_get_field_rest_links() ACF 6.0.4

function acf_get_field_rest_links( $post_id, array $field ) {
	$value = acf_get_value( $post_id, $field );
	$type  = acf_get_field_type( $field['type'] );
	$links = $type->get_rest_links( $value, $post_id, $field );

	/**
	 * Filter the REST API links for a given field.
	 *
	 * @param array      $links
	 * @param string|int $post_id
	 * @param array      $field
	 * @param mixed      $value
	 */
	return (array) apply_filters( 'acf/rest/get_field_links', $links, $post_id, $field, $value );
}