OK, I answered my own question and I guess I was missing something really simple: just call get_field() from within my plugin code.
What I was missing was that because the get_field function is defined in a file that was “include”d by the ACF class initialize method, that function is added to the global namespace. It just never occurred to me that get_field might be a global function.
But I’m really confused about *why* the ACF coders would dump functions like “get_field” into the global namespace. If I ever attempt to load another plugin or theme that does the same thing – declares a ‘get_field’ function into the global namespace – it will trigger a fatal error.
Isn’t this what namespaces and classes are for?
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!