LegacySettingsPageAdapter.php
4 weeks ago
SettingsSection.php
2 weeks ago
SettingsSectionInterface.php
2 weeks ago
SettingsSectionRegistry.php
2 weeks ago
SettingsUIPageInterface.php
4 weeks ago
SettingsUISchema.php
4 weeks ago
SettingsSectionInterface.php
78 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Settings section registration contract. |
| 4 | */ |
| 5 | |
| 6 | declare( strict_types=1 ); |
| 7 | |
| 8 | namespace Automattic\WooCommerce\Admin\Settings; |
| 9 | |
| 10 | defined( 'ABSPATH' ) || exit; |
| 11 | |
| 12 | /** |
| 13 | * Contract for extensions that register a section under an existing WooCommerce settings page. |
| 14 | * |
| 15 | * @since 10.9.0 |
| 16 | */ |
| 17 | interface SettingsSectionInterface { |
| 18 | |
| 19 | /** |
| 20 | * Get the parent WooCommerce settings page id. |
| 21 | * |
| 22 | * @return string |
| 23 | * |
| 24 | * @since 10.9.0 |
| 25 | */ |
| 26 | public function get_parent_page_id(): string; |
| 27 | |
| 28 | /** |
| 29 | * Get the section id. |
| 30 | * |
| 31 | * @return string |
| 32 | * |
| 33 | * @since 10.9.0 |
| 34 | */ |
| 35 | public function get_id(): string; |
| 36 | |
| 37 | /** |
| 38 | * Get the section label. |
| 39 | * |
| 40 | * @return string |
| 41 | * |
| 42 | * @since 10.9.0 |
| 43 | */ |
| 44 | public function get_label(): string; |
| 45 | |
| 46 | /** |
| 47 | * Get legacy settings for this section. |
| 48 | * |
| 49 | * @param \WC_Settings_Page $parent_page Parent settings page. |
| 50 | * @return array |
| 51 | * |
| 52 | * @since 10.9.0 |
| 53 | */ |
| 54 | public function get_settings( \WC_Settings_Page $parent_page ): array; |
| 55 | |
| 56 | /** |
| 57 | * Get script handles that must be loaded before the settings UI app mounts. |
| 58 | * |
| 59 | * @param \WC_Settings_Page $parent_page Parent settings page. |
| 60 | * @return string[] |
| 61 | * |
| 62 | * @since 10.9.0 |
| 63 | */ |
| 64 | public function get_script_handles( \WC_Settings_Page $parent_page ): array; |
| 65 | |
| 66 | /** |
| 67 | * Get the default save adapter for fields in this section. |
| 68 | * |
| 69 | * Supported values are `form_post` and `none`. |
| 70 | * |
| 71 | * @param \WC_Settings_Page $parent_page Parent settings page. |
| 72 | * @return string |
| 73 | * |
| 74 | * @since 10.9.0 |
| 75 | */ |
| 76 | public function get_save_adapter( \WC_Settings_Page $parent_page ): string; |
| 77 | } |
| 78 |