Created
October 16, 2013 03:12
-
-
Save anonymous/7002125 to your computer and use it in GitHub Desktop.
Simple TogetherJS for WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: TogetherJS for WordPress | |
Plugin URI: http://www.rami.nu | |
Description: Integrates TogetherJS with WordPress | |
Version: 0.1 | |
Author: ramiabraham | |
Author URI: http://rami.nu | |
License: GPL 2.0 | |
*/ | |
if ( ! is_admin() ) { | |
function get_togetherjs_scripts() { | |
wp_register_script( 'togetherjs', 'https://togetherjs.com/togetherjs-min.js' ); | |
wp_enqueue_script( 'togetherjs', 'https://togetherjs.com/togetherjs-min.js' ); | |
} | |
add_action('wp_enqueue_scripts','get_togetherjs_scripts'); | |
} // admin check | |
if ( ! is_admin() ) { | |
function togetherjs_button_shortcode() { | |
return '<button onclick="TogetherJS(this); return false;">Collaborate!</button>'; | |
} | |
} // admin check | |
add_shortcode( 'together', 'togetherjs_button_shortcode' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment