From 49ac1357ebd17abfb2570a709c286b2174d51b9e Mon Sep 17 00:00:00 2001 From: tommcfarlin Date: Mon, 11 Jul 2011 17:37:07 -0400 Subject: [PATCH] Initial commit. --- README.txt | 0 css/admin.css | 1 + css/display.css | 1 + js/admin.js | 3 + js/display.js | 3 + lang/plugin.mo | Bin 0 -> 534 bytes lang/plugin.po | 17 +++++ plugin.php | 155 ++++++++++++++++++++++++++++++++++++++++++++++ views/admin.php | 1 + views/display.php | 1 + 10 files changed, 182 insertions(+) create mode 100644 README.txt create mode 100644 css/admin.css create mode 100644 css/display.css create mode 100644 js/admin.js create mode 100644 js/display.js create mode 100644 lang/plugin.mo create mode 100644 lang/plugin.po create mode 100644 plugin.php create mode 100644 views/admin.php create mode 100644 views/display.php diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..e69de29 diff --git a/css/admin.css b/css/admin.css new file mode 100644 index 0000000..f8c50dd --- /dev/null +++ b/css/admin.css @@ -0,0 +1 @@ +/* This stylesheet is used to style the admin option form of the widget. */ \ No newline at end of file diff --git a/css/display.css b/css/display.css new file mode 100644 index 0000000..23789a1 --- /dev/null +++ b/css/display.css @@ -0,0 +1 @@ +/* This stylesheet is used to style the public view of the plugin. */ \ No newline at end of file diff --git a/js/admin.js b/js/admin.js new file mode 100644 index 0000000..34ebfd0 --- /dev/null +++ b/js/admin.js @@ -0,0 +1,3 @@ +jQuery(function($) { + // Place your administration-specific code here +}); \ No newline at end of file diff --git a/js/display.js b/js/display.js new file mode 100644 index 0000000..c6afed6 --- /dev/null +++ b/js/display.js @@ -0,0 +1,3 @@ +jQuery(function($) { + // Place your public facing JavaScript here +}); \ No newline at end of file diff --git a/lang/plugin.mo b/lang/plugin.mo new file mode 100644 index 0000000000000000000000000000000000000000..fa33c2b4c440728f0fcf8a8b371a3c5b73931f22 GIT binary patch literal 534 zcmaJ-!A=`75KYyd_Ska|bKuB?O(aAxZB>$Nq=*DoiGkiCcXzUJm9-;#wk03J-yyz* zNfGR=BRyG~_cZT4KY#x8*pc}l_#!wGd=wlD4l@uu33)E>LGwO&@V}{GoR)Y;AzJSg z-1|`GfntPvTUNv{^ma>Ow>3=3f_6SI&SPau95z)%?G+^XjmA+R!*T(~B2>^%dp%6g zFdaazuljvVPt#O{xS&7w;PhYJ%tS^VjEiFHgILUrs~S@gYBIF~?Q5796BD-9!B_V6 z4?$h5|1G+OufHer={##|^}1;?@{Y;L;r&h$GClB#)UxgZij4`8_}i_X;GoqV0<0-u z<_ce0S1B0$vYh+lZxnRfX<;P!f|voS37rOuWuzw}KgX!M#?LBnf_`W|ITCKQ`o{4f>AZqj)Hg0r77 literal 0 HcmV?d00001 diff --git a/lang/plugin.po b/lang/plugin.po new file mode 100644 index 0000000..1f65c56 --- /dev/null +++ b/lang/plugin.po @@ -0,0 +1,17 @@ +msgid "" +msgstr "" +"Project-Id-Version: WordPress Plugin Boilerplate\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2011-07-11 12:22-0500\n" +"PO-Revision-Date: 2011-07-11 12:22-0500\n" +"Last-Translator: \n" +"Language-Team: Tom McFarlin \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-KeywordsList: __;_e\n" +"X-Poedit-Basepath: .\n" +"X-Poedit-Language: English\n" +"X-Poedit-Country: UNITED STATES\n" +"X-Poedit-SourceCharset: utf-8\n" +"X-Poedit-SearchPath-0: ..\n" \ No newline at end of file diff --git a/plugin.php b/plugin.php new file mode 100644 index 0000000..175c8ec --- /dev/null +++ b/plugin.php @@ -0,0 +1,155 @@ +init_plugin_constants(); + + load_plugin_textdomain(PLUGIN_LOCALE, false, dirname(plugin_basename(__FILE__)) . '/lang'); + + /* + * TODO: + * Define the custom functionality for your plugin. The first parameter of the + * add_action/add_filter calls are the hooks into which your code should fire. + * + * The second parameter is the function name located within this class. See the stubs + * later in the file. + * + * For more information: + * http://codex.wordpress.org/Plugin_API#Hooks.2C_Actions_and_Filters + */ + add_action('TODO', array($this, 'action_method_name')); + add_filter('TODO', array($this, 'filter_method_name')); + + } // end if + + } // end constructor + + /*--------------------------------------------* + * Core Functions + *---------------------------------------------*/ + + /** + * Note: Actions are points in the execution of a page or process + * lifecycle that WordPress fires. + */ + function action_method_name() { + // TODO define your action method here + } // end action_method_name + + /** + * Note: Filters are points of execution in which WordPress modifies data + * before saving it or sending it to the browser. + */ + function filter_method_name() { + // TODO define your filter method here + } // end filter_method_name + + /*--------------------------------------------* + * Private Functions + *---------------------------------------------*/ + + /** + * Initializes constants used for convenience throughout + * the plugin. + */ + private function init_plugin_constants() { + + /* TODO + * + * This provides the unique identifier for your plugin used in + * localizing the strings used throughout. + * + * For example: wordpress-widget-boilerplate-locale. + */ + if(!defined('PLUGIN_LOCALE')) { + define('PLUGIN_LOCALE', 'plugin-name-locale'); + } // end if + + /* TODO + * + * Define this as the name of your plugin. This is what shows + * in the Widgets area of WordPress. + * + * For example: WordPress Widget Boilerplate. + */ + if(!defined('PLUGIN_NAME')) { + define('PLUGIN_NAME', 'Plugin Name'); + } // end if + + /* TODO + * + * this is the slug of your plugin used in initializing it with + * the WordPress API. + + * This should also be the + * directory in which your plugin resides. Use hyphens. + * + * For example: wordpress-widget-boilerplate + */ + if(!defined('PLUGIN_SLUG')) { + define('PLUGIN_SLUG', 'plugin-name-slug'); + } // end if + + } // end init_plugin_constants + + /** + * Helper function for registering and loading scripts and styles. + * + * @name The ID to register with WordPress + * @file_path The path to the actual file + * @is_script Optional argument for if the incoming file_path is a JavaScript source file. + */ + private function load_file($name, $file_path, $is_script = false) { + $url = WP_PLUGIN_URL . $file_path; + $file = WP_PLUGIN_DIR . $file_path; + if(file_exists($file)) { + if($is_script) { + wp_register_script($name, $url); + wp_enqueue_script($name); + } else { + wp_register_style($name, $url); + wp_enqueue_style($name); + } // end if + } // end if + } // end _load_file + +} // end class +// TODO: update the instantiation call of your plugin to the name given at the class definition +new TODO(); +?> \ No newline at end of file diff --git a/views/admin.php b/views/admin.php new file mode 100644 index 0000000..d5d53a2 --- /dev/null +++ b/views/admin.php @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/views/display.php b/views/display.php new file mode 100644 index 0000000..70a7021 --- /dev/null +++ b/views/display.php @@ -0,0 +1 @@ + \ No newline at end of file