Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[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