This is old but for anyone else reading this question, don't use github as it won't work.
<?php
/**
* Plugin Name: Add JQuery Chosen Quickly
* Plugin URI: http://wordpress.stackexchange.com/questions/85824/
* Description: Test/Add chosen to site without adding any files
* Version: 1.0
*/
function enqueue_chosen_jquery() {
wp_register_style( 'chosencss', 'https://cdnjs.cloudflare.com/ajax/libs/chosen/1.1.0/chosen.min.css', false, '1.1.0', 'all' );
wp_register_script( 'chosenjs', 'https://cdnjs.cloudflare.com/ajax/libs/chosen/1.1.0/chosen.jquery.min.js', array( 'jquery' ), '1.1.0', true );
wp_enqueue_style( 'chosencss' );
wp_enqueue_script( 'chosenjs' );
}
add_action( 'wp_enqueue_scripts', 'enqueue_chosen_jquery' );
// Assuming jQuery is loaded in the head
function chosen_jquery_inline() {
if ( wp_script_is( 'jquery', 'done' ) ) { ?>
<script type="text/javascript">
jQuery(document).ready(function ($) {
$( ".chzn-select" ).chosen();
});
</script>
<?php }
add_action( 'wp_head', 'chosen_jquery_inline', 999 );
js/jquery.js?