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:
parent
5297deede7
commit
92259517db
3 changed files with 10 additions and 9 deletions
|
@ -1,5 +1,5 @@
|
||||||
(function($) {
|
(function ($) {
|
||||||
$(function() {
|
$(function () {
|
||||||
// Place your administration-specific JavaScript here
|
// Place your administration-specific JavaScript here
|
||||||
});
|
});
|
||||||
})(jQuery);
|
}(jQuery));
|
|
@ -1,5 +1,6 @@
|
||||||
(function($) {
|
(function ($) {
|
||||||
$(function() {
|
"use strict";
|
||||||
|
$(function () {
|
||||||
// Place your public-facing JavaScript here
|
// Place your public-facing JavaScript here
|
||||||
});
|
});
|
||||||
})(jQuery);
|
}(jQuery));
|
|
@ -46,7 +46,7 @@ class PluginName {
|
||||||
add_action( 'admin_enqueue_scripts', array( &$this, 'register_admin_scripts' ) );
|
add_action( 'admin_enqueue_scripts', array( &$this, 'register_admin_scripts' ) );
|
||||||
|
|
||||||
// Register site styles and 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' ) );
|
add_action( 'wp_enqueue_scripts', array( &$this, 'register_plugin_scripts' ) );
|
||||||
|
|
||||||
register_activation_hook( __FILE__, array( &$this, 'activate' ) );
|
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
|
* @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
|
// TODO define activation functionality here
|
||||||
} // end activate
|
} // 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
|
* @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
|
// TODO define deactivation functionality here
|
||||||
} // end deactivate
|
} // end deactivate
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue