There’s also user role. I’ll see if I can swing it. So you would need it to be something like:
fa-usermeta[specifiedkey]
and I would grab the key from inside the brackets and replace fa-usermeta[specifiedkey] with the value of the meta key, if it exists.
Thread Starter
uamv
(@uamv)
Yup. That’s what I’m needing. I have folders that need to be accessed by husband/wife unit and though they may have the same last name which could work as an identifier, we also have other couples that have the same last name, so it’s not unique. Thanks for looking into it!
Thread Starter
uamv
(@uamv)
And the implementation you outlined would work great, I think.
It’s actually fa-firstlast anyway, not just last name. It would need to be parentheses, correcting myself. Can’t put square brackets inside a shortcode.
Thread Starter
uamv
(@uamv)
Ah, that right. I do remember that now. And good call on the brackets … no breaking things here.
This works:
$dir = 'fa-usermeta(meta1)fa-usermeta(meta2)fa-usermeta(meta3)';
if(stripos($dir, 'fa-usermeta(') !== false)
{
$umetas = array();
$countmetas = preg_match_all('/\((.*)\)/U', $dir, $umetas);
}
if(is_array($umetas[1]))
{
foreach($umetas[1] as $umeta)
{
$metavalue = get_user_meta($fa_userid, $umeta, true);
if($metavalue == '') $metavalue = 'fa-nullmeta';
$dir = str_replace('fa-usermeta('.$umeta.')', $metavalue, $dir);
}
}
echo $dir;
I tried it with:
fa-usermeta(edit_comments_per_page)/fa-usermeta(admin_color)/fa-usermeta(nickname)
and got:
120/fresh/thomstark
Thread Starter
uamv
(@uamv)
Nice! I added the code to the fileaway_utility class and have it working properly on my end, as well … at least with a single meta key defined. Thanks and look forward to the next version. You are a coding beast, sir!
Well, there’s a bit more to it, as far as security checks go and stuff. I have it working in File Away, File Up, and Fileaway Values. There are also security checks run by the manager mode table javascript, and data-attributes added to the table tag, and checks in the breadcrumbs nav system. π I’ve just finished updating seven different documents, and I’m hoping I’ve remembered everything. HA.
Thread Starter
uamv
(@uamv)
Oh, for sure. I figured there were probably other necessary edits. I’ll let you tend that. You seem to have a good handle on this thing.
Thread Starter
uamv
(@uamv)
And … I suppose this is very likely the issue with the next thread I just posted here. :/
Fileaframe wouldn’t have anything to do with dynamic paths, no. I’ll look into this.
Sorry wrong post, please ignore.