Skip to content

Instantly share code, notes, and snippets.

@jacobfogg
Created August 27, 2010 20:43
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 jacobfogg/554166 to your computer and use it in GitHub Desktop.
Save jacobfogg/554166 to your computer and use it in GitHub Desktop.
<?php
/*
Plugin Name: DataJoe Hawaii Buyer's Guide Plugin
Plugin URI: http://joe4-jacob.datajoe.com/wp
Description: Custom plugin built for Hawaii Buyer's Guide to embed a custom interface for their directory on their site. To add the directory to your site, simply include "%%DJ_HBG_page%%" on any page.
Version: 0.03
Author: Jacob Fogg
Author URI: http://jacobfogg.blogspot.com
*/
require_once(dirname(dirname(__FILE__)).'/DataJoe_Main/DataJoe_helper.inc');
define('DJ_main_plugin_url', WP_PLUGIN_URL.'/'.dirname(plugin_basename(__FILE__)));
add_action('admin_menu', 'DJ_HBG_plugin_menu');
function DJ_HBG_plugin_menu() {
add_submenu_page(
'DJ_Main_Menu',
'Hawaii Buyers Guide Settings',
'Hawaii Buyers Guide',
'manage_options',
__FILE__,
'DJ_HBG_plugin_options'
);
}
function DJ_HBG_plugin_options() {
echo "test";
if (!current_user_can('manage_options')) {
wp_die( __('You do not have sufficient permissions to access this page888.') );
}
echo '<div class="wrap">';
echo '<p>Here is where the form would go if I actually had options.</p>';
echo '</div>';
}
?>
//*****************
//DataJoe_Main.php:
function DJ_menu_setup(){
add_menu_page(__('DataJoe','djo'), __('DataJoe','djo'), 'manage_options', 'DJ_Main_Menu', 'DJ_settings_menu',DJ_main_plugin_url.'/logo_sm.png');
add_submenu_page('DJ_Main_Menu', __('DataJoe - Global Settings','djo'), __('Global Settings','djo'), 'manage_options', 'DJ_Main_Menu', 'DJ_settings_menu');
}
add_action('admin_menu', 'DJ_menu_setup');
@jacobfogg
Copy link
Author

function DJ_menu_setup(){
add_menu_page(('DataJoe','djo'), __('DataJoe','djo'), 'manage_options', __FILE, 'DJ_settings_menu',DJ_main_plugin_url.'/logo_sm.png');
add_submenu_page(FILE, ('DataJoe - Global Settings','djo'), __('Global Settings','djo'), 'manage_options', __FILE, 'DJ_settings_menu');
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment