Home Forums Feature Requests Use post_object field type as a custom field setting


Use post_object field type as a custom field setting

  • Hey,

    we’re wondering if it’s possible to use the post_object field type as a custom field setting (implementing acf_render_field_setting)? Has anyone already accomplished this already?

    We’d like to have a post object select field in order to select and effectively map a custom post type (post_id) to specific fields (which holds even more options/custom meta that are related to the specific field).

    Trying to use a post_object type renders the field wrap but the ajax query won’t yield any results as acf_get_field( $options['field_key'] ) returns false in this case.

  • In this case I think you would need to code your own AJAX query. The JavaScript involved for the post object field is not loaded on the field group editor page. In my experience you can use any type of a field for a field setting as long as it does not require JS, fields that requires ACFs JS generally fail to work as expected. An example is adding a default image setting to an image field. To do this you need to load the WP uploaded on the field group edit page manually.

  • Thanks for making this clear. I’ll see if it will be enough to have my own ajax query then and update this thread if we’ll come up with a solution.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.