Home › Forums › Backend Issues (wp-admin) › Disabling Select2 for Post Object fields › Reply To: Disabling Select2 for Post Object fields
I think that ACF 4 is going to be discontinued and will no longer be getting any updates.
I would convert the current field to a dynamically populated select field.
A post object field stores:
If multiple selections are not allowed: A single post ID of the related posts
If multiple are allowed: an array of Post IDs
So your select field should have Post IDs as values and Post Titles as labels, this will mimic post object field, or you could set the label to something else.
The main difference with the two fields is that you will not have ACF to automatically populate an array of post objects and you’ll need to do this yourself. It is a simple process of doing a WP_Query using the returned value or array in the ‘post__in’ argument. If it’s a single ID then you should post__in should be an array with a single value.
If you convert the existing field(s) and you store the same values then all of your existing data should remain intact because the new field will have the same field key as the old field.
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!
🤔 Curious about the ACF user experience? So are we! Help guide the evolution of ACF by taking part in our first ever Annual Survey and guarantee you’re represented in the results. https://t.co/0cgr9ZFOJ5
— Advanced Custom Fields (@wp_acf) May 8, 2023
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.