Change WordPress user roles and capabilities › Forums › Give user access to plugin – how to › Access to CSV Importer plugin › Reply To: Access to CSV Importer plugin
Hi Sachin,
Unfortunately, developer of UCI plugin hardcoded that its admin menu is shown for the user with administrator role only:
public static function show_admin_menus(){
$ucisettings = get_option('sm_uci_pro_settings');
if( is_user_logged_in() ) {
$user = wp_get_current_user();
$role = ( array ) $user->roles;
}
if(!empty($role) && in_array( 'administrator' , $role)){
if ( is_user_logged_in() && current_user_can('manage_options') ) {
add_action('admin_menu',array(__CLASS__,'testing_function'));
}
}
$first_activate = get_option("WP_ULTIMATE_CSV_FIRST_ACTIVATE");
if($first_activate == 'On'){
delete_option("WP_ULTIMATE_CSV_FIRST_ACTIVATE");
exit(wp_redirect(admin_url().'admin.php?page=wp-addons-page'));
}
}
This part is interesting for you from the code above:
if(!empty($role) && in_array( 'administrator' , $role)){
if ( is_user_logged_in() && current_user_can('manage_options') ) {
add_action('admin_menu',array(__CLASS__,'testing_function'));
}
}