0

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

2
  • 1
    Dashboard widgets only go on the dashboard. You can't put 'em on any other pages, as far as I know. Commented Mar 22, 2012 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/… Commented Mar 22, 2012 at 21:41

2 Answers 2

1

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.

0

Add metaboxes, dashboard widgets are for the dashboard only!

2
  • 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 Commented Mar 24, 2012 at 11:25
  • Have you looked into the function codex.wordpress.org/Function_Reference/wp_add_dashboard_widget Commented Mar 24, 2012 at 12:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.