Skip to content

Commit

Permalink
Remove $theme_version property.
Browse files Browse the repository at this point in the history
Using WP_Theme seems like a better way to handle this.
  • Loading branch information
Michael Sisk committed Sep 19, 2012
1 parent 81ce1f3 commit b12ab05
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
12 changes: 7 additions & 5 deletions -/php/tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,18 +143,20 @@ public static function sort_webcomic_collections_updated( $a, $b ) {

/** Is a compatible version of Webcomic installed?
*
* This is mostly useful for constructing Webcomic-ready themes to
* verify that a compatible version of Webcomic is installed, but we
* can also check for an arbitrary version by passing it via the
* `$version` parameter.
* This is mostly useful to verify that a compatible version of
* Webcomic is installed when constructing Webcomic-ready themes,
* but we can also check for an arbitrary version if necessary.
*
* @param string $version Minimum version to check for. Defaults to the active themes version.
* @return boolean
* @uses Webcomic::$version
* @uses Webcomic::$theme_version
*/
public static function webcomic( $version = '' ) {
$version = $version ? $version : self::$theme_version;
if ( empty( $version ) ) {
$theme = new WP_Theme( get_stylesheet_directory(), '' );
$version = $theme->get( 'Webcomic' );
}

return ( $version and version_compare( self::$version, $version, '>=' ) );
}
Expand Down
14 changes: 2 additions & 12 deletions webcomic.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,6 @@ class Webcomic {
*/
protected static $collection = '';

/** Minimum Webcomic version supported by the active theme.
* @var string
*/
protected static $theme_version = '';

/** Set class properties and register hooks.
*
* @uses Webcomic::$dir
Expand Down Expand Up @@ -351,13 +346,8 @@ public function setup_theme() {
self::$collection = empty( self::$config[ 'collections' ][ $match[ 0 ] ] ) ? preg_replace( '/_(archive|webcomic|storyline|character)$/', '', array_search( $match[ 1 ], $permalinks ) ) : $match[ 0 ];
}

$theme = new WP_Theme( get_stylesheet_directory(), '' );

if ( $theme->get( 'Webcomic' ) ) {
self::$integrate = true;
} else {
self::$theme_version = $theme->get( 'Webcomic' );
}
$active_theme = new WP_Theme( get_stylesheet_directory(), '' );
self::$integrate = !$active_theme->get( 'Webcomic' );
}

/** Email buffer alert notifications.
Expand Down

0 comments on commit b12ab05

Please sign in to comment.