WC_REST_Webhook_Deliveries_V1_Controller::prepare_links()
Prepare links for the request.
Метод класса: WC_REST_Webhook_Deliveries_V1_Controller{}
Хуков нет.
Возвращает
Массив
. Links for the given webhook delivery.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->prepare_links( $log );
- $log(stdClass) (обязательный)
- Delivery log object.
Код WC_REST_Webhook_Deliveries_V1_Controller::prepare_links() WC REST Webhook Deliveries V1 Controller::prepare links WC 7.7.0
protected function prepare_links( $log ) { $webhook_id = (int) $log->request_headers['X-WC-Webhook-ID']; $base = str_replace( '(?P<webhook_id>[\d]+)', $webhook_id, $this->rest_base ); $links = array( 'self' => array( 'href' => rest_url( sprintf( '/%s/%s/%d', $this->namespace, $base, $log->id ) ), ), 'collection' => array( 'href' => rest_url( sprintf( '/%s/%s', $this->namespace, $base ) ), ), 'up' => array( 'href' => rest_url( sprintf( '/%s/webhooks/%d', $this->namespace, $webhook_id ) ), ), ); return $links; }