Viewing 13 replies - 1 through 13 (of 13 total)
  • Hey The Wachamacalli,

    How are you today? ??

    There’s no option for this but we can do it with bit of coding, you can place the below code to your child theme functions.php or create mu-plugin with that code:

    add_action('admin_head', 'hide_custom_sidebars');
    
    function hide_custom_sidebars() {
    	if ( !current_user_can( 'manage_options' ) ) {
    		  echo '<style>
    			#customsidebars-mb {
    				display: none;
    			}
    		  </style>';
    	}
    }

    Cheers,
    Predrag

    Hello The Wachamacallit,

    I hope you are doing well!

    This is by design, if a user is able to create posts, then a user can also adjust the sidebar on their posts.

    It needs some custom code, to hide the sidebar based on a user role. Our developer kindly provided this code for you:

    if ( is_admin() ) {
        add_action( 'do_meta_boxes' , 'wpmudev_remove_customsidebar_metabox' );
    }
    function wpmudev_remove_customsidebar_metabox() {
        if( !current_user_can('manage_options') ) {
            $post_types_res = get_post_types();
            $post_types = array();
            foreach( $post_types_res as $key => $post_type ){
                $post_types[] = $key;
            }
            remove_meta_box( 'customsidebars-mb' , $post_types , 'side' );
        }
    }

    Put this coden in the end of functions.php file of your theme.

    I hope this helps!

    Cheers,
    Nastia

    Thread Starter The Wachamacallit

    (@ineed-help)

    Oh wow!

    YOU GUYS ARE PHENOMENAL!

    It’s very kind of you both to provide me with these codes, may great things happen in your life!

    I tried both, and they both worked! Thank you very much!

    Which one would you recommend that I use?

    Clearly, I’m not a programmer but I’m very curious to know how come such different pieces of codes accomplish the same function?

    ( … I mean in Spanish “Chimichanga”, means “Chimichanga” but in PHP it seems we can say: ChimneyChanga and it would be the same! lol )

    Hi The Wachamacallit,

    Thanks for the kind words and glad to hear both of the solutions worked, look like me and Nastia were typing the answer around the same time there ??

    Both of our codes first check if the user is admin or not, and after that in Nastia’s approach it removes the section completely with remove_meta_box function, while in my snipped it makes them invisible.

    Basically you can go with either one, completely your choice ??

    Cheers,
    Predrag

    Thread Starter The Wachamacallit

    (@ineed-help)

    You guys are probably Twins that leave in different places = )

    Thank you for explaining the functions to me, it makes a lot of sense!

    It’s like going with mild green sauce or red hot sauce.

    I need to check if she is maybe my long lost twin ??

    Glad we could help with this.

    Have a great day!

    Predrag

    Thread Starter The Wachamacallit

    (@ineed-help)

    = ) Hope you find her.
    Thank you both for your help again!

    I need help. I love your plugin but in the admin panel I have too many and it won’t allow me to scroll or put them in a dropdown. I am not good at writing code or changing too much as I just want things simple. Can you help?

    Thread Starter The Wachamacallit

    (@ineed-help)

    Hello Askmich,

    Have you Asked Mitch? … just kidding : )

    I’m not sure what you mean, could you please gives us more details?

    Do you mean, you have many Plugins or many Sidebars on your Admin Panel?

    I think you mean that on:
    https://www.YourDomian.com/wp-admin/widgets.php
    You are not able to open the “dropdowns” when you click on the arrows?

    I’m not a programmer either but perhaps I might help.

    Screenshots do tell a lot also.

    I’m using the plugin Custom Sidebars I have built out several sidebars and when I try to scroll to see them and customize them…they are stationary. The admin content on the left scrolls but the sidebars I have built on the right do not move.

    I need a way to have them scroll so I can see what I am doing. Otherwise I like the plugin.

    I loaded a photo on my site and here is a link to it

    Thread Starter The Wachamacallit

    (@ineed-help)

    Ok, I see it…

    Had to figure out the direct link to that screenshot since it was to small to view:
    Bigger

    (You might want to use https://screencloud.net/ next time, it’s free!)

    Looks like you are using a Mac OS, I’m not so sure what the problem might be.

    What I would do is make sure I got that latest updates on everything: Operating System, Chrome Browser, Word Press, and Plugins including Custom Sidebars, I might even try RE-Installing the plugin.

    If you are already up to date with all your software, Nastia and Predrag would be the best to handle that issue, perhaps another one of your plugins has a java script conflict.

    Usually, by deactivating the plugins one by one, you can find out which one is causing the conflict.

    Hope that helps!
    Kudos to you, I also live in AZ and are getting involved into RE.

    Hello askmich,

    Based on the www.ads-software.com regulations, Would you please start your own thread, so we can have a look at the issue you have.

    The screenshot you posted is too small for us to see. You can try the https://screencloud.net/ like The Wachamacallit has suggested or try a Monosnap.

    Please note, near the browser’s scroll bar, there is another scroll bar that should allow to scroll down to see the rest of the sidebars. You just need to hever on it and it will appear.

    Screenshot:
    https://prntscr.com/bcl9ec

    I hope this helps!

    Cheers,
    Nastia

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Admin Privileges’ is closed to new replies.