Skip to content

Instantly share code, notes, and snippets.

@dcangulo
Last active April 3, 2018 06:16
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/291e653958877053e7f5631a3762432c to your computer and use it in GitHub Desktop.
Save dcangulo/291e653958877053e7f5631a3762432c to your computer and use it in GitHub Desktop.
A WordPress plugin template that has an admin menu. Visit https://www.davidangulo.xyz/ for more information.
<?php
/*
Plugin Name: My WordPress Plugin
Plugin URI: https://wordpress.org/plugins/
Description: Just another WordPress plugin.
Version: 1.0.0
Author: David Angulo
Author URI: https://www.davidangulo.xyz/
*/
add_action('admin_menu','addAdminPageContent');
function addAdminPageContent() {
add_menu_page('My Plugin','My Plugin','manage_options',__FILE__,'adminPageContent','dashicons-wordpress');
}
function adminPageContent() {
echo "<h2>My WordPress Plugin</h2>Hello world!";
}
//Visit the tutorial for more information
//https://www.davidangulo.xyz/website-development/how-to-create-an-admin-page-for-your-wordpress-plugin/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment