File tree Expand file tree Collapse file tree
src/wp-includes/abilities Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ private static function get_available_groups(): array {
8383 $ groups = array ();
8484
8585 foreach ( get_registered_settings () as $ args ) {
86- if ( empty ( $ args ['show_in_rest ' ] ) ) {
86+ if ( wp_is_serving_rest_request () && empty ( $ args ['show_in_rest ' ] ) ) {
8787 continue ;
8888 }
8989
@@ -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 ( empty ( $ args ['show_in_rest ' ] ) ) {
112+ if ( wp_is_serving_rest_request () && empty ( $ args ['show_in_rest ' ] ) ) {
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 ( empty ( $ args ['show_in_rest ' ] ) ) {
139+ if ( wp_is_serving_rest_request () && empty ( $ args ['show_in_rest ' ] ) ) {
140140 continue ;
141141 }
142142
@@ -267,7 +267,7 @@ public static function execute_get_settings( $input = array() ): array {
267267 $ settings_by_group = array ();
268268
269269 foreach ( $ registered_settings as $ option_name => $ args ) {
270- if ( empty ( $ args ['show_in_rest ' ] ) ) {
270+ if ( wp_is_serving_rest_request () && empty ( $ args ['show_in_rest ' ] ) ) {
271271 continue ;
272272 }
273273
You can’t perform that action at this time.
0 commit comments