Thanks very much, it’s multiple.
Here’s a comparison of the var_dump($related) for the CPT that does work, and the extended post type where the code mentioned above doesn’t show the download field:
var_dump( $related )
Pods CPT where documents are displayed:
array(1) { [0]=> array(24) { ["ID"]=> string(3) "293" ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2021-07-29 08:23:23" ["post_date_gmt"]=> string(19) "2021-07-29 08:23:23" ["post_content"]=> string(0) "" ["post_title"]=> string(67) "Meeting name" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "inherit" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(63) "Download title" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2021-07-29 10:17:26" ["post_modified_gmt"]=> string(19) "2021-07-29 10:17:26" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> string(3) "257" ["guid"]=> string(136) "download.doc" ["menu_order"]=> string(1) "0" ["post_type"]=> string(10) "attachment" ["post_mime_type"]=> string(71) "application/vnd.openxmlformats-officedocument.wordprocessingml.document" ["comment_count"]=> string(1) "0" ["pod_item_id"]=> string(3) "293" } } 293
PODS extended post type where Illegal string offset 'ID' in $id = $rel[ 'ID' ];:
array(24) { ["ID"]=> string(3) "392" ["post_author"]=> string(1) "1" ["post_date"]=> string(19) "2021-08-06 15:00:53" ["post_date_gmt"]=> string(19) "2021-08-06 15:00:53" ["post_content"]=> string(0) "" ["post_title"]=> string(37) "Event name" ["post_excerpt"]=> string(0) "" ["post_status"]=> string(7) "inherit" ["comment_status"]=> string(6) "closed" ["ping_status"]=> string(6) "closed" ["post_password"]=> string(0) "" ["post_name"]=> string(39) "Download title" ["to_ping"]=> string(0) "" ["pinged"]=> string(0) "" ["post_modified"]=> string(19) "2021-09-15 15:48:54" ["post_modified_gmt"]=> string(19) "2021-09-15 15:48:54" ["post_content_filtered"]=> string(0) "" ["post_parent"]=> string(3) "390" ["guid"]=> string(109) "download.pdf" ["menu_order"]=> string(1) "0" ["post_type"]=> string(10) "attachment" ["post_mime_type"]=> string(15) "application/pdf" ["comment_count"]=> string(1) "0" ["pod_item_id"]=> string(3) "392" }
-
This reply was modified 3 years, 2 months ago by pixelshrink.
-
This reply was modified 3 years, 2 months ago by Yui. Reason: formatting