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