file upload loop doesn’t return empty if no file is uploaded
-
I have a file upload where I input an attachment and it will be echoed as a link on the frontend.
On the post edit window, when I accidentally press the “+” button to add a loop but without uploading anything, in the output, it will still echo text, but without the source.
I’ve tried a lot of things but nothing worked:
if ( $theloop ) :
if ( ! empty ($theloop ) ) :
if ( $theloop != '' ) :
if ( $theloop ) :
How can I test if the added loop doesn’t have anything on it?
here’s my full code:
<?php $theloop = CFS()->get('file_upload');
if ( ! empty ($theloop ) ) : foreach ( $theloop as $thefile ) {
$thesource= $thefile ['upload_file'];?><a>EN</a> ?>
<?php}endif;?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘file upload loop doesn’t return empty if no file is uploaded’ is closed to new replies.