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've just released ACF 5.12.3 with a security fix to prevent arbitrary file uploads to forms with ACF fields.— Advanced Custom Fields (@wp_acf) July 14, 2022
Now that we've released this update, we recommend updating your sites as soon as possible.
© 2022 Advanced Custom Fields.