Skip to content

Commit bbc9c19

Browse files
Label the settings abilities Get Settings and Update Settings
"Settings Get" and "Settings Update" follow the ability names but do not read as labels. The core abilities start with the verb, as in "Get Site Information", and the core port uses "Get Settings" too.
1 parent fbc9cf6 commit bbc9c19

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎includes/Abilities/Settings/Settings.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ private function register_get_settings(): void {
143143
wp_register_ability(
144144
'core/settings-get',
145145
array(
146-
'label' => __( 'Settings Get', 'ai' ),
146+
'label' => __( 'Get Settings', 'ai' ),
147147
'description' => __( 'Returns WordPress settings as a flat map of setting name to value. By default returns all settings exposed to abilities, or optionally a subset filtered by settings group, by setting name, or both. A setting whose value does not match its schema is left out.', 'ai' ),
148148
'category' => 'site',
149149
'input_schema' => $this->get_settings_input_schema( $groups, array_keys( $this->exposed_settings ) ),
@@ -206,7 +206,7 @@ private function register_update_settings(): void {
206206
wp_register_ability(
207207
'core/settings-update',
208208
array(
209-
'label' => __( 'Settings Update', 'ai' ),
209+
'label' => __( 'Update Settings', 'ai' ),
210210
'description' => __( 'Updates WordPress settings exposed to abilities, except siteurl, admin_email, and wp_page_for_privacy_policy. Accepts a map of setting name to its new value, where null deletes the stored value so the setting falls back to its default. Returns the updated settings with their values after the update; a setting whose value does not match its schema is left out, as in core/settings-get.', 'ai' ),
211211
'category' => 'site',
212212
'input_schema' => array(

‎tests/Integration/Includes/Abilities/Settings/SettingsTest.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public function test_override_replaces_existing_core_settings_get(): void {
228228
$this->register_ability();
229229

230230
$ability = wp_get_ability( 'core/settings-get' );
231-
$this->assertSame( 'Settings Get', $ability->get_label() );
231+
$this->assertSame( 'Get Settings', $ability->get_label() );
232232
// The plugin's shape exposes optional `group` and `fields` filters.
233233
$this->assertArrayHasKey( 'fields', $ability->get_input_schema()['properties'] );
234234
}
@@ -475,7 +475,7 @@ public function test_registers_deprecated_read_settings_alias(): void {
475475
$current = wp_get_ability( 'core/settings-get' );
476476

477477
$this->assertInstanceOf( WP_Ability::class, $alias, 'The deprecated core/read-settings alias should be registered.' );
478-
$this->assertSame( 'Settings Get (deprecated)', $alias->get_label(), 'The alias label should mark it as deprecated.' );
478+
$this->assertSame( 'Get Settings (deprecated)', $alias->get_label(), 'The alias label should mark it as deprecated.' );
479479
$this->assertStringContainsString( 'Use `core/settings-get` instead.', $alias->get_description(), 'The alias description should name the replacement.' );
480480
$this->assertSame( $current->get_category(), $alias->get_category(), 'The alias should share the replacement category.' );
481481
$this->assertSame( $current->get_input_schema(), $alias->get_input_schema(), 'The alias should share the replacement input schema.' );
@@ -595,7 +595,7 @@ public function test_core_settings_update_ability_is_registered(): void {
595595
$ability = wp_get_ability( 'core/settings-update' );
596596

597597
$this->assertInstanceOf( WP_Ability::class, $ability );
598-
$this->assertSame( 'Settings Update', $ability->get_label() );
598+
$this->assertSame( 'Update Settings', $ability->get_label() );
599599
$this->assertSame( 'site', $ability->get_category() );
600600
$this->assertTrue( $ability->get_meta_item( 'show_in_rest', false ) );
601601

0 commit comments

Comments
 (0)