Permalink
Browse files

Fix incorrect use of `get_post()`

  • Loading branch information...
mgsisk committed Aug 19, 2012
1 parent 0b312ab commit 9de70aa6ebd5634f1f6abcebf6bf669a7749def8
Showing with 3 additions and 2 deletions.
  1. +3 −2 -/php/tags.php
View
@@ -161,10 +161,11 @@ public static function is_webcomic( $dynamic = false ) {
* @uses Webcomic::$config
*/
public static function is_webcomic_attachment( $collection = '' ) {
- $the_post = get_post();
+ global $post;
+
$collection = $collection ? ( array ) $collection : array_keys( self::$config[ 'collections' ] );
- return ( is_attachment() and preg_match( '/^image\//', get_post_mime_type( $the_post ) ) and in_array( get_post_type( $the_post->post_parent ), $collection ) );
+ return ( is_attachment() and preg_match( '/^image\//', get_post_mime_type( $post ) ) and in_array( get_post_type( $post->post_parent ), $collection ) );
}
/** Is the query for a webcomic-related page?

0 comments on commit 9de70aa

Please sign in to comment.