Well I gave up on trying to get a field from formiddable forms in a current "all" view, in that case I had a field (that contained SCALE01, SCALE02 etc) that would have done the trick but I have no user in the form to hook it on to. And I eventually gave up.
So here I have something that works, the echo is spitting out the answer four times each (there are four entries from fomiddable displaying)like so:
<a href="file1">file1<a>
<a href="file2">file2<a>
<a href="file3">file3<a>
<a href="file4">file4<a>
(repeated 4 times)
The file links are correct though!
I need to turn that echo into a return so where I put the shortcode from the wordpress function the return gives me the first then the second then the third etc in the right place not at the top of the page. And not four times, just once :)
function scale_verification_certificate_func($atts) {
$current_user = wp_get_current_user();
$ffield = FrmProEntriesController::get_field_value_shortcode(array(
'field_id' => 140,
'user_id' => 'current'));
for ($i = 1; $i <= 10; $i++) {
foreach (glob("./clients/Sites/" . $ffield . "/SCALE0". $i . "/*SCALE_VERIFICATION_CERTIFICATE*", GLOB_NOSORT) as $filename) {
echo "<a href='./.$filename.'>.$filename<img src='../document.png' /></a> <br>";
}
}
}
add_shortcode( 'scale-verification-certificate', 'scale_verification_certificate_func' );
Any help would be appreciated, Im sorry if I didnt write my question very well, its my first one :)
EDIT: I realise why its repeating 4 times now, because their are four folders, that start with that name, but no matter I would still appreciate help on the rest!