Home › Forums › General Issues › Unable to display post objects list
I have a test site I’ve been experimenting with.
I have 2 custom post types – One is “Doctors”, the other is “Facilities”.
I’d like to be able to link doctors with their facilities they service. That way, when someone visits the doctor’s post page, it displays an array of the facilities that they service, (hopefully with links to these facilites.)
I am using the Divi Theme Builder to display the doctor’s name, and their specialties. I have no issues with these two values.
But when I add a post object and link the doctor to the facility and try to display this, nothing displays. Even worse, when I enable multiple values within the post object and select multiple values, I get the following error:
Fatal error: Uncaught Error: Object of class WP_Post could not be converted to string in /home/test/public_html/dtm/wp-content/themes/Divi/includes/builder/plugin-compat/advanced-custom-fields.php:303 Stack trace: #0 /home/test/public_html/dtm/wp-content/themes/Divi/includes/builder/plugin-compat/advanced-custom-fields.php(303): implode(‘, ‘, Array) #1 /home/test/public_html/dtm/wp-content/themes/Divi/includes/builder/plugin-compat/advanced-custom-fields.php(98): ET_Builder_Plugin_Compat_Advanced_Custom_Fields->format_field_value(Array, Array) #2 /home/test/public_html/dtm/wp-includes/class-wp-hook.php(308): ET_Builder_Plugin_Compat_Advanced_Custom_Fields->maybe_filter_dynamic_content_meta_value(Array, ‘post_object_fac…’, 32) #3 /home/test/public_html/dtm/wp-includes/plugin.php(205): WP_Hook->apply_filters(Array, Array) #4 /home/test/public_html/dtm/wp-content/themes/Divi/includes/builder/feature/dynamic-content.php(1674): apply_filters(‘et_builder_dyna…’, Array, ‘post_object_fac… in /home/alighttest/public_html/dtm/wp-content/themes/Divi/includes/builder/plugin-compat/advanced-custom-fields.php on line 303
Any insight?
Also, if I enable “Post ID” instead of “POst Object” in the field, it displays the post ID’s in an array.
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.