Skip to content

Instantly share code, notes, and snippets.

@dcangulo
Created April 4, 2018 04:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcangulo/0929aeda03b3e704f9d44b4f2ea9f7f6 to your computer and use it in GitHub Desktop.
Save dcangulo/0929aeda03b3e704f9d44b4f2ea9f7f6 to your computer and use it in GitHub Desktop.
A dashboard widget code in WordPress. Visit https://www.davidangulo.xyz/ for more information.
<?php
/*
Plugin Name: Dashboard Widget Example
Plugin URI: https://www.davidangulo.xyz/portfolio/
Description: Just another WordPress plugin with dashboard widget.
Version: 1.0.0
Author: David Angulo
Author URI: https://www.davidangulo.xyz/
License: GPL2
*/
add_action("wp_dashboard_setup","registerDashboardWidget");
function registerDashboardWidget() {
wp_add_dashboard_widget("My Widget","My Widget","myPluginDashboardWidget");
}
function myPluginDashboardWidget() {
echo "<h2>Hello World!</h2><p>This is my plugin's dashboard widget.</p>";
}
//Visit the tutorial for more information
//https://www.davidangulo.xyz/website-development/how-to-create-a-dashboard-widget-in-wordpress/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment