I’ve arrange a member portal with final member the place customers can fill in and submit varied varieties after which see the solutions in an inventory. Every submitted reply is mechanically transformed right into a pdf.
Every firm has a singular function the place they will solely see the responses of their very own function members. Take a look at firm has the function “testcompany”. There may be additionally an admin for Take a look at firm who has the roles “testcompany” and “testcompany admin”.
I wish to create a shortcode that mechanically retrieves the corporate emblem (the function’s emblem) and consists of this within the kind put up and the pdf. Proper now the person can add a emblem within the kind, but it surely turns into unsustainable if he has to do that each time.
The very best factor can be in case you might make a web page for every admin, the place they will add and alter the corporate’s emblem if vital, however it will additionally work with a less complicated model like:
You place all logos manually within the folder wp-content/userlogos/
Then you definately identify them function names, for instance:
testcompany.jpg
testcompany2.jpg
testcompany3.jpg
So if the person has the function testcompany2, the picture testcompany2.jpg must be displayed.
Then you’ll be able to simply add a shortcode the place you need to show the emblem, and it will likely be downloaded mechanically. Like [company_logo]
Ought to it’s attainable so as to add one thing to features to make this work?
Discovered a bunch of swap codes, however that may imply the thread can be actually lengthy + I might have so as to add new roles to the code, as quickly as a brand new firm joins the portal. There have to be a neater means?
<?php $args = array( array('function' => 'administrator', 'img' => '<img src="http://placeape.com/100/100">'),array('function' => 'subscriber', 'img' => '<img src="http://placekitten.com/100/100">')); foreach ($args as $arg): userLooping($arg['role'], $arg['img']); endforeach; ?>
Is there anybody who can assist me with this?