Skip to content

Commit 1a9fddb

Browse files
Use show_in_abilities cehcking mechanism.
1 parent 42a8309 commit 1a9fddb

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/wp-includes/abilities/class-wp-settings-abilities.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
class WP_Settings_Abilities {
2525

2626
/**
27-
* Available setting groups with show_in_rest enabled.
27+
* Available setting groups with show_in_abilities enabled.
2828
*
2929
* @since 7.0.0
3030
* @var array
@@ -40,7 +40,7 @@ class WP_Settings_Abilities {
4040
private static $output_schema;
4141

4242
/**
43-
* Available setting slugs with show_in_rest enabled.
43+
* Available setting slugs with show_in_abilities enabled.
4444
*
4545
* @since 7.0.0
4646
* @var array
@@ -73,7 +73,7 @@ private static function init(): void {
7373
}
7474

7575
/**
76-
* Gets unique setting groups that have show_in_rest enabled.
76+
* Gets unique setting groups that have show_in_abilities enabled.
7777
*
7878
* @since 7.0.0
7979
*
@@ -83,7 +83,7 @@ private static function get_available_groups(): array {
8383
$groups = array();
8484

8585
foreach ( get_registered_settings() as $args ) {
86-
if ( wp_is_serving_rest_request() && empty( $args['show_in_rest'] ) ) {
86+
if ( empty( $args['show_in_abilities'] ) ) {
8787
continue;
8888
}
8989

@@ -99,7 +99,7 @@ private static function get_available_groups(): array {
9999
}
100100

101101
/**
102-
* Gets unique setting slugs that have show_in_rest enabled.
102+
* Gets unique setting slugs that have show_in_abilities enabled.
103103
*
104104
* @since 7.0.0
105105
*
@@ -109,7 +109,7 @@ private static function get_available_slugs(): array {
109109
$slugs = array();
110110

111111
foreach ( get_registered_settings() as $option_name => $args ) {
112-
if ( wp_is_serving_rest_request() && empty( $args['show_in_rest'] ) ) {
112+
if ( empty( $args['show_in_abilities'] ) ) {
113113
continue;
114114
}
115115

@@ -136,7 +136,7 @@ private static function build_output_schema(): array {
136136
$group_properties = array();
137137

138138
foreach ( get_registered_settings() as $option_name => $args ) {
139-
if ( wp_is_serving_rest_request() && empty( $args['show_in_rest'] ) ) {
139+
if ( empty( $args['show_in_abilities'] ) ) {
140140
continue;
141141
}
142142

@@ -260,7 +260,7 @@ public static function check_manage_options(): bool {
260260
/**
261261
* Execute callback for core/get-settings ability.
262262
*
263-
* Retrieves all registered settings that are exposed to the REST API,
263+
* Retrieves all registered settings that are exposed through the Abilities API,
264264
* grouped by their registration group.
265265
*
266266
* @since 7.0.0
@@ -282,7 +282,7 @@ public static function execute_get_settings( $input = array() ): array {
282282
$settings_by_group = array();
283283

284284
foreach ( $registered_settings as $option_name => $args ) {
285-
if ( wp_is_serving_rest_request() && empty( $args['show_in_rest'] ) ) {
285+
if ( empty( $args['show_in_abilities'] ) ) {
286286
continue;
287287
}
288288

0 commit comments

Comments
 (0)