From 5fa6cbfb2ed4b3fae588c5fb10237fdb836f5679 Mon Sep 17 00:00:00 2001 From: Quasel Date: Thu, 18 May 2017 11:42:49 +0200 Subject: [PATCH] fix foreach empty array --- classes/class-pods-page-data.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/classes/class-pods-page-data.php b/classes/class-pods-page-data.php index b3c4a2e..1bf51ff 100644 --- a/classes/class-pods-page-data.php +++ b/classes/class-pods-page-data.php @@ -323,7 +323,11 @@ private function recurse_pod_fields( $pod_name, $field_options = array(), $prefi $pod = pods( $pod_name ); $recurse_queue = array(); - $all_pod_fields = array_merge( $pod->pod_data['object_fields'], $pod->fields() ); + if ( isset( $pod->pod_data['object_fields'] ) ) { + $all_pod_fields = array_merge( $pod->pod_data['object_fields'], $pod->fields() ); + } else { + $all_pod_fields = $pod->fields(); + } foreach ( $all_pod_fields as $field_name => $field ) {