• Resolved emflomed17

    (@emflomed17)


    I created a custom role called “Employee” with the following function.

    /* Employee Role */
    add_role(
    	'employee', 
    	__('Employee'),
    	array(
    		'read' => true,
    	)
    );

    This role is appearing in my conditions window but when I check it does not work.

    The condition that I want to apply is: show menu when “User is logged in and User Role is Employee”

    My conditional menu plugin is only working with the default wordpress roles such as “Editor, Subscriber, Author, etc.”

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author themifyme

    (@themifyme)

    Hi,

    The plugin works with custom user roles as well, I tested this with the snippet you provided and the menu shows only for ‘Employee’ users. However found a bug where this wouldn’t work if user has multiple roles. This is not a feature in WP core (users have only one role) but other plugins can add this in. Perhaps that is the case for you?

    The issue with ‘multi-role users’ has been fixed now, will be included in the next update. ??

    • This reply was modified 5 years ago by themifyme.
    Plugin Author themifyme

    (@themifyme)

    UPDATE: This has been fixed and released in the latest version.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to use with custom roles?’ is closed to new replies.