WC_REST_Data_Continents_Controller::prepare_links()
Prepare links for the request.
Метод класса: WC_REST_Data_Continents_Controller{}
Хуков нет.
Возвращает
Массив
. Links for the given continent.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->prepare_links( $item );
- $item(объект) (обязательный)
- Data object.
Код WC_REST_Data_Continents_Controller::prepare_links() WC REST Data Continents Controller::prepare links WC 9.5.1
protected function prepare_links( $item ) { $continent_code = strtolower( $item['code'] ); $links = array( 'self' => array( 'href' => rest_url( sprintf( '/%s/%s/%s', $this->namespace, $this->rest_base, $continent_code ) ), ), 'collection' => array( 'href' => rest_url( sprintf( '/%s/%s', $this->namespace, $this->rest_base ) ), ), ); return $links; }