Skip to content

Commit

Permalink
Fix REST API Show All Fields handling
Browse files Browse the repository at this point in the history
Fixes #7318
  • Loading branch information
sc0ttkclark committed Jul 15, 2024
1 parent 13d8939 commit d9101da
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions classes/PodsRESTFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down

0 comments on commit d9101da

Please sign in to comment.