Custom Widgets in sub site admin dashboard

Hi,

I wanted to have custom widgets in the sub-site admin dashboard. I found the below article useful and tried. It works well.
Click Here

I used the code below in the child theme's function.php

add_action( 'wp_dashboard_setup', 'register_my_dashboard_widget' );
function register_my_dashboard_widget() {
wp_add_dashboard_widget(
'my_dashboard_widget',
'Website Guidelines',
'my_dashboard_widget_display'
);
}
function my_dashboard_widget_display() {
?>
<p>Howdy Mr. Client, welcome to your website. Here are some quick guidelines to keep in mind when using the site.</p>

<h4><strong>Plugins</strong></h4>
<p>If you'd like to use any plugin please let us know first so we can vet it to make sure the code quality is good.</p>

<h4><strong>Images</strong></h4>
<p>Please make sure to always add good title and proper alt text to images. This makes single attachment pages better and does some SEO magic as well.</p>

<h4><strong>Important Links</strong></h4>
<ul>
<li><a href='<?php echo admin_url("post-new.php") ?>'>New Post</a></li>
<li><a href='<?php echo admin_url("edit.php?post_type=shop_order") ?>'>Shop Orders</a></li>
<li><a href='<?php echo admin_url("profile.php") ?>'>Your Profile</a></li>
</ul>

<?php
}

It works as intended.

Problem :

1. I wanted to show more than one widget for the sub site admins. Ordered in the way I wanted. Also I wanted to remove the checkbox for few widgets in the Screen options tab(to make it impossible for the admins to hide it)

2. I have three types of users to my network. Now, how do I show different widgets to the respective user type? Means If type A users logins..he sees custom widgets based on his type alone.Likewise if B sees his dashboard the widgets matches his type. Is there a way to do this?

NOTE - I USE ONLY ONE THEME BOTH FOR THE NETWORK AND FOR SUB SITES.

Now in order to make changes, I must create a child theme and allow that to use for the sub sites right?

3. If the same theme can be installed thrice, then the solution is simple. Put the above widget code in each theme and grant access to respective user type. But is this really possible ? Installing a theme thrice ? Even if it is possible, condition one should be satisfied to make it work.

Please advice me. Put me in a correct path to do this. Thanks in advance :slight_smile: