Custom Admin Dashboard Widget

/ Published in: PHP
Save to your folder(s)

Copy this code and paste it in your HTML
  1. function example_dashboard_widget_function() {
  2. // Display whatever it is you want to show
  3. echo "Hello World, I'm a great Dashboard Widget";
  4. }
  6. // Create the function use in the action hook
  7. function example_add_dashboard_widgets() {
  8. wp_add_dashboard_widget('example_dashboard_widget', 'Example Dashboard Widget', 'example_dashboard_widget_function');
  9. }
  10. // Hoook into the 'wp_dashboard_setup' action to register our other functions
  11. add_action('wp_dashboard_setup', 'example_add_dashboard_widgets' );

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.