Automattic\WooCommerce\Internal\Admin

Loader::get_custom_settingspublic staticWC 1.0

Deprecated since migrate to \Automattic\WooCommerce\Internal\Admin\Settings instead.. It is no longer supported and may be removed in future releases. It is recommended to replace this function with the same one.

Gets custom settings used for WC Admin.

Method of the class: Loader{}

No Hooks.

Returns

Array.

Usage

$result = Loader::get_custom_settings( $settings );
$settings(array) (required)
Array of settings to merge into.

Changelog

Deprecated migrate to \Automattic\WooCommerce\Internal\Admin\Settings instead.

Loader::get_custom_settings() code WC 11.0.1

public static function get_custom_settings( $settings ) {
	wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '9.9.0' );

	$wc_rest_settings_options_controller = new \WC_REST_Setting_Options_Controller();
	$wc_admin_group_settings             = $wc_rest_settings_options_controller->get_group_settings( 'wc_admin' );
	$settings['wcAdminSettings']         = array();

	foreach ( $wc_admin_group_settings as $setting ) {
		if ( ! empty( $setting['id'] ) ) {
			$settings['wcAdminSettings'][ $setting['id'] ] = $setting['value'];
		}
	}
	return $settings;
}