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
SettingsUIPageInterface.php
60 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Settings UI page 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 settings pages that opt into the settings UI renderer. |
| 14 | * |
| 15 | * @since 10.9.0 |
| 16 | */ |
| 17 | interface SettingsUIPageInterface { |
| 18 | |
| 19 | /** |
| 20 | * Get the stable page id used for scoping the settings UI. |
| 21 | * |
| 22 | * @since 10.9.0 |
| 23 | * |
| 24 | * @return string |
| 25 | */ |
| 26 | public function get_page_id(): string; |
| 27 | |
| 28 | /** |
| 29 | * Build the canonical settings schema for a section. |
| 30 | * |
| 31 | * @since 10.9.0 |
| 32 | * |
| 33 | * @param string $section Section id. Empty string means the default section. |
| 34 | * @return array |
| 35 | */ |
| 36 | public function get_schema( string $section ): array; |
| 37 | |
| 38 | /** |
| 39 | * Get script handles that must be loaded before the settings UI app mounts. |
| 40 | * |
| 41 | * @since 10.9.0 |
| 42 | * |
| 43 | * @param string $section Section id. Empty string means the default section. |
| 44 | * @return string[] |
| 45 | */ |
| 46 | public function get_script_handles( string $section ): array; |
| 47 | |
| 48 | /** |
| 49 | * Get the default save adapter for fields on this page. |
| 50 | * |
| 51 | * Supported values are `form_post` and `none`. |
| 52 | * |
| 53 | * @since 10.9.0 |
| 54 | * |
| 55 | * @param string $section Section id. Empty string means the default section. |
| 56 | * @return string |
| 57 | */ |
| 58 | public function get_save_adapter( string $section ): string; |
| 59 | } |
| 60 |