From 0fdfb27288e1deaddcc922c8a2505a3d0f31ec26 Mon Sep 17 00:00:00 2001 From: Michael Sisk Date: Fri, 14 Sep 2012 18:28:52 -0400 Subject: [PATCH] Rearrange the OpenGraph output. This way the hook always fires, so OpenGraph data can be added to pages Webcomic may not recognize as Webcomic-related (like the homepage). --- webcomic.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/webcomic.php b/webcomic.php index 8431cc1..7720b5c 100755 --- a/webcomic.php +++ b/webcomic.php @@ -547,17 +547,17 @@ public function head() { $attributes = wp_get_attachment_image_src( self::$config[ 'collections' ][ self::$collection ][ 'image' ] ); $output[ 'og:image' ] = $attributes[ 0 ]; } - - $output = apply_filters( 'webcomic_opengraph', $output, $object, self::$collection ); - - foreach ( ( array ) $output as $k => $v ) { - if ( is_array( $v ) ) { - foreach( $v as $b ) { - echo sprintf( '', $k, $b ), "\n"; - } - } else { - echo sprintf( '', $k, $v ), "\n"; + } + + $output = apply_filters( 'webcomic_opengraph', $output, $object, self::$collection ); + + foreach ( ( array ) $output as $k => $v ) { + if ( is_array( $v ) ) { + foreach( $v as $b ) { + echo sprintf( '', $k, $b ), "\n"; } + } else { + echo sprintf( '', $k, $v ), "\n"; } } }