Support

Account

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.