woocommerce/plugins/woocommerce-admin/client/analytics/settings
Paul Sealock 619804cff3
Stylelint: Update config to double quotes (#45607)
* Add eslint override

* bump versions stylelint config

* re pnpm install

* fix config

* move to double quotes in scss

* Add changefile(s) from automation for the following project(s): woocommerce-blocks, woocommerce

* lint fix new scss files

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-03-26 10:41:34 -03:00
..
historical-data Stylelint: Update config to double quotes (#45607) 2024-03-26 10:41:34 -03:00
README.md Fix/37502: Correct spelling errors. (#37887) 2023-05-08 15:55:09 +08:00
config.js fix: fixed all instances of translator lint rule violations (#41450) 2023-11-16 19:15:11 +08:00
default-date.js Fix JS linting errors 2022-10-18 00:17:22 +02:00
index.js Codemod to change i18n text domain from 'woocommerce-admin' to 'woocommerce' in WCA Client 2022-04-01 11:41:32 +08:00
index.scss Stylelint: Update config to double quotes (#45607) 2024-03-26 10:41:34 -03:00
setting.js Add date sorting configuration for Analytics (#36492) 2023-02-17 10:29:36 -03:00
setting.scss Stylelint: Update config to double quotes (#45607) 2024-03-26 10:41:34 -03:00

README.md

Settings

The settings used to modify the way data is retrieved or displayed in WooCommerce reports.

Extending Settings

Settings can be added, removed, or modified outside oc wc-admin by hooking into woocommerce_admin_analytics_settings. For example:

addFilter( 'woocommerce_admin_analytics_settings', 'wc-example/my-setting', settings => {
	return [
		...settings,
		{
            name: 'custom_setting',
            label: __( 'Custom setting:', 'woocommerce' ),
            inputType: 'text',
            helpText: __( 'Help text to describe what the setting does.' ),
            defaultValue: 'Default value',
		},
	];
} );

Each settings has the following properties:

  • name (string): The slug of the setting to be updated.
  • label (string): The label used to describe and displayed next to the setting.
  • inputType (enum: text|checkbox|checkboxGroup): The type of input to use.
  • helpText (string): Text displayed beneath the setting.
  • options (array): Array of options used for inputs with selectable options.
  • defaultValue (string|array): Value used when resetting to default settings.