Skip to content

Instantly share code, notes, and snippets.

@jacobfogg
Created August 27, 2010 20:43
Show Gist options
  • Select an option

  • Save jacobfogg/554166 to your computer and use it in GitHub Desktop.

Select an option

Save jacobfogg/554166 to your computer and use it in GitHub Desktop.

Revisions

  1. jacobfogg revised this gist Aug 27, 2010. 1 changed file with 15 additions and 3 deletions.
    18 changes: 15 additions & 3 deletions gistfile1.php
    Original file line number Diff line number Diff line change
    @@ -15,8 +15,8 @@
    function DJ_HBG_plugin_menu() {

    add_submenu_page(
    DJ_MAIN_PLUGIN_DIR,
    'Hawaii Buyers Guide',
    'DJ_Main_Menu',
    'Hawaii Buyers Guide Settings',
    'Hawaii Buyers Guide',
    'manage_options',
    __FILE__,
    @@ -39,4 +39,16 @@ function DJ_HBG_plugin_options() {



    ?>
    ?>



    //*****************
    //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');
  2. jacobfogg renamed this gist Aug 27, 2010. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. jacobfogg created this gist Aug 27, 2010.
    42 changes: 42 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,42 @@
    <?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_PLUGIN_DIR,
    'Hawaii Buyers Guide',
    '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>';

    }



    ?>