Reputation: 6662
I'm creating a dashboard for a custom plugin.
It would be nice if I could create a custom dashboard that looks just like the default dashboard but with my own widgets. But the drag'n'drop and the collapse/expand functionality
I know how to add normal dashboard widgets
anybody got any pointers?
Upvotes: 1
Views: 1216
Reputation: 1404
That's not a ready to use solution, but you can check out the code from these files:
You'll need the dashboard
script, then initialize the widgets section with the following code:
<div id="dashboard-widgets-wrap">
<?php wp_dashboard(); ?>
<div class="clear"></div>
</div><!-- dashboard-widgets-wrap -->
This should give you the same contents as the default dashboard. Once you've done that, you can disable some of the widgets and add others just for this page. This will allow you to use the default dashboard api which is always a good idea in case you want to move your widgets to the main dashboard.
Edit: here's how to add/remove dashboard widgets: http://theme.it/an-in-depth-look-at-the-dashboard-widgets-api/.
Upvotes: 1