You appear to be a bot. Output may be restricted
Description
Retrieve a single sitemap with given name and type.
Returns null if no such sitemap exists.
Usage
$array = Jetpack_Sitemap_Librarian::read_sitemap_data( $name, $type );
Parameters
- $name
- ( string ) required – Name of the sitemap to be retrieved.
- $type
- ( string ) required – Type of the sitemap to be retrieved.
- $id
- ( int ) required – ID number of the sitemap in the database.
- $timestamp
- ( string ) required – Most recent timestamp of the resources pointed to.
- $name
- ( string ) required – Name of the sitemap in the database.
- $type
- ( string ) required – Type of the sitemap in the database.
- $text
- ( string ) required – The content of the sitemap. }
Returns
array $args {
Source
File name: jetpack/modules/sitemaps/sitemap-librarian.php
Lines:
1 to 24 of 24
public function read_sitemap_data( $name, $type ) { $post_array = get_posts( array( 'numberposts' => 1, 'title' => $name, 'post_type' => $type, 'post_status' => 'draft', ) ); $the_post = array_shift( $post_array ); if ( null === $the_post ) { return null; } else { return array( 'id' => $the_post->ID, 'timestamp' => $the_post->post_date, 'name' => $the_post->post_title, 'type' => $the_post->post_type, 'text' => base64_decode( $the_post->post_content ), ); } }