Permalink
Browse files

namespaced image sitemap

  • Loading branch information...
1 parent 5329d44 commit dec16cae25a6d454b509a831a5ab642960d29126 @niallkennedy committed Oct 20, 2011
Showing with 5 additions and 5 deletions.
  1. +5 −5 class.flickr.php
View
@@ -153,13 +153,13 @@ public function asImageSitemap( SimpleXMLElement $url_el ) {
if ( empty( $largest_image ) )
return;
- $prefix = 'image';
- $image = $url_el->addChild( $prefix . ':image' );
- $image->addChild( $prefix . ':loc', $largest_image["url"] );
+ $namespace = 'http://www.google.com/schemas/sitemap-image/1.1';
+ $image = $url_el->addChild( 'image', null, $namespace );
+ $image->addChild( 'loc', esc_url( $largest_image['url'] ), $namespace );
if ( ! empty( $this->title ) )
- $image->addChild( $prefix . ':title', $this->title );
+ $image->addChild( 'title', esc_html( trim( $this->title ) ), $namespace );
if ( ! empty( $this->description ) )
- $image->addChild( $prefix . ':caption', $this->description );
+ $image->addChild( 'caption', esc_html( trim( strip_tags( $this->description ) ) ), $namespace );
return $url_el;
}

0 comments on commit dec16ca

Please sign in to comment.