Home › Forums › General Issues › How to Upgrade Simple Fields to ACF 5 › Reply To: How to Upgrade Simple Fields to ACF 5
Hello BliniReizen,
The parameters of ACF get_field() are as follows:
get_field($selector, [$post_id], [$format_value]);
So your test code should look like this:
$tip = get_field("tip",$post->ID);
if( $tip ) {
echo $tip;
} else {
echo ’empty’;
}
Give this a try. The third parameter is true by default ($format_value).
Thanks,
John
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.