Home › Forums › General Issues › Get a field object outside of the post context › Reply To: Get a field object outside of the post context
outside of the search result loop, i have the search form like this :
Sort by :
– post type
– post_type_1_checkbox
– post_type_2_checkbox
– …
– date
– 2001
– 2003
– …
– language
– french
– english
– ….
the languages choices must sort all the languages select option on the field ‘language’. That is what i want 🙂
because i am not on a post that is using this field (i am on the search page), i cannot use
get_field_object('language')['choices'][get_field('language')]
to sort all options available for ‘language’ field.
get_field_object(‘language’) returns false because i am not on the scope of that field (this field is for posts not for pages).
I want something to get the field structure regardless of the post id.
Something like the export of acf fields, but with a function i can use on my theme/plugin
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.