WC_REST_System_Status_V2_Controller::get_settings
Get some setting values for the site that are useful for debugging purposes. For full settings access, use the settings api.
Method of the class: WC_REST_System_Status_V2_Controller{}
No Hooks.
Returns
Array.
Usage
$WC_REST_System_Status_V2_Controller = new WC_REST_System_Status_V2_Controller(); $WC_REST_System_Status_V2_Controller->get_settings();
WC_REST_System_Status_V2_Controller::get_settings() WC REST System Status V2 Controller::get settings code WC 10.3.6
public function get_settings() {
// Get a list of terms used for product/order taxonomies.
$term_response = array();
$terms = get_terms( 'product_type', array( 'hide_empty' => 0 ) );
foreach ( $terms as $term ) {
$term_response[ $term->slug ] = strtolower( $term->name );
}
// Get a list of terms used for product visibility.
$product_visibility_terms = array();
$terms = get_terms( 'product_visibility', array( 'hide_empty' => 0 ) );
foreach ( $terms as $term ) {
$product_visibility_terms[ $term->slug ] = strtolower( $term->name );
}
// Get list of enabled features.
$enabled_features_slugs = array_keys(
wp_list_filter(
wc_get_container()->get( FeaturesController::class )->get_features( true, true ),
array( 'is_enabled' => true )
)
);
// Return array of useful settings for debugging.
return array(
'api_enabled' => 'yes' === get_option( 'woocommerce_api_enabled' ),
'force_ssl' => 'yes' === get_option( 'woocommerce_force_ssl_checkout' ),
'currency' => get_woocommerce_currency(),
'currency_symbol' => get_woocommerce_currency_symbol(),
'currency_position' => get_option( 'woocommerce_currency_pos' ),
'thousand_separator' => wc_get_price_thousand_separator(),
'decimal_separator' => wc_get_price_decimal_separator(),
'number_of_decimals' => wc_get_price_decimals(),
'geolocation_enabled' => in_array(
get_option( 'woocommerce_default_customer_address' ),
array(
'geolocation_ajax',
'geolocation',
),
true
),
'taxonomies' => $term_response,
'product_visibility_terms' => $product_visibility_terms,
'woocommerce_com_connected' => ConnectionHelper::is_connected() ? 'yes' : 'no',
'enforce_approved_download_dirs' => wc_get_container()->get( Download_Directories::class )->get_mode() === Download_Directories::MODE_ENABLED,
'order_datastore' => WC_Data_Store::load( 'order' )->get_current_class_name(),
'HPOS_enabled' => OrderUtil::custom_orders_table_usage_is_enabled(),
'HPOS_sync_enabled' => wc_get_container()->get( Order_DataSynchronizer::class )->data_sync_is_enabled(),
'enabled_features' => $enabled_features_slugs,
);
}