En curso

Need help with $user_role


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') {


Habilidades: PHP

Ver más: help converting file, need file vectorized, samba ubuntu user help, magento file upload option, help need job, need file zencart fulfillment, read need file, help need artist design, ecjc file upload option

Información del empleador:
( 24 comentarios ) Utrecht, Netherlands

ID de proyecto: #11812944

Adjudicado a:


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 en 1 día
(64 comentarios)

11 los freelancers están ofertando un promedio de €21 para este trabajo.


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 Más

€12 EUR en 1 día
(188 comentarios)

Hi, I am joomla, virtuemart expert having 5 years of experience. Recently i completed these projects http://www.ticotogo.com http://pandanusmooloolaba.com.au http://www.mscertkit.nl Please award me the project.

€34 EUR en 1 día
(266 comentarios)
€29 EUR en 0 días
(60 comentarios)

Hi buyer, Greeting of the day. We have good experience of Core PHP, Frameworks, CMS's, Ecommerce, Mysql, Responsive Web Designs, Ajax, jquery, JavaScript, Json, Photoshop, Graphics, Banner, Flyer and Logo Designs, Más

€29 EUR en 0 días
(35 comentarios)

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 Más

€23 EUR en 1 día
(24 comentarios)

Hello, I have over 7+ years of experience in Web Development and Maintenance.I have read your requirements and think that I would be a great fit for this project. I am available to discuss and ready to start right a Más

€19 EUR en 0 días
(36 comentarios)

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 en 1 día
(60 comentarios)
€23 EUR en 1 día
(12 comentarios)

Hi, I am master developer, I have worked with all the techs eg. Joomla, Wordpress, Magento ,Prestashop, Opencart, zencart, shopify, I really in need of Work. I have read the Project description, I am very much co Más

€10 EUR en 1 día
(27 comentarios)

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 Más

€23 EUR en 1 día
(0 comentarios)