@@ -58,10 +58,10 @@ public static function register(): void {
5858 * @since 7.1.0
5959 */
6060 public static function register_get_settings (): void {
61- $ settings = self ::get_exposed_settings ();
62- $ groups = array_values ( array_unique ( array_filter ( wp_list_pluck ( $ settings , 'group ' ) ) ) );
63- $ slugs = array_keys ( $ settings );
64- $ properties = array ();
61+ $ settings = self ::get_exposed_settings ();
62+ $ groups = array_values ( array_unique ( array_filter ( wp_list_pluck ( $ settings , 'group ' ) ) ) );
63+ $ setting_names = array_keys ( $ settings );
64+ $ properties = array ();
6565 foreach ( $ settings as $ exposed_name => $ setting ) {
6666 $ properties [ $ exposed_name ] = $ setting ['schema ' ];
6767 }
@@ -72,7 +72,7 @@ public static function register_get_settings(): void {
7272 'label ' => __ ( 'Get Settings ' ),
7373 '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 or by setting name. ' ),
7474 'category ' => self ::CATEGORY ,
75- 'input_schema ' => self ::get_settings_input_schema ( $ groups , $ slugs ),
75+ 'input_schema ' => self ::get_settings_input_schema ( $ groups , $ setting_names ),
7676 'output_schema ' => array (
7777 'type ' => 'object ' ,
7878 'description ' => __ ( 'A map of setting name to its current value. ' ),
@@ -106,14 +106,14 @@ public static function execute_get_settings( $input = array() ): array {
106106
107107 $ settings = self ::get_exposed_settings ();
108108 $ group = isset ( $ input ['group ' ] ) ? (string ) $ input ['group ' ] : '' ;
109- $ slugs = isset ( $ input ['slugs ' ] ) && is_array ( $ input ['slugs ' ] ) ? $ input ['slugs ' ] : array ();
109+ $ names = isset ( $ input ['settings ' ] ) && is_array ( $ input ['settings ' ] ) ? $ input ['settings ' ] : array ();
110110
111111 $ result = array ();
112112 foreach ( $ settings as $ exposed_name => $ setting ) {
113113 if ( '' !== $ group && $ setting ['group ' ] !== $ group ) {
114114 continue ;
115115 }
116- if ( ! empty ( $ slugs ) && ! in_array ( $ exposed_name , $ slugs , true ) ) {
116+ if ( ! empty ( $ names ) && ! in_array ( $ exposed_name , $ names , true ) ) {
117117 continue ;
118118 }
119119
@@ -142,11 +142,11 @@ public static function has_permission(): bool {
142142 *
143143 * @since 7.1.0
144144 *
145- * @param string[] $groups Available settings groups.
146- * @param string[] $slugs Available exposed setting names.
145+ * @param string[] $groups Available settings groups.
146+ * @param string[] $setting_names Available exposed setting names.
147147 * @return array<string, mixed> The input JSON Schema.
148148 */
149- protected static function get_settings_input_schema ( array $ groups , array $ slugs ): array {
149+ protected static function get_settings_input_schema ( array $ groups , array $ setting_names ): array {
150150 return array (
151151 'type ' => 'object ' ,
152152 'default ' => array (),
@@ -173,13 +173,13 @@ protected static function get_settings_input_schema( array $groups, array $slugs
173173 array (
174174 'title ' => __ ( 'Filter by name ' ),
175175 'type ' => 'object ' ,
176- 'required ' => array ( 'slugs ' ),
176+ 'required ' => array ( 'settings ' ),
177177 'properties ' => array (
178- 'slugs ' => array (
178+ 'settings ' => array (
179179 'type ' => 'array ' ,
180180 'items ' => array (
181181 'type ' => 'string ' ,
182- 'enum ' => $ slugs ,
182+ 'enum ' => $ setting_names ,
183183 ),
184184 'description ' => __ ( 'Return only the settings with these names. ' ),
185185 ),
0 commit comments