Posted By

trepmal on 07/31/10


Tagged

wordpress


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

maxvee8
lgarcia
athanassiadis
komozi


Basic Empty Plugin for WordPress


 / Published in: PHP
 

URL: http://trepmal.com/plugins/empty-plugin/

  1. <?php
  2. /*
  3. Plugin Name: Empty Plugin
  4. Plugin URI: http://trepmal.com/
  5. Description: Does nothing - testing only
  6. Author: Kailey Lampert
  7. Version: 0.0
  8. Author URI: http://kaileylampert.com/
  9. */
  10. /*
  11.   Copyright (C) 2010 Kailey Lampert
  12.  
  13.   This program is free software: you can redistribute it and/or modify
  14.   it under the terms of the GNU General Public License as published by
  15.   the Free Software Foundation, either version 3 of the License, or
  16.   (at your option) any later version.
  17.  
  18.   This program is distributed in the hope that it will be useful,
  19.   but WITHOUT ANY WARRANTY; without even the implied warranty of
  20.   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21.   GNU General Public License for more details.
  22.  
  23.   You should have received a copy of the GNU General Public License
  24.   along with this program. If not, see <http://www.gnu.org/licenses/>.
  25. */
  26.  
  27. $emptyplugin = new emptyplugin();
  28.  
  29. class emptyplugin {
  30.  
  31. function emptyplugin() {
  32.  
  33. add_action('admin_menu', array(&$this, 'menu'));
  34.  
  35. }
  36.  
  37. function menu() {
  38.  
  39. $page = add_submenu_page('options-general.php', 'Empty Plugin', 'Empty Plugin', 'administrator', __FILE__, array(&$this, 'page'));
  40. // add_action('admin_print_scripts-'.$page, array(&$this, 'scripts'));
  41. // add_action('admin_print_scripts', array(&$this, 'scripts'));
  42.  
  43. }
  44.  
  45. function scripts() {
  46.  
  47. $plugin_path = '/'.PLUGINDIR.'/'.plugin_basename(dirname(__FILE__));
  48. wp_enqueue_script('jquery');
  49. // wp_register_script('jquerycolorpicker',$plugin_path.'/js/colorpicker.js','jquery');
  50. // wp_enqueue_script('jquerycolorpicker');
  51.  
  52. }
  53.  
  54. function page() {
  55.  
  56. echo '<div class="wrap">';
  57. echo '<h2>'.__('Empty Plugin').'</h2>';
  58. echo '</div>';
  59.  
  60. }// end function
  61.  
  62. }//end class
  63.  
  64. ?>

Report this snippet  

You need to login to post a comment.