Home › Forums › General Issues › Code Field / Return value of another custom field in post edit › Reply To: Code Field / Return value of another custom field in post edit
Even a field that allows code to be entered will not run that code. It is something you need to build. To run PHP code that is stored in a field you would need to use PHP eval() https://www.php.net/manual/en/function.eval.php to run the code in the script. This would need to be done using an acf/format_value filter. https://www.advancedcustomfields.com/resources/acf-format_value/. This is considered unsafe.
To alter a message field to show a value from another page you could create an acf/prepare_field filter for the message field and you can get the value and alter the message.
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.