Skip to content

Commit

Permalink
Rearrange the OpenGraph output.
Browse files Browse the repository at this point in the history
This way the hook always fires, so OpenGraph data can be added to pages
Webcomic may not recognize as Webcomic-related (like the homepage).
  • Loading branch information
Michael Sisk committed Sep 14, 2012
1 parent 26d3d7e commit 0fdfb27
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions webcomic.php
Expand Up @@ -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( '<meta property="%s" content="%s">', $k, $b ), "\n";
}
} else {
echo sprintf( '<meta property="%s" content="%s">', $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( '<meta property="%s" content="%s">', $k, $b ), "\n";
}
} else {
echo sprintf( '<meta property="%s" content="%s">', $k, $v ), "\n";
}
}
}
Expand Down

0 comments on commit 0fdfb27

Please sign in to comment.