Comments on: How to Create Custom User Roles in WordPress https://85ideas.com/wp-tutorials/how-to-create-custom-user-roles-in-wordpress/ WordPress Themes Collection Wed, 21 Aug 2019 14:43:50 +0000 hourly 1 https://wordpress.org/?v=6.2.2 By: Brian H https://85ideas.com/wp-tutorials/how-to-create-custom-user-roles-in-wordpress/#comment-5453 Tue, 23 Jun 2015 14:44:00 +0000 https://85ideas.com/?p=19059#comment-5453 In reply to dandres077.

Hi @dandres077:disqus

Sorry for the delay in my reply I am happy it worked out well for you. Thank you for stopping by.

]]>
By: dandres077 https://85ideas.com/wp-tutorials/how-to-create-custom-user-roles-in-wordpress/#comment-5434 Thu, 18 Jun 2015 00:12:00 +0000 https://85ideas.com/?p=19059#comment-5434 Hi, excellent post, very nice. I created a menu with the following code:

function theme_options_panel(){
add_menu_page('Theme page title', 'Theme menu label', 'manage_options', 'theme-options', 'wps_theme_func');
add_submenu_page( 'theme-options', 'Settings page title', 'Settings menu label', 'manage_options', 'theme-op-settings', 'wps_theme_func_settings');
add_submenu_page( 'theme-options', 'FAQ page title', 'FAQ menu label', 'manage_options', 'theme-op-faq', 'wps_theme_func_faq');
}

add_action('admin_menu', 'theme_options_panel');
function wps_theme_func(){
echo '
Theme';
}

function wps_theme_func_settings(){
echo '
Settings';
}

function wps_theme_func_faq(){
echo '
FAQ';
}

I created a new role to only access the menu I just created:

$result = add_role( 'invitador', __('Invitador' ),array(
'wps_theme_func' => true,
'wps_theme_func_setting' => true,
'wps_theme_func_faq' => true,
));

I think inviting a user with the role.

when I try to throw me a permissions error .

I can help determine because it works for me.

thank you very much .

]]>