ACF_Rest_Embed_Links::load_item_links
Hook into the rest_prepare_{$type} filters and add links for the object being prepared.
Метод класса: ACF_Rest_Embed_Links{}
Хуков нет.
Возвращает
WP_REST_Response.
Использование
$ACF_Rest_Embed_Links = new ACF_Rest_Embed_Links(); $ACF_Rest_Embed_Links->load_item_links( $response, $item, $request );
- $response(WP_REST_Response) (обязательный)
- .
- $item(WP_Post|WP_User|WP_Term) (обязательный)
- .
- $request(WP_REST_Request) (обязательный)
- .
Код ACF_Rest_Embed_Links::load_item_links() ACF Rest Embed Links::load item links ACF 6.4.2
public function load_item_links( $response, $item, $request ) {
if ( empty( $this->links ) ) {
return $response;
}
while ( $attributes = array_pop( $this->links ) ) {
$response->add_link(
acf_extract_var( $attributes, 'rel' ),
acf_extract_var( $attributes, 'href' ),
$attributes
);
}
// Reset the links prop.
$this->links = array();
return $response;
}