-
-
Save tommcfarlin/28f9f774791473864d841afff96b85b1 to your computer and use it in GitHub Desktop.
[WordPress] Bootstrapping JavaScript Files in WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function( $ ) { | |
'use strict'; | |
$(function() { | |
}); | |
})( jQuery ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function( $ ) { | |
'use strict'; | |
/** | |
* This function handles WordPress' heartbeat-send functionality. | |
* | |
* @param $doc A jQuery-wrapped version of the document object. | |
*/ | |
var on_send = function( $doc ) { | |
// The code for the implementation goes here. | |
}; | |
/** | |
* This function handles WordPress' heartbeat-tick functionality. | |
* | |
* @param $doc A jQuery-wrapped version of the document object. | |
*/ | |
var on_tick = function( $doc ) { | |
// The code for the implementation goes here. | |
}; | |
/** | |
* This plugin's bootstrap functionality resides in the ready handler below this line. | |
*/ | |
$(function() { | |
var $doc = $( document ); | |
on_send( $doc ); | |
on_tick( $doc ); | |
}); | |
})( jQuery ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment