We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5939ed9 commit 4784a45Copy full SHA for 4784a45
1 file changed
ableplayer.php.html
@@ -371,6 +371,20 @@
371
return apply_filters( 'ableplayer_default_parameters', $params );
372
}
373
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
+
388
/**
389
* Add support for [ableplayer] shortcode.
390
*
0 commit comments