Hello
User bellow code
Add this new function
function continuous_slider_plus_lightbox_get_user_role($id=null){
global $current_user;
if(!$id) $id = $current_user->ID;
if ( is_user_logged_in() ) {
$user = new WP_User( $id );
if ( !empty( $user->roles ) && is_array( $user->roles ) ) {
foreach ( $user->roles as $role )
return $role;
}
}
}
Replace Bellow Existing function
function continuous_slider_plus_lightbox_add_admin_menu(){
$userRoles=continuous_slider_plus_lightbox_get_user_role();
if($userRoles=='administrator'){
$hook_suffix_r_l=add_menu_page( __( 'Continuous Slider plus Lightbox'), __( 'Continuous Slider plus Lightbox' ), 'administrator', 'continuous_thumbnail_slider_with_lightbox', 'continuous_thumbnail_slider_with_lightbox_admin_options_func' );
$hook_suffix_r_l=add_submenu_page( 'continuous_thumbnail_slider_with_lightbox', __( 'Manage Sliders'), __( 'Slider Settings' ),'administrator', 'continuous_thumbnail_slider_with_lightbox', 'continuous_thumbnail_slider_with_lightbox_admin_options_func' );
$hook_suffix_r_l_1=add_submenu_page( 'continuous_thumbnail_slider_with_lightbox', __( 'Manage Images'), __( 'Manage Images'),'administrator', 'continuous_thumbnail_slider_with_lightbox_image_management', 'continuous_thumbnail_slider_with_lightbox_image_management_func' );
$hook_suffix_r_l_2=add_submenu_page( 'continuous_thumbnail_slider_with_lightbox', __( 'Preview Slider'), __( 'Preview Slider'),'administrator', 'continuous_thumbnail_slider_with_lightbox_preview', 'continuous_thumbnail_slider_with_lightbox_admin_preview_func' );
}
elseif($userRoles=='editor'){
$hook_suffix_r_l=add_menu_page( __( 'Continuous Slider plus Lightbox'), __( 'Continuous Slider plus Lightbox' ), 'editor', 'continuous_thumbnail_slider_with_lightbox', 'continuous_thumbnail_slider_with_lightbox_admin_options_func' );
$hook_suffix_r_l=add_submenu_page( 'continuous_thumbnail_slider_with_lightbox', __( 'Manage Sliders'), __( 'Slider Settings' ),'editor', 'continuous_thumbnail_slider_with_lightbox', 'continuous_thumbnail_slider_with_lightbox_admin_options_func' );
$hook_suffix_r_l_1=add_submenu_page( 'continuous_thumbnail_slider_with_lightbox', __( 'Manage Images'), __( 'Manage Images'),'editor', 'continuous_thumbnail_slider_with_lightbox_image_management', 'continuous_thumbnail_slider_with_lightbox_image_management_func' );
$hook_suffix_r_l_2=add_submenu_page( 'continuous_thumbnail_slider_with_lightbox', __( 'Preview Slider'), __( 'Preview Slider'),'editor', 'continuous_thumbnail_slider_with_lightbox_preview', 'continuous_thumbnail_slider_with_lightbox_admin_preview_func' );
}
add_action( 'load-' . $hook_suffix_r_l , 'continuous_slider_plus_lightbox_plugin_admin_init' );
add_action( 'load-' . $hook_suffix_r_l_1 , 'continuous_slider_plus_lightbox_plugin_admin_init' );
add_action( 'load-' . $hook_suffix_r_l_2 , 'continuous_slider_plus_lightbox_plugin_admin_init' );
}
Please rate plugin if you found useful..