Skip to content

Instantly share code, notes, and snippets.

@hideokamoto
Last active February 26, 2018 12:04
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 hideokamoto/21e59c1760d2694308cc19cc76ec0d4f to your computer and use it in GitHub Desktop.
Save hideokamoto/21e59c1760d2694308cc19cc76ec0d4f to your computer and use it in GitHub Desktop.
<?php
/**
* Plugin Name: admin tracker
* Plugin URI: https://wp-kyoto.net
* Description: tracker
* Version: 0.0.1
* Author: Hidetaka Okamoto
* Author URI: https://wp-kyoto.net
* License: GPLv2+
*
* @since 0.0.1
*/
function insert_logrocket_script() {
wp_enqueue_script( 'logRocket', 'https://cdn.logrocket.com/LogRocket.min.js', array(), '1.0.0' );
}
add_action( 'admin_enqueue_scripts', 'insert_logrocket_script' );
function insert_logrocket_code() {
?>
<!-- [Logrocket code] -->
<script>window.LogRocket && window.LogRocket.init('PJID/PROJECT_NAME');</script>
<!-- [/Logrocket code] -->
<?php
}
add_action('admin_head', 'insert_logrocket_code');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment