Home › Forums › General Issues › It is possible to select a custom post type via ACF? › Reply To: It is possible to select a custom post type via ACF?
It would be impossible to create a solution that fit everybody’s needs. So they provide a way to do anything you want thanks to the acf/load_field/name=$name
filter, which is even better.
The documentation John shared does give examples.
From the first section (Populating Choices From a Text Area Field), the author of this thread would basically just need to replace $choices = get_field('my_select_values', 'option', false);
with $choices = get_post_types();
and also remove the two next lines that trim the string as it is already an array of name.
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.