Home › Forums › General Issues › Fetching default image option › Reply To: Fetching default image option
Short of this you’ll need to resort to
$image = get_field('image');
if (!$image) {
// code here to set $image to default value
// you can probably use get_field_object($field_key)
// end get the setting for default_value
}
but it would probably be much easier to just use the key in get_field in the first place.
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.