WC_Admin_Settings
The main class in charge of the settings in WooCommerce is WC_Admin_Settings.
Path to the file:
plugins/woocommerce/includes/admin/class-wc-admin-settings.php
Useful methods:
WC_Admin_Settings::add_message();
WC_Admin_Settings::add_error();
WC_Settings_Page
And there’s a class responsible for the tabs on the Settings page: WC_Settings_Page.
Path to the file:
/plugins/woocommerce/includes/admin/settings/class-wc-settings-page.php
There are 9 default tabs:
| Tab | ID |
|---|---|
| General | general |
| Products | products |
| Tax | tax |
| Shipping | shipping |
| Payments | checkout |
| Accounts & Privacy | account |
| Emails | |
| Integration | integration |
| Advanced | advanced |
Shipping and Gateways
There was created a special abstract class WC_Settings_API for shipping and gateways.
Path to the file:
/plugins/woocommerce/includes/abstracts/abstract-wc-settings-api.php
There, we can find process_admin_options() method used to save options.
We can also see two classes extended from WC_Settings_API:
WC_Payment_Gateway
WC_Shipping_Method
Andrew Dorokhov