WC_REST_Data_Currencies_Controller::get_currency() public WC 1.0
Get currency information.
{} Это метод класса: WC_REST_Data_Currencies_Controller{}
Хуков нет.
Возвращает
Массив/Разное
. Response data, ready for insertion into collection data.
Использование
$WC_REST_Data_Currencies_Controller = new WC_REST_Data_Currencies_Controller(); $WC_REST_Data_Currencies_Controller->get_currency( $code, $request );
- $code(строка) (обязательный)
- Currency code.
- $request(WP_REST_Request) (обязательный)
- Request data.
Код WC_REST_Data_Currencies_Controller::get_currency() WC REST Data Currencies Controller::get currency WC 5.2.2
public function get_currency( $code, $request ) {
$currencies = get_woocommerce_currencies();
$data = array();
if ( ! array_key_exists( $code, $currencies ) ) {
return false;
}
$currency = array(
'code' => $code,
'name' => $currencies[ $code ],
'symbol' => get_woocommerce_currency_symbol( $code ),
);
return $currency;
}