Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove $theme_version property.

Using WP_Theme seems like a better way to handle this.
  • Loading branch information...
commit b12ab0517db3f40db34f047347681cf8b9eea274 1 parent 81ce1f3
Michael Sisk authored
Showing with 9 additions and 17 deletions.
  1. +7 −5 -/php/tags.php
  2. +2 −12 webcomic.php
View
12 -/php/tags.php
@@ -143,10 +143,9 @@ 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
@@ -154,7 +153,10 @@ public static function sort_webcomic_collections_updated( $a, $b ) {
* @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, '>=' ) );
}
View
14 webcomic.php
@@ -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
@@ -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.
Please sign in to comment.
Something went wrong with that request. Please try again.