1+ <?php
2+ /*
3+ Plugin Name: Able Player
4+ Plugin URI: https://github.com/ableplayer-wordpress
5+ Description: Accessible HTML5 media player
6+ Contributors: terrillthompson
7+ Tags: html5, media, audio, video, accessibility
8+ Version: 0.1
9+ Stable tag: 0.1
10+ Requires at least: 2.6
11+ Tested up to: 4.5
12+ License: MIT
13+ License URI: https://github.com/ableplayer-wordpress/LICENSE
14+ */
15+
16+ /*
17+ *
18+ * Disable the feature in WordPress that wraps everything (including Able Player code)
19+ * in <p> tags
20+ *
21+ * NOTE: This will affect ALL content on site, and may have undesirable consequences
22+ * Therefore it's commented out by default. Test before using.
23+ *
24+ *
25+ */
26+ // remove_filter ('the_content', 'wpautop');
27+
28+ /*
29+ *
30+ * load styles and scripts to head
31+ *
32+ */
33+
34+ function ableplayer_enqueue_scripts (){
35+
36+ // Documentation:
37+ // http://codex.wordpress.org/Function_Reference/wp_enqueue_script
38+
39+ // Register/enqueue common scripts that can be called automatically with just their handles (as of WP 3.5)
40+ wp_enqueue_script ( 'jquery ' );
41+
42+ // Register/enqueue other dependencies
43+ wp_enqueue_script ( 'modernizer ' , plugins_url ('thirdparty ' ,__FILE__ ).'/modernizr.custom.js ' );
44+ wp_enqueue_script ( 'js-cookie ' , plugins_url ('thirdparty ' ,__FILE__ ).'/js.cookie.js ' ,array ('jquery ' ));
45+
46+ // Register/enqueue Able Player script
47+ wp_enqueue_script ( 'ableplayer ' , plugins_url ('build ' ,__FILE__ ).'/ableplayer.js ' ,array ('jquery ' ));
48+
49+ // Register/enqueue Able Player CSS (two options; uncomment the one you prefer)
50+
51+ // Use minimized CSS that's included in Able Player build
52+ // wp_enqueue_style( 'ableplayer', plugins_url('build',__FILE__).'/ableplayer.min.css');
53+
54+ // Use human-readable CSS if you intend to change the styles and customize the player
55+ wp_enqueue_style ( 'ableplayer ' , plugins_url ('styles ' ,__FILE__ ).'/ableplayer.css ' );
56+
57+ }
58+ add_action ( 'wp_enqueue_scripts ' , 'ableplayer_enqueue_scripts ' );
59+
60+ function ableplayer_head () {
61+
62+ // add a variable that points to the current plugin directory
63+ echo "<script> \n" ;
64+ echo 'var pluginUrl = " ' .plugins_url ('' ,__FILE__ ).'"; ' ."\n" ;
65+ echo "</script> \n" ;
66+ }
67+ add_action ('wp_head ' ,'ableplayer_head ' ,3 );
68+ ?>
0 commit comments