-
Notifications
You must be signed in to change notification settings - Fork 4
/
pbd-livejs.php
23 lines (22 loc) · 876 Bytes
/
pbd-livejs.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
/**
* Plugin Name: PBD Live.js for WordPress
* Plugin URI: http://www.problogdesign.com/
* Description: Adds automatic CSS and JS refreshing through <a href="http://livejs.com/">Live.js</a> by Martin Kool to a theme when you are logged in and running locally.
* Version: 0.1
* Author: Pro Blog Design
* Author URI: http://www.problogdesign.com/
* License: GPLv2/MIT
*
*
* Live.js was written by Martin Kool and is licensed under the MIT license.
* - http://livejs.com/
* - http://twitter.com/mrtnkl
*/
function pbd_livejs_script() {
if(is_user_logged_in() && ($_SERVER["SERVER_NAME"] == 'localhost' || $_SERVER["SERVER_NAME"] == '127.0.0.1' || $_SERVER["SERVER_ADDR"] == '127.0.0.1')) {
echo '<script type="text/javascript" src="'. plugins_url('js/live.js#css,js', __FILE__) .'"></script>';
}
}
add_action('wp_enqueue_scripts', 'pbd_livejs_script');
?>