Enable Store Management Widget for Editor.

Is it possible to enable the Dashboards Store Management Widget for an Editor? I've been able to customize what Editors can see with the Ultimate Branding plugin but cannot find how to do this :\

  • Milan

    Hello Nathan Swafford

    Hope you are well today and thanks for asking us. :slight_smile:

    I've flagged our SLS ( Second Line Support ) team to get possible solution for this one. If there is any possible solution to make it work for Editor role based users, Our SLS team will surely provide you, but if this will require some custom amount of work of coding then we will suggest you other ways you can get it working.

    I would also want to mention here that, responses of our SLS team is slightly slower than usual staff response so I suggest you to be patient if you don't hear from them very soon.

    Cheers,
    Milan

  • Panos

    Hi Nathan Swafford ,

    You can try adding the following snipped at your child theme's functions.php file (or in a custom plugin or in a MU plugin):

    add_filter( 'mp_can_view_dashboard_widgets_capability_needed', 'wpmudev_mp_can_view_dashboard_widgets_capability_needed', 10);
    
    function wpmudev_mp_can_view_dashboard_widgets_capability_needed(){
    
    	return 'edit_others_pages';
    
    }

    This though will add all (3) dashboard widgets though.

    If you only need the one you mention without the rest, instead of editing core files, I would recommend to "hide" the rest with some css and then remove them with js, like:

    add_action( 'admin_head', 'wpmudev_hide_notneeded_mp_dashwidgets' );
    
    function wpmudev_hide_notneeded_mp_dashwidgets(){
    
    	$screen = get_current_screen();
    	if( !current_user_can( 'manage_options' ) && $screen->id == 'dashboard' ){
    		?>
    		<style>#mp_low_stock, #mp_store_report{ display: none; }</style>
    		<script input type="text/javascript">jQuery(document).ready(function(){jQuery('#mp_low_stock, #mp_store_report').remove();});</script>
    		<?php
    	}
    
    }

    Hope this helps :slight_smile:

    Cheers!
    Panos