acf_field_gallery::get_rest_links
Метод класса: acf_field_gallery{}
Хуков нет.
Возвращает
Массив.
Использование
$acf_field_gallery = new acf_field_gallery(); $acf_field_gallery->get_rest_links( $value, $post_id, $field );
- $value(разное) (обязательный)
- The raw (unformatted) field value.
- $post_id(int|строка) (обязательный)
- .
- $field(массив) (обязательный)
- .
Заметки
- Смотрите: [acf_field::get_rest_links()](/plugin/acf/function/acf_field::get_rest_links)
Код acf_field_gallery::get_rest_links() acf field gallery::get rest links ACF 6.4.2
public function get_rest_links( $value, $post_id, array $field ) {
$links = array();
if ( empty( $value ) ) {
return $links;
}
foreach ( (array) $value as $object_id ) {
$links[] = array(
'rel' => 'acf:attachment',
'href' => rest_url( '/wp/v2/media/' . $object_id ),
'embeddable' => true,
);
}
return $links;
}