Inner block with if
-
Hello I create this block,
<?php foreach( $attributes['titolo-descrizione'] as $inner ): ?> <?php if ( $inner['regione'] ) : ?> <div class="acc-regione mt-1"> <?php echo $inner['regione']; ?> </div> <?php endif; ?> <?php if ( $inner['cantina'] ) : ?> <div class="acc-cantina"> <?php echo $inner['cantina']; ?> </div> <?php endif; ?> <div class="acc-drink"> <?php echo $inner['drink']; ?> </div> <div class="acc-price"> <?php echo $inner['prezzo']; ?> </div> <?php endforeach; ?>
the block works but in error_log_php I have this error:
PHP Warning: Undefined array key “cantina”
PHP Warning: Undefined array key “regione”Can you help me please
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Inner block with if’ is closed to new replies.