diff --git a/plugin-name/trunk/public/class-plugin-name-public-loader.php b/plugin-name/trunk/public/class-plugin-name-public-loader.php index 3b8ffc3..e17c320 100644 --- a/plugin-name/trunk/public/class-plugin-name-public-loader.php +++ b/plugin-name/trunk/public/class-plugin-name-public-loader.php @@ -1,11 +1,15 @@ + * @license GPL-2.0+ + * @link http://example.com + * @copyright 2014 Your Name or Company Name + * @since 1.0.0 */ /** @@ -13,10 +17,9 @@ * * Define a longer description for the purpose of this class. * - * @author Your Name - * @license GPL-2.0+ - * @link URL - * @copyright 2014 Your Name or Company Name + * @package Plugin_Name + * @subpackage Plugin_Name/public + * @author Your Name */ class Plugin_Name_Public_Loader { @@ -26,9 +29,9 @@ class Plugin_Name_Public_Loader { * Long description. * * @since 1.0.0 - * @param type $plugin_name_public TODO + * @param type $plugin_name_public A reference to the Plugin_Name_Public class that defines the functions for the hooks. */ - public function run( $plugin_name_public ) { + public function run( Plugin_Name_Public $plugin_name_public ) { /** * This function is used to define the various hooks that are used in the @@ -37,12 +40,11 @@ class Plugin_Name_Public_Loader { * * Each hook then corresponds to a public function defined within the Plugin_Name_Public * class. - * - * For example: - * - * add_filter( 'the_content', array( $plugin_name_public, 'display_the_content' ) ); */ + add_action( 'wp_enqueue_scripts', array( $plugin_name_public, 'enqueue_styles' ) ); + add_action( 'wp_enqueue_scripts', array( $plugin_name_public, 'enqueue_scripts' ) ); + } -} \ No newline at end of file +} diff --git a/plugin-name/trunk/public/class-plugin-name-public.php b/plugin-name/trunk/public/class-plugin-name-public.php index b072111..4fc5be5 100644 --- a/plugin-name/trunk/public/class-plugin-name-public.php +++ b/plugin-name/trunk/public/class-plugin-name-public.php @@ -1,10 +1,15 @@ + * @license GPL-2.0+ + * @link http://example.com + * @copyright 2014 Your Name or Company Name + * @since 1.0.0 */ /** @@ -12,11 +17,9 @@ * * Define a longer description for the purpose of this class. * - * @package TODO - * @author Your Name - * @license GPL-2.0+ - * @link URL - * @copyright 2014 Your Name or Company Name + * @package Plugin_Name + * @subpackage Plugin_Name/public + * @author Your Name */ class Plugin_Name_Public { @@ -26,11 +29,8 @@ class Plugin_Name_Public { * Long description. * * @since 1.0.0 - * @link URL - * @param string $content The content for the post type that's being filtered. - * @return string The modified version of the post content. */ - public function display_the_content( $content ) { + public function enqueue_styles() { /** * This function is provided for demonstration purposes only. @@ -44,7 +44,32 @@ class Plugin_Name_Public { * class. */ - return $content; + wp_enqueue_style( 'plugin-name-public', plugin_dir_url( __FILE__ ) . 'css/plugin-name-public.css', array(), PLUGIN_NAME_VER, 'all' ); + + } + + /** + * Short description. (use period) + * + * Long description. + * + * @since 1.0.0 + */ + public function enqueue_scripts() { + + /** + * This function is provided for demonstration purposes only. + * + * An instance of this class should be passed to the run() function + * defined in Plugin_Name_Public_Loader as all of the hooks are defined + * in that particular class. + * + * The Plugin_Name_Public_Loader will then create the relationship + * between the defined hooks and the functions defined in this + * class. + */ + + wp_enqueue_script( 'plugin-name-public', plugin_dir_url( __FILE__ ) . 'js/plugin-name-public.js', array( 'jquery' ), PLUGIN_NAME_VER, FALSE ); } diff --git a/plugin-name/trunk/public/js/plugin-name-public.js b/plugin-name/trunk/public/js/plugin-name-public.js index 9858cbe..b644f71 100644 --- a/plugin-name/trunk/public/js/plugin-name-public.js +++ b/plugin-name/trunk/public/js/plugin-name-public.js @@ -13,14 +13,20 @@ * ready: * * $(function() { + * * }); * * Or when the window is completely ready: * * $( window ).load(function() { + * * }); * * ...and so on. + * + * Remember that ideally, we should not attach anymore than a single DOM-ready or window-load handler + * for any particular page. Though other scripts in WordPress core, other plugins, and other themes may + * be doing this, we should try to minimize doing that in our own work. */ -})( jQuery ); \ No newline at end of file +})( jQuery ); diff --git a/plugin-name/trunk/public/partials/plugin-name-public-display.php b/plugin-name/trunk/public/partials/plugin-name-public-display.php index 3e09893..fc1fcab 100644 --- a/plugin-name/trunk/public/partials/plugin-name-public-display.php +++ b/plugin-name/trunk/public/partials/plugin-name-public-display.php @@ -1,10 +1,15 @@ + * @license GPL-2.0+ + * @link http://example.com + * @copyright 2014 Your Name or Company Name + * @since 1.0.0 */ /** @@ -12,11 +17,9 @@ * * Define a longer description for the purpose of this file. * - * @package TODO - * @author Your Name - * @license GPL-2.0+ - * @link URL - * @copyright 2014 Your Name or Company Name + * @package Plugin_Name + * @subpackage Plugin_Name/public/partials + * @author Your Name */ ?>