From 172c2777f78ea21f5f986a60e80ddff125fd511e Mon Sep 17 00:00:00 2001 From: JoryHogeveen Date: Thu, 2 Jul 2020 16:14:49 +0200 Subject: [PATCH] Fix media rest pod name --- classes/PodsRESTHandlers.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/classes/PodsRESTHandlers.php b/classes/PodsRESTHandlers.php index 2291ba5e5c..a7ab2ea2b8 100755 --- a/classes/PodsRESTHandlers.php +++ b/classes/PodsRESTHandlers.php @@ -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'; } /**