Last active
August 29, 2015 14:16
-
-
Save mdemrs/34687bbb419c85ddd39f to your computer and use it in GitHub Desktop.
wp: wp_add_dashboard_widget
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add a widget to the dashboard. | |
* | |
* This function is hooked into the 'wp_dashboard_setup' action below. | |
*/ | |
function example_add_dashboard_widgets() { | |
wp_add_dashboard_widget( | |
'example_dashboard_widget', // Widget slug. | |
'Example Dashboard Widget', // Title. | |
'example_dashboard_widget_function' // Display function. | |
); | |
} | |
add_action( 'wp_dashboard_setup', 'example_add_dashboard_widgets' ); | |
/** | |
* Create the function to output the contents of our Dashboard Widget. | |
*/ | |
function example_dashboard_widget_function() { | |
// Display whatever it is you want to show. | |
echo "Hello World, I'm a great Dashboard Widget"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment