Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Nks

    (@nik00726)

    NO, It is impossible.

    The slider has only access to admin.you might have some plugin that cause that problem..

    Thread Starter phoenixobia

    (@phoenixobia)

    Yes, that’s what I mean. The slider has only access to administrator role.
    I need other user roles such as editors to be able to access the plugin.

    Plugin Author Nks

    (@nik00726)

    Custom code must be need to allow other then admin.

    Thread Starter phoenixobia

    (@phoenixobia)

    Ok, so could you please provide that custom code please.

    It needs to be added to the plugin because that’s the only plugin that non administrators can’t use.

    Thanks

    Plugin Author Nks

    (@nik00726)

    Please let me know which roles you want to allow?

    Thread Starter phoenixobia

    (@phoenixobia)

    Well, I have a custom role called “site manager” but I assume if the capability works for the editor role it would work with my custom role as well.

    Thoughts?

    Thanks

    Plugin Author Nks

    (@nik00726)

    Which version you are using free Or Pro ?

    Thread Starter phoenixobia

    (@phoenixobia)

    It’s the free version.

    Plugin Author Nks

    (@nik00726)

    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..

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Admin panel gone for non Administrators!’ is closed to new replies.