Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've created a standard page with a top level menu using add_menu_page() and I want to turn that page into a bespoke dashboard, ie to have a number of boxes like the dashboard widgets using something like wp_add_dashboard_widget(). I cannot find any documentation that even suggests this is possible and I've looked into creating dashboards widgets and then doing something like

global $wp_meta_boxes;
$my_widget = $wp_meta_boxes['dashboard']['normal']['core']['example_dashboard_widget'];
unset($wp_meta_boxes['dashboard']['normal']['core']['example_dashboard_widget']);
$wp_meta_boxes[$my_dashboard]['normal']['core']['example_dashboard_widget'] = $my_widget;

where $my_dashboard has variously been a $hook from $hook=add_menu_page() and the page slug etc, but it hasn't worked. As you can tell, I'm shooting in the dark here but this functionality would be very useful to me. Does anyone know how this can be done?

Edit: I've found the answer to my own question here

http://www.code-styling.de/english/how-to-use-wordpress-metaboxes-at-own-plugins

share|improve this question
1  
Dashboard widgets only go on the dashboard. You can't put 'em on any other pages, as far as I know. –  Bainternet Mar 22 '12 at 21:11
    
I'm going to answer my own question... I finally found this and it works for what I need, with soem amendments :-) code-styling.de/english/… –  Adam Mar 22 '12 at 21:41

2 Answers 2

I've edited my question to include the fact that I've found the answer to my own question here

http://www.code-styling.de/english/how-to-use-wordpress-metaboxes-at-own-plugins

in case anyone finds the question while searching for a similar solution. The two column variation he includes in his solution no longer seems to work but is a simple thing to override.

share|improve this answer

Add metaboxes, dashboard widgets are for the dashboard only!

share|improve this answer
    
yeah, that's what the article lead me to. I am effectively treating them as dashboard widgets (as far as I can see, dashboard widgets are a special case of metaboxes) but constructing them as metaboxes –  Adam Mar 24 '12 at 11:25
    
Have you looked into the function codex.wordpress.org/Function_Reference/wp_add_dashboard_widget –  Rutwick Gangurde Mar 24 '12 at 12:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.