WC_REST_Customers_V1_Controller::prepare_links()
Prepare links for the request.
Метод класса: WC_REST_Customers_V1_Controller{}
Хуков нет.
Возвращает
Массив
. Links for the given customer.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->prepare_links( $customer );
- $customer(WP_User) (обязательный)
- Customer object.
Код WC_REST_Customers_V1_Controller::prepare_links() WC REST Customers V1 Controller::prepare links WC 8.7.0
protected function prepare_links( $customer ) { $links = array( 'self' => array( 'href' => rest_url( sprintf( '/%s/%s/%d', $this->namespace, $this->rest_base, $customer->ID ) ), ), 'collection' => array( 'href' => rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ), ), ); return $links; }