@@ -62,7 +62,7 @@ function ableplayer_enqueue_scripts() {
6262 * @param {string} $url URL to Able Player root directory.
6363 * @param {bool} $is_production True if environment is designated as production.
6464 *
65- * @return string
65+ * @return { string}
6666 */
6767 $ js_dir = apply_filters ( 'able_player_js ' , plugins_url ( 'build ' , __FILE__ ) . '/ ' . $ js_file , $ is_production );
6868 /**
@@ -73,12 +73,25 @@ function ableplayer_enqueue_scripts() {
7373 * @param {string} $url URL to Able Player root directory.
7474 * @param {bool} $is_production True if environment is designated as production.
7575 *
76- * @return string
76+ * @return { string}
7777 */
7878 $ css_dir = apply_filters ( 'able_player_css ' , plugins_url ( 'build ' , __FILE__ ) . '/ ' . $ css_file , $ is_production );
7979
8080 // Enqueue Able Player script and CSS.
81- wp_enqueue_script ( 'ableplayer ' , $ js_dir , array ( 'jquery ' , 'ableplayer-video ' ), ABLEPLAYER_VERSION , true );
81+ $ dependencies = array ( 'jquery ' , 'ableplayer-video ' );
82+ $ js_dir = apply_filters ( 'able_player_js ' , plugins_url ( 'build ' , __FILE__ ) . '/ ' . $ js_file , $ is_production );
83+ /**
84+ * Filter the Able Player script dependencies.
85+ *
86+ * @hook ableplayer_dependencies
87+ *
88+ * @param {array} $dependencies Array of scripts required by the main AblePlayer script.
89+ * @param {bool} $is_production True if environment is designated as production.
90+ *
91+ * @return {array}
92+ */
93+ $ dependencies = apply_filters ( 'ableplayer_dependencies ' , $ dependencies , $ is_production );
94+ wp_enqueue_script ( 'ableplayer ' , $ js_dir , $ dependencies , ABLEPLAYER_VERSION , true );
8295 wp_enqueue_style ( 'ableplayer ' , $ css_dir , array (), ABLEPLAYER_VERSION );
8396}
8497add_action ( 'wp_enqueue_scripts ' , 'ableplayer_enqueue_scripts ' );
0 commit comments