Opened 6 years ago
Last modified 6 years ago
#51016 new enhancement
Video and image schemas support
| Reported by: | constructivemedia | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Sitemaps | Version: | 5.5 |
| Severity: | minor | Keywords: | |
| Cc: | Focuses: |
Description
Proposal to allow for image and video schema types within class-wp-sitemaps-renderer.php.
Allowing for more schemas to be added to urlset ( xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1")
When $url_list contains a image/video child node:
<?php $parent = $url->addChild( $name, '', 'http://www.google.com/schemas/sitemap-image/1.1' ); foreach ( $value as $child_name => $child_value ) { $parent->addChild( $child_name, esc_xml( $child_value ) ); }
Proposed $sitemap_entry structure:
<?php $sitemap_entry = array( 'loc' => home_url('/') . $listing->slug, 'image' => array( 'loc' => 'http://example.com/image.jpg' ), 'video' => array( 'thumbnail_loc' => 'http://www.example.com/thumbs/123.jpg' ) );
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
For referene we had lots of discussions about the API design for this at https://github.com/GoogleChromeLabs/wp-sitemaps/issues/151