Posted By

gd6d on 04/06/10


Tagged

wordpress dashboard widget admin area


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

themolitor
BrianCoyDesign
maxvee8


Adding widgets to wordpress admin dashboard


 / Published in: PHP
 

URL: http://wpcanyon.com/tipsandtricks/adding-widgets-to-wordpress-admin-dashboard/

  1. add_action('wp_dashboard_setup', 'custom_dashboard_widgets');
  2.  
  3. function custom_dashboard_widgets(){
  4. //first parameter is the ID of the widget (the div holding the widget will have that ID)
  5. //second parameter is title (shown in the header of the widget) -> see picture bellow
  6. //third parameter is the function name we are calling to get the content of our widget
  7. wp_add_dashboard_widget('my_custom_widget_id', 'My Widget Title', 'my_custom_widget');
  8. }
  9.  
  10. function my_custom_widget() {
  11. //the content of our custom widget
  12. echo '<p>The content of the widget goes here.</p>';
  13. }

Report this snippet  

You need to login to post a comment.