Answers for "acf check if field empty"

PHP
1

if field is filled out acf

<?php if( get_field('field_name') ): ?>
	<p>My field value: <?php the_field('field_name'); ?></p>
<?php endif; ?>
Posted by: Guest on June-29-2020
0

acf if is empty

$image = get_field('logo', 'option');
if (!is_array($image)) {
  $image = acf_get_attachment($image);
}
$url = $image['url'];
Posted by: Guest on December-19-2021

Browse Popular Code Answers by Language