Skip to content

Instantly share code, notes, and snippets.

@kerelist
Last active November 18, 2016 16:59
Show Gist options
  • Save kerelist/31ffc173c1ac9dc5487db10484bb1468 to your computer and use it in GitHub Desktop.
Save kerelist/31ffc173c1ac9dc5487db10484bb1468 to your computer and use it in GitHub Desktop.
Add an example custom widget to the WordPress Dashboard
function project_add_dashboard_widgets() {
wp_add_dashboard_widget(
'project_hint_dashboard_widget', // Widget slug.
'Title Here', // Title.
'project_hint_dashboard_widget_function' // Display function.
);
}
//this function matches the display function in the above code
function project_hint_dashboard_widget_function() {
echo '<p>Put your instructions here!</p>';
}
add_action( 'wp_dashboard_setup', 'project_add_dashboard_widgets' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment