WC_Admin_Setup_Wizard::should_show_automated_tax() protected WC 1.0
Устарела с версии 4.6.0. Больше не поддерживается и может быть удалена. Рекомендуется заменить эту функцию на аналог.╳
The "automated tax" extra should only be shown if the current user can install plugins and the store is in a supported country.
{} Это метод класса: WC_Admin_Setup_Wizard{}
Хуков нет.
Возвращает
Null. Ничего.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->should_show_automated_tax();
Список изменений
Устарела с | 4.6.0 |
Код WC_Admin_Setup_Wizard::should_show_automated_tax() WC Admin Setup Wizard::should show automated tax WC 5.0.0
protected function should_show_automated_tax() {
_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
if ( ! current_user_can( 'install_plugins' ) ) {
return false;
}
$country_code = WC()->countries->get_base_country();
// https://developers.taxjar.com/api/reference/#countries .
$tax_supported_countries = array_merge(
array( 'US', 'CA', 'AU' ),
WC()->countries->get_european_union_countries()
);
return in_array( $country_code, $tax_supported_countries, true );
}