Skip to content

Commit 4784a45

Browse files
committed
deploy: 86d808c
1 parent 5939ed9 commit 4784a45

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

ableplayer.php.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,20 @@
371371
return apply_filters( 'ableplayer_default_parameters', $params );
372372
}
373373

374+
/**
375+
* Remove Media Element scripts.
376+
*/
377+
function ableplayer_remove_scripts() {
378+
if ( ! is_admin() ) {
379+
$elements = ableplayer_get_settings( 'disable_elements' );
380+
if ( 'true' === $elements ) {
381+
wp_deregister_script( 'mediaelement' );
382+
wp_deregister_script( 'wp-playlist' );
383+
}
384+
}
385+
}
386+
add_action( 'init', 'ableplayer_remove_scripts' );
387+
374388
/**
375389
* Add support for [ableplayer] shortcode.
376390
*

0 commit comments

Comments
 (0)