Permalink
Browse files

Correct edge case for webcomic() returning false negative.

In some cases WP_Theme fails to correctly return the active theme's
information.
  • Loading branch information...
1 parent b42a6fb commit 1030129055ba053a77dacfd7e9d6e38c9781f7dd Michael Sisk committed Dec 6, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 -/php/tags.php
View
@@ -154,8 +154,9 @@ public static function sort_webcomic_collections_updated( $a, $b ) {
*/
public static function webcomic( $version = '' ) {
if ( empty( $version ) ) {
- $theme = new WP_Theme( get_stylesheet_directory(), '' );
- $version = $theme->get( 'Webcomic' );
+ $directory = get_stylesheet_directory();
+ $theme = new WP_Theme( basename( $directory ), dirname( $directory ) );
+ $version = $theme->get( 'Webcomic' );
}
return ( $version and version_compare( self::$version, $version, '>=' ) );

0 comments on commit 1030129

Please sign in to comment.