Skip to content

Commit

Permalink
Merge pull request #5763 from pods-framework/feature/5752-media-rest-…
Browse files Browse the repository at this point in the history
…fields

Fix REST fields for media Pod
  • Loading branch information
sc0ttkclark authored Jul 2, 2020
2 parents 1005f72 + 172c277 commit 490daec
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions classes/PodsRESTHandlers.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@ public static function get_handler( $object, $field_name, $request, $object_type
*/

if ( empty( $pod_name ) ) {
if ( 'attachment' === $object_type ) {
$pod_name = 'media';
} else {
$pod_name = $object_type;
}
$pod_name = $object_type;
}

// Fix media pod name.
if ( 'attachment' === $pod_name ) {
$pod_name = 'media';
}

/**
Expand Down

0 comments on commit 490daec

Please sign in to comment.