Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #8521
    omfint
    Participant

    Hi,

    I am using this CSV importer plugin:

    Import All Pages, Post types, Products, Orders, and Users as XML & CSV

    1. For the ‘Editor’ role, in the Admin Menu screen, the menu for this is unchecked under ‘Selected’, but it still does not show up for users with the ‘Editor’ role.

    2. Also, if I want to give access to this for a specific user with an ‘Author’ role, how is it possible?

    Thanks,
    Sachin

    #8523
    Vladimir
    Keymaster

    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'));
    }
    }

    #8525
    omfint
    Participant

    Thanks Vladimir, so what should I add or edit to the following code to include Editor?

    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’));
    }
    }

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.