From d9101da1d058b7718379ee03a9dfc33775c74a76 Mon Sep 17 00:00:00 2001 From: Scott Kingsley Clark Date: Mon, 15 Jul 2024 13:36:24 -0500 Subject: [PATCH] Fix REST API Show All Fields handling Fixes #7318 --- classes/PodsRESTFields.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/classes/PodsRESTFields.php b/classes/PodsRESTFields.php index 6ba82addce..a6a6ab1c30 100644 --- a/classes/PodsRESTFields.php +++ b/classes/PodsRESTFields.php @@ -216,11 +216,10 @@ public static function field_allowed_to_extend( $field, $pod, $mode ) { return false; } - $pod_mode_arg = 'rest_' . $mode . '_all'; - $pod_mode_access_arg = 'rest_' . $mode . '_all_access'; + $pod_mode_arg = $mode . '_all'; $all_fields_can_use_mode = filter_var( $pod->get_arg( $pod_mode_arg, false ), FILTER_VALIDATE_BOOLEAN ); - $all_fields_access = filter_var( $pod->get_arg( $pod_mode_access_arg, false ), FILTER_VALIDATE_BOOLEAN ); + $all_fields_access = 'read' === $mode && filter_var( $pod->get_arg( 'read_all_access', false ), FILTER_VALIDATE_BOOLEAN ); // Check if user must be logged in to access all fields and override whether they can use it. if ( $all_fields_can_use_mode && $all_fields_access ) {