I am trying to recover images from a folder with the native function of php glob
, but it is returning an empty array .
I'm passing the complete path of the folder to the function.
Follow the code below:
$pasta = get_template_directory_uri() . '/img/projetos/' . get_post_meta($post->ID, 'projeto', true) .'/';
$imagens = glob("$pasta{*jpg,*png}", GLOB_BRACE) or die ("Erro ao acessar $pasta");