Completed

Need help with $user_role

This project was successfully completed by shailendra041090 for €8 EUR in a day.

Get free quotes for a project like this
Employer working
Project Budget
€8 - €30 EUR
Completed In
1 day
Total Bids
11
Project Description

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

----

Completed by:
Skills Required

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online