2

I´m customizing the new core audio/video player via CSS in my styles.css. I tried to remove the wp-mediaelement.css with the following code in functions.php, because I don´t need it anymore.

function custom_deregister_styles()
{
  wp_deregister_style( 'mediaelement');
}
add_action( 'wp_print_styles', 'custom_deregister_styles', 100 );

The problem is, that this function removes the call of mediaelementplayer.min.css and wp-mediaelement.css. The following doesn´t work, too.

function custom_deregister_styles()
    {
      wp_deregister_style( 'wp-mediaelement');
    }
    add_action( 'wp_print_styles', 'custom_deregister_styles', 100 );
3

Move those declarations out of the action. Simply paste both of them in the functions.php file and it will work (tested).

wp_deregister_script('wp-mediaelement');
wp_deregister_style('wp-mediaelement');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.