acf_field::get_rest_links()publicACF 1.0

Return an array of links for addition to the REST API response. Each link is an array and must have both rel and href keys. The href key must be a REST API resource URL. If a link is marked as embeddable, the _embed URL parameter will trigger WordPress to dispatch an internal sub request and load the object within the same request under the _embedded response property.

e.g;

[
	[
		'rel' => 'acf:post',
		'href' => 'https://example.com/wp-json/wp/v2/posts/497',
		'embeddable' => true,
	],
	[
		'rel' => 'acf:user',
		'href' => 'https://example.com/wp-json/wp/v2/users/2',
		'embeddable' => true,
	],
]

Метод класса: acf_field{}

Хуков нет.

Возвращает

Массив.

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

$acf_field = new acf_field();
$acf_field->get_rest_links( $value, $post_id, $field );
$value(разное) (обязательный)
The raw (unformatted) field value.
$post_id(строка|int) (обязательный)
-
$field(массив) (обязательный)
-

Код acf_field::get_rest_links() ACF 6.0.4

public function get_rest_links( $value, $post_id, array $field ) {
	return array();
}