1
0
Fork 0
mirror of https://github.com/inretio/WordPress-Plugin-Boilerplate synced 2024-12-22 20:03:53 +02:00

Updating the JavaScript for better practices and refining one of the hooks for the plugin boilerplate

This commit is contained in:
Tom McFarlin 2012-08-17 14:06:06 -04:00
parent 5297deede7
commit 92259517db
3 changed files with 10 additions and 9 deletions

View file

@ -1,5 +1,5 @@
(function($) {
$(function() {
(function ($) {
$(function () {
// Place your administration-specific JavaScript here
});
})(jQuery);
}(jQuery));

View file

@ -1,5 +1,6 @@
(function($) {
$(function() {
(function ($) {
"use strict";
$(function () {
// Place your public-facing JavaScript here
});
})(jQuery);
}(jQuery));

View file

@ -46,7 +46,7 @@ class PluginName {
add_action( 'admin_enqueue_scripts', array( &$this, 'register_admin_scripts' ) );
// Register site styles and scripts
add_action( 'wp_print_styles', array( &$this, 'register_plugin_styles' ) );
add_action( 'wp_enqueue_scripts', array( &$this, 'register_plugin_styles' ) );
add_action( 'wp_enqueue_scripts', array( &$this, 'register_plugin_scripts' ) );
register_activation_hook( __FILE__, array( &$this, 'activate' ) );
@ -73,7 +73,7 @@ class PluginName {
*
* @params $network_wide True if WPMU superadmin uses "Network Activate" action, false if WPMU is disabled or plugin is activated on an individual blog
*/
function activate( $network_wide ) {
public function activate( $network_wide ) {
// TODO define activation functionality here
} // end activate
@ -82,7 +82,7 @@ class PluginName {
*
* @params $network_wide True if WPMU superadmin uses "Network Activate" action, false if WPMU is disabled or plugin is activated on an individual blog
*/
function deactivate( $network_wide ) {
public function deactivate( $network_wide ) {
// TODO define deactivation functionality here
} // end deactivate