Skip to content

Instantly share code, notes, and snippets.

@Yodapp
Created March 11, 2018 15:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yodapp/e20f73644e303835f17fb691fa68bebc to your computer and use it in GitHub Desktop.
Save Yodapp/e20f73644e303835f17fb691fa68bebc to your computer and use it in GitHub Desktop.
How to include UserGuiding in Wordpress admin area
/**
* LOAD USERGUIDE ON ADMIN AREA
*/
add_action( 'admin_enqueue_scripts', function() {
wp_enqueue_script( 'userguiding', get_template_directory_uri() . '/userguiding.js', false );
} );
(function (u, s, e, r, g) {
u[r] = u[r] || [];
u[r].push({
'ug.start': new Date().getTime(), event: 'embed.js',
});
var f = s.getElementsByTagName(e)[0],
j = s.createElement(e);
j.async = true;
j.src = 'https://static.userguiding.com/media/user-guiding-'
+ g + '-embedded.js';
f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'userGuidingLayer', 'XXXXXXXXXXXX');
// REPLACE XXXXXXXXXXXX WITH CORRECT CODE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment