Automattic\WooCommerce\StoreApi\Routes\V1
CartItems::prepare_links()
Prepare links for the request.
Метод класса: CartItems{}
Хуков нет.
Возвращает
Массив
.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->prepare_links( $cart_item, $request );
- $cart_item(массив) (обязательный)
- Object to prepare.
- $request(\WP_REST_Request) (обязательный)
- Request object.
Код CartItems::prepare_links() CartItems::prepare links WC 8.7.0
protected function prepare_links( $cart_item, $request ) { $base = $this->get_namespace() . $this->get_path(); $links = array( 'self' => array( 'href' => rest_url( trailingslashit( $base ) . $cart_item['key'] ), ), 'collection' => array( 'href' => rest_url( $base ), ), ); return $links; }