I spent my afternoon as a graphic designer trying in vain to find the right grammar for a damn php code that will probably look childish to some. I'm trying to put a file upload ACF block in a shortcode, but I obviously don't have the right wording
add_shortcode('delib-fichier', function($atts, $content)
{
$delib_fichier = get_field( 'delib-fichier' );
$output="";
$url = wp_get_attachment_url( $file );
if($delib-fichier){
$output .= <a href="<?php echo esc_url( $delib_fichier['url'] ); ?>"><?php echo esc_html( $delib_fichier['filename'] ); ?></a>
}
return $output;
});
I now the $output line contains a pure piece of nonsense, but I'm like a kid in front of a Rubiks tonight.
Thanks for your help!!