Skip to content

Instantly share code, notes, and snippets.

@tommcfarlin
Created July 22, 2016 21:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tommcfarlin/28f9f774791473864d841afff96b85b1 to your computer and use it in GitHub Desktop.
Save tommcfarlin/28f9f774791473864d841afff96b85b1 to your computer and use it in GitHub Desktop.
[WordPress] Bootstrapping JavaScript Files in WordPress
;(function( $ ) {
'use strict';
$(function() {
});
})( jQuery );
;(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