Subtitles v2.0.0 is now available in the WordPress.org repository. The primary change in this version is how front-end CSS is handled. It was previously output via a call to a separate enqueued stylesheet but that wasn’t very sound for performance. In this version styling is sent via wp_head
to avoid the additional CSS file mucking things up.
The reason for the version bump is because ditching styling is now done differently from how it was done in v1.0.0+. Previously it was handled in the following manner:
[code language=”php”]
function ditch_subtitle_styling() {
wp_dequeue_style( ‘subtitles-style’ );
}
add_action( ‘wp_enqueue_scripts’, ‘ditch_subtitle_styling’ );
[/code]
It’s now handled like this:
[code language=”php”]
if ( class_exists( ‘Subtitles’ ) && method_exists( ‘Subtitles’, ‘subtitle_styling’ ) ) {
remove_action( ‘wp_head’, array( Subtitles::getInstance(), ‘subtitle_styling’ ) );
}
[/code]
Download your copy of Subtitles today. Pretty soon here I’ll be adding in a way to remove all subtitles from a site, as there’s currently no way to easily do that.