Need help with $user_role

Suoritettu Julkaistu 7 vuotta sitten Maksettu toimituksen yhteydessä
Suoritettu Maksettu toimituksen yhteydessä

Hi,

I have a plugin that is doing something only for certain userroles. However, I need it to work for ALL users, also just visitors of my website.

Here's the code that is determining the userroles. Can anyone help me with adjusting this? If I simply remove this code from the file, it breaks my website so that is not an option.

-----

global $current_user;

$user_roles = $current_user->roles;

$user_role = array_shift($user_roles);

if ($user_role == 'administrator' || $user_role == 'developer' || $user_role == 'shop_manager' || $user_role == 'fons') {

----

PHP

Projektin tunnus: #11812944

Tietoa projektista

9 ehdotusta Etäprojekti Aktiivinen 7 vuotta sitten

Myönnetty käyttäjälle:

shailendra041090

Hi, i can help u solve user role problem, I can do this job easily. I have checked your attach file also, I can start now only.

€8 EUR 1 päivässä
(143 Arvostelua)
6.3

9 freelanceria on tarjonnut keskimäärin €23 tähän työhön

bestphpjobs

I read your project description and that make sense , at there you described issue very well. I know all stuff good that you want for this job, PHP, javascript, mysql, html, etc very well. I can manage this job very we Lisää

€12 EUR 1 päivässä
(225 arvostelua)
6.5
mvaqasuddin

Hi there, How are you doing ? Could you please PM me right away so I can discuss what's actual issue is ? Thanks

€23 EUR 1 päivässä
(188 arvostelua)
6.6
artiboria

Thank you so much for this great opportunity. I have 9+ years of experience in this field and can provide you my past work sample. I am an expert in WordPress, Magento, Joomla, PSD to HTML conversion, LOGO Desigi Lisää

€23 EUR 1 päivässä
(41 arvostelua)
5.2
DarshitAppsLab

Hi, I am Amit, Business Development Manager. We are ISO 9001:2008 & ISO: 27001 Certified Web Designing and Development Company based in India with our offices in USA and Canada. We are a leading Web designing Lisää

€23 EUR 1 päivässä
(1 arvostelu)
0.8